static int x[3] = {1, 2, 3};
int y[3] = {4, 5, 6};
void myEntry(void)
{
x[1] = y[2];
}
; ModuleID = '/tmp/semicompiled-20ZCJrcn-1753074932600286300/source.c'
source_filename = "/tmp/semicompiled-20ZCJrcn-1753074932600286300/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@y = dso_local global [3 x i32] [i32 4, i32 5, i32 6], align 4
@x = internal global [3 x i32] [i32 1, i32 2, i32 3], align 4
; Function Attrs: noinline nounwind optnone uwtable
define dso_local void @myEntry() #0 {
%1 = load i32, i32* getelementptr inbounds ([3 x i32], [3 x i32]* @y, i64 0, i64 2), align 4
store i32 %1, i32* getelementptr inbounds ([3 x i32], [3 x i32]* @x, i64 0, i64 1), align 4
ret void
}
attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
!llvm.module.flags = !{!0}
!llvm.ident = !{!1}
!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{!"Debian clang version 11.0.1-2"}
; ModuleID = '/tmp/semicompiled-20ZCJrcn-1753074932600286300/source.c'
source_filename = "/tmp/semicompiled-20ZCJrcn-1753074932600286300/source.c"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-linux-gnu"
@y = dso_local global [3 x i32] [i32 4, i32 5, i32 6], align 4, !dbg !0
@x = internal global [3 x i32] [i32 1, i32 2, i32 3], align 4, !dbg !6
; Function Attrs: noinline nounwind optnone uwtable
define dso_local void @myEntry() #0 !dbg !17 {
%1 = load i32, i32* getelementptr inbounds ([3 x i32], [3 x i32]* @y, i64 0, i64 2), align 4, !dbg !20
store i32 %1, i32* getelementptr inbounds ([3 x i32], [3 x i32]* @x, i64 0, i64 1), align 4, !dbg !21
ret void, !dbg !22
}
attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="all" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!13, !14, !15}
!llvm.ident = !{!16}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(name: "y", scope: !2, file: !8, line: 2, type: !9, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "Debian clang version 11.0.1-2", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, splitDebugInlining: false, nameTableKind: None)
!3 = !DIFile(filename: "/tmp/semicompiled-20ZCJrcn-1753074932600286300/source.c", directory: "/__w/semicompiled/semicompiled")
!4 = !{}
!5 = !{!0, !6}
!6 = !DIGlobalVariableExpression(var: !7, expr: !DIExpression())
!7 = distinct !DIGlobalVariable(name: "x", scope: !2, file: !8, line: 1, type: !9, isLocal: true, isDefinition: true)
!8 = !DIFile(filename: "/tmp/semicompiled-20ZCJrcn-1753074932600286300/source.c", directory: "")
!9 = !DICompositeType(tag: DW_TAG_array_type, baseType: !10, size: 96, elements: !11)
!10 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!11 = !{!12}
!12 = !DISubrange(count: 3)
!13 = !{i32 7, !"Dwarf Version", i32 4}
!14 = !{i32 2, !"Debug Info Version", i32 3}
!15 = !{i32 1, !"wchar_size", i32 4}
!16 = !{!"Debian clang version 11.0.1-2"}
!17 = distinct !DISubprogram(name: "myEntry", scope: !8, file: !8, line: 3, type: !18, scopeLine: 4, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !4)
!18 = !DISubroutineType(types: !19)
!19 = !{null}
!20 = !DILocation(line: 5, column: 12, scope: !17)
!21 = !DILocation(line: 5, column: 10, scope: !17)
!22 = !DILocation(line: 6, column: 1, scope: !17)
(module
(type (;0;) (func))
(import "env" "__stack_pointer" (global (;0;) (mut i32)))
(import "env" "__memory_base" (global (;1;) i32))
(import "env" "__table_base" (global (;2;) i32))
(import "GOT.mem" "y" (global (;3;) (mut i32)))
(import "env" "memory" (memory (;0;) 0))
(import "env" "__indirect_function_table" (table (;0;) 0 funcref))
(func (;0;) (type 0)
call 1)
(func (;1;) (type 0))
(func (;2;) (type 0)
(local i32 i32 i32 i32 i32)
global.get 3
local.set 0
local.get 0
i32.load offset=8
local.set 1
i32.const 12
local.set 2
global.get 1
local.set 3
local.get 3
local.get 2
i32.add
local.set 4
local.get 4
local.get 1
i32.store offset=4
return)
(global (;4;) i32 (i32.const 0))
(global (;5;) i32 (i32.const 0))
(export "__post_instantiate" (func 0))
(export "__wasm_apply_relocs" (func 1))
(export "myEntry" (func 2))
(export "y" (global 4))
(export "__dso_handle" (global 5))
(data (;0;) (global.get 1) "\04\00\00\00\05\00\00\00\06\00\00\00\01\00\00\00\02\00\00\00\03\00\00\00"))
/tmp/semicompiled-20ZCJrcn-1753074932600286300/source.o: file format elf64-bpf
Disassembly of section .text:
0000000000000000 <myEntry>:
; myEntry():
; /tmp/semicompiled-20ZCJrcn-1753074932600286300/source.c:5
; x[1] = y[2];
0: r1 = 0 ll
2: r1 = *(u32 *)(r1 + 8)
3: r2 = 12 ll
5: *(u32 *)(r2 + 4) = r1
; /tmp/semicompiled-20ZCJrcn-1753074932600286300/source.c:6
; }
6: exit
Join the thriving social scene at github.com/andrewbaxter/semicompiled.