3939# MY_PRINTF("val: %d", temp);
4040# return temp;
4141# }
42+ # Manually modified to remove "extra" assembly.
4243 .text
4344 .file "main.cpp"
4445 .globl _Z6fooMulii # -- Begin function _Z6fooMulii
4546 .p2align 4 , 0x90
4647 .type _Z6fooMulii,@function
4748_Z6fooMulii: # @_Z6fooMulii
4849 .cfi_startproc
49- # %bb.0:
50- pushq %rbp
51- .cfi_def_cfa_offset 16
52- .cfi_offset %rbp , -16
53- movq %rsp , %rbp
54- .cfi_def_cfa_register %rbp
55- movl %edi , -4 (%rbp )
56- movl %esi , -8 (%rbp )
57- movl -4 (%rbp ), %eax
5850 imull -8 (%rbp ), %eax
5951 popq %rbp
6052 .cfi_def_cfa %rsp , 8
@@ -68,15 +60,6 @@ _Z6fooMulii: # @_Z6fooMulii
6860 .type _Z6barMulii,@function
6961_Z6barMulii: # @_Z6barMulii
7062 .cfi_startproc
71- # %bb.0:
72- pushq %rbp
73- .cfi_def_cfa_offset 16
74- .cfi_offset %rbp , -16
75- movq %rsp , %rbp
76- .cfi_def_cfa_register %rbp
77- movl %edi , -4 (%rbp )
78- movl %esi , -8 (%rbp )
79- movl -4 (%rbp ), %eax
8063 imull -8 (%rbp ), %eax
8164 popq %rbp
8265 .cfi_def_cfa %rsp , 8
@@ -90,15 +73,6 @@ _Z6barMulii: # @_Z6barMulii
9073 .type _Z6fooAddii,@function
9174_Z6fooAddii: # @_Z6fooAddii
9275 .cfi_startproc
93- # %bb.0:
94- pushq %rbp
95- .cfi_def_cfa_offset 16
96- .cfi_offset %rbp , -16
97- movq %rsp , %rbp
98- .cfi_def_cfa_register %rbp
99- movl %edi , -4 (%rbp )
100- movl %esi , -8 (%rbp )
101- movl -4 (%rbp ), %eax
10276 addl -8 (%rbp ), %eax
10377 popq %rbp
10478 .cfi_def_cfa %rsp , 8
@@ -112,15 +86,6 @@ _Z6fooAddii: # @_Z6fooAddii
11286 .type _Z6barAddii,@function
11387_Z6barAddii: # @_Z6barAddii
11488 .cfi_startproc
115- # %bb.0:
116- pushq %rbp
117- .cfi_def_cfa_offset 16
118- .cfi_offset %rbp , -16
119- movq %rsp , %rbp
120- .cfi_def_cfa_register %rbp
121- movl %edi , -4 (%rbp )
122- movl %esi , -8 (%rbp )
123- movl -4 (%rbp ), %eax
12489 addl -8 (%rbp ), %eax
12590 popq %rbp
12691 .cfi_def_cfa %rsp , 8
@@ -134,34 +99,8 @@ _Z6barAddii: # @_Z6barAddii
13499 .type _Z7helper1PFKiiiEii,@function
135100_Z7helper1PFKiiiEii: # @_Z7helper1PFKiiiEii
136101 .cfi_startproc
137- # %bb.0:
138- pushq %rbp
139- .cfi_def_cfa_offset 16
140- .cfi_offset %rbp , -16
141- movq %rsp , %rbp
142- .cfi_def_cfa_register %rbp
143- subq $32 , %rsp
144- movq %rdi , -16 (%rbp )
145- movl %esi , -20 (%rbp )
146- movl %edx , -24 (%rbp )
147102 movabsq $_Z6barAddii, %rax
148103 cmpq %rax , -16 (%rbp )
149- jne .LBB4_2
150- # %bb.1:
151- movl $1 , -4 (%rbp )
152- jmp .LBB4_3
153- .LBB4_2:
154- movq -16 (%rbp ), %rax
155- movl -20 (%rbp ), %edi
156- movl -24 (%rbp ), %esi
157- callq *%rax
158- subl $4 , %eax
159- movl %eax , -4 (%rbp )
160- .LBB4_3:
161- movl -4 (%rbp ), %eax
162- addq $32 , %rsp
163- popq %rbp
164- .cfi_def_cfa %rsp , 8
165104 retq
166105.Lfunc_end4:
167106 .size _Z7helper1PFKiiiEii, .Lfunc_end4-_Z7helper1PFKiiiEii
@@ -171,43 +110,8 @@ _Z7helper1PFKiiiEii: # @_Z7helper1PFKiiiEii
171110 .p2align 4 , 0x90
172111 .type _Z7helper2PFKiiiES1_ii,@function
173112_Z7helper2PFKiiiES1_ii: # @_Z7helper2PFKiiiES1_ii
174- .cfi_startproc
175- # %bb.0:
176- pushq %rbp
177- .cfi_def_cfa_offset 16
178- .cfi_offset %rbp , -16
179- movq %rsp , %rbp
180- .cfi_def_cfa_register %rbp
181- subq $48 , %rsp
182- movq %rdi , -16 (%rbp )
183- movq %rsi , -24 (%rbp )
184- movl %edx , -28 (%rbp )
185- movl %ecx , -32 (%rbp )
186- movq -16 (%rbp ), %rax
187- cmpq -24 (%rbp ), %rax
188- jne .LBB5_2
189- # %bb.1:
190- movl $2 , -4 (%rbp )
191- jmp .LBB5_3
192- .LBB5_2:
193- movq -16 (%rbp ), %rax
194- movl -28 (%rbp ), %edi
195- movl -32 (%rbp ), %esi
196- callq *%rax
197- movl %eax , -36 (%rbp ) # 4-byte Spill
198- movq -24 (%rbp ), %rax
199- movl -28 (%rbp ), %edi
200- movl -32 (%rbp ), %esi
201- callq *%rax
202- movl %eax , %ecx
203- movl -36 (%rbp ), %eax # 4-byte Reload
204- addl %ecx , %eax
205- movl %eax , -4 (%rbp )
206- .LBB5_3:
207- movl -4 (%rbp ), %eax
208- addq $48 , %rsp
209- popq %rbp
210- .cfi_def_cfa %rsp , 8
113+ .cfi_startproc
114+ # no direct function references.
211115 retq
212116.Lfunc_end5:
213117 .size _Z7helper2PFKiiiES1_ii, .Lfunc_end5-_Z7helper2PFKiiiES1_ii
@@ -218,16 +122,6 @@ _Z7helper2PFKiiiES1_ii: # @_Z7helper2PFKiiiES1_ii
218122 .type main,@function
219123main: # @main
220124 .cfi_startproc
221- # %bb.0:
222- pushq %rbp
223- .cfi_def_cfa_offset 16
224- .cfi_offset %rbp , -16
225- movq %rsp , %rbp
226- .cfi_def_cfa_register %rbp
227- subq $32 , %rsp
228- movl $0 , -4 (%rbp )
229- movl %edi , -8 (%rbp )
230- movq %rsi , -16 (%rbp )
231125 movl FooVar, %esi
232126 movl BarVar, %edx
233127 movabsq $_Z6barAddii, %rdi
@@ -238,25 +132,6 @@ main: # @main
238132 movabsq $_Z6fooMulii, %rdi
239133 movabsq $_Z6barMulii, %rsi
240134 callq _Z7helper2PFKiiiES1_ii
241- movl %eax , %ecx
242- movl -28 (%rbp ), %eax # 4-byte Reload
243- addl %ecx , %eax
244- movl %eax , -24 (%rbp ) # 4-byte Spill
245- movl FooVar, %edi
246- movl BarVar, %esi
247- callq _Z6fooAddii
248- movl %eax , %ecx
249- movl -24 (%rbp ), %eax # 4-byte Reload
250- addl %ecx , %eax
251- movl %eax , -20 (%rbp )
252- movl -20 (%rbp ), %esi
253- movabsq $.L.str , %rdi
254- movb $0 , %al
255- callq printf
256- movl -20 (%rbp ), %eax
257- addq $32 , %rsp
258- popq %rbp
259- .cfi_def_cfa %rsp , 8
260135 retq
261136.Lfunc_end6:
262137 .size main, .Lfunc_end6-main
@@ -269,14 +144,3 @@ main: # @main
269144 .size .L.str , 9
270145
271146 .ident "clang version 20.0.0git"
272- .section ".note.GNU-stack" ,"",@progbits
273- .addrsig
274- .addrsig_sym _Z6fooMulii
275- .addrsig_sym _Z6barMulii
276- .addrsig_sym _Z6fooAddii
277- .addrsig_sym _Z6barAddii
278- .addrsig_sym _Z7helper1PFKiiiEii
279- .addrsig_sym _Z7helper2PFKiiiES1_ii
280- .addrsig_sym printf
281- .addrsig_sym FooVar
282- .addrsig_sym BarVar
0 commit comments