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
|
.file "main.c"
.text
.section .rodata.str1.1,"aMS",@progbits,1
.LC0:
.string "Usage: stem [-hv] [file]"
.text
.p2align 4
.globl usage
.type usage, @function
usage:
.LFB22:
.cfi_startproc
leaq .LC0(%rip), %rdi
subq $8, %rsp
.cfi_def_cfa_offset 16
call puts@PLT
movl $1, %edi
call exit@PLT
.cfi_endproc
.LFE22:
.size usage, .-usage
.section .rodata.str1.8,"aMS",@progbits,1
.align 8
.LC1:
.string "Author: Preston Pan, MIT License 2023"
.section .rodata.str1.1
.LC2:
.string "stem, version 1.2 alpha"
.text
.p2align 4
.globl version
.type version, @function
version:
.LFB23:
.cfi_startproc
subq $8, %rsp
.cfi_def_cfa_offset 16
leaq .LC1(%rip), %rdi
call puts@PLT
leaq .LC2(%rip), %rdi
call puts@PLT
xorl %edi, %edi
call exit@PLT
.cfi_endproc
.LFE23:
.size version, .-version
.section .rodata.str1.1
.LC3:
.string "--help"
.LC4:
.string "--version"
.LC5:
.string "rb"
.section .text.startup,"ax",@progbits
.p2align 4
.globl main
.type main, @function
main:
.LFB24:
.cfi_startproc
pushq %rbp
.cfi_def_cfa_offset 16
.cfi_offset 6, -16
pushq %rbx
.cfi_def_cfa_offset 24
.cfi_offset 3, -24
subq $24, %rsp
.cfi_def_cfa_offset 48
movq %fs:40, %rax
movq %rax, 8(%rsp)
xorl %eax, %eax
cmpl $1, %edi
jle .L9
movq 8(%rsi), %rbx
movzbl (%rbx), %ebp
cmpl $45, %ebp
je .L31
.L16:
leaq .LC3(%rip), %rsi
movq %rbx, %rdi
call strcmp@PLT
testl %eax, %eax
je .L9
cmpl $45, %ebp
je .L32
.L17:
leaq .LC4(%rip), %rsi
movq %rbx, %rdi
call strcmp@PLT
testl %eax, %eax
je .L11
movq %rbx, %rdi
leaq .LC5(%rip), %rsi
call fopen@PLT
movq %rax, %rbx
testq %rax, %rax
je .L9
movq %rsp, %rsi
movq %rax, %rcx
leaq INBUF(%rip), %rdi
xorl %edx, %edx
call getdelim@PLT
movq %rbx, %rdi
call fclose@PLT
movq INBUF(%rip), %rdi
call init_parser@PLT
movl $10, %edi
movq %rax, PARSER(%rip)
call init_array@PLT
movl $500, %edi
movq %rax, STACK(%rip)
call init_ht@PLT
movl $10, %edi
movq %rax, WORD_TABLE(%rip)
call init_array@PLT
movl $500, %edi
movq %rax, EVAL_STACK(%rip)
call init_ht@PLT
movl $500, %edi
movq %rax, FLIT(%rip)
call init_ht@PLT
movq %rax, OBJ_TABLE(%rip)
xorl %eax, %eax
call add_funcs@PLT
jmp .L14
.p2align 4,,10
.p2align 3
.L33:
call eval@PLT
.L14:
movq PARSER(%rip), %rdi
call parser_get_next@PLT
movq %rax, %rdi
testq %rax, %rax
jne .L33
movq INBUF(%rip), %rdi
call free@PLT
movq value_free@GOTPCREL(%rip), %rsi
movq WORD_TABLE(%rip), %rdi
call ht_free@PLT
movq func_free@GOTPCREL(%rip), %rsi
movq FLIT(%rip), %rdi
call ht_free@PLT
movq custom_free@GOTPCREL(%rip), %rsi
movq OBJ_TABLE(%rip), %rdi
call ht_free@PLT
movq STACK(%rip), %rdi
call array_free@PLT
movq PARSER(%rip), %rdi
call free@PLT
movq EVAL_STACK(%rip), %rdi
call array_free@PLT
movq 8(%rsp), %rax
subq %fs:40, %rax
jne .L34
addq $24, %rsp
.cfi_remember_state
.cfi_def_cfa_offset 24
xorl %eax, %eax
popq %rbx
.cfi_def_cfa_offset 16
popq %rbp
.cfi_def_cfa_offset 8
ret
.L32:
.cfi_restore_state
cmpb $118, 1(%rbx)
jne .L17
cmpb $0, 2(%rbx)
jne .L17
.L11:
xorl %eax, %eax
call version
.L31:
cmpb $104, 1(%rbx)
jne .L16
cmpb $0, 2(%rbx)
jne .L16
.L9:
xorl %eax, %eax
call usage
.L34:
call __stack_chk_fail@PLT
.cfi_endproc
.LFE24:
.size main, .-main
.ident "GCC: (GNU) 13.2.1 20230801"
.section .note.GNU-stack,"",@progbits
|