comparison code/as/reg.gcc.s @ 0:02656ea776f3

Regexp-Compiler with LLVM
author ryoma <e075725@ie.u-ryukyu.ac.jp>
date Tue, 15 Jun 2010 00:54:59 +0900
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:02656ea776f3
1 .cstring
2 LC0:
3 .ascii "\12string matches regexp. \12\0"
4 .align 2
5 LC1:
6 .ascii "\12string does not match regexp. \12\0"
7 .text
8 .align 4,0x90
9 .globl _state_8
10 _state_8:
11 pushl %ebp
12 movl %esp, %ebp
13 pushl %ebx
14 subl $20, %esp
15 call ___i686.get_pc_thunk.bx
16 "L00000000001$pb":
17 cmpb $0, (%ecx)
18 jne L5
19 leal LC0-"L00000000001$pb"(%ebx), %eax
20 movl %eax, (%esp)
21 call L_puts$stub
22 addl $20, %esp
23 popl %ebx
24 popl %ebp
25 ret
26 .align 4,0x90
27 L5:
28 leal LC1-"L00000000001$pb"(%ebx), %eax
29 movl %eax, (%esp)
30 call L_puts$stub
31 addl $20, %esp
32 popl %ebx
33 popl %ebp
34 ret
35 .align 4,0x90
36 .globl _state_1_2_3_5_7
37 _state_1_2_3_5_7:
38 pushl %ebp
39 movl %esp, %ebp
40 pushl %ebx
41 call ___i686.get_pc_thunk.bx
42 "L00000000002$pb":
43 subl $20, %esp
44 L22:
45 movzbl (%ecx), %eax
46 addl $1, %ecx
47 cmpb $66, %al
48 je L22
49 cmpb $67, %al
50 je L18
51 cmpb $65, %al
52 je L22
53 L26:
54 leal LC1-"L00000000002$pb"(%ebx), %eax
55 movl %eax, (%esp)
56 call L_puts$stub
57 addl $20, %esp
58 popl %ebx
59 popl %ebp
60 ret
61 .align 4,0x90
62 L18:
63 cmpb $0, (%ecx)
64 jne L26
65 leal LC0-"L00000000002$pb"(%ebx), %eax
66 movl %eax, (%esp)
67 call L_puts$stub
68 addl $20, %esp
69 popl %ebx
70 popl %ebp
71 ret
72 .align 4,0x90
73 .globl _state_1_3_4_5_7
74 _state_1_3_4_5_7:
75 pushl %ebp
76 movl %esp, %ebp
77 pushl %ebx
78 call ___i686.get_pc_thunk.bx
79 "L00000000003$pb":
80 subl $20, %esp
81 L38:
82 movzbl (%ecx), %eax
83 addl $1, %ecx
84 cmpb $66, %al
85 je L38
86 cmpb $67, %al
87 je L41
88 cmpb $65, %al
89 je L48
90 L46:
91 leal LC1-"L00000000003$pb"(%ebx), %eax
92 movl %eax, (%esp)
93 call L_puts$stub
94 addl $20, %esp
95 popl %ebx
96 popl %ebp
97 ret
98 .align 4,0x90
99 L48:
100 addl $20, %esp
101 popl %ebx
102 popl %ebp
103 jmp _state_1_2_3_5_7
104 .align 4,0x90
105 L41:
106 cmpb $0, (%ecx)
107 jne L46
108 leal LC0-"L00000000003$pb"(%ebx), %eax
109 movl %eax, (%esp)
110 call L_puts$stub
111 addl $20, %esp
112 popl %ebx
113 popl %ebp
114 ret
115 .align 4,0x90
116 .globl _state_1_3_5_6_7
117 _state_1_3_5_6_7:
118 pushl %ebp
119 movl %esp, %ebp
120 pushl %ebx
121 subl $20, %esp
122 movzbl (%ecx), %eax
123 call ___i686.get_pc_thunk.bx
124 "L00000000004$pb":
125 leal 1(%ecx), %edx
126 cmpb $66, %al
127 je L63
128 cmpb $67, %al
129 je L53
130 L72:
131 cmpb $65, %al
132 je L73
133 L65:
134 leal LC1-"L00000000004$pb"(%ebx), %eax
135 movl %eax, (%esp)
136 call L_puts$stub
137 addl $20, %esp
138 popl %ebx
139 popl %ebp
140 ret
141 .align 4,0x90
142 L73:
143 addl $20, %esp
144 movl %edx, %ecx
145 popl %ebx
146 popl %ebp
147 jmp _state_1_2_3_5_7
148 .align 4,0x90
149 L63:
150 movzbl (%edx), %eax
151 addl $1, %edx
152 cmpb $66, %al
153 je L63
154 cmpb $67, %al
155 jne L72
156 cmpb $0, (%edx)
157 jne L65
158 leal LC0-"L00000000004$pb"(%ebx), %eax
159 movl %eax, (%esp)
160 call L_puts$stub
161 .align 4,0x90
162 L74:
163 addl $20, %esp
164 popl %ebx
165 popl %ebp
166 ret
167 .align 4,0x90
168 L53:
169 cmpb $0, 1(%ecx)
170 jne L65
171 leal LC0-"L00000000004$pb"(%ebx), %eax
172 movl %eax, (%esp)
173 call L_puts$stub
174 jmp L74
175 .cstring
176 LC2:
177 .ascii "regexp: (A|B)*C\0"
178 LC3:
179 .ascii "number of state: 4\0"
180 LC4:
181 .ascii "string: %s\12\0"
182 .text
183 .align 4,0x90
184 .globl _main
185 _main:
186 pushl %ebp
187 movl %esp, %ebp
188 pushl %esi
189 pushl %ebx
190 call ___i686.get_pc_thunk.bx
191 "L00000000005$pb":
192 subl $16, %esp
193 movl 12(%ebp), %esi
194 leal LC2-"L00000000005$pb"(%ebx), %eax
195 movl %eax, (%esp)
196 call L_puts$stub
197 leal LC3-"L00000000005$pb"(%ebx), %eax
198 movl %eax, (%esp)
199 call L_puts$stub
200 movl 4(%esi), %eax
201 movl %eax, 4(%esp)
202 leal LC4-"L00000000005$pb"(%ebx), %eax
203 movl %eax, (%esp)
204 call L_printf$stub
205 movl 4(%esi), %eax
206 movzbl (%eax), %edx
207 leal 1(%eax), %ecx
208 cmpb $66, %dl
209 je L89
210 cmpb $67, %dl
211 je L79
212 cmpb $65, %dl
213 je L97
214 L91:
215 leal LC1-"L00000000005$pb"(%ebx), %eax
216 movl %eax, (%esp)
217 call L_puts$stub
218 addl $16, %esp
219 popl %ebx
220 popl %esi
221 popl %ebp
222 ret
223 .align 4,0x90
224 L89:
225 movzbl (%ecx), %eax
226 addl $1, %ecx
227 cmpb $66, %al
228 je L89
229 cmpb $67, %al
230 je L86
231 cmpb $65, %al
232 jne L91
233 L97:
234 addl $16, %esp
235 popl %ebx
236 popl %esi
237 popl %ebp
238 jmp _state_1_2_3_5_7
239 .align 4,0x90
240 L79:
241 cmpb $0, 1(%eax)
242 jne L91
243 L96:
244 leal LC0-"L00000000005$pb"(%ebx), %eax
245 movl %eax, (%esp)
246 call L_puts$stub
247 addl $16, %esp
248 popl %ebx
249 popl %esi
250 popl %ebp
251 ret
252 .align 4,0x90
253 L86:
254 cmpb $0, (%ecx)
255 jne L91
256 .p2align 4,,3
257 jmp L96
258 .align 4,0x90
259 .globl _accept
260 _accept:
261 pushl %ebp
262 movl %esp, %ebp
263 pushl %ebx
264 call ___i686.get_pc_thunk.bx
265 "L00000000006$pb":
266 subl $20, %esp
267 leal LC0-"L00000000006$pb"(%ebx), %eax
268 movl %eax, (%esp)
269 call L_puts$stub
270 addl $20, %esp
271 popl %ebx
272 popl %ebp
273 ret
274 .align 4,0x90
275 .globl _reject
276 _reject:
277 pushl %ebp
278 movl %esp, %ebp
279 pushl %ebx
280 call ___i686.get_pc_thunk.bx
281 "L00000000007$pb":
282 subl $20, %esp
283 leal LC1-"L00000000007$pb"(%ebx), %eax
284 movl %eax, (%esp)
285 call L_puts$stub
286 addl $20, %esp
287 popl %ebx
288 popl %ebp
289 ret
290 .picsymbol_stub
291 L_printf$stub:
292 .indirect_symbol _printf
293 call LPC$1
294 LPC$1: popl %eax
295 movl L1$lz-LPC$1(%eax),%edx
296 jmp *%edx
297 L_printf$stub_binder:
298 lea L1$lz-LPC$1(%eax),%eax
299 pushl %eax
300 jmp dyld_stub_binding_helper
301 .lazy_symbol_pointer
302 L1$lz:
303 .indirect_symbol _printf
304 .long L_printf$stub_binder
305 .picsymbol_stub
306 L_puts$stub:
307 .indirect_symbol _puts
308 call LPC$2
309 LPC$2: popl %eax
310 movl L2$lz-LPC$2(%eax),%edx
311 jmp *%edx
312 L_puts$stub_binder:
313 lea L2$lz-LPC$2(%eax),%eax
314 pushl %eax
315 jmp dyld_stub_binding_helper
316 .lazy_symbol_pointer
317 L2$lz:
318 .indirect_symbol _puts
319 .long L_puts$stub_binder
320 .subsections_via_symbols
321 .section __TEXT,__textcoal_nt,coalesced,pure_instructions
322 .weak_definition ___i686.get_pc_thunk.bx
323 .private_extern ___i686.get_pc_thunk.bx
324 ___i686.get_pc_thunk.bx:
325 movl (%esp), %ebx
326 ret