-
Notifications
You must be signed in to change notification settings - Fork 0
/
hello_world.ll
224 lines (192 loc) · 11 KB
/
hello_world.ll
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
; ModuleID = 'hello_world.7rcbfp3g-cgu.0'
source_filename = "hello_world.7rcbfp3g-cgu.0"
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
%"core::fmt::Arguments" = type { [0 x i64], { [0 x { [0 x i8]*, i64 }]*, i64 }, [0 x i64], { i64*, i64 }, [0 x i64], { [0 x { i8*, i8* }]*, i64 }, [0 x i64] }
%"unwind::libunwind::_Unwind_Exception" = type { [0 x i64], i64, [0 x i64], void (i32, %"unwind::libunwind::_Unwind_Exception"*)*, [0 x i64], [6 x i64], [0 x i64] }
%"unwind::libunwind::_Unwind_Context" = type { [0 x i8] }
@vtable.0 = private unnamed_addr constant { void (i8**)*, i64, i64, i32 (i8**)*, i32 (i8**)*, i32 (i8**)* } { void (i8**)* @_ZN4core3ptr18real_drop_in_place17h284850d1a40eb6daE, i64 8, i64 8, i32 (i8**)* @"_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17ha1b7ad2f7027bb10E", i32 (i8**)* @"_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17ha1b7ad2f7027bb10E", i32 (i8**)* @"_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17haa37b3978e9388c2E" }, align 8
@0 = private unnamed_addr constant <{ [13 x i8] }> <{ [13 x i8] c"Hello, World\0A" }>, align 1
@1 = private unnamed_addr constant <{ i8*, [8 x i8] }> <{ i8* getelementptr inbounds (<{ [13 x i8] }>, <{ [13 x i8] }>* @0, i32 0, i32 0, i32 0), [8 x i8] c"\0D\00\00\00\00\00\00\00" }>, align 8
; std::rt::lang_start
; Function Attrs: nonlazybind uwtable
define hidden i64 @_ZN3std2rt10lang_start17h8160322698c08501E(void ()* nonnull %main, i64 %argc, i8** %argv) unnamed_addr #0 {
start:
%_7 = alloca i8*, align 8
%0 = bitcast i8** %_7 to void ()**
store void ()* %main, void ()** %0, align 8
%_4.0 = bitcast i8** %_7 to {}*
; call std::rt::lang_start_internal
%1 = call i64 @_ZN3std2rt19lang_start_internal17hb8081e0e7e42ac0dE({}* nonnull align 1 %_4.0, [3 x i64]* noalias readonly align 8 dereferenceable(24) bitcast ({ void (i8**)*, i64, i64, i32 (i8**)*, i32 (i8**)*, i32 (i8**)* }* @vtable.0 to [3 x i64]*), i64 %argc, i8** %argv)
br label %bb1
bb1: ; preds = %start
ret i64 %1
}
; std::rt::lang_start::{{closure}}
; Function Attrs: nonlazybind uwtable
define internal i32 @"_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17ha1b7ad2f7027bb10E"(i8** noalias readonly align 8 dereferenceable(8) %_1) unnamed_addr #0 {
start:
%0 = bitcast i8** %_1 to void ()**
%_3 = load void ()*, void ()** %0, align 8, !nonnull !3
call void %_3()
br label %bb1
bb1: ; preds = %start
; call <() as std::process::Termination>::report
%1 = call i32 @"_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h30eceee04b1097a6E"()
br label %bb2
bb2: ; preds = %bb1
ret i32 %1
}
; std::sys::unix::process::process_common::ExitCode::as_i32
; Function Attrs: inlinehint nonlazybind uwtable
define internal i32 @_ZN3std3sys4unix7process14process_common8ExitCode6as_i3217hd229eebb0f750ffdE(i8* noalias readonly align 1 dereferenceable(1) %self) unnamed_addr #1 {
start:
%_2 = load i8, i8* %self, align 1
%0 = zext i8 %_2 to i32
ret i32 %0
}
; core::fmt::Arguments::new_v1
; Function Attrs: inlinehint nonlazybind uwtable
define internal void @_ZN4core3fmt9Arguments6new_v117h9ac2c498ba1972d4E(%"core::fmt::Arguments"* noalias nocapture sret dereferenceable(48), [0 x { [0 x i8]*, i64 }]* noalias nonnull readonly align 8 %pieces.0, i64 %pieces.1, [0 x { i8*, i8* }]* noalias nonnull readonly align 8 %args.0, i64 %args.1) unnamed_addr #1 {
start:
%_4 = alloca { i64*, i64 }, align 8
%1 = bitcast { i64*, i64 }* %_4 to {}**
store {}* null, {}** %1, align 8
%2 = bitcast %"core::fmt::Arguments"* %0 to { [0 x { [0 x i8]*, i64 }]*, i64 }*
%3 = getelementptr inbounds { [0 x { [0 x i8]*, i64 }]*, i64 }, { [0 x { [0 x i8]*, i64 }]*, i64 }* %2, i32 0, i32 0
store [0 x { [0 x i8]*, i64 }]* %pieces.0, [0 x { [0 x i8]*, i64 }]** %3, align 8
%4 = getelementptr inbounds { [0 x { [0 x i8]*, i64 }]*, i64 }, { [0 x { [0 x i8]*, i64 }]*, i64 }* %2, i32 0, i32 1
store i64 %pieces.1, i64* %4, align 8
%5 = getelementptr inbounds %"core::fmt::Arguments", %"core::fmt::Arguments"* %0, i32 0, i32 3
%6 = getelementptr inbounds { i64*, i64 }, { i64*, i64 }* %_4, i32 0, i32 0
%7 = load i64*, i64** %6, align 8
%8 = getelementptr inbounds { i64*, i64 }, { i64*, i64 }* %_4, i32 0, i32 1
%9 = load i64, i64* %8, align 8
%10 = getelementptr inbounds { i64*, i64 }, { i64*, i64 }* %5, i32 0, i32 0
store i64* %7, i64** %10, align 8
%11 = getelementptr inbounds { i64*, i64 }, { i64*, i64 }* %5, i32 0, i32 1
store i64 %9, i64* %11, align 8
%12 = getelementptr inbounds %"core::fmt::Arguments", %"core::fmt::Arguments"* %0, i32 0, i32 5
%13 = getelementptr inbounds { [0 x { i8*, i8* }]*, i64 }, { [0 x { i8*, i8* }]*, i64 }* %12, i32 0, i32 0
store [0 x { i8*, i8* }]* %args.0, [0 x { i8*, i8* }]** %13, align 8
%14 = getelementptr inbounds { [0 x { i8*, i8* }]*, i64 }, { [0 x { i8*, i8* }]*, i64 }* %12, i32 0, i32 1
store i64 %args.1, i64* %14, align 8
ret void
}
; core::ops::function::FnOnce::call_once{{vtable.shim}}
; Function Attrs: nonlazybind uwtable
define internal i32 @"_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17haa37b3978e9388c2E"(i8** %_1) unnamed_addr #0 {
start:
%_2 = alloca {}, align 1
%0 = load i8*, i8** %_1, align 8, !nonnull !3
; call core::ops::function::FnOnce::call_once
%1 = call i32 @_ZN4core3ops8function6FnOnce9call_once17h5237de241d4aa8f6E(i8* nonnull %0)
br label %bb1
bb1: ; preds = %start
ret i32 %1
}
; core::ops::function::FnOnce::call_once
; Function Attrs: nonlazybind uwtable
define internal i32 @_ZN4core3ops8function6FnOnce9call_once17h5237de241d4aa8f6E(i8* nonnull) unnamed_addr #0 personality i32 (i32, i32, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*)* @rust_eh_personality {
start:
%1 = alloca { i8*, i32 }, align 8
%_2 = alloca {}, align 1
%_1 = alloca i8*, align 8
store i8* %0, i8** %_1, align 8
; invoke std::rt::lang_start::{{closure}}
%2 = invoke i32 @"_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17ha1b7ad2f7027bb10E"(i8** noalias readonly align 8 dereferenceable(8) %_1)
to label %bb1 unwind label %cleanup
bb1: ; preds = %start
br label %bb2
bb2: ; preds = %bb1
ret i32 %2
bb3: ; preds = %cleanup
br label %bb4
bb4: ; preds = %bb3
%3 = bitcast { i8*, i32 }* %1 to i8**
%4 = load i8*, i8** %3, align 8
%5 = getelementptr inbounds { i8*, i32 }, { i8*, i32 }* %1, i32 0, i32 1
%6 = load i32, i32* %5, align 8
%7 = insertvalue { i8*, i32 } undef, i8* %4, 0
%8 = insertvalue { i8*, i32 } %7, i32 %6, 1
resume { i8*, i32 } %8
cleanup: ; preds = %start
%9 = landingpad { i8*, i32 }
cleanup
%10 = extractvalue { i8*, i32 } %9, 0
%11 = extractvalue { i8*, i32 } %9, 1
%12 = getelementptr inbounds { i8*, i32 }, { i8*, i32 }* %1, i32 0, i32 0
store i8* %10, i8** %12, align 8
%13 = getelementptr inbounds { i8*, i32 }, { i8*, i32 }* %1, i32 0, i32 1
store i32 %11, i32* %13, align 8
br label %bb3
}
; core::ptr::real_drop_in_place
; Function Attrs: nonlazybind uwtable
define internal void @_ZN4core3ptr18real_drop_in_place17h284850d1a40eb6daE(i8** align 8 dereferenceable(8) %_1) unnamed_addr #0 {
start:
ret void
}
; <() as std::process::Termination>::report
; Function Attrs: inlinehint nonlazybind uwtable
define internal i32 @"_ZN54_$LT$$LP$$RP$$u20$as$u20$std..process..Termination$GT$6report17h30eceee04b1097a6E"() unnamed_addr #1 {
start:
; call <std::process::ExitCode as std::process::Termination>::report
%0 = call i32 @"_ZN68_$LT$std..process..ExitCode$u20$as$u20$std..process..Termination$GT$6report17h9e2aa7480098a157E"(i8 0)
br label %bb1
bb1: ; preds = %start
ret i32 %0
}
; <std::process::ExitCode as std::process::Termination>::report
; Function Attrs: inlinehint nonlazybind uwtable
define internal i32 @"_ZN68_$LT$std..process..ExitCode$u20$as$u20$std..process..Termination$GT$6report17h9e2aa7480098a157E"(i8) unnamed_addr #1 {
start:
%self = alloca i8, align 1
store i8 %0, i8* %self, align 1
; call std::sys::unix::process::process_common::ExitCode::as_i32
%1 = call i32 @_ZN3std3sys4unix7process14process_common8ExitCode6as_i3217hd229eebb0f750ffdE(i8* noalias readonly align 1 dereferenceable(1) %self)
br label %bb1
bb1: ; preds = %start
ret i32 %1
}
; hello_world::main
; Function Attrs: nonlazybind uwtable
define internal void @_ZN11hello_world4main17h122fbd04657e1f4aE() unnamed_addr #0 {
start:
%_2 = alloca %"core::fmt::Arguments", align 8
; call core::fmt::Arguments::new_v1
call void @_ZN4core3fmt9Arguments6new_v117h9ac2c498ba1972d4E(%"core::fmt::Arguments"* noalias nocapture sret dereferenceable(48) %_2, [0 x { [0 x i8]*, i64 }]* noalias nonnull readonly align 8 bitcast (<{ i8*, [8 x i8] }>* @1 to [0 x { [0 x i8]*, i64 }]*), i64 1, [0 x { i8*, i8* }]* noalias nonnull readonly align 8 inttoptr (i64 8 to [0 x { i8*, i8* }]*), i64 0)
br label %bb1
bb1: ; preds = %start
; call std::io::stdio::_print
call void @_ZN3std2io5stdio6_print17ha21135370f774d93E(%"core::fmt::Arguments"* noalias nocapture dereferenceable(48) %_2)
br label %bb2
bb2: ; preds = %bb1
ret void
}
; std::rt::lang_start_internal
; Function Attrs: nonlazybind uwtable
declare i64 @_ZN3std2rt19lang_start_internal17hb8081e0e7e42ac0dE({}* nonnull align 1, [3 x i64]* noalias readonly align 8 dereferenceable(24), i64, i8**) unnamed_addr #0
; Function Attrs: nounwind nonlazybind uwtable
declare i32 @rust_eh_personality(i32, i32, i64, %"unwind::libunwind::_Unwind_Exception"*, %"unwind::libunwind::_Unwind_Context"*) unnamed_addr #2
; std::io::stdio::_print
; Function Attrs: nonlazybind uwtable
declare void @_ZN3std2io5stdio6_print17ha21135370f774d93E(%"core::fmt::Arguments"* noalias nocapture dereferenceable(48)) unnamed_addr #0
; Function Attrs: nonlazybind
define i32 @main(i32, i8**) unnamed_addr #3 {
top:
%2 = sext i32 %0 to i64
; call std::rt::lang_start
%3 = call i64 @_ZN3std2rt10lang_start17h8160322698c08501E(void ()* @_ZN11hello_world4main17h122fbd04657e1f4aE, i64 %2, i8** %1)
%4 = trunc i64 %3 to i32
ret i32 %4
}
attributes #0 = { nonlazybind uwtable "probe-stack"="__rust_probestack" "target-cpu"="x86-64" }
attributes #1 = { inlinehint nonlazybind uwtable "probe-stack"="__rust_probestack" "target-cpu"="x86-64" }
attributes #2 = { nounwind nonlazybind uwtable "probe-stack"="__rust_probestack" "target-cpu"="x86-64" }
attributes #3 = { nonlazybind "target-cpu"="x86-64" }
!llvm.module.flags = !{!0, !1, !2}
!0 = !{i32 7, !"PIC Level", i32 2}
!1 = !{i32 7, !"PIE Level", i32 2}
!2 = !{i32 2, !"RtLibUseGOT", i32 1}
!3 = !{}