forked from aaronbloomfield/pdr
-
Notifications
You must be signed in to change notification settings - Fork 228
/
test_max.s
148 lines (140 loc) · 3.55 KB
/
test_max.s
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
.text
.intel_syntax noprefix
.file "test_max.cpp"
.section .text.startup,"ax",@progbits
.align 16, 0x90
.type __cxx_global_var_init,@function
__cxx_global_var_init: # @__cxx_global_var_init
.cfi_startproc
# BB#0:
push rax
.Ltmp0:
.cfi_def_cfa_offset 16
movabs rdi, _ZStL8__ioinit
call _ZNSt8ios_base4InitC1Ev
movabs rdi, _ZNSt8ios_base4InitD1Ev
movabs rsi, _ZStL8__ioinit
movabs rdx, __dso_handle
call __cxa_atexit
mov dword ptr [rsp + 4], eax # 4-byte Spill
pop rax
ret
.Lfunc_end0:
.size __cxx_global_var_init, .Lfunc_end0-__cxx_global_var_init
.cfi_endproc
.text
.globl max
.align 16, 0x90
.type max,@function
max: # @max
.cfi_startproc
# BB#0:
mov dword ptr [rsp - 4], edi
mov dword ptr [rsp - 8], esi
mov esi, dword ptr [rsp - 4]
cmp esi, dword ptr [rsp - 8]
jle .LBB1_2
# BB#1:
mov eax, dword ptr [rsp - 4]
mov dword ptr [rsp - 12], eax
jmp .LBB1_3
.LBB1_2:
mov eax, dword ptr [rsp - 8]
mov dword ptr [rsp - 12], eax
.LBB1_3:
mov eax, dword ptr [rsp - 12]
ret
.Lfunc_end1:
.size max, .Lfunc_end1-max
.cfi_endproc
.globl main
.align 16, 0x90
.type main,@function
main: # @main
.cfi_startproc
# BB#0:
sub rsp, 56
.Ltmp1:
.cfi_def_cfa_offset 64
movabs rdi, _ZSt4cout
movabs rsi, .L.str
mov dword ptr [rsp + 52], 0
mov dword ptr [rsp + 48], 0
mov dword ptr [rsp + 44], 0
call _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
movabs rsi, _ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
mov rdi, rax
call _ZNSolsEPFRSoS_E
movabs rdi, _ZSt3cin
lea rsi, [rsp + 48]
mov qword ptr [rsp + 32], rax # 8-byte Spill
call _ZNSirsERi
movabs rdi, _ZSt4cout
movabs rsi, .L.str.1
mov qword ptr [rsp + 24], rax # 8-byte Spill
call _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
movabs rsi, _ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
mov rdi, rax
call _ZNSolsEPFRSoS_E
movabs rdi, _ZSt3cin
lea rsi, [rsp + 44]
mov qword ptr [rsp + 16], rax # 8-byte Spill
call _ZNSirsERi
mov edi, dword ptr [rsp + 48]
mov esi, dword ptr [rsp + 44]
mov qword ptr [rsp + 8], rax # 8-byte Spill
call max
movabs rdi, _ZSt4cout
movabs rsi, .L.str.2
mov dword ptr [rsp + 40], eax
call _ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc
mov esi, dword ptr [rsp + 40]
mov rdi, rax
call _ZNSolsEi
movabs rsi, _ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_
mov rdi, rax
call _ZNSolsEPFRSoS_E
xor ecx, ecx
mov qword ptr [rsp], rax # 8-byte Spill
mov eax, ecx
add rsp, 56
ret
.Lfunc_end2:
.size main, .Lfunc_end2-main
.cfi_endproc
.section .text.startup,"ax",@progbits
.align 16, 0x90
.type _GLOBAL__sub_I_test_max.cpp,@function
_GLOBAL__sub_I_test_max.cpp: # @_GLOBAL__sub_I_test_max.cpp
.cfi_startproc
# BB#0:
push rax
.Ltmp2:
.cfi_def_cfa_offset 16
call __cxx_global_var_init
pop rax
ret
.Lfunc_end3:
.size _GLOBAL__sub_I_test_max.cpp, .Lfunc_end3-_GLOBAL__sub_I_test_max.cpp
.cfi_endproc
.type _ZStL8__ioinit,@object # @_ZStL8__ioinit
.local _ZStL8__ioinit
.comm _ZStL8__ioinit,1,1
.type .L.str,@object # @.str
.section .rodata.str1.1,"aMS",@progbits,1
.L.str:
.asciz "Enter value 1: "
.size .L.str, 16
.type .L.str.1,@object # @.str.1
.L.str.1:
.asciz "Enter value 2: "
.size .L.str.1, 16
.type .L.str.2,@object # @.str.2
.L.str.2:
.asciz "The result is: "
.size .L.str.2, 16
.section .init_array,"aw",@init_array
.align 8
.quad _GLOBAL__sub_I_test_max.cpp
.ident "clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)"
.section ".note.GNU-stack","",@progbits