Mercurial > hg > Members > shinya > pyrect
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/code/as/reg.gcc.s Tue Jun 15 00:54:59 2010 +0900 @@ -0,0 +1,326 @@ + .cstring +LC0: + .ascii "\12string matches regexp. \12\0" + .align 2 +LC1: + .ascii "\12string does not match regexp. \12\0" + .text + .align 4,0x90 +.globl _state_8 +_state_8: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $20, %esp + call ___i686.get_pc_thunk.bx +"L00000000001$pb": + cmpb $0, (%ecx) + jne L5 + leal LC0-"L00000000001$pb"(%ebx), %eax + movl %eax, (%esp) + call L_puts$stub + addl $20, %esp + popl %ebx + popl %ebp + ret + .align 4,0x90 +L5: + leal LC1-"L00000000001$pb"(%ebx), %eax + movl %eax, (%esp) + call L_puts$stub + addl $20, %esp + popl %ebx + popl %ebp + ret + .align 4,0x90 +.globl _state_1_2_3_5_7 +_state_1_2_3_5_7: + pushl %ebp + movl %esp, %ebp + pushl %ebx + call ___i686.get_pc_thunk.bx +"L00000000002$pb": + subl $20, %esp +L22: + movzbl (%ecx), %eax + addl $1, %ecx + cmpb $66, %al + je L22 + cmpb $67, %al + je L18 + cmpb $65, %al + je L22 +L26: + leal LC1-"L00000000002$pb"(%ebx), %eax + movl %eax, (%esp) + call L_puts$stub + addl $20, %esp + popl %ebx + popl %ebp + ret + .align 4,0x90 +L18: + cmpb $0, (%ecx) + jne L26 + leal LC0-"L00000000002$pb"(%ebx), %eax + movl %eax, (%esp) + call L_puts$stub + addl $20, %esp + popl %ebx + popl %ebp + ret + .align 4,0x90 +.globl _state_1_3_4_5_7 +_state_1_3_4_5_7: + pushl %ebp + movl %esp, %ebp + pushl %ebx + call ___i686.get_pc_thunk.bx +"L00000000003$pb": + subl $20, %esp +L38: + movzbl (%ecx), %eax + addl $1, %ecx + cmpb $66, %al + je L38 + cmpb $67, %al + je L41 + cmpb $65, %al + je L48 +L46: + leal LC1-"L00000000003$pb"(%ebx), %eax + movl %eax, (%esp) + call L_puts$stub + addl $20, %esp + popl %ebx + popl %ebp + ret + .align 4,0x90 +L48: + addl $20, %esp + popl %ebx + popl %ebp + jmp _state_1_2_3_5_7 + .align 4,0x90 +L41: + cmpb $0, (%ecx) + jne L46 + leal LC0-"L00000000003$pb"(%ebx), %eax + movl %eax, (%esp) + call L_puts$stub + addl $20, %esp + popl %ebx + popl %ebp + ret + .align 4,0x90 +.globl _state_1_3_5_6_7 +_state_1_3_5_6_7: + pushl %ebp + movl %esp, %ebp + pushl %ebx + subl $20, %esp + movzbl (%ecx), %eax + call ___i686.get_pc_thunk.bx +"L00000000004$pb": + leal 1(%ecx), %edx + cmpb $66, %al + je L63 + cmpb $67, %al + je L53 +L72: + cmpb $65, %al + je L73 +L65: + leal LC1-"L00000000004$pb"(%ebx), %eax + movl %eax, (%esp) + call L_puts$stub + addl $20, %esp + popl %ebx + popl %ebp + ret + .align 4,0x90 +L73: + addl $20, %esp + movl %edx, %ecx + popl %ebx + popl %ebp + jmp _state_1_2_3_5_7 + .align 4,0x90 +L63: + movzbl (%edx), %eax + addl $1, %edx + cmpb $66, %al + je L63 + cmpb $67, %al + jne L72 + cmpb $0, (%edx) + jne L65 + leal LC0-"L00000000004$pb"(%ebx), %eax + movl %eax, (%esp) + call L_puts$stub + .align 4,0x90 +L74: + addl $20, %esp + popl %ebx + popl %ebp + ret + .align 4,0x90 +L53: + cmpb $0, 1(%ecx) + jne L65 + leal LC0-"L00000000004$pb"(%ebx), %eax + movl %eax, (%esp) + call L_puts$stub + jmp L74 + .cstring +LC2: + .ascii "regexp: (A|B)*C\0" +LC3: + .ascii "number of state: 4\0" +LC4: + .ascii "string: %s\12\0" + .text + .align 4,0x90 +.globl _main +_main: + pushl %ebp + movl %esp, %ebp + pushl %esi + pushl %ebx + call ___i686.get_pc_thunk.bx +"L00000000005$pb": + subl $16, %esp + movl 12(%ebp), %esi + leal LC2-"L00000000005$pb"(%ebx), %eax + movl %eax, (%esp) + call L_puts$stub + leal LC3-"L00000000005$pb"(%ebx), %eax + movl %eax, (%esp) + call L_puts$stub + movl 4(%esi), %eax + movl %eax, 4(%esp) + leal LC4-"L00000000005$pb"(%ebx), %eax + movl %eax, (%esp) + call L_printf$stub + movl 4(%esi), %eax + movzbl (%eax), %edx + leal 1(%eax), %ecx + cmpb $66, %dl + je L89 + cmpb $67, %dl + je L79 + cmpb $65, %dl + je L97 +L91: + leal LC1-"L00000000005$pb"(%ebx), %eax + movl %eax, (%esp) + call L_puts$stub + addl $16, %esp + popl %ebx + popl %esi + popl %ebp + ret + .align 4,0x90 +L89: + movzbl (%ecx), %eax + addl $1, %ecx + cmpb $66, %al + je L89 + cmpb $67, %al + je L86 + cmpb $65, %al + jne L91 +L97: + addl $16, %esp + popl %ebx + popl %esi + popl %ebp + jmp _state_1_2_3_5_7 + .align 4,0x90 +L79: + cmpb $0, 1(%eax) + jne L91 +L96: + leal LC0-"L00000000005$pb"(%ebx), %eax + movl %eax, (%esp) + call L_puts$stub + addl $16, %esp + popl %ebx + popl %esi + popl %ebp + ret + .align 4,0x90 +L86: + cmpb $0, (%ecx) + jne L91 + .p2align 4,,3 + jmp L96 + .align 4,0x90 +.globl _accept +_accept: + pushl %ebp + movl %esp, %ebp + pushl %ebx + call ___i686.get_pc_thunk.bx +"L00000000006$pb": + subl $20, %esp + leal LC0-"L00000000006$pb"(%ebx), %eax + movl %eax, (%esp) + call L_puts$stub + addl $20, %esp + popl %ebx + popl %ebp + ret + .align 4,0x90 +.globl _reject +_reject: + pushl %ebp + movl %esp, %ebp + pushl %ebx + call ___i686.get_pc_thunk.bx +"L00000000007$pb": + subl $20, %esp + leal LC1-"L00000000007$pb"(%ebx), %eax + movl %eax, (%esp) + call L_puts$stub + addl $20, %esp + popl %ebx + popl %ebp + ret + .picsymbol_stub +L_printf$stub: + .indirect_symbol _printf + call LPC$1 +LPC$1: popl %eax + movl L1$lz-LPC$1(%eax),%edx + jmp *%edx +L_printf$stub_binder: + lea L1$lz-LPC$1(%eax),%eax + pushl %eax + jmp dyld_stub_binding_helper + .lazy_symbol_pointer +L1$lz: + .indirect_symbol _printf + .long L_printf$stub_binder + .picsymbol_stub +L_puts$stub: + .indirect_symbol _puts + call LPC$2 +LPC$2: popl %eax + movl L2$lz-LPC$2(%eax),%edx + jmp *%edx +L_puts$stub_binder: + lea L2$lz-LPC$2(%eax),%eax + pushl %eax + jmp dyld_stub_binding_helper + .lazy_symbol_pointer +L2$lz: + .indirect_symbol _puts + .long L_puts$stub_binder + .subsections_via_symbols + .section __TEXT,__textcoal_nt,coalesced,pure_instructions + .weak_definition ___i686.get_pc_thunk.bx + .private_extern ___i686.get_pc_thunk.bx +___i686.get_pc_thunk.bx: + movl (%esp), %ebx + ret