From d18a93da705aacf79f45b4e061e06dce0ff796c6 Mon Sep 17 00:00:00 2001 From: v420v Date: Sun, 19 Nov 2023 18:01:03 +0900 Subject: [PATCH] Add argc to variable length args. New lib folder for stdlib --- .gitignore | 1 + Makefile | 6 +- README.md | 43 +- bootstrap/ibu-linux-x86_x64.s | 15893 ++++++++++++++++------------- example/age.ibu | 2 +- example/fizzbuzz.ibu | 2 +- example/link.ibu | 5 +- lib/linux-syscall.ibu | 342 + {src => lib}/std.ibu | 121 +- main.ibu | 2 +- src/gen.ibu | 550 + src/linux-syscall.ibu | 29 - src/main.ibu | 49 + src/{compiler.ibu => parser.ibu} | 1359 +-- src/preprocessor.ibu | 225 + src/tokenizer.ibu | 392 + 16 files changed, 10741 insertions(+), 8280 deletions(-) create mode 100644 lib/linux-syscall.ibu rename {src => lib}/std.ibu (57%) create mode 100644 src/gen.ibu delete mode 100644 src/linux-syscall.ibu create mode 100644 src/main.ibu rename src/{compiler.ibu => parser.ibu} (56%) create mode 100644 src/preprocessor.ibu create mode 100644 src/tokenizer.ibu diff --git a/.gitignore b/.gitignore index c83c04a..f225287 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ main ibuc ibu +save \ No newline at end of file diff --git a/Makefile b/Makefile index 335b5b2..309d962 100644 --- a/Makefile +++ b/Makefile @@ -8,13 +8,13 @@ make: ld -o ibuc bootstrap/ibu-linux-x86_x64.o src/builtin.o self: - ./ibuc src/compiler.ibu | as - -o src/ibu.o + ./ibuc src/main.ibu | as - -o src/ibu.o as -o src/builtin.o src/builtin.s ld -o ibuc src/ibu.o src/builtin.o update_bootstrap: - ./ibuc src/compiler.ibu | as - - ./ibuc src/compiler.ibu > bootstrap/ibu-linux-x86_x64.s + ./ibuc src/main.ibu | as - + ./ibuc src/main.ibu > bootstrap/ibu-linux-x86_x64.s clean: rm *.o *.out ibuc bootstrap/*.o src/*.o diff --git a/README.md b/README.md index 5f1a631..8a8aac7 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ $ ld -o .o src/builtin.o #### Hello, world! ```go -#include "src/std.ibu" +#include "std.ibu" func main() i32 { printf("Hello, world!\n"); @@ -77,6 +77,8 @@ func main() i32 { #### Variables ```go +#include "std.ibu" + func main() i32 { var name *u8 = "Ibuki"; var age i8 = 19; @@ -94,6 +96,8 @@ i8, i16, i32, i64, u0, u8, u16, u32, u64 #### If ```go +#include "std.ibu" + func main() i32 { var x i32 = 34; var y i32 = 35; @@ -108,6 +112,8 @@ func main() i32 { ``` ```go +#include "std.ibu" + // Allows "13 <= age < 20" instead of "13 <= age && age < 20" func main() i32 { @@ -123,22 +129,24 @@ func main() i32 { #### Variable length args ```go -// Variable-length arguments can be accessed using the built-in variable argv +#include "std.ibu" + +// Variable-length arguments can be accessed using the built-in variable argv, argc func add_nums(...) i32 { - return argv[0] + argv[1] + argv[2]; -} + var n i32 = 0; + var idx i32 = 0; + + while idx < argc { + n = n + argv[idx]; + idx++; + } -func add_nums2(nums ...) i32 { - return nums[0] + nums[1] + nums[2]; + return n; } func main() i32 { - var d i32; - d = add_nums(1, 2, 3); - printf("%d\n", d); - - d = add_nums2(4, 5, 6); + var d i32 = add_nums(1, 2, 3); printf("%d\n", d); return 0; @@ -147,6 +155,8 @@ func main() i32 { #### While ```go +#include "std.ibu" + func main() i32 { // Like go's for loop, the condition is true if it is empty. while { @@ -165,6 +175,8 @@ func main() i32 { #### Struct ```go +#include "std.ibu" + struct Person { name *u8, age i8, @@ -183,6 +195,8 @@ func main() i32 { #### Struct Pointer ```go +#include "std.ibu" + struct Person { name *u8, age i8, @@ -202,16 +216,13 @@ func main() i32 { #### Linked list ```go - -struct User; +#include "std.ibu" struct User { name *u8, next *User, } -func user_print_names(user *User) i32; - func user_print_names(user *User) i32 { printf("%s\n", user.name); @@ -249,7 +260,7 @@ func main(argc i32, argv **u8) i32 { Visual Studio Code ### Selfhosting -`make self` will compile `src/compiler.ibu` using the ./ibuc executable +`make self` will compile `src/main.ibu` using the ./ibuc executable ```sh $ make self diff --git a/bootstrap/ibu-linux-x86_x64.s b/bootstrap/ibu-linux-x86_x64.s index 4c69732..18dbc5c 100644 --- a/bootstrap/ibu-linux-x86_x64.s +++ b/bootstrap/ibu-linux-x86_x64.s @@ -14,7 +14,7 @@ _start: main: push %rbp movq %rsp, %rbp - subq $64, %rsp + subq $80, %rsp movq $2, %rax push %rax leaq 16(%rbp), %rax @@ -25,8 +25,6 @@ main: movzbl %al, %eax cmpq $1, %rax jne .L.else.0 - leaq (%rsp), %rax - push %rax .data .L.str.0: .byte 117 @@ -64,7 +62,7 @@ main: movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $0, %rax push %rax leaq exit(%rip), %rax @@ -146,6 +144,7 @@ main: push %rax leaq (%rsp), %rax push %rax + push $1 .data .L.str.2: .byte 27 @@ -192,7 +191,7 @@ main: movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -206,7 +205,7 @@ main: .L.end.1: leaq -20(%rbp), %rax push %rax - movq $60000, %rax + movq $40000, %rax push %rax leaq alloc(%rip), %rax movq %rax, %r10 @@ -215,7 +214,7 @@ main: addq $8, %rsp pop %rdi movq %rax, (%rdi) - movq $60000, %rax + movq $40000, %rax push %rax leaq -20(%rbp), %rax movq (%rax), %rax @@ -228,6 +227,18 @@ main: movq $0, %rax callq *%r10 addq $24, %rsp + leaq -28(%rbp), %rax + push %rax + leaq -12(%rbp), %rax + movslq (%rax), %rax + push %rax + leaq fd_get_file_full_path(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) leaq -12(%rbp), %rax movslq (%rax), %rax push %rax @@ -236,7 +247,7 @@ main: movq $0, %rax callq *%r10 addq $8, %rsp - leaq -28(%rbp), %rax + leaq -36(%rbp), %rax push %rax leaq -20(%rbp), %rax movq (%rax), %rax @@ -251,9 +262,9 @@ main: addq $16, %rsp pop %rdi movq %rax, (%rdi) - leaq -36(%rbp), %rax + leaq -44(%rbp), %rax push %rax - leaq -28(%rbp), %rax + leaq -36(%rbp), %rax movq (%rax), %rax push %rax leaq tokenize(%rip), %rax @@ -263,38 +274,29 @@ main: addq $8, %rsp pop %rdi movq %rax, (%rdi) - leaq -44(%rbp), %rax - push %rax - movq $8, %rax + leaq -52(%rbp), %rax push %rax - leaq alloc(%rip), %rax + leaq new_preprocessor(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $8, %rsp + addq $0, %rsp pop %rdi movq %rax, (%rdi) - leaq -44(%rbp), %rax + leaq -52(%rbp), %rax movq (%rax), %rax - addq $0, %rax push %rax - movq $0, %rax - pop %rdi - movq %rax, (%rdi) leaq -44(%rbp), %rax movq (%rax), %rax push %rax - leaq -36(%rbp), %rax - movq (%rax), %rax - push %rax leaq preprocess(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $16, %rsp - leaq -52(%rbp), %rax + leaq -60(%rbp), %rax push %rax - leaq -36(%rbp), %rax + leaq -44(%rbp), %rax movq (%rax), %rax push %rax leaq -20(%rbp), %rax @@ -307,7 +309,7 @@ main: addq $16, %rsp pop %rdi movq %rax, (%rdi) - leaq -52(%rbp), %rax + leaq -60(%rbp), %rax movq (%rax), %rax push %rax leaq parse(%rip), %rax @@ -315,7 +317,7 @@ main: movq $0, %rax callq *%r10 addq $8, %rsp - leaq -60(%rbp), %rax + leaq -68(%rbp), %rax push %rax leaq new_gen(%rip), %rax movq %rax, %r10 @@ -324,12 +326,12 @@ main: addq $0, %rsp pop %rdi movq %rax, (%rdi) - leaq -52(%rbp), %rax + leaq -60(%rbp), %rax movq (%rax), %rax addq $8, %rax movq (%rax), %rax push %rax - leaq -60(%rbp), %rax + leaq -68(%rbp), %rax movq (%rax), %rax push %rax leaq gen(%rip), %rax @@ -347,7 +349,40 @@ main: preprocess: push %rbp movq %rsp, %rbp - subq $48, %rsp + subq $80, %rsp + leaq -8(%rbp), %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $4, %rax + movq (%rax), %rax + push %rax + leaq strlen(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $4, %rax + movq (%rax), %rax + push %rax + leaq strndup(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp + pop %rdi + movq %rax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + push %rax + leaq dirname(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp .L.while.start.3: movq $1, %rax cmpq $1, %rax @@ -425,7 +460,7 @@ preprocess: .L.end.5: cmpq $1, %rax jne .L.else.4 - leaq -8(%rbp), %rax + leaq -16(%rbp), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -452,7 +487,7 @@ preprocess: addq $16, %rsp pop %rdi movq %rax, (%rdi) - leaq -8(%rbp), %rax + leaq -16(%rbp), %rax movq (%rax), %rax addq $16, %rax push %rax @@ -466,7 +501,7 @@ preprocess: movq (%rax), %rax addq $0, %rax push %rax - leaq -8(%rbp), %rax + leaq -16(%rbp), %rax movq (%rax), %rax pop %rdi movq %rax, (%rdi) @@ -674,7 +709,7 @@ preprocess: .L.end.8: cmpq $1, %rax jne .L.else.7 - leaq -16(%rbp), %rax + leaq -24(%rbp), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -682,184 +717,748 @@ preprocess: movq (%rax), %rax addq $49, %rax movq (%rax), %rax - addq $40, %rax - movq (%rax), %rax pop %rdi movq %rax, (%rdi) - leaq -20(%rbp), %rax - push %rax - movq $420, %rax - push %rax - movq $0, %rax + movq $3, %rax push %rax - leaq -16(%rbp), %rax + leaq -24(%rbp), %rax movq (%rax), %rax - push %rax - leaq open(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $24, %rsp - pop %rdi - movl %eax, (%rdi) - movq $0, %rax - push %rax - leaq -20(%rbp), %rax + addq $0, %rax movslq (%rax), %rax pop %rdi cmpl %edi, %eax - setl %al + setne %al movzbl %al, %eax cmpq $1, %rax jne .L.else.10 - leaq -16(%rbp), %rax - movq (%rax), %rax - push %rax - leaq (%rsp), %rax - push %rax .data .L.str.7: - .byte 27 - .byte 91 - .byte 49 - .byte 109 - .byte 27 - .byte 91 - .byte 51 - .byte 49 - .byte 109 .byte 101 - .byte 114 - .byte 114 - .byte 111 - .byte 114 - .byte 27 - .byte 91 - .byte 48 - .byte 109 - .byte 58 + .byte 120 + .byte 112 + .byte 101 + .byte 99 + .byte 116 + .byte 101 + .byte 100 .byte 32 + .byte 116 .byte 111 - .byte 112 + .byte 107 .byte 101 .byte 110 + .byte 32 + .byte 115 + .byte 116 + .byte 114 .byte 105 .byte 110 .byte 103 - .byte 32 - .byte 102 - .byte 105 - .byte 108 - .byte 101 - .byte 32 - .byte 37 - .byte 115 - .byte 10 .byte 0 .text leaq .L.str.7(%rip), %rax push %rax - leaq eprintf(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $24, %rsp - movq $1, %rax + leaq -24(%rbp), %rax + movq (%rax), %rax push %rax - leaq exit(%rip), %rax + leaq print_error(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $8, %rsp + addq $16, %rsp jmp .L.end.10 .L.else.10: .L.end.10: - leaq -28(%rbp), %rax - push %rax - movq $60000, %rax + leaq -32(%rbp), %rax push %rax - leaq alloc(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp - pop %rdi - movq %rax, (%rdi) - movq $60000, %rax + movq $1, %rax push %rax - leaq -28(%rbp), %rax + leaq -24(%rbp), %rax + movq (%rax), %rax + addq $40, %rax movq (%rax), %rax push %rax - leaq -20(%rbp), %rax - movslq (%rax), %rax - push %rax - leaq read(%rip), %rax + leaq strlen(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp - leaq -20(%rbp), %rax - movslq (%rax), %rax + addq $8, %rsp push %rax - leaq close(%rip), %rax +.data +.L.str.8: + .byte 47 + .byte 0 +.text + leaq .L.str.8(%rip), %rax + push %rax + leaq strlen(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp - leaq -36(%rbp), %rax - push %rax - leaq -28(%rbp), %rax - movq (%rax), %rax push %rax - leaq -16(%rbp), %rax + leaq -8(%rbp), %rax movq (%rax), %rax push %rax - leaq new_tokenizer(%rip), %rax + leaq strlen(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp + pop %rdi + addl %edi, %eax + pop %rdi + addl %edi, %eax + pop %rdi + addl %edi, %eax push %rax - leaq tokenize(%rip), %rax + leaq alloc(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp pop %rdi movq %rax, (%rdi) - leaq -36(%rbp), %rax - movq (%rax), %rax - push %rax - leaq get_eof_from_tokens(%rip), %rax - movq %rax, %r10 movq $0, %rax - callq *%r10 - addq $8, %rsp push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $49, %rax - movq (%rax), %rax - addq $49, %rax - movq (%rax), %rax - addq $49, %rax + leaq -32(%rbp), %rax movq (%rax), %rax pop %rdi - movb 0(%rax), %r8b - movb %r8b, 0(%rdi) - movb 1(%rax), %r8b - movb %r8b, 1(%rdi) - movb 2(%rax), %r8b - movb %r8b, 2(%rdi) - movb 3(%rax), %r8b - movb %r8b, 3(%rdi) - movb 4(%rax), %r8b - movb %r8b, 4(%rdi) - movb 5(%rax), %r8b - movb %r8b, 5(%rdi) - movb 6(%rax), %r8b - movb %r8b, 6(%rdi) - movb 7(%rax), %r8b + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.11 +.data +.L.str.9: + .byte 97 + .byte 108 + .byte 108 + .byte 111 + .byte 99 + .byte 32 + .byte 114 + .byte 101 + .byte 116 + .byte 117 + .byte 114 + .byte 110 + .byte 101 + .byte 100 + .byte 32 + .byte 110 + .byte 105 + .byte 108 + .byte 10 + .byte 0 +.text + leaq .L.str.9(%rip), %rax + push %rax + leaq eprintf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + movq $1, %rax + push %rax + leaq exit(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + jmp .L.end.11 +.L.else.11: +.L.end.11: + leaq -24(%rbp), %rax + movq (%rax), %rax + addq $40, %rax + movq (%rax), %rax + push %rax + leaq -8(%rbp), %rax + movq (%rax), %rax + push %rax + leaq (%rsp), %rax + push %rax + push $2 +.data +.L.str.10: + .byte 37 + .byte 115 + .byte 47 + .byte 37 + .byte 115 + .byte 0 +.text + leaq .L.str.10(%rip), %rax + push %rax + leaq -32(%rbp), %rax + movq (%rax), %rax + push %rax + leaq sprintf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $48, %rsp + leaq -36(%rbp), %rax + push %rax + movq $420, %rax + push %rax + movq $0, %rax + push %rax + leaq -32(%rbp), %rax + movq (%rax), %rax + push %rax + leaq open(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $24, %rsp + pop %rdi + movl %eax, (%rdi) + movq $0, %rax + push %rax + leaq -36(%rbp), %rax + movslq (%rax), %rax + pop %rdi + cmpl %edi, %eax + setl %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.12 + leaq -36(%rbp), %rax + push %rax + movq $420, %rax + push %rax + movq $0, %rax + push %rax + leaq -24(%rbp), %rax + movq (%rax), %rax + addq $40, %rax + movq (%rax), %rax + push %rax + leaq get_ibu_lib_path(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + push %rax + leaq open(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $24, %rsp + pop %rdi + movl %eax, (%rdi) + movq $0, %rax + push %rax + leaq -36(%rbp), %rax + movslq (%rax), %rax + pop %rdi + cmpl %edi, %eax + setl %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.13 +.data +.L.str.11: + .byte 110 + .byte 111 + .byte 32 + .byte 115 + .byte 117 + .byte 99 + .byte 104 + .byte 32 + .byte 102 + .byte 105 + .byte 108 + .byte 101 + .byte 32 + .byte 111 + .byte 114 + .byte 32 + .byte 100 + .byte 105 + .byte 114 + .byte 101 + .byte 99 + .byte 116 + .byte 111 + .byte 114 + .byte 121 + .byte 0 +.text + leaq .L.str.11(%rip), %rax + push %rax + leaq -24(%rbp), %rax + movq (%rax), %rax + push %rax + leaq print_error(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp + jmp .L.end.13 +.L.else.13: +.L.end.13: + jmp .L.end.12 +.L.else.12: +.L.end.12: + leaq -44(%rbp), %rax + push %rax + leaq -36(%rbp), %rax + movslq (%rax), %rax + push %rax + leaq fd_get_file_full_path(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + leaq -45(%rbp), %rax + push %rax + movq $0, %rax + pop %rdi + movb %al, (%rdi) + leaq -49(%rbp), %rax + push %rax + movq $0, %rax + pop %rdi + movl %eax, (%rdi) +.L.while.start.14: + leaq 24(%rbp), %rax + movq (%rax), %rax + addq $8, %rax + movq (%rax), %rax + addq $8, %rax + movslq (%rax), %rax + push %rax + leaq -49(%rbp), %rax + movslq (%rax), %rax + pop %rdi + cmpl %edi, %eax + setl %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.while.end.14 + movq $8, %rax + push %rax + leaq -49(%rbp), %rax + movslq (%rax), %rax + pop %rdi + imull %edi, %eax + push %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + addq $8, %rax + movq (%rax), %rax + addq $0, %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + movq (%rax), %rax + push %rax + leaq -44(%rbp), %rax + movq (%rax), %rax + push %rax + leaq strcmp(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp + movzx %al, %eax + cmpq $1, %rax + jne .L.else.15 + leaq -45(%rbp), %rax + push %rax + movq $1, %rax + pop %rdi + movb %al, (%rdi) + jmp .L.end.15 +.L.else.15: +.L.end.15: + movq $1, %rax + push %rax + leaq -49(%rbp), %rax + push %rax + movq $1, %rax + push %rax + leaq -49(%rbp), %rax + movslq (%rax), %rax + pop %rdi + addl %edi, %eax + pop %rdi + movl %eax, (%rdi) + pop %rdi + subl %edi, %eax + jmp .L.while.start.14 +.L.while.end.14: + leaq -45(%rbp), %rax + movsbl (%rax), %eax + cmpq $0, %rax + sete %al + movzbq %al, %rax + cmpq $1, %rax + jne .L.else.16 + leaq -44(%rbp), %rax + movq (%rax), %rax + push %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + addq $8, %rax + movq (%rax), %rax + push %rax + leaq vec_append_str(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp + leaq -57(%rbp), %rax + push %rax + movq $40000, %rax + push %rax + leaq alloc(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + movq $40000, %rax + push %rax + leaq -57(%rbp), %rax + movq (%rax), %rax + push %rax + leaq -36(%rbp), %rax + movslq (%rax), %rax + push %rax + leaq read(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $24, %rsp + leaq -36(%rbp), %rax + movslq (%rax), %rax + push %rax + leaq close(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + leaq -65(%rbp), %rax + push %rax + leaq -57(%rbp), %rax + movq (%rax), %rax + push %rax + leaq -32(%rbp), %rax + movq (%rax), %rax + push %rax + leaq new_tokenizer(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp + push %rax + leaq tokenize(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + leaq 24(%rbp), %rax + movq (%rax), %rax + push %rax + leaq -65(%rbp), %rax + movq (%rax), %rax + push %rax + leaq preprocess(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp + leaq -65(%rbp), %rax + movq (%rax), %rax + push %rax + leaq get_eof_from_tokens(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $49, %rax + movq (%rax), %rax + addq $49, %rax + movq (%rax), %rax + addq $49, %rax + movq (%rax), %rax + pop %rdi + movb 0(%rax), %r8b + movb %r8b, 0(%rdi) + movb 1(%rax), %r8b + movb %r8b, 1(%rdi) + movb 2(%rax), %r8b + movb %r8b, 2(%rdi) + movb 3(%rax), %r8b + movb %r8b, 3(%rdi) + movb 4(%rax), %r8b + movb %r8b, 4(%rdi) + movb 5(%rax), %r8b + movb %r8b, 5(%rdi) + movb 6(%rax), %r8b + movb %r8b, 6(%rdi) + movb 7(%rax), %r8b + movb %r8b, 7(%rdi) + movb 8(%rax), %r8b + movb %r8b, 8(%rdi) + movb 9(%rax), %r8b + movb %r8b, 9(%rdi) + movb 10(%rax), %r8b + movb %r8b, 10(%rdi) + movb 11(%rax), %r8b + movb %r8b, 11(%rdi) + movb 12(%rax), %r8b + movb %r8b, 12(%rdi) + movb 13(%rax), %r8b + movb %r8b, 13(%rdi) + movb 14(%rax), %r8b + movb %r8b, 14(%rdi) + movb 15(%rax), %r8b + movb %r8b, 15(%rdi) + movb 16(%rax), %r8b + movb %r8b, 16(%rdi) + movb 17(%rax), %r8b + movb %r8b, 17(%rdi) + movb 18(%rax), %r8b + movb %r8b, 18(%rdi) + movb 19(%rax), %r8b + movb %r8b, 19(%rdi) + movb 20(%rax), %r8b + movb %r8b, 20(%rdi) + movb 21(%rax), %r8b + movb %r8b, 21(%rdi) + movb 22(%rax), %r8b + movb %r8b, 22(%rdi) + movb 23(%rax), %r8b + movb %r8b, 23(%rdi) + movb 24(%rax), %r8b + movb %r8b, 24(%rdi) + movb 25(%rax), %r8b + movb %r8b, 25(%rdi) + movb 26(%rax), %r8b + movb %r8b, 26(%rdi) + movb 27(%rax), %r8b + movb %r8b, 27(%rdi) + movb 28(%rax), %r8b + movb %r8b, 28(%rdi) + movb 29(%rax), %r8b + movb %r8b, 29(%rdi) + movb 30(%rax), %r8b + movb %r8b, 30(%rdi) + movb 31(%rax), %r8b + movb %r8b, 31(%rdi) + movb 32(%rax), %r8b + movb %r8b, 32(%rdi) + movb 33(%rax), %r8b + movb %r8b, 33(%rdi) + movb 34(%rax), %r8b + movb %r8b, 34(%rdi) + movb 35(%rax), %r8b + movb %r8b, 35(%rdi) + movb 36(%rax), %r8b + movb %r8b, 36(%rdi) + movb 37(%rax), %r8b + movb %r8b, 37(%rdi) + movb 38(%rax), %r8b + movb %r8b, 38(%rdi) + movb 39(%rax), %r8b + movb %r8b, 39(%rdi) + movb 40(%rax), %r8b + movb %r8b, 40(%rdi) + movb 41(%rax), %r8b + movb %r8b, 41(%rdi) + movb 42(%rax), %r8b + movb %r8b, 42(%rdi) + movb 43(%rax), %r8b + movb %r8b, 43(%rdi) + movb 44(%rax), %r8b + movb %r8b, 44(%rdi) + movb 45(%rax), %r8b + movb %r8b, 45(%rdi) + movb 46(%rax), %r8b + movb %r8b, 46(%rdi) + movb 47(%rax), %r8b + movb %r8b, 47(%rdi) + movb 48(%rax), %r8b + movb %r8b, 48(%rdi) + movb 49(%rax), %r8b + movb %r8b, 49(%rdi) + movb 50(%rax), %r8b + movb %r8b, 50(%rdi) + movb 51(%rax), %r8b + movb %r8b, 51(%rdi) + movb 52(%rax), %r8b + movb %r8b, 52(%rdi) + movb 53(%rax), %r8b + movb %r8b, 53(%rdi) + movb 54(%rax), %r8b + movb %r8b, 54(%rdi) + movb 55(%rax), %r8b + movb %r8b, 55(%rdi) + movb 56(%rax), %r8b + movb %r8b, 56(%rdi) + leaq 16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq -65(%rbp), %rax + movq (%rax), %rax + pop %rdi + movb 0(%rax), %r8b + movb %r8b, 0(%rdi) + movb 1(%rax), %r8b + movb %r8b, 1(%rdi) + movb 2(%rax), %r8b + movb %r8b, 2(%rdi) + movb 3(%rax), %r8b + movb %r8b, 3(%rdi) + movb 4(%rax), %r8b + movb %r8b, 4(%rdi) + movb 5(%rax), %r8b + movb %r8b, 5(%rdi) + movb 6(%rax), %r8b + movb %r8b, 6(%rdi) + movb 7(%rax), %r8b + movb %r8b, 7(%rdi) + movb 8(%rax), %r8b + movb %r8b, 8(%rdi) + movb 9(%rax), %r8b + movb %r8b, 9(%rdi) + movb 10(%rax), %r8b + movb %r8b, 10(%rdi) + movb 11(%rax), %r8b + movb %r8b, 11(%rdi) + movb 12(%rax), %r8b + movb %r8b, 12(%rdi) + movb 13(%rax), %r8b + movb %r8b, 13(%rdi) + movb 14(%rax), %r8b + movb %r8b, 14(%rdi) + movb 15(%rax), %r8b + movb %r8b, 15(%rdi) + movb 16(%rax), %r8b + movb %r8b, 16(%rdi) + movb 17(%rax), %r8b + movb %r8b, 17(%rdi) + movb 18(%rax), %r8b + movb %r8b, 18(%rdi) + movb 19(%rax), %r8b + movb %r8b, 19(%rdi) + movb 20(%rax), %r8b + movb %r8b, 20(%rdi) + movb 21(%rax), %r8b + movb %r8b, 21(%rdi) + movb 22(%rax), %r8b + movb %r8b, 22(%rdi) + movb 23(%rax), %r8b + movb %r8b, 23(%rdi) + movb 24(%rax), %r8b + movb %r8b, 24(%rdi) + movb 25(%rax), %r8b + movb %r8b, 25(%rdi) + movb 26(%rax), %r8b + movb %r8b, 26(%rdi) + movb 27(%rax), %r8b + movb %r8b, 27(%rdi) + movb 28(%rax), %r8b + movb %r8b, 28(%rdi) + movb 29(%rax), %r8b + movb %r8b, 29(%rdi) + movb 30(%rax), %r8b + movb %r8b, 30(%rdi) + movb 31(%rax), %r8b + movb %r8b, 31(%rdi) + movb 32(%rax), %r8b + movb %r8b, 32(%rdi) + movb 33(%rax), %r8b + movb %r8b, 33(%rdi) + movb 34(%rax), %r8b + movb %r8b, 34(%rdi) + movb 35(%rax), %r8b + movb %r8b, 35(%rdi) + movb 36(%rax), %r8b + movb %r8b, 36(%rdi) + movb 37(%rax), %r8b + movb %r8b, 37(%rdi) + movb 38(%rax), %r8b + movb %r8b, 38(%rdi) + movb 39(%rax), %r8b + movb %r8b, 39(%rdi) + movb 40(%rax), %r8b + movb %r8b, 40(%rdi) + movb 41(%rax), %r8b + movb %r8b, 41(%rdi) + movb 42(%rax), %r8b + movb %r8b, 42(%rdi) + movb 43(%rax), %r8b + movb %r8b, 43(%rdi) + movb 44(%rax), %r8b + movb %r8b, 44(%rdi) + movb 45(%rax), %r8b + movb %r8b, 45(%rdi) + movb 46(%rax), %r8b + movb %r8b, 46(%rdi) + movb 47(%rax), %r8b + movb %r8b, 47(%rdi) + movb 48(%rax), %r8b + movb %r8b, 48(%rdi) + movb 49(%rax), %r8b + movb %r8b, 49(%rdi) + movb 50(%rax), %r8b + movb %r8b, 50(%rdi) + movb 51(%rax), %r8b + movb %r8b, 51(%rdi) + movb 52(%rax), %r8b + movb %r8b, 52(%rdi) + movb 53(%rax), %r8b + movb %r8b, 53(%rdi) + movb 54(%rax), %r8b + movb %r8b, 54(%rdi) + movb 55(%rax), %r8b + movb %r8b, 55(%rdi) + movb 56(%rax), %r8b + movb %r8b, 56(%rdi) + jmp .L.end.16 +.L.else.16: + leaq 16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $49, %rax + movq (%rax), %rax + addq $49, %rax + movq (%rax), %rax + addq $49, %rax + movq (%rax), %rax + pop %rdi + movb 0(%rax), %r8b + movb %r8b, 0(%rdi) + movb 1(%rax), %r8b + movb %r8b, 1(%rdi) + movb 2(%rax), %r8b + movb %r8b, 2(%rdi) + movb 3(%rax), %r8b + movb %r8b, 3(%rdi) + movb 4(%rax), %r8b + movb %r8b, 4(%rdi) + movb 5(%rax), %r8b + movb %r8b, 5(%rdi) + movb 6(%rax), %r8b + movb %r8b, 6(%rdi) + movb 7(%rax), %r8b movb %r8b, 7(%rdi) movb 8(%rax), %r8b movb %r8b, 8(%rdi) @@ -959,206 +1558,965 @@ preprocess: movb %r8b, 55(%rdi) movb 56(%rax), %r8b movb %r8b, 56(%rdi) +.L.end.16: + jmp .L.end.7 +.L.else.7: + jmp .L.preprocess.break +.L.end.7: +.L.end.4: + jmp .L.while.start.3 +.L.while.end.3: +.L.preprocess.break: + leaq -73(%rbp), %rax + push %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $28, %rax + movq (%rax), %rax + push %rax + leaq find_macro(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp + pop %rdi + movq %rax, (%rdi) + movq $0, %rax + push %rax + leaq -73(%rbp), %rax + movq (%rax), %rax + pop %rdi + cmpl %edi, %eax + setne %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.17 + leaq 16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq -73(%rbp), %rax + movq (%rax), %rax + addq $8, %rax + movq (%rax), %rax + push %rax + leaq copy_token(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp + jmp .L.end.17 +.L.else.17: +.L.end.17: + movq $0, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $49, %rax + movq (%rax), %rax + pop %rdi + cmpl %edi, %eax + setne %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.18 + leaq 24(%rbp), %rax + movq (%rax), %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $49, %rax + movq (%rax), %rax + push %rax + leaq preprocess(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp + jmp .L.end.18 +.L.else.18: +.L.end.18: + movq $0, %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global fd_get_file_full_path +fd_get_file_full_path: + push %rbp + movq %rsp, %rbp + subq $32, %rsp + leaq -8(%rbp), %rax + push %rax + movq $4096, %rax + push %rax + leaq alloc(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + movq $0, %rax + push %rax + leaq -8(%rbp), %rax + movq (%rax), %rax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.19 +.data +.L.str.12: + .byte 97 + .byte 108 + .byte 108 + .byte 111 + .byte 99 + .byte 32 + .byte 114 + .byte 101 + .byte 116 + .byte 117 + .byte 114 + .byte 110 + .byte 101 + .byte 100 + .byte 32 + .byte 110 + .byte 105 + .byte 108 + .byte 10 + .byte 0 +.text + leaq .L.str.12(%rip), %rax + push %rax + leaq eprintf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + movq $1, %rax + push %rax + leaq exit(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + jmp .L.end.19 +.L.else.19: +.L.end.19: + leaq -16(%rbp), %rax + push %rax + movq $64, %rax + push %rax + leaq alloc(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + leaq 16(%rbp), %rax + movslq (%rax), %rax + push %rax + leaq (%rsp), %rax + push %rax + push $1 +.data +.L.str.13: + .byte 47 + .byte 112 + .byte 114 + .byte 111 + .byte 99 + .byte 47 + .byte 115 + .byte 101 + .byte 108 + .byte 102 + .byte 47 + .byte 102 + .byte 100 + .byte 47 + .byte 37 + .byte 100 + .byte 0 +.text + leaq .L.str.13(%rip), %rax + push %rax + leaq -16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq sprintf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $40, %rsp + leaq -20(%rbp), %rax + push %rax + movq $1, %rax + push %rax + movq $4096, %rax + pop %rdi + subl %edi, %eax + push %rax + leaq -8(%rbp), %rax + movq (%rax), %rax + push %rax + leaq -16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq readlink(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $24, %rsp + pop %rdi + movl %eax, (%rdi) + movq $0, %rax + push %rax + leaq -20(%rbp), %rax + movslq (%rax), %rax + pop %rdi + cmpl %edi, %eax + setl %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.20 +.data +.L.str.14: + .byte 102 + .byte 97 + .byte 105 + .byte 108 + .byte 101 + .byte 100 + .byte 32 + .byte 97 + .byte 116 + .byte 32 + .byte 114 + .byte 101 + .byte 97 + .byte 100 + .byte 105 + .byte 110 + .byte 103 + .byte 32 + .byte 47 + .byte 112 + .byte 114 + .byte 111 + .byte 99 + .byte 47 + .byte 115 + .byte 101 + .byte 108 + .byte 102 + .byte 47 + .byte 102 + .byte 100 + .byte 32 + .byte 116 + .byte 111 + .byte 32 + .byte 103 + .byte 101 + .byte 116 + .byte 32 + .byte 101 + .byte 120 + .byte 101 + .byte 32 + .byte 112 + .byte 97 + .byte 116 + .byte 104 + .byte 10 + .byte 0 +.text + leaq .L.str.14(%rip), %rax + push %rax + leaq eprintf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + movq $1, %rax + movq %rbp, %rsp + pop %rbp + retq + jmp .L.end.20 +.L.else.20: +.L.end.20: + movq $1, %rax + push %rax + leaq -20(%rbp), %rax + movslq (%rax), %rax + pop %rdi + imull %edi, %eax + push %rax + leaq -8(%rbp), %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + push %rax + movq $0, %rax + pop %rdi + movb %al, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global get_ibu_lib_path +get_ibu_lib_path: + push %rbp + movq %rsp, %rbp + subq $32, %rsp + leaq -8(%rbp), %rax + push %rax + movq $4096, %rax + push %rax + leaq alloc(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + movq $0, %rax + push %rax + leaq -8(%rbp), %rax + movq (%rax), %rax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.21 +.data +.L.str.15: + .byte 97 + .byte 108 + .byte 108 + .byte 111 + .byte 99 + .byte 32 + .byte 114 + .byte 101 + .byte 116 + .byte 117 + .byte 114 + .byte 110 + .byte 101 + .byte 100 + .byte 32 + .byte 110 + .byte 105 + .byte 108 + .byte 10 + .byte 0 +.text + leaq .L.str.15(%rip), %rax + push %rax + leaq eprintf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + movq $1, %rax + push %rax + leaq exit(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + jmp .L.end.21 +.L.else.21: +.L.end.21: + leaq -12(%rbp), %rax + push %rax + movq $1, %rax + push %rax + movq $4096, %rax + pop %rdi + subl %edi, %eax + push %rax + leaq -8(%rbp), %rax + movq (%rax), %rax + push %rax +.data +.L.str.16: + .byte 47 + .byte 112 + .byte 114 + .byte 111 + .byte 99 + .byte 47 + .byte 115 + .byte 101 + .byte 108 + .byte 102 + .byte 47 + .byte 101 + .byte 120 + .byte 101 + .byte 0 +.text + leaq .L.str.16(%rip), %rax + push %rax + leaq readlink(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $24, %rsp + pop %rdi + movl %eax, (%rdi) + movq $0, %rax + push %rax + leaq -12(%rbp), %rax + movslq (%rax), %rax + pop %rdi + cmpl %edi, %eax + setl %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.22 +.data +.L.str.17: + .byte 102 + .byte 97 + .byte 105 + .byte 108 + .byte 101 + .byte 100 + .byte 32 + .byte 97 + .byte 116 + .byte 32 + .byte 114 + .byte 101 + .byte 97 + .byte 100 + .byte 105 + .byte 110 + .byte 103 + .byte 32 + .byte 47 + .byte 112 + .byte 114 + .byte 111 + .byte 99 + .byte 47 + .byte 115 + .byte 101 + .byte 108 + .byte 102 + .byte 47 + .byte 101 + .byte 120 + .byte 101 + .byte 32 + .byte 116 + .byte 111 + .byte 32 + .byte 103 + .byte 101 + .byte 116 + .byte 32 + .byte 105 + .byte 98 + .byte 117 + .byte 95 + .byte 101 + .byte 120 + .byte 101 + .byte 32 + .byte 112 + .byte 97 + .byte 116 + .byte 104 + .byte 10 + .byte 0 +.text + leaq .L.str.17(%rip), %rax + push %rax + leaq eprintf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + movq $1, %rax + push %rax + leaq exit(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + jmp .L.end.22 +.L.else.22: +.L.end.22: + movq $1, %rax + push %rax + leaq -12(%rbp), %rax + movslq (%rax), %rax + pop %rdi + imull %edi, %eax + push %rax + leaq -8(%rbp), %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + push %rax + movq $0, %rax + pop %rdi + movb %al, (%rdi) + leaq -20(%rbp), %rax + push %rax + leaq -12(%rbp), %rax + movslq (%rax), %rax + push %rax + leaq -8(%rbp), %rax + movq (%rax), %rax + push %rax + leaq strndup(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp + push %rax + leaq dirname(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + leaq -28(%rbp), %rax + push %rax + movq $1, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq strlen(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + push %rax +.data +.L.str.18: + .byte 47 + .byte 108 + .byte 105 + .byte 98 + .byte 47 + .byte 0 +.text + leaq .L.str.18(%rip), %rax + push %rax + leaq strlen(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + push %rax + leaq -20(%rbp), %rax + movq (%rax), %rax + push %rax + leaq strlen(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + pop %rdi + addl %edi, %eax + pop %rdi + addl %edi, %eax + pop %rdi + addl %edi, %eax + push %rax + leaq alloc(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + movq $0, %rax + push %rax + leaq -28(%rbp), %rax + movq (%rax), %rax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.23 +.data +.L.str.19: + .byte 97 + .byte 108 + .byte 108 + .byte 111 + .byte 99 + .byte 32 + .byte 114 + .byte 101 + .byte 116 + .byte 117 + .byte 114 + .byte 110 + .byte 101 + .byte 100 + .byte 32 + .byte 110 + .byte 105 + .byte 108 + .byte 10 + .byte 0 +.text + leaq .L.str.19(%rip), %rax + push %rax + leaq eprintf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + movq $1, %rax + push %rax + leaq exit(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + jmp .L.end.23 +.L.else.23: +.L.end.23: leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq -36(%rbp), %rax + leaq -20(%rbp), %rax + movq (%rax), %rax + push %rax + leaq (%rsp), %rax + push %rax + push $2 +.data +.L.str.20: + .byte 37 + .byte 115 + .byte 47 + .byte 108 + .byte 105 + .byte 98 + .byte 47 + .byte 37 + .byte 115 + .byte 0 +.text + leaq .L.str.20(%rip), %rax + push %rax + leaq -28(%rbp), %rax + movq (%rax), %rax + push %rax + leaq sprintf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $48, %rsp + leaq -28(%rbp), %rax + movq (%rax), %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global dirname +dirname: + push %rbp + movq %rsp, %rbp + subq $16, %rsp + leaq -4(%rbp), %rax + push %rax + leaq 16(%rbp), %rax movq (%rax), %rax + push %rax + leaq strlen(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp pop %rdi - movb 0(%rax), %r8b - movb %r8b, 0(%rdi) - movb 1(%rax), %r8b - movb %r8b, 1(%rdi) - movb 2(%rax), %r8b - movb %r8b, 2(%rdi) - movb 3(%rax), %r8b - movb %r8b, 3(%rdi) - movb 4(%rax), %r8b - movb %r8b, 4(%rdi) - movb 5(%rax), %r8b - movb %r8b, 5(%rdi) - movb 6(%rax), %r8b - movb %r8b, 6(%rdi) - movb 7(%rax), %r8b - movb %r8b, 7(%rdi) - movb 8(%rax), %r8b - movb %r8b, 8(%rdi) - movb 9(%rax), %r8b - movb %r8b, 9(%rdi) - movb 10(%rax), %r8b - movb %r8b, 10(%rdi) - movb 11(%rax), %r8b - movb %r8b, 11(%rdi) - movb 12(%rax), %r8b - movb %r8b, 12(%rdi) - movb 13(%rax), %r8b - movb %r8b, 13(%rdi) - movb 14(%rax), %r8b - movb %r8b, 14(%rdi) - movb 15(%rax), %r8b - movb %r8b, 15(%rdi) - movb 16(%rax), %r8b - movb %r8b, 16(%rdi) - movb 17(%rax), %r8b - movb %r8b, 17(%rdi) - movb 18(%rax), %r8b - movb %r8b, 18(%rdi) - movb 19(%rax), %r8b - movb %r8b, 19(%rdi) - movb 20(%rax), %r8b - movb %r8b, 20(%rdi) - movb 21(%rax), %r8b - movb %r8b, 21(%rdi) - movb 22(%rax), %r8b - movb %r8b, 22(%rdi) - movb 23(%rax), %r8b - movb %r8b, 23(%rdi) - movb 24(%rax), %r8b - movb %r8b, 24(%rdi) - movb 25(%rax), %r8b - movb %r8b, 25(%rdi) - movb 26(%rax), %r8b - movb %r8b, 26(%rdi) - movb 27(%rax), %r8b - movb %r8b, 27(%rdi) - movb 28(%rax), %r8b - movb %r8b, 28(%rdi) - movb 29(%rax), %r8b - movb %r8b, 29(%rdi) - movb 30(%rax), %r8b - movb %r8b, 30(%rdi) - movb 31(%rax), %r8b - movb %r8b, 31(%rdi) - movb 32(%rax), %r8b - movb %r8b, 32(%rdi) - movb 33(%rax), %r8b - movb %r8b, 33(%rdi) - movb 34(%rax), %r8b - movb %r8b, 34(%rdi) - movb 35(%rax), %r8b - movb %r8b, 35(%rdi) - movb 36(%rax), %r8b - movb %r8b, 36(%rdi) - movb 37(%rax), %r8b - movb %r8b, 37(%rdi) - movb 38(%rax), %r8b - movb %r8b, 38(%rdi) - movb 39(%rax), %r8b - movb %r8b, 39(%rdi) - movb 40(%rax), %r8b - movb %r8b, 40(%rdi) - movb 41(%rax), %r8b - movb %r8b, 41(%rdi) - movb 42(%rax), %r8b - movb %r8b, 42(%rdi) - movb 43(%rax), %r8b - movb %r8b, 43(%rdi) - movb 44(%rax), %r8b - movb %r8b, 44(%rdi) - movb 45(%rax), %r8b - movb %r8b, 45(%rdi) - movb 46(%rax), %r8b - movb %r8b, 46(%rdi) - movb 47(%rax), %r8b - movb %r8b, 47(%rdi) - movb 48(%rax), %r8b - movb %r8b, 48(%rdi) - movb 49(%rax), %r8b - movb %r8b, 49(%rdi) - movb 50(%rax), %r8b - movb %r8b, 50(%rdi) - movb 51(%rax), %r8b - movb %r8b, 51(%rdi) - movb 52(%rax), %r8b - movb %r8b, 52(%rdi) - movb 53(%rax), %r8b - movb %r8b, 53(%rdi) - movb 54(%rax), %r8b - movb %r8b, 54(%rdi) - movb 55(%rax), %r8b - movb %r8b, 55(%rdi) - movb 56(%rax), %r8b - movb %r8b, 56(%rdi) - jmp .L.end.7 -.L.else.7: - jmp .L.preprocess.break -.L.end.7: -.L.end.4: - jmp .L.while.start.3 -.L.while.end.3: -.L.preprocess.break: - leaq -44(%rbp), %rax + movl %eax, (%rdi) + movq $2, %rax + push %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + cmpl %edi, %eax + setge %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.26 + movq $46, %rax + push %rax + movq $1, %rax + push %rax + movq $0, %rax + pop %rdi + imull %edi, %eax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.26 + movq $1, %rax + jmp .L.end.26 +.L.false.26: + movq $0, %rax +.L.end.26: + cmpq $0, %rax + je .L.false.25 + movq $47, %rax push %rax - leaq 24(%rbp), %rax + movq $1, %rax + push %rax + movq $1, %rax + pop %rdi + imull %edi, %eax + push %rax + leaq 16(%rbp), %rax movq (%rax), %rax + pop %rdi + addq %rdi, %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.25 + movq $1, %rax + jmp .L.end.25 +.L.false.25: + movq $0, %rax +.L.end.25: + cmpq $1, %rax + jne .L.else.24 + movq $2, %rax + push %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + subl %edi, %eax + push %rax + movq $2, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $28, %rax + pop %rdi + addq %rdi, %rax + push %rax + leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq find_macro(%rip), %rax + leaq memmove(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $24, %rsp + movq $1, %rax + push %rax + movq $2, %rax + push %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax pop %rdi - movq %rax, (%rdi) + subl %edi, %eax + pop %rdi + imull %edi, %eax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + push %rax + movq $0, %rax + pop %rdi + movb %al, (%rdi) + jmp .L.end.24 +.L.else.24: +.L.end.24: +.L.while.start.27: movq $0, %rax push %rax - leaq -44(%rbp), %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + cmpl %edi, %eax + setg %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.28 + movq $47, %rax + push %rax + movq $1, %rax + push %rax + movq $1, %rax + push %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + subl %edi, %eax + pop %rdi + imull %edi, %eax + push %rax + leaq 16(%rbp), %rax movq (%rax), %rax pop %rdi + addq %rdi, %rax + movzbl (%rax), %eax + pop %rdi cmpl %edi, %eax - setne %al + sete %al movzbl %al, %eax + cmpq $0, %rax + je .L.false.28 + movq $1, %rax + jmp .L.end.28 +.L.false.28: + movq $0, %rax +.L.end.28: cmpq $1, %rax - jne .L.else.11 + jne .L.while.end.27 + movq $1, %rax + push %rax + leaq -4(%rbp), %rax + push %rax + movq $1, %rax + push %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + subl %edi, %eax + pop %rdi + movl %eax, (%rdi) + pop %rdi + addl %edi, %eax + movq $1, %rax + push %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + imull %edi, %eax + push %rax leaq 16(%rbp), %rax movq (%rax), %rax + pop %rdi + addq %rdi, %rax push %rax - leaq -44(%rbp), %rax - movq (%rax), %rax - addq $8, %rax + movq $0, %rax + pop %rdi + movb %al, (%rdi) + jmp .L.while.start.27 +.L.while.end.27: + leaq -12(%rbp), %rax + push %rax + movq $47, %rax + push %rax + leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq copy_token(%rip), %rax + leaq strrchr(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.11 -.L.else.11: -.L.end.11: + pop %rdi + movq %rax, (%rdi) movq $0, %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $49, %rax + leaq -12(%rbp), %rax movq (%rax), %rax pop %rdi cmpl %edi, %eax - setne %al + sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.12 - leaq 24(%rbp), %rax - movq (%rax), %rax + jne .L.else.29 + movq $2, %rax + push %rax +.data +.L.str.21: + .byte 46 + .byte 0 +.text + leaq .L.str.21(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $49, %rax - movq (%rax), %rax push %rax - leaq preprocess(%rip), %rax + leaq memcpy(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.12 -.L.else.12: -.L.end.12: + addq $24, %rsp + jmp .L.end.29 +.L.else.29: + leaq 16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq -12(%rbp), %rax + movq (%rax), %rax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.30 + movq $1, %rax + push %rax + movq $1, %rax + pop %rdi + imull %edi, %eax + push %rax + leaq -12(%rbp), %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + push %rax + movq $0, %rax + pop %rdi + movb %al, (%rdi) + jmp .L.end.30 +.L.else.30: + leaq -12(%rbp), %rax + movq (%rax), %rax + push %rax movq $0, %rax + pop %rdi + movb %al, (%rdi) +.L.end.30: +.L.end.29: + leaq 16(%rbp), %rax + movq (%rax), %rax movq %rbp, %rsp pop %rbp retq @@ -1169,7 +2527,7 @@ get_eof_from_tokens: push %rbp movq %rsp, %rbp subq $0, %rsp -.L.while.start.13: +.L.while.start.31: movq $5, %rax push %rax leaq 16(%rbp), %rax @@ -1181,7 +2539,7 @@ get_eof_from_tokens: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.13 + jne .L.while.end.31 leaq 16(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -1190,8 +2548,8 @@ get_eof_from_tokens: movq (%rax), %rax pop %rdi movq %rax, (%rdi) - jmp .L.while.start.13 -.L.while.end.13: + jmp .L.while.start.31 +.L.while.end.31: leaq 16(%rbp), %rax movq (%rax), %rax movq %rbp, %rsp @@ -1279,7 +2637,7 @@ find_macro: movq (%rax), %rax pop %rdi movq %rax, (%rdi) -.L.while.start.14: +.L.while.start.32: movq $0, %rax push %rax leaq -8(%rbp), %rax @@ -1289,7 +2647,7 @@ find_macro: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.14 + jne .L.while.end.32 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -1305,15 +2663,15 @@ find_macro: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.15 + jne .L.else.33 leaq -8(%rbp), %rax movq (%rax), %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.15 -.L.else.15: -.L.end.15: + jmp .L.end.33 +.L.else.33: +.L.end.33: leaq -8(%rbp), %rax push %rax leaq -8(%rbp), %rax @@ -1322,8 +2680,8 @@ find_macro: movq (%rax), %rax pop %rdi movq %rax, (%rdi) - jmp .L.while.start.14 -.L.while.end.14: + jmp .L.while.start.32 +.L.while.end.32: movq $0, %rax movq %rbp, %rsp pop %rbp @@ -1356,17 +2714,60 @@ new_macro: movq %rax, (%rdi) leaq -8(%rbp), %rax movq (%rax), %rax - addq $8, %rax + addq $8, %rax + push %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + pop %rdi + movq %rax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $16, %rax + push %rax + movq $0, %rax + pop %rdi + movq %rax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global new_preprocessor +new_preprocessor: + push %rbp + movq %rsp, %rbp + subq $16, %rsp + leaq -8(%rbp), %rax + push %rax + movq $16, %rax + push %rax + leaq alloc(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $0, %rax push %rax - leaq 24(%rbp), %rax - movq (%rax), %rax + movq $0, %rax pop %rdi movq %rax, (%rdi) leaq -8(%rbp), %rax movq (%rax), %rax - addq $16, %rax + addq $8, %rax + push %rax + movq $4, %rax push %rax + leaq new_str_vec(%rip), %rax + movq %rax, %r10 movq $0, %rax + callq *%r10 + addq $8, %rsp pop %rdi movq %rax, (%rdi) leaq -8(%rbp), %rax @@ -1392,10 +2793,8 @@ gen: movq $0, %rax callq *%r10 addq $16, %rsp - leaq (%rsp), %rax - push %rax .data -.L.str.8: +.L.str.22: .byte 46 .byte 116 .byte 101 @@ -1404,23 +2803,21 @@ gen: .byte 10 .byte 0 .text - leaq .L.str.8(%rip), %rax + leaq .L.str.22(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq 16(%rbp), %rax movq (%rax), %rax addq $16, %rax movsbl (%rax), %eax cmpq $1, %rax - jne .L.else.16 - leaq (%rsp), %rax - push %rax + jne .L.else.34 .data -.L.str.9: +.L.str.23: .byte 46 .byte 103 .byte 108 @@ -1438,17 +2835,15 @@ gen: .byte 10 .byte 0 .text - leaq .L.str.9(%rip), %rax + leaq .L.str.23(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.10: +.L.str.24: .byte 95 .byte 115 .byte 116 @@ -1459,17 +2854,15 @@ gen: .byte 10 .byte 0 .text - leaq .L.str.10(%rip), %rax + leaq .L.str.24(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.11: +.L.str.25: .byte 9 .byte 112 .byte 117 @@ -1483,17 +2876,15 @@ gen: .byte 10 .byte 0 .text - leaq .L.str.11(%rip), %rax + leaq .L.str.25(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.12: +.L.str.26: .byte 9 .byte 109 .byte 111 @@ -1513,17 +2904,15 @@ gen: .byte 10 .byte 0 .text - leaq .L.str.12(%rip), %rax + leaq .L.str.26(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.13: +.L.str.27: .byte 9 .byte 108 .byte 101 @@ -1547,17 +2936,15 @@ gen: .byte 10 .byte 0 .text - leaq .L.str.13(%rip), %rax + leaq .L.str.27(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.14: +.L.str.28: .byte 9 .byte 112 .byte 117 @@ -1571,17 +2958,15 @@ gen: .byte 10 .byte 0 .text - leaq .L.str.14(%rip), %rax + leaq .L.str.28(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.15: +.L.str.29: .byte 9 .byte 112 .byte 117 @@ -1599,17 +2984,15 @@ gen: .byte 10 .byte 0 .text - leaq .L.str.15(%rip), %rax + leaq .L.str.29(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.16: +.L.str.30: .byte 9 .byte 99 .byte 97 @@ -1624,17 +3007,15 @@ gen: .byte 10 .byte 0 .text - leaq .L.str.16(%rip), %rax + leaq .L.str.30(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.17: +.L.str.31: .byte 9 .byte 109 .byte 111 @@ -1654,17 +3035,15 @@ gen: .byte 10 .byte 0 .text - leaq .L.str.17(%rip), %rax + leaq .L.str.31(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.18: +.L.str.32: .byte 9 .byte 109 .byte 111 @@ -1683,17 +3062,15 @@ gen: .byte 10 .byte 0 .text - leaq .L.str.18(%rip), %rax + leaq .L.str.32(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.19: +.L.str.33: .byte 9 .byte 115 .byte 121 @@ -1705,17 +3082,17 @@ gen: .byte 10 .byte 0 .text - leaq .L.str.19(%rip), %rax + leaq .L.str.33(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.16 -.L.else.16: -.L.end.16: -.L.while.start.17: + addq $8, %rsp + jmp .L.end.34 +.L.else.34: +.L.end.34: +.L.while.start.35: movq $0, %rax push %rax leaq 24(%rbp), %rax @@ -1725,7 +3102,7 @@ gen: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.17 + jne .L.while.end.35 movq $0, %rax push %rax leaq 24(%rbp), %rax @@ -1737,7 +3114,7 @@ gen: sete %al movzbl %al, %eax cmpq $0, %rax - je .L.false.19 + je .L.false.37 leaq 24(%rbp), %rax movq (%rax), %rax addq $52, %rax @@ -1746,14 +3123,14 @@ gen: sete %al movzbq %al, %rax cmpq $0, %rax - je .L.false.19 + je .L.false.37 movq $1, %rax - jmp .L.end.19 -.L.false.19: + jmp .L.end.37 +.L.false.37: movq $0, %rax -.L.end.19: +.L.end.37: cmpq $1, %rax - jne .L.else.18 + jne .L.else.36 leaq 16(%rbp), %rax movq (%rax), %rax addq $8, %rax @@ -1804,8 +3181,9 @@ gen: push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.20: +.L.str.34: .byte 46 .byte 103 .byte 108 @@ -1819,13 +3197,13 @@ gen: .byte 10 .byte 0 .text - leaq .L.str.20(%rip), %rax + leaq .L.str.34(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp leaq 24(%rbp), %rax movq (%rax), %rax addq $0, %rax @@ -1833,25 +3211,24 @@ gen: push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.21: +.L.str.35: .byte 37 .byte 115 .byte 58 .byte 10 .byte 0 .text - leaq .L.str.21(%rip), %rax + leaq .L.str.35(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp - leaq (%rsp), %rax - push %rax + addq $32, %rsp .data -.L.str.22: +.L.str.36: .byte 9 .byte 112 .byte 117 @@ -1865,17 +3242,15 @@ gen: .byte 10 .byte 0 .text - leaq .L.str.22(%rip), %rax + leaq .L.str.36(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.23: +.L.str.37: .byte 9 .byte 109 .byte 111 @@ -1895,13 +3270,13 @@ gen: .byte 10 .byte 0 .text - leaq .L.str.23(%rip), %rax + leaq .L.str.37(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq 24(%rbp), %rax movq (%rax), %rax addq $48, %rax @@ -1909,8 +3284,9 @@ gen: push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.24: +.L.str.38: .byte 9 .byte 115 .byte 117 @@ -1929,13 +3305,13 @@ gen: .byte 10 .byte 0 .text - leaq .L.str.24(%rip), %rax + leaq .L.str.38(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp leaq 24(%rbp), %rax movq (%rax), %rax addq $24, %rax @@ -1949,10 +3325,8 @@ gen: movq $0, %rax callq *%r10 addq $16, %rsp - leaq (%rsp), %rax - push %rax .data -.L.str.25: +.L.str.39: .byte 9 .byte 108 .byte 101 @@ -1962,17 +3336,15 @@ gen: .byte 10 .byte 0 .text - leaq .L.str.25(%rip), %rax + leaq .L.str.39(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.26: +.L.str.40: .byte 9 .byte 114 .byte 101 @@ -1980,16 +3352,16 @@ gen: .byte 10 .byte 0 .text - leaq .L.str.26(%rip), %rax + leaq .L.str.40(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.18 -.L.else.18: -.L.end.18: + addq $8, %rsp + jmp .L.end.36 +.L.else.36: +.L.end.36: leaq 24(%rbp), %rax push %rax leaq 24(%rbp), %rax @@ -1998,8 +3370,8 @@ gen: movq (%rax), %rax pop %rdi movq %rax, (%rdi) - jmp .L.while.start.17 -.L.while.end.17: + jmp .L.while.start.35 +.L.while.end.35: movq $0, %rax movq %rbp, %rsp pop %rbp @@ -2011,7 +3383,7 @@ check_global_objects: push %rbp movq %rsp, %rbp subq $0, %rsp -.L.while.start.20: +.L.while.start.38: movq $0, %rax push %rax leaq 24(%rbp), %rax @@ -2021,16 +3393,16 @@ check_global_objects: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.20 + jne .L.while.end.38 .data -.L.str.27: +.L.str.41: .byte 109 .byte 97 .byte 105 .byte 110 .byte 0 .text - leaq .L.str.27(%rip), %rax + leaq .L.str.41(%rip), %rax push %rax leaq 24(%rbp), %rax movq (%rax), %rax @@ -2044,7 +3416,7 @@ check_global_objects: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.21 + jne .L.else.39 leaq 16(%rbp), %rax movq (%rax), %rax addq $16, %rax @@ -2052,9 +3424,9 @@ check_global_objects: movq $1, %rax pop %rdi movb %al, (%rdi) - jmp .L.end.21 -.L.else.21: -.L.end.21: + jmp .L.end.39 +.L.else.39: +.L.end.39: leaq 24(%rbp), %rax push %rax leaq 24(%rbp), %rax @@ -2063,8 +3435,8 @@ check_global_objects: movq (%rax), %rax pop %rdi movq %rax, (%rdi) - jmp .L.while.start.20 -.L.while.end.20: + jmp .L.while.start.38 +.L.while.end.38: movq $0, %rax movq %rbp, %rsp pop %rbp @@ -2085,7 +3457,7 @@ assign_offset: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.22 + jne .L.else.40 movq $16, %rax push %rax leaq 16(%rbp), %rax @@ -2101,9 +3473,9 @@ assign_offset: movq %rbp, %rsp pop %rbp retq - jmp .L.end.22 -.L.else.22: -.L.end.22: + jmp .L.end.40 +.L.else.40: +.L.end.40: movq $0, %rax push %rax leaq 24(%rbp), %rax @@ -2115,7 +3487,7 @@ assign_offset: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.23 + jne .L.else.41 leaq 24(%rbp), %rax movq (%rax), %rax addq $55, %rax @@ -2129,15 +3501,15 @@ assign_offset: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.23 -.L.else.23: -.L.end.23: + jmp .L.end.41 +.L.else.41: +.L.end.41: leaq 24(%rbp), %rax movq (%rax), %rax addq $53, %rax movsbl (%rax), %eax cmpq $1, %rax - jne .L.else.24 + jne .L.else.42 leaq 24(%rbp), %rax movq (%rax), %rax addq $20, %rax @@ -2162,8 +3534,8 @@ assign_offset: addl %edi, %eax pop %rdi movl %eax, (%rdi) - jmp .L.end.24 -.L.else.24: + jmp .L.end.42 +.L.else.42: leaq 16(%rbp), %rax movq (%rax), %rax addq $18, %rax @@ -2204,7 +3576,7 @@ assign_offset: subl %edi, %eax pop %rdi movl %eax, (%rdi) -.L.end.24: +.L.end.42: movq $16, %rax push %rax leaq 16(%rbp), %rax @@ -2232,7 +3604,7 @@ gen_node_block: movq $0, %rax pop %rdi movl %eax, (%rdi) -.L.while.start.25: +.L.while.start.43: leaq 24(%rbp), %rax movq (%rax), %rax addq $8, %rax @@ -2245,7 +3617,7 @@ gen_node_block: setl %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.25 + jne .L.while.end.43 movq $8, %rax push %rax leaq -4(%rbp), %rax @@ -2283,8 +3655,8 @@ gen_node_block: movl %eax, (%rdi) pop %rdi subl %edi, %eax - jmp .L.while.start.25 -.L.while.end.25: + jmp .L.while.start.43 +.L.while.end.43: movq $0, %rax movq %rbp, %rsp pop %rbp @@ -2312,14 +3684,14 @@ gen_stmt: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.26 + jne .L.else.44 movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.26 -.L.else.26: -.L.end.26: + jmp .L.end.44 +.L.else.44: +.L.end.44: movq $21, %rax push %rax leaq 24(%rbp), %rax @@ -2331,7 +3703,7 @@ gen_stmt: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.27 + jne .L.else.45 leaq 24(%rbp), %rax movq (%rax), %rax addq $20, %rax @@ -2349,9 +3721,9 @@ gen_stmt: movq %rbp, %rsp pop %rbp retq - jmp .L.end.27 -.L.else.27: -.L.end.27: + jmp .L.end.45 +.L.else.45: +.L.end.45: movq $22, %rax push %rax leaq 24(%rbp), %rax @@ -2363,7 +3735,7 @@ gen_stmt: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.28 + jne .L.else.46 leaq 24(%rbp), %rax movq (%rax), %rax addq $4, %rax @@ -2381,9 +3753,9 @@ gen_stmt: movq %rbp, %rsp pop %rbp retq - jmp .L.end.28 -.L.else.28: -.L.end.28: + jmp .L.end.46 +.L.else.46: +.L.end.46: movq $18, %rax push %rax leaq 24(%rbp), %rax @@ -2395,7 +3767,7 @@ gen_stmt: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.29 + jne .L.else.47 leaq 24(%rbp), %rax movq (%rax), %rax addq $4, %rax @@ -2409,10 +3781,8 @@ gen_stmt: movq $0, %rax callq *%r10 addq $16, %rsp - leaq (%rsp), %rax - push %rax .data -.L.str.28: +.L.str.42: .byte 9 .byte 109 .byte 111 @@ -2432,17 +3802,15 @@ gen_stmt: .byte 10 .byte 0 .text - leaq .L.str.28(%rip), %rax + leaq .L.str.42(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.29: +.L.str.43: .byte 9 .byte 112 .byte 111 @@ -2455,17 +3823,15 @@ gen_stmt: .byte 10 .byte 0 .text - leaq .L.str.29(%rip), %rax + leaq .L.str.43(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.30: +.L.str.44: .byte 9 .byte 114 .byte 101 @@ -2474,20 +3840,20 @@ gen_stmt: .byte 10 .byte 0 .text - leaq .L.str.30(%rip), %rax + leaq .L.str.44(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.29 -.L.else.29: -.L.end.29: + jmp .L.end.47 +.L.else.47: +.L.end.47: movq $15, %rax push %rax leaq 24(%rbp), %rax @@ -2499,7 +3865,7 @@ gen_stmt: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.30 + jne .L.else.48 leaq -4(%rbp), %rax push %rax movq $1, %rax @@ -2535,10 +3901,8 @@ gen_stmt: movq $0, %rax callq *%r10 addq $16, %rsp - leaq (%rsp), %rax - push %rax .data -.L.str.31: +.L.str.45: .byte 9 .byte 99 .byte 109 @@ -2556,20 +3920,21 @@ gen_stmt: .byte 10 .byte 0 .text - leaq .L.str.31(%rip), %rax + leaq .L.str.45(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq -4(%rbp), %rax movslq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.32: +.L.str.46: .byte 9 .byte 106 .byte 110 @@ -2588,13 +3953,13 @@ gen_stmt: .byte 10 .byte 0 .text - leaq .L.str.32(%rip), %rax + leaq .L.str.46(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp leaq 24(%rbp), %rax movq (%rax), %rax addq $28, %rax @@ -2613,8 +3978,9 @@ gen_stmt: push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.33: +.L.str.47: .byte 9 .byte 106 .byte 109 @@ -2632,20 +3998,21 @@ gen_stmt: .byte 10 .byte 0 .text - leaq .L.str.33(%rip), %rax + leaq .L.str.47(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp leaq -4(%rbp), %rax movslq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.34: +.L.str.48: .byte 46 .byte 76 .byte 46 @@ -2660,13 +4027,13 @@ gen_stmt: .byte 10 .byte 0 .text - leaq .L.str.34(%rip), %rax + leaq .L.str.48(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp movq $0, %rax push %rax leaq 24(%rbp), %rax @@ -2678,7 +4045,7 @@ gen_stmt: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.31 + jne .L.else.49 leaq 24(%rbp), %rax movq (%rax), %rax addq $36, %rax @@ -2692,16 +4059,17 @@ gen_stmt: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.31 -.L.else.31: -.L.end.31: + jmp .L.end.49 +.L.else.49: +.L.end.49: leaq -4(%rbp), %rax movslq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.35: +.L.str.49: .byte 46 .byte 76 .byte 46 @@ -2715,20 +4083,20 @@ gen_stmt: .byte 10 .byte 0 .text - leaq .L.str.35(%rip), %rax + leaq .L.str.49(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.30 -.L.else.30: -.L.end.30: + jmp .L.end.48 +.L.else.48: +.L.end.48: movq $23, %rax push %rax leaq 24(%rbp), %rax @@ -2740,7 +4108,7 @@ gen_stmt: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.32 + jne .L.else.50 leaq 24(%rbp), %rax movq (%rax), %rax addq $52, %rax @@ -2753,8 +4121,9 @@ gen_stmt: push %rax leaq (%rsp), %rax push %rax + push $2 .data -.L.str.36: +.L.str.50: .byte 9 .byte 106 .byte 109 @@ -2771,20 +4140,20 @@ gen_stmt: .byte 10 .byte 0 .text - leaq .L.str.36(%rip), %rax + leaq .L.str.50(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $32, %rsp + addq $40, %rsp movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.32 -.L.else.32: -.L.end.32: + jmp .L.end.50 +.L.else.50: +.L.end.50: movq $24, %rax push %rax leaq 24(%rbp), %rax @@ -2796,7 +4165,7 @@ gen_stmt: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.33 + jne .L.else.51 leaq 24(%rbp), %rax movq (%rax), %rax addq $52, %rax @@ -2809,8 +4178,9 @@ gen_stmt: push %rax leaq (%rsp), %rax push %rax + push $2 .data -.L.str.37: +.L.str.51: .byte 46 .byte 76 .byte 46 @@ -2823,20 +4193,20 @@ gen_stmt: .byte 10 .byte 0 .text - leaq .L.str.37(%rip), %rax + leaq .L.str.51(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $32, %rsp + addq $40, %rsp movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.33 -.L.else.33: -.L.end.33: + jmp .L.end.51 +.L.else.51: +.L.end.51: movq $16, %rax push %rax leaq 24(%rbp), %rax @@ -2848,7 +4218,7 @@ gen_stmt: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.34 + jne .L.else.52 leaq -4(%rbp), %rax push %rax movq $1, %rax @@ -2876,8 +4246,9 @@ gen_stmt: push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.38: +.L.str.52: .byte 46 .byte 76 .byte 46 @@ -2899,13 +4270,13 @@ gen_stmt: .byte 10 .byte 0 .text - leaq .L.str.38(%rip), %rax + leaq .L.str.52(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp leaq 24(%rbp), %rax movq (%rax), %rax addq $44, %rax @@ -2919,10 +4290,8 @@ gen_stmt: movq $0, %rax callq *%r10 addq $16, %rsp - leaq (%rsp), %rax - push %rax .data -.L.str.39: +.L.str.53: .byte 9 .byte 99 .byte 109 @@ -2940,20 +4309,21 @@ gen_stmt: .byte 10 .byte 0 .text - leaq .L.str.39(%rip), %rax + leaq .L.str.53(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq -4(%rbp), %rax movslq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.40: +.L.str.54: .byte 9 .byte 106 .byte 110 @@ -2977,13 +4347,13 @@ gen_stmt: .byte 10 .byte 0 .text - leaq .L.str.40(%rip), %rax + leaq .L.str.54(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp leaq 24(%rbp), %rax movq (%rax), %rax addq $28, %rax @@ -3002,8 +4372,9 @@ gen_stmt: push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.41: +.L.str.55: .byte 9 .byte 106 .byte 109 @@ -3029,20 +4400,21 @@ gen_stmt: .byte 10 .byte 0 .text - leaq .L.str.41(%rip), %rax + leaq .L.str.55(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp leaq -4(%rbp), %rax movslq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.42: +.L.str.56: .byte 46 .byte 76 .byte 46 @@ -3062,20 +4434,20 @@ gen_stmt: .byte 10 .byte 0 .text - leaq .L.str.42(%rip), %rax + leaq .L.str.56(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.34 -.L.else.34: -.L.end.34: + jmp .L.end.52 +.L.else.52: +.L.end.52: movq $17, %rax push %rax leaq 24(%rbp), %rax @@ -3087,7 +4459,7 @@ gen_stmt: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.35 + jne .L.else.53 leaq 24(%rbp), %rax movq (%rax), %rax addq $4, %rax @@ -3101,10 +4473,8 @@ gen_stmt: movq $0, %rax callq *%r10 addq $16, %rsp - leaq (%rsp), %rax - push %rax .data -.L.str.43: +.L.str.57: .byte 9 .byte 112 .byte 117 @@ -3118,13 +4488,13 @@ gen_stmt: .byte 10 .byte 0 .text - leaq .L.str.43(%rip), %rax + leaq .L.str.57(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq 24(%rbp), %rax movq (%rax), %rax addq $12, %rax @@ -3138,10 +4508,8 @@ gen_stmt: movq $0, %rax callq *%r10 addq $16, %rsp - leaq (%rsp), %rax - push %rax .data -.L.str.44: +.L.str.58: .byte 9 .byte 112 .byte 111 @@ -3154,13 +4522,13 @@ gen_stmt: .byte 10 .byte 0 .text - leaq .L.str.44(%rip), %rax + leaq .L.str.58(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq 24(%rbp), %rax movq (%rax), %rax addq $80, %rax @@ -3175,13 +4543,11 @@ gen_stmt: movq %rbp, %rsp pop %rbp retq - jmp .L.end.35 -.L.else.35: -.L.end.35: - leaq (%rsp), %rax - push %rax + jmp .L.end.53 +.L.else.53: +.L.end.53: .data -.L.str.45: +.L.str.59: .byte 117 .byte 110 .byte 114 @@ -3196,13 +4562,13 @@ gen_stmt: .byte 10 .byte 0 .text - leaq .L.str.45(%rip), %rax + leaq .L.str.59(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -3228,28 +4594,28 @@ binop_ax_by_type_size: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.36 + jne .L.else.54 .data -.L.str.46: +.L.str.60: .byte 37 .byte 114 .byte 97 .byte 120 .byte 0 .text - leaq .L.str.46(%rip), %rax - jmp .L.end.36 -.L.else.36: + leaq .L.str.60(%rip), %rax + jmp .L.end.54 +.L.else.54: .data -.L.str.47: +.L.str.61: .byte 37 .byte 101 .byte 97 .byte 120 .byte 0 .text - leaq .L.str.47(%rip), %rax -.L.end.36: + leaq .L.str.61(%rip), %rax +.L.end.54: leave ret .global func_call_args_to_stack @@ -3259,57 +4625,174 @@ func_call_args_to_stack: subq $16, %rsp movq $0, %rax push %rax - leaq 24(%rbp), %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + addq $8, %rax + movslq (%rax), %rax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.55 + movq $0, %rax + movq %rbp, %rsp + pop %rbp + retq + jmp .L.end.55 +.L.else.55: +.L.end.55: + leaq -4(%rbp), %rax + push %rax + movq $0, %rax + pop %rdi + movl %eax, (%rdi) + leaq -8(%rbp), %rax + push %rax + movq $1, %rax + push %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + addq $8, %rax + movslq (%rax), %rax + pop %rdi + subl %edi, %eax + pop %rdi + movl %eax, (%rdi) +.L.while.start.56: + leaq -8(%rbp), %rax + movslq (%rax), %rax + push %rax + movq $0, %rax + pop %rdi + cmpl %edi, %eax + setle %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.while.end.56 + movq $8, %rax + push %rax + leaq -8(%rbp), %rax + movslq (%rax), %rax + pop %rdi + imull %edi, %eax + push %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + addq $0, %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + movq (%rax), %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq gen_expr(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp +.data +.L.str.62: + .byte 9 + .byte 112 + .byte 117 + .byte 115 + .byte 104 + .byte 32 + .byte 37 + .byte 114 + .byte 97 + .byte 120 + .byte 10 + .byte 0 +.text + leaq .L.str.62(%rip), %rax + push %rax + leaq printf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + leaq -4(%rbp), %rax + push %rax + movq $8, %rax + push %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + addl %edi, %eax + pop %rdi + movl %eax, (%rdi) + leaq 32(%rbp), %rax + movq (%rax), %rax + addq $40, %rax + movsbl (%rax), %eax + cmpq $0, %rax + je .L.false.58 + movq $1, %rax + push %rax + movq $2, %rax + push %rax + leaq 32(%rbp), %rax + movq (%rax), %rax + addq $32, %rax movq (%rax), %rax addq $8, %rax movslq (%rax), %rax pop %rdi + subl %edi, %eax + pop %rdi + subl %edi, %eax + push %rax + movq $1, %rax + push %rax + leaq -8(%rbp), %rax + movslq (%rax), %rax + pop %rdi + subl %edi, %eax + pop %rdi cmpl %edi, %eax sete %al movzbl %al, %eax - cmpq $1, %rax - jne .L.else.37 + cmpq $0, %rax + je .L.false.58 + movq $1, %rax + jmp .L.end.58 +.L.false.58: movq $0, %rax - movq %rbp, %rsp - pop %rbp - retq - jmp .L.end.37 -.L.else.37: -.L.end.37: - leaq -4(%rbp), %rax +.L.end.58: + cmpq $1, %rax + jne .L.else.57 + leaq -12(%rbp), %rax push %rax movq $0, %rax pop %rdi movl %eax, (%rdi) - leaq -8(%rbp), %rax - push %rax - movq $1, %rax + movq $2, %rax push %rax - leaq 24(%rbp), %rax + leaq 32(%rbp), %rax + movq (%rax), %rax + addq $32, %rax movq (%rax), %rax addq $8, %rax movslq (%rax), %rax pop %rdi subl %edi, %eax - pop %rdi - movl %eax, (%rdi) -.L.while.start.38: - leaq -8(%rbp), %rax - movslq (%rax), %rax push %rax - movq $0, %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + addq $8, %rax + movslq (%rax), %rax pop %rdi cmpl %edi, %eax - setle %al + setg %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.38 - leaq 32(%rbp), %rax - movq (%rax), %rax - addq $40, %rax - movsbl (%rax), %eax - cmpq $0, %rax - je .L.false.40 + jne .L.else.59 + leaq -12(%rbp), %rax + push %rax movq $2, %rax push %rax leaq 32(%rbp), %rax @@ -3321,25 +4804,19 @@ func_call_args_to_stack: pop %rdi subl %edi, %eax push %rax - leaq -8(%rbp), %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + addq $8, %rax movslq (%rax), %rax pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $0, %rax - je .L.false.40 - movq $1, %rax - jmp .L.end.40 -.L.false.40: - movq $0, %rax -.L.end.40: - cmpq $1, %rax - jne .L.else.39 - leaq (%rsp), %rax - push %rax + subl %edi, %eax + pop %rdi + movl %eax, (%rdi) + jmp .L.end.59 +.L.else.59: +.L.end.59: .data -.L.str.48: +.L.str.63: .byte 9 .byte 108 .byte 101 @@ -3361,17 +4838,15 @@ func_call_args_to_stack: .byte 10 .byte 0 .text - leaq .L.str.48(%rip), %rax + leaq .L.str.63(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.49: +.L.str.64: .byte 9 .byte 112 .byte 117 @@ -3385,76 +4860,43 @@ func_call_args_to_stack: .byte 10 .byte 0 .text - leaq .L.str.49(%rip), %rax + leaq .L.str.64(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq -4(%rbp), %rax - push %rax - movq $8, %rax - push %rax - leaq -4(%rbp), %rax - movslq (%rax), %rax - pop %rdi - addl %edi, %eax - pop %rdi - movl %eax, (%rdi) - jmp .L.end.39 -.L.else.39: -.L.end.39: - movq $8, %rax - push %rax - leaq -8(%rbp), %rax + addq $8, %rsp + leaq -12(%rbp), %rax movslq (%rax), %rax - pop %rdi - imull %edi, %eax - push %rax - leaq 24(%rbp), %rax - movq (%rax), %rax - addq $0, %rax - movq (%rax), %rax - pop %rdi - addq %rdi, %rax - movq (%rax), %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - push %rax - leaq gen_expr(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp leaq (%rsp), %rax push %rax + push $1 .data -.L.str.50: +.L.str.65: .byte 9 .byte 112 .byte 117 .byte 115 .byte 104 .byte 32 + .byte 36 .byte 37 - .byte 114 - .byte 97 - .byte 120 + .byte 100 .byte 10 .byte 0 .text - leaq .L.str.50(%rip), %rax + leaq .L.str.65(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $32, %rsp leaq -4(%rbp), %rax push %rax - movq $8, %rax + movq $16, %rax push %rax leaq -4(%rbp), %rax movslq (%rax), %rax @@ -3462,6 +4904,9 @@ func_call_args_to_stack: addl %edi, %eax pop %rdi movl %eax, (%rdi) + jmp .L.end.57 +.L.else.57: +.L.end.57: movq $1, %rax push %rax leaq -8(%rbp), %rax @@ -3476,8 +4921,8 @@ func_call_args_to_stack: movl %eax, (%rdi) pop %rdi addl %edi, %eax - jmp .L.while.start.38 -.L.while.end.38: + jmp .L.while.start.56 +.L.while.end.56: leaq -4(%rbp), %rax movslq (%rax), %rax movq %rbp, %rsp @@ -3501,11 +4946,9 @@ gen_condition_store: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.41 - leaq (%rsp), %rax - push %rax + jne .L.else.60 .data -.L.str.51: +.L.str.66: .byte 9 .byte 109 .byte 111 @@ -3526,15 +4969,15 @@ gen_condition_store: .byte 10 .byte 0 .text - leaq .L.str.51(%rip), %rax + leaq .L.str.66(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.41 -.L.else.41: + addq $8, %rsp + jmp .L.end.60 +.L.else.60: movq $0, %rax push %rax leaq 16(%rbp), %rax @@ -3546,11 +4989,9 @@ gen_condition_store: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.42 - leaq (%rsp), %rax - push %rax + jne .L.else.61 .data -.L.str.52: +.L.str.67: .byte 9 .byte 109 .byte 111 @@ -3571,19 +5012,17 @@ gen_condition_store: .byte 10 .byte 0 .text - leaq .L.str.52(%rip), %rax + leaq .L.str.67(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.42 -.L.else.42: - leaq (%rsp), %rax - push %rax + addq $8, %rsp + jmp .L.end.61 +.L.else.61: .data -.L.str.53: +.L.str.68: .byte 9 .byte 109 .byte 111 @@ -3604,15 +5043,15 @@ gen_condition_store: .byte 10 .byte 0 .text - leaq .L.str.53(%rip), %rax + leaq .L.str.68(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp -.L.end.42: -.L.end.41: + addq $8, %rsp +.L.end.61: +.L.end.60: leave ret .global gen_binop @@ -3631,14 +5070,15 @@ gen_binop: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.43 + jne .L.else.62 leaq 16(%rbp), %rax movq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.54: +.L.str.69: .byte 9 .byte 37 .byte 115 @@ -3657,22 +5097,23 @@ gen_binop: .byte 10 .byte 0 .text - leaq .L.str.54(%rip), %rax + leaq .L.str.69(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp - jmp .L.end.43 -.L.else.43: + addq $32, %rsp + jmp .L.end.62 +.L.else.62: leaq 16(%rbp), %rax movq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.55: +.L.str.70: .byte 9 .byte 37 .byte 115 @@ -3691,14 +5132,14 @@ gen_binop: .byte 10 .byte 0 .text - leaq .L.str.55(%rip), %rax + leaq .L.str.70(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp -.L.end.43: + addq $32, %rsp +.L.end.62: movq $0, %rax movq %rbp, %rsp pop %rbp @@ -3721,20 +5162,20 @@ gen_load: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.44 + jne .L.else.63 movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.44 -.L.else.44: -.L.end.44: + jmp .L.end.63 +.L.else.63: +.L.end.63: leaq 16(%rbp), %rax movq (%rax), %rax addq $17, %rax movsbl (%rax), %eax cmpq $1, %rax - jne .L.else.45 + jne .L.else.64 leaq 16(%rbp), %rax movq (%rax), %rax addq $17, %rax @@ -3746,44 +5187,44 @@ gen_load: movq %rbp, %rsp pop %rbp retq - jmp .L.end.45 -.L.else.45: -.L.end.45: + jmp .L.end.64 +.L.else.64: +.L.end.64: leaq 24(%rbp), %rax movq (%rax), %rax addq $49, %rax movsbl (%rax), %eax cmpq $1, %rax - jne .L.else.46 + jne .L.else.65 leaq -8(%rbp), %rax push %rax .data -.L.str.56: +.L.str.71: .byte 109 .byte 111 .byte 118 .byte 122 .byte 0 .text - leaq .L.str.56(%rip), %rax + leaq .L.str.71(%rip), %rax pop %rdi movq %rax, (%rdi) - jmp .L.end.46 -.L.else.46: + jmp .L.end.65 +.L.else.65: leaq -8(%rbp), %rax push %rax .data -.L.str.57: +.L.str.72: .byte 109 .byte 111 .byte 118 .byte 115 .byte 0 .text - leaq .L.str.57(%rip), %rax + leaq .L.str.72(%rip), %rax pop %rdi movq %rax, (%rdi) -.L.end.46: +.L.end.65: movq $8, %rax push %rax leaq 24(%rbp), %rax @@ -3795,11 +5236,9 @@ gen_load: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.47 - leaq (%rsp), %rax - push %rax + jne .L.else.66 .data -.L.str.58: +.L.str.73: .byte 9 .byte 109 .byte 111 @@ -3821,15 +5260,15 @@ gen_load: .byte 10 .byte 0 .text - leaq .L.str.58(%rip), %rax + leaq .L.str.73(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.47 -.L.else.47: + addq $8, %rsp + jmp .L.end.66 +.L.else.66: movq $4, %rax push %rax leaq 24(%rbp), %rax @@ -3841,11 +5280,9 @@ gen_load: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.48 - leaq (%rsp), %rax - push %rax + jne .L.else.67 .data -.L.str.59: +.L.str.74: .byte 9 .byte 109 .byte 111 @@ -3869,15 +5306,15 @@ gen_load: .byte 10 .byte 0 .text - leaq .L.str.59(%rip), %rax + leaq .L.str.74(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.48 -.L.else.48: + addq $8, %rsp + jmp .L.end.67 +.L.else.67: movq $2, %rax push %rax leaq 24(%rbp), %rax @@ -3889,14 +5326,15 @@ gen_load: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.49 + jne .L.else.68 leaq -8(%rbp), %rax movq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.60: +.L.str.75: .byte 9 .byte 37 .byte 115 @@ -3918,15 +5356,15 @@ gen_load: .byte 10 .byte 0 .text - leaq .L.str.60(%rip), %rax + leaq .L.str.75(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp - jmp .L.end.49 -.L.else.49: + addq $32, %rsp + jmp .L.end.68 +.L.else.68: movq $1, %rax push %rax leaq 24(%rbp), %rax @@ -3938,14 +5376,15 @@ gen_load: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.50 + jne .L.else.69 leaq -8(%rbp), %rax movq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.61: +.L.str.76: .byte 9 .byte 37 .byte 115 @@ -3967,19 +5406,17 @@ gen_load: .byte 10 .byte 0 .text - leaq .L.str.61(%rip), %rax + leaq .L.str.76(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp - jmp .L.end.50 -.L.else.50: - leaq (%rsp), %rax - push %rax + addq $32, %rsp + jmp .L.end.69 +.L.else.69: .data -.L.str.62: +.L.str.77: .byte 117 .byte 110 .byte 114 @@ -3994,13 +5431,13 @@ gen_load: .byte 10 .byte 0 .text - leaq .L.str.62(%rip), %rax + leaq .L.str.77(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -4008,10 +5445,10 @@ gen_load: movq $0, %rax callq *%r10 addq $8, %rsp -.L.end.50: -.L.end.49: -.L.end.48: -.L.end.47: +.L.end.69: +.L.end.68: +.L.end.67: +.L.end.66: movq $0, %rax movq %rbp, %rsp pop %rbp @@ -4028,28 +5465,28 @@ load_instr: addq $49, %rax movsbl (%rax), %eax cmpq $1, %rax - jne .L.else.51 + jne .L.else.70 .data -.L.str.63: +.L.str.78: .byte 109 .byte 111 .byte 118 .byte 122 .byte 0 .text - leaq .L.str.63(%rip), %rax - jmp .L.end.51 -.L.else.51: + leaq .L.str.78(%rip), %rax + jmp .L.end.70 +.L.else.70: .data -.L.str.64: +.L.str.79: .byte 109 .byte 111 .byte 118 .byte 115 .byte 0 .text - leaq .L.str.64(%rip), %rax -.L.end.51: + leaq .L.str.79(%rip), %rax +.L.end.70: leave ret .global gen_store @@ -4068,13 +5505,13 @@ gen_store: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.52 + jne .L.else.71 leaq -4(%rbp), %rax push %rax movq $0, %rax pop %rdi movl %eax, (%rdi) -.L.while.start.53: +.L.while.start.72: leaq 16(%rbp), %rax movq (%rax), %rax addq $4, %rax @@ -4087,14 +5524,15 @@ gen_store: setl %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.53 + jne .L.while.end.72 leaq -4(%rbp), %rax movslq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.65: +.L.str.80: .byte 9 .byte 109 .byte 111 @@ -4118,20 +5556,21 @@ gen_store: .byte 10 .byte 0 .text - leaq .L.str.65(%rip), %rax + leaq .L.str.80(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp leaq -4(%rbp), %rax movslq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.66: +.L.str.81: .byte 9 .byte 109 .byte 111 @@ -4155,13 +5594,13 @@ gen_store: .byte 10 .byte 0 .text - leaq .L.str.66(%rip), %rax + leaq .L.str.81(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp movq $1, %rax push %rax leaq -4(%rbp), %rax @@ -4176,15 +5615,15 @@ gen_store: movl %eax, (%rdi) pop %rdi subl %edi, %eax - jmp .L.while.start.53 -.L.while.end.53: + jmp .L.while.start.72 +.L.while.end.72: movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.52 -.L.else.52: -.L.end.52: + jmp .L.end.71 +.L.else.71: +.L.end.71: movq $1, %rax push %rax leaq 16(%rbp), %rax @@ -4196,11 +5635,9 @@ gen_store: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.54 - leaq (%rsp), %rax - push %rax + jne .L.else.73 .data -.L.str.67: +.L.str.82: .byte 9 .byte 109 .byte 111 @@ -4221,15 +5658,15 @@ gen_store: .byte 10 .byte 0 .text - leaq .L.str.67(%rip), %rax + leaq .L.str.82(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.54 -.L.else.54: + addq $8, %rsp + jmp .L.end.73 +.L.else.73: movq $2, %rax push %rax leaq 16(%rbp), %rax @@ -4241,11 +5678,9 @@ gen_store: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.55 - leaq (%rsp), %rax - push %rax + jne .L.else.74 .data -.L.str.68: +.L.str.83: .byte 9 .byte 109 .byte 111 @@ -4266,15 +5701,15 @@ gen_store: .byte 10 .byte 0 .text - leaq .L.str.68(%rip), %rax + leaq .L.str.83(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.55 -.L.else.55: + addq $8, %rsp + jmp .L.end.74 +.L.else.74: movq $4, %rax push %rax leaq 16(%rbp), %rax @@ -4286,11 +5721,9 @@ gen_store: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.56 - leaq (%rsp), %rax - push %rax + jne .L.else.75 .data -.L.str.69: +.L.str.84: .byte 9 .byte 109 .byte 111 @@ -4312,15 +5745,15 @@ gen_store: .byte 10 .byte 0 .text - leaq .L.str.69(%rip), %rax + leaq .L.str.84(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.56 -.L.else.56: + addq $8, %rsp + jmp .L.end.75 +.L.else.75: movq $8, %rax push %rax leaq 16(%rbp), %rax @@ -4332,11 +5765,9 @@ gen_store: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.57 - leaq (%rsp), %rax - push %rax + jne .L.else.76 .data -.L.str.70: +.L.str.85: .byte 9 .byte 109 .byte 111 @@ -4358,19 +5789,17 @@ gen_store: .byte 10 .byte 0 .text - leaq .L.str.70(%rip), %rax + leaq .L.str.85(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.57 -.L.else.57: - leaq (%rsp), %rax - push %rax + addq $8, %rsp + jmp .L.end.76 +.L.else.76: .data -.L.str.71: +.L.str.86: .byte 117 .byte 110 .byte 114 @@ -4385,13 +5814,13 @@ gen_store: .byte 10 .byte 0 .text - leaq .L.str.71(%rip), %rax + leaq .L.str.86(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -4399,10 +5828,10 @@ gen_store: movq $0, %rax callq *%r10 addq $8, %rsp -.L.end.57: -.L.end.56: -.L.end.55: -.L.end.54: +.L.end.76: +.L.end.75: +.L.end.74: +.L.end.73: movq $0, %rax movq %rbp, %rsp pop %rbp @@ -4425,7 +5854,7 @@ gen_addr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.58 + jne .L.else.77 leaq 24(%rbp), %rax movq (%rax), %rax addq $4, %rax @@ -4446,8 +5875,9 @@ gen_addr: push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.72: +.L.str.87: .byte 9 .byte 97 .byte 100 @@ -4466,15 +5896,15 @@ gen_addr: .byte 10 .byte 0 .text - leaq .L.str.72(%rip), %rax + leaq .L.str.87(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp - jmp .L.end.58 -.L.else.58: + addq $32, %rsp + jmp .L.end.77 +.L.else.77: movq $14, %rax push %rax leaq 24(%rbp), %rax @@ -4486,7 +5916,7 @@ gen_addr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.59 + jne .L.else.78 leaq 24(%rbp), %rax movq (%rax), %rax addq $72, %rax @@ -4494,7 +5924,7 @@ gen_addr: addq $54, %rax movsbl (%rax), %eax cmpq $1, %rax - jne .L.else.60 + jne .L.else.79 leaq 16(%rbp), %rax movq (%rax), %rax addq $17, %rax @@ -4511,8 +5941,9 @@ gen_addr: push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.73: +.L.str.88: .byte 9 .byte 108 .byte 101 @@ -4536,15 +5967,15 @@ gen_addr: .byte 10 .byte 0 .text - leaq .L.str.73(%rip), %rax + leaq .L.str.88(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp - jmp .L.end.60 -.L.else.60: + addq $32, %rsp + jmp .L.end.79 +.L.else.79: leaq 24(%rbp), %rax movq (%rax), %rax addq $72, %rax @@ -4554,8 +5985,9 @@ gen_addr: push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.74: +.L.str.89: .byte 9 .byte 108 .byte 101 @@ -4579,16 +6011,16 @@ gen_addr: .byte 10 .byte 0 .text - leaq .L.str.74(%rip), %rax + leaq .L.str.89(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp -.L.end.60: - jmp .L.end.59 -.L.else.59: + addq $32, %rsp +.L.end.79: + jmp .L.end.78 +.L.else.78: movq $20, %rax push %rax leaq 24(%rbp), %rax @@ -4600,7 +6032,7 @@ gen_addr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.61 + jne .L.else.80 leaq 24(%rbp), %rax movq (%rax), %rax addq $4, %rax @@ -4614,11 +6046,11 @@ gen_addr: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.61 -.L.else.61: -.L.end.61: -.L.end.59: -.L.end.58: + jmp .L.end.80 +.L.else.80: +.L.end.80: +.L.end.78: +.L.end.77: movq $0, %rax movq %rbp, %rsp pop %rbp @@ -4641,10 +6073,8 @@ gen_lhs_rhs: movq $0, %rax callq *%r10 addq $16, %rsp - leaq (%rsp), %rax - push %rax .data -.L.str.75: +.L.str.90: .byte 9 .byte 112 .byte 117 @@ -4658,13 +6088,13 @@ gen_lhs_rhs: .byte 10 .byte 0 .text - leaq .L.str.75(%rip), %rax + leaq .L.str.90(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq 24(%rbp), %rax movq (%rax), %rax push %rax @@ -4676,10 +6106,8 @@ gen_lhs_rhs: movq $0, %rax callq *%r10 addq $16, %rsp - leaq (%rsp), %rax - push %rax .data -.L.str.76: +.L.str.91: .byte 9 .byte 112 .byte 111 @@ -4692,13 +6120,13 @@ gen_lhs_rhs: .byte 10 .byte 0 .text - leaq .L.str.76(%rip), %rax + leaq .L.str.91(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leave ret .global gen_expr @@ -4722,14 +6150,14 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.62 + jne .L.else.81 movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.62 -.L.else.62: -.L.end.62: + jmp .L.end.81 +.L.else.81: +.L.end.81: movq $28, %rax push %rax leaq 24(%rbp), %rax @@ -4741,7 +6169,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.63 + jne .L.else.82 leaq 24(%rbp), %rax movq (%rax), %rax push %rax @@ -4770,9 +6198,9 @@ gen_expr: movq %rbp, %rsp pop %rbp retq - jmp .L.end.63 -.L.else.63: -.L.end.63: + jmp .L.end.82 +.L.else.82: +.L.end.82: movq $12, %rax push %rax leaq 24(%rbp), %rax @@ -4784,7 +6212,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.64 + jne .L.else.83 leaq -4(%rbp), %rax push %rax movq $1, %rax @@ -4807,10 +6235,8 @@ gen_expr: subl %edi, %eax pop %rdi movl %eax, (%rdi) - leaq (%rsp), %rax - push %rax .data -.L.str.77: +.L.str.92: .byte 46 .byte 100 .byte 97 @@ -4819,20 +6245,21 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.77(%rip), %rax + leaq .L.str.92(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq -4(%rbp), %rax movslq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.78: +.L.str.93: .byte 46 .byte 76 .byte 46 @@ -4846,13 +6273,13 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.78(%rip), %rax + leaq .L.str.93(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp leaq -12(%rbp), %rax push %rax leaq 24(%rbp), %rax @@ -4861,7 +6288,7 @@ gen_expr: movq (%rax), %rax pop %rdi movq %rax, (%rdi) -.L.while.start.65: +.L.while.start.84: movq $0, %rax push %rax leaq -12(%rbp), %rax @@ -4872,15 +6299,16 @@ gen_expr: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.65 + jne .L.while.end.84 leaq -12(%rbp), %rax movq (%rax), %rax movzbl (%rax), %eax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.79: +.L.str.94: .byte 9 .byte 46 .byte 98 @@ -4893,13 +6321,13 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.79(%rip), %rax + leaq .L.str.94(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp movq $1, %rax push %rax leaq -12(%rbp), %rax @@ -4914,12 +6342,10 @@ gen_expr: movq %rax, (%rdi) pop %rdi subq %rdi, %rax - jmp .L.while.start.65 -.L.while.end.65: - leaq (%rsp), %rax - push %rax + jmp .L.while.start.84 +.L.while.end.84: .data -.L.str.80: +.L.str.95: .byte 9 .byte 46 .byte 98 @@ -4931,17 +6357,15 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.80(%rip), %rax + leaq .L.str.95(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.81: +.L.str.96: .byte 46 .byte 116 .byte 101 @@ -4950,20 +6374,21 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.81(%rip), %rax + leaq .L.str.96(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq -4(%rbp), %rax movslq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.82: +.L.str.97: .byte 9 .byte 108 .byte 101 @@ -4994,20 +6419,20 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.82(%rip), %rax + leaq .L.str.97(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.64 -.L.else.64: -.L.end.64: + jmp .L.end.83 +.L.else.83: +.L.end.83: movq $13, %rax push %rax leaq 24(%rbp), %rax @@ -5019,7 +6444,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.66 + jne .L.else.85 leaq 24(%rbp), %rax movq (%rax), %rax addq $60, %rax @@ -5027,8 +6452,9 @@ gen_expr: push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.83: +.L.str.98: .byte 9 .byte 109 .byte 111 @@ -5047,20 +6473,20 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.83(%rip), %rax + leaq .L.str.98(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.66 -.L.else.66: -.L.end.66: + jmp .L.end.85 +.L.else.85: +.L.end.85: movq $17, %rax push %rax leaq 24(%rbp), %rax @@ -5072,7 +6498,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.67 + jne .L.else.86 leaq 24(%rbp), %rax movq (%rax), %rax addq $4, %rax @@ -5086,10 +6512,8 @@ gen_expr: movq $0, %rax callq *%r10 addq $16, %rsp - leaq (%rsp), %rax - push %rax .data -.L.str.84: +.L.str.99: .byte 9 .byte 112 .byte 117 @@ -5103,13 +6527,13 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.84(%rip), %rax + leaq .L.str.99(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq 24(%rbp), %rax movq (%rax), %rax addq $12, %rax @@ -5123,10 +6547,8 @@ gen_expr: movq $0, %rax callq *%r10 addq $16, %rsp - leaq (%rsp), %rax - push %rax .data -.L.str.85: +.L.str.100: .byte 9 .byte 112 .byte 111 @@ -5139,13 +6561,13 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.85(%rip), %rax + leaq .L.str.100(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq 24(%rbp), %rax movq (%rax), %rax addq $80, %rax @@ -5160,9 +6582,9 @@ gen_expr: movq %rbp, %rsp pop %rbp retq - jmp .L.end.67 -.L.else.67: -.L.end.67: + jmp .L.end.86 +.L.else.86: +.L.end.86: movq $14, %rax push %rax leaq 24(%rbp), %rax @@ -5174,7 +6596,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.68 + jne .L.else.87 leaq 24(%rbp), %rax movq (%rax), %rax push %rax @@ -5203,9 +6625,9 @@ gen_expr: movq %rbp, %rsp pop %rbp retq - jmp .L.end.68 -.L.else.68: -.L.end.68: + jmp .L.end.87 +.L.else.87: +.L.end.87: movq $25, %rax push %rax leaq 24(%rbp), %rax @@ -5217,7 +6639,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.69 + jne .L.else.88 leaq -16(%rbp), %rax push %rax movq $0, %rax @@ -5260,10 +6682,8 @@ gen_expr: movq $0, %rax callq *%r10 addq $16, %rsp - leaq (%rsp), %rax - push %rax .data -.L.str.86: +.L.str.101: .byte 9 .byte 109 .byte 111 @@ -5283,17 +6703,15 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.86(%rip), %rax + leaq .L.str.101(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.87: +.L.str.102: .byte 9 .byte 109 .byte 111 @@ -5311,17 +6729,15 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.87(%rip), %rax + leaq .L.str.102(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.88: +.L.str.103: .byte 9 .byte 99 .byte 97 @@ -5337,20 +6753,21 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.88(%rip), %rax + leaq .L.str.103(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq -16(%rbp), %rax movslq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.89: +.L.str.104: .byte 9 .byte 97 .byte 100 @@ -5369,13 +6786,13 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.89(%rip), %rax + leaq .L.str.104(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp movq $4, %rax push %rax leaq 24(%rbp), %rax @@ -5389,11 +6806,9 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.70 - leaq (%rsp), %rax - push %rax + jne .L.else.89 .data -.L.str.90: +.L.str.105: .byte 9 .byte 109 .byte 111 @@ -5413,15 +6828,15 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.90(%rip), %rax + leaq .L.str.105(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.70 -.L.else.70: + addq $8, %rsp + jmp .L.end.89 +.L.else.89: movq $3, %rax push %rax leaq 24(%rbp), %rax @@ -5435,11 +6850,9 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.71 - leaq (%rsp), %rax - push %rax + jne .L.else.90 .data -.L.str.91: +.L.str.106: .byte 9 .byte 109 .byte 111 @@ -5460,15 +6873,15 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.91(%rip), %rax + leaq .L.str.106(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.71 -.L.else.71: + addq $8, %rsp + jmp .L.end.90 +.L.else.90: movq $11, %rax push %rax leaq 24(%rbp), %rax @@ -5482,11 +6895,9 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.72 - leaq (%rsp), %rax - push %rax + jne .L.else.91 .data -.L.str.92: +.L.str.107: .byte 9 .byte 109 .byte 111 @@ -5507,15 +6918,15 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.92(%rip), %rax + leaq .L.str.107(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.72 -.L.else.72: + addq $8, %rsp + jmp .L.end.91 +.L.else.91: movq $2, %rax push %rax leaq 24(%rbp), %rax @@ -5529,11 +6940,9 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.73 - leaq (%rsp), %rax - push %rax + jne .L.else.92 .data -.L.str.93: +.L.str.108: .byte 9 .byte 109 .byte 111 @@ -5554,15 +6963,15 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.93(%rip), %rax + leaq .L.str.108(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.73 -.L.else.73: + addq $8, %rsp + jmp .L.end.92 +.L.else.92: movq $10, %rax push %rax leaq 24(%rbp), %rax @@ -5576,11 +6985,9 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.74 - leaq (%rsp), %rax - push %rax + jne .L.else.93 .data -.L.str.94: +.L.str.109: .byte 9 .byte 109 .byte 111 @@ -5601,27 +7008,27 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.94(%rip), %rax + leaq .L.str.109(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.74 -.L.else.74: -.L.end.74: -.L.end.73: -.L.end.72: -.L.end.71: -.L.end.70: + addq $8, %rsp + jmp .L.end.93 +.L.else.93: +.L.end.93: +.L.end.92: +.L.end.91: +.L.end.90: +.L.end.89: movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.69 -.L.else.69: -.L.end.69: + jmp .L.end.88 +.L.else.88: +.L.end.88: movq $22, %rax push %rax leaq 24(%rbp), %rax @@ -5633,7 +7040,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.75 + jne .L.else.94 leaq 24(%rbp), %rax movq (%rax), %rax addq $4, %rax @@ -5651,9 +7058,9 @@ gen_expr: movq %rbp, %rsp pop %rbp retq - jmp .L.end.75 -.L.else.75: -.L.end.75: + jmp .L.end.94 +.L.else.94: +.L.end.94: movq $19, %rax push %rax leaq 24(%rbp), %rax @@ -5665,7 +7072,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.76 + jne .L.else.95 leaq 24(%rbp), %rax movq (%rax), %rax addq $4, %rax @@ -5683,9 +7090,9 @@ gen_expr: movq %rbp, %rsp pop %rbp retq - jmp .L.end.76 -.L.else.76: -.L.end.76: + jmp .L.end.95 +.L.else.95: +.L.end.95: movq $20, %rax push %rax leaq 24(%rbp), %rax @@ -5697,7 +7104,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.77 + jne .L.else.96 leaq 24(%rbp), %rax movq (%rax), %rax addq $4, %rax @@ -5728,9 +7135,9 @@ gen_expr: movq %rbp, %rsp pop %rbp retq - jmp .L.end.77 -.L.else.77: -.L.end.77: + jmp .L.end.96 +.L.else.96: +.L.end.96: movq $5, %rax push %rax leaq 24(%rbp), %rax @@ -5742,7 +7149,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.78 + jne .L.else.97 leaq 24(%rbp), %rax movq (%rax), %rax addq $4, %rax @@ -5756,10 +7163,8 @@ gen_expr: movq $0, %rax callq *%r10 addq $16, %rsp - leaq (%rsp), %rax - push %rax .data -.L.str.95: +.L.str.110: .byte 9 .byte 99 .byte 109 @@ -5777,17 +7182,15 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.95(%rip), %rax + leaq .L.str.110(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.96: +.L.str.111: .byte 9 .byte 115 .byte 101 @@ -5800,17 +7203,15 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.96(%rip), %rax + leaq .L.str.111(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.97: +.L.str.112: .byte 9 .byte 109 .byte 111 @@ -5831,20 +7232,20 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.97(%rip), %rax + leaq .L.str.112(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.78 -.L.else.78: -.L.end.78: + jmp .L.end.97 +.L.else.97: +.L.end.97: movq $0, %rax push %rax leaq 24(%rbp), %rax @@ -5856,7 +7257,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.79 + jne .L.else.98 leaq 24(%rbp), %rax movq (%rax), %rax addq $12, %rax @@ -5881,13 +7282,13 @@ gen_expr: movq (%rax), %rax push %rax .data -.L.str.98: +.L.str.113: .byte 97 .byte 100 .byte 100 .byte 0 .text - leaq .L.str.98(%rip), %rax + leaq .L.str.113(%rip), %rax push %rax leaq gen_binop(%rip), %rax movq %rax, %r10 @@ -5898,9 +7299,9 @@ gen_expr: movq %rbp, %rsp pop %rbp retq - jmp .L.end.79 -.L.else.79: -.L.end.79: + jmp .L.end.98 +.L.else.98: +.L.end.98: movq $30, %rax push %rax leaq 24(%rbp), %rax @@ -5912,7 +7313,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.80 + jne .L.else.99 leaq 24(%rbp), %rax movq (%rax), %rax addq $12, %rax @@ -5931,10 +7332,8 @@ gen_expr: movq $0, %rax callq *%r10 addq $24, %rsp - leaq (%rsp), %rax - push %rax .data -.L.str.99: +.L.str.114: .byte 9 .byte 109 .byte 111 @@ -5954,13 +7353,13 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.99(%rip), %rax + leaq .L.str.114(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq 24(%rbp), %rax movq (%rax), %rax addq $4, %rax @@ -5976,8 +7375,9 @@ gen_expr: push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.100: +.L.str.115: .byte 9 .byte 115 .byte 104 @@ -5993,20 +7393,20 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.100(%rip), %rax + leaq .L.str.115(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.80 -.L.else.80: -.L.end.80: + jmp .L.end.99 +.L.else.99: +.L.end.99: movq $31, %rax push %rax leaq 24(%rbp), %rax @@ -6018,7 +7418,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.81 + jne .L.else.100 leaq 24(%rbp), %rax movq (%rax), %rax addq $12, %rax @@ -6037,10 +7437,8 @@ gen_expr: movq $0, %rax callq *%r10 addq $24, %rsp - leaq (%rsp), %rax - push %rax .data -.L.str.101: +.L.str.116: .byte 9 .byte 109 .byte 111 @@ -6060,13 +7458,13 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.101(%rip), %rax + leaq .L.str.116(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq 24(%rbp), %rax movq (%rax), %rax addq $4, %rax @@ -6082,8 +7480,9 @@ gen_expr: push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.102: +.L.str.117: .byte 9 .byte 115 .byte 104 @@ -6099,20 +7498,20 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.102(%rip), %rax + leaq .L.str.117(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.81 -.L.else.81: -.L.end.81: + jmp .L.end.100 +.L.else.100: +.L.end.100: movq $1, %rax push %rax leaq 24(%rbp), %rax @@ -6124,7 +7523,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.82 + jne .L.else.101 leaq 24(%rbp), %rax movq (%rax), %rax addq $12, %rax @@ -6149,13 +7548,13 @@ gen_expr: movq (%rax), %rax push %rax .data -.L.str.103: +.L.str.118: .byte 115 .byte 117 .byte 98 .byte 0 .text - leaq .L.str.103(%rip), %rax + leaq .L.str.118(%rip), %rax push %rax leaq gen_binop(%rip), %rax movq %rax, %r10 @@ -6166,9 +7565,9 @@ gen_expr: movq %rbp, %rsp pop %rbp retq - jmp .L.end.82 -.L.else.82: -.L.end.82: + jmp .L.end.101 +.L.else.101: +.L.end.101: movq $2, %rax push %rax leaq 24(%rbp), %rax @@ -6180,7 +7579,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.83 + jne .L.else.102 leaq 24(%rbp), %rax movq (%rax), %rax addq $12, %rax @@ -6205,14 +7604,14 @@ gen_expr: movq (%rax), %rax push %rax .data -.L.str.104: +.L.str.119: .byte 105 .byte 109 .byte 117 .byte 108 .byte 0 .text - leaq .L.str.104(%rip), %rax + leaq .L.str.119(%rip), %rax push %rax leaq gen_binop(%rip), %rax movq %rax, %r10 @@ -6223,9 +7622,9 @@ gen_expr: movq %rbp, %rsp pop %rbp retq - jmp .L.end.83 -.L.else.83: -.L.end.83: + jmp .L.end.102 +.L.else.102: +.L.end.102: movq $3, %rax push %rax leaq 24(%rbp), %rax @@ -6237,7 +7636,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $0, %rax - jne .L.true.85 + jne .L.true.104 movq $4, %rax push %rax leaq 24(%rbp), %rax @@ -6249,14 +7648,14 @@ gen_expr: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.85 + jne .L.true.104 mov $0, %rax - jmp .L.end.85 -.L.true.85: + jmp .L.end.104 +.L.true.104: mov $1, %rax -.L.end.85: +.L.end.104: cmpq $1, %rax - jne .L.else.84 + jne .L.else.103 leaq 24(%rbp), %rax movq (%rax), %rax addq $12, %rax @@ -6282,7 +7681,7 @@ gen_expr: addq $49, %rax movsbl (%rax), %eax cmpq $1, %rax - jne .L.else.86 + jne .L.else.105 movq $8, %rax push %rax leaq 24(%rbp), %rax @@ -6296,11 +7695,9 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.87 - leaq (%rsp), %rax - push %rax + jne .L.else.106 .data -.L.str.105: +.L.str.120: .byte 9 .byte 109 .byte 111 @@ -6317,17 +7714,15 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.105(%rip), %rax + leaq .L.str.120(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.106: +.L.str.121: .byte 9 .byte 100 .byte 105 @@ -6341,19 +7736,17 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.106(%rip), %rax + leaq .L.str.121(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.87 -.L.else.87: - leaq (%rsp), %rax - push %rax + addq $8, %rsp + jmp .L.end.106 +.L.else.106: .data -.L.str.107: +.L.str.122: .byte 9 .byte 109 .byte 111 @@ -6370,17 +7763,15 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.107(%rip), %rax + leaq .L.str.122(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax + addq $8, %rsp .data -.L.str.108: +.L.str.123: .byte 9 .byte 100 .byte 105 @@ -6394,16 +7785,16 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.108(%rip), %rax + leaq .L.str.123(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp -.L.end.87: - jmp .L.end.86 -.L.else.86: + addq $8, %rsp +.L.end.106: + jmp .L.end.105 +.L.else.105: movq $8, %rax push %rax leaq 24(%rbp), %rax @@ -6419,11 +7810,9 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.88 - leaq (%rsp), %rax - push %rax + jne .L.else.107 .data -.L.str.109: +.L.str.124: .byte 9 .byte 99 .byte 113 @@ -6432,19 +7821,17 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.109(%rip), %rax + leaq .L.str.124(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.88 -.L.else.88: - leaq (%rsp), %rax - push %rax + addq $8, %rsp + jmp .L.end.107 +.L.else.107: .data -.L.str.110: +.L.str.125: .byte 9 .byte 99 .byte 108 @@ -6453,14 +7840,14 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.110(%rip), %rax + leaq .L.str.125(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp -.L.end.88: + addq $8, %rsp +.L.end.107: movq $8, %rax push %rax leaq 24(%rbp), %rax @@ -6474,11 +7861,9 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.89 - leaq (%rsp), %rax - push %rax + jne .L.else.108 .data -.L.str.111: +.L.str.126: .byte 9 .byte 105 .byte 100 @@ -6493,19 +7878,17 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.111(%rip), %rax + leaq .L.str.126(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.89 -.L.else.89: - leaq (%rsp), %rax - push %rax + addq $8, %rsp + jmp .L.end.108 +.L.else.108: .data -.L.str.112: +.L.str.127: .byte 9 .byte 105 .byte 100 @@ -6520,15 +7903,15 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.112(%rip), %rax + leaq .L.str.127(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp -.L.end.89: -.L.end.86: + addq $8, %rsp +.L.end.108: +.L.end.105: movq $4, %rax push %rax leaq 24(%rbp), %rax @@ -6540,11 +7923,9 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.90 - leaq (%rsp), %rax - push %rax + jne .L.else.109 .data -.L.str.113: +.L.str.128: .byte 9 .byte 109 .byte 111 @@ -6564,23 +7945,23 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.113(%rip), %rax + leaq .L.str.128(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.90 -.L.else.90: -.L.end.90: + addq $8, %rsp + jmp .L.end.109 +.L.else.109: +.L.end.109: movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.84 -.L.else.84: -.L.end.84: + jmp .L.end.103 +.L.else.103: +.L.end.103: movq $7, %rax push %rax leaq 24(%rbp), %rax @@ -6592,7 +7973,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.91 + jne .L.else.110 leaq 24(%rbp), %rax movq (%rax), %rax addq $12, %rax @@ -6617,23 +7998,21 @@ gen_expr: movq (%rax), %rax push %rax .data -.L.str.114: +.L.str.129: .byte 99 .byte 109 .byte 112 .byte 0 .text - leaq .L.str.114(%rip), %rax + leaq .L.str.129(%rip), %rax push %rax leaq gen_binop(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $16, %rsp - leaq (%rsp), %rax - push %rax .data -.L.str.115: +.L.str.130: .byte 9 .byte 115 .byte 101 @@ -6646,13 +8025,13 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.115(%rip), %rax + leaq .L.str.130(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq 24(%rbp), %rax movq (%rax), %rax addq $80, %rax @@ -6667,9 +8046,9 @@ gen_expr: movq %rbp, %rsp pop %rbp retq - jmp .L.end.91 -.L.else.91: -.L.end.91: + jmp .L.end.110 +.L.else.110: +.L.end.110: movq $6, %rax push %rax leaq 24(%rbp), %rax @@ -6681,7 +8060,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.92 + jne .L.else.111 leaq 24(%rbp), %rax movq (%rax), %rax addq $12, %rax @@ -6706,23 +8085,21 @@ gen_expr: movq (%rax), %rax push %rax .data -.L.str.116: +.L.str.131: .byte 99 .byte 109 .byte 112 .byte 0 .text - leaq .L.str.116(%rip), %rax + leaq .L.str.131(%rip), %rax push %rax leaq gen_binop(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $16, %rsp - leaq (%rsp), %rax - push %rax .data -.L.str.117: +.L.str.132: .byte 9 .byte 115 .byte 101 @@ -6736,13 +8113,13 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.117(%rip), %rax + leaq .L.str.132(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq 24(%rbp), %rax movq (%rax), %rax addq $80, %rax @@ -6757,9 +8134,9 @@ gen_expr: movq %rbp, %rsp pop %rbp retq - jmp .L.end.92 -.L.else.92: -.L.end.92: + jmp .L.end.111 +.L.else.111: +.L.end.111: movq $26, %rax push %rax leaq 24(%rbp), %rax @@ -6771,7 +8148,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.93 + jne .L.else.112 leaq -4(%rbp), %rax push %rax movq $1, %rax @@ -6807,10 +8184,8 @@ gen_expr: movq $0, %rax callq *%r10 addq $16, %rsp - leaq (%rsp), %rax - push %rax .data -.L.str.118: +.L.str.133: .byte 9 .byte 99 .byte 109 @@ -6828,20 +8203,21 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.118(%rip), %rax + leaq .L.str.133(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq -4(%rbp), %rax movslq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.119: +.L.str.134: .byte 9 .byte 106 .byte 101 @@ -6860,13 +8236,13 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.119(%rip), %rax + leaq .L.str.134(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp leaq 24(%rbp), %rax movq (%rax), %rax addq $12, %rax @@ -6880,10 +8256,8 @@ gen_expr: movq $0, %rax callq *%r10 addq $16, %rsp - leaq (%rsp), %rax - push %rax .data -.L.str.120: +.L.str.135: .byte 9 .byte 99 .byte 109 @@ -6901,20 +8275,21 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.120(%rip), %rax + leaq .L.str.135(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq -4(%rbp), %rax movslq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.121: +.L.str.136: .byte 9 .byte 106 .byte 101 @@ -6933,17 +8308,15 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.121(%rip), %rax + leaq .L.str.136(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp - leaq (%rsp), %rax - push %rax + addq $32, %rsp .data -.L.str.122: +.L.str.137: .byte 9 .byte 109 .byte 111 @@ -6961,20 +8334,21 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.122(%rip), %rax + leaq .L.str.137(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq -4(%rbp), %rax movslq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.123: +.L.str.138: .byte 9 .byte 106 .byte 109 @@ -6992,20 +8366,21 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.123(%rip), %rax + leaq .L.str.138(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp leaq -4(%rbp), %rax movslq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.124: +.L.str.139: .byte 46 .byte 76 .byte 46 @@ -7021,17 +8396,15 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.124(%rip), %rax + leaq .L.str.139(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp - leaq (%rsp), %rax - push %rax + addq $32, %rsp .data -.L.str.125: +.L.str.140: .byte 9 .byte 109 .byte 111 @@ -7049,20 +8422,21 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.125(%rip), %rax + leaq .L.str.140(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq -4(%rbp), %rax movslq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.126: +.L.str.141: .byte 46 .byte 76 .byte 46 @@ -7076,20 +8450,20 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.126(%rip), %rax + leaq .L.str.141(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.93 -.L.else.93: -.L.end.93: + jmp .L.end.112 +.L.else.112: +.L.end.112: movq $27, %rax push %rax leaq 24(%rbp), %rax @@ -7101,7 +8475,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.94 + jne .L.else.113 leaq -4(%rbp), %rax push %rax movq $1, %rax @@ -7137,10 +8511,8 @@ gen_expr: movq $0, %rax callq *%r10 addq $16, %rsp - leaq (%rsp), %rax - push %rax .data -.L.str.127: +.L.str.142: .byte 9 .byte 99 .byte 109 @@ -7158,20 +8530,21 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.127(%rip), %rax + leaq .L.str.142(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq -4(%rbp), %rax movslq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.128: +.L.str.143: .byte 9 .byte 106 .byte 110 @@ -7190,13 +8563,13 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.128(%rip), %rax + leaq .L.str.143(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp leaq 24(%rbp), %rax movq (%rax), %rax addq $12, %rax @@ -7210,10 +8583,8 @@ gen_expr: movq $0, %rax callq *%r10 addq $16, %rsp - leaq (%rsp), %rax - push %rax .data -.L.str.129: +.L.str.144: .byte 9 .byte 99 .byte 109 @@ -7230,20 +8601,21 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.129(%rip), %rax + leaq .L.str.144(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq -4(%rbp), %rax movslq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.130: +.L.str.145: .byte 9 .byte 106 .byte 110 @@ -7262,17 +8634,15 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.130(%rip), %rax + leaq .L.str.145(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp - leaq (%rsp), %rax - push %rax + addq $32, %rsp .data -.L.str.131: +.L.str.146: .byte 9 .byte 109 .byte 111 @@ -7289,20 +8659,21 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.131(%rip), %rax + leaq .L.str.146(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq -4(%rbp), %rax movslq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.132: +.L.str.147: .byte 9 .byte 106 .byte 109 @@ -7320,20 +8691,21 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.132(%rip), %rax + leaq .L.str.147(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp leaq -4(%rbp), %rax movslq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.133: +.L.str.148: .byte 46 .byte 76 .byte 46 @@ -7348,17 +8720,15 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.133(%rip), %rax + leaq .L.str.148(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp - leaq (%rsp), %rax - push %rax + addq $32, %rsp .data -.L.str.134: +.L.str.149: .byte 9 .byte 109 .byte 111 @@ -7375,20 +8745,21 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.134(%rip), %rax + leaq .L.str.149(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp leaq -4(%rbp), %rax movslq (%rax), %rax push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.135: +.L.str.150: .byte 46 .byte 76 .byte 46 @@ -7402,20 +8773,20 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.135(%rip), %rax + leaq .L.str.150(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $32, %rsp movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.94 -.L.else.94: -.L.end.94: + jmp .L.end.113 +.L.else.113: +.L.end.113: movq $10, %rax push %rax leaq 24(%rbp), %rax @@ -7427,7 +8798,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.95 + jne .L.else.114 leaq 24(%rbp), %rax movq (%rax), %rax addq $12, %rax @@ -7452,13 +8823,13 @@ gen_expr: movq (%rax), %rax push %rax .data -.L.str.136: +.L.str.151: .byte 99 .byte 109 .byte 112 .byte 0 .text - leaq .L.str.136(%rip), %rax + leaq .L.str.151(%rip), %rax push %rax leaq gen_binop(%rip), %rax movq %rax, %r10 @@ -7474,11 +8845,9 @@ gen_expr: addq $49, %rax movsbl (%rax), %eax cmpq $1, %rax - jne .L.else.96 - leaq (%rsp), %rax - push %rax + jne .L.else.115 .data -.L.str.137: +.L.str.152: .byte 9 .byte 115 .byte 101 @@ -7492,19 +8861,17 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.137(%rip), %rax + leaq .L.str.152(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.96 -.L.else.96: - leaq (%rsp), %rax - push %rax + addq $8, %rsp + jmp .L.end.115 +.L.else.115: .data -.L.str.138: +.L.str.153: .byte 9 .byte 115 .byte 101 @@ -7518,139 +8885,14 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.138(%rip), %rax + leaq .L.str.153(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp -.L.end.96: - leaq 24(%rbp), %rax - movq (%rax), %rax - addq $80, %rax - movq (%rax), %rax - push %rax - leaq gen_condition_store(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 addq $8, %rsp - movq $0, %rax - movq %rbp, %rsp - pop %rbp - retq - jmp .L.end.95 -.L.else.95: -.L.end.95: - movq $11, %rax - push %rax - leaq 24(%rbp), %rax - movq (%rax), %rax - addq $0, %rax - movslq (%rax), %rax - pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.else.97 - leaq 24(%rbp), %rax - movq (%rax), %rax - addq $12, %rax - movq (%rax), %rax - push %rax - leaq 24(%rbp), %rax - movq (%rax), %rax - addq $4, %rax - movq (%rax), %rax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - push %rax - leaq gen_lhs_rhs(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $24, %rsp - leaq 24(%rbp), %rax - movq (%rax), %rax - addq $80, %rax - movq (%rax), %rax - push %rax -.data -.L.str.139: - .byte 99 - .byte 109 - .byte 112 - .byte 0 -.text - leaq .L.str.139(%rip), %rax - push %rax - leaq gen_binop(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - leaq 24(%rbp), %rax - movq (%rax), %rax - addq $4, %rax - movq (%rax), %rax - addq $80, %rax - movq (%rax), %rax - addq $49, %rax - movsbl (%rax), %eax - cmpq $1, %rax - jne .L.else.98 - leaq (%rsp), %rax - push %rax -.data -.L.str.140: - .byte 9 - .byte 115 - .byte 101 - .byte 116 - .byte 97 - .byte 32 - .byte 37 - .byte 97 - .byte 108 - .byte 10 - .byte 0 -.text - leaq .L.str.140(%rip), %rax - push %rax - leaq printf(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - jmp .L.end.98 -.L.else.98: - leaq (%rsp), %rax - push %rax -.data -.L.str.141: - .byte 9 - .byte 115 - .byte 101 - .byte 116 - .byte 103 - .byte 32 - .byte 37 - .byte 97 - .byte 108 - .byte 10 - .byte 0 -.text - leaq .L.str.141(%rip), %rax - push %rax - leaq printf(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp -.L.end.98: +.L.end.115: leaq 24(%rbp), %rax movq (%rax), %rax addq $80, %rax @@ -7665,10 +8907,10 @@ gen_expr: movq %rbp, %rsp pop %rbp retq - jmp .L.end.97 -.L.else.97: -.L.end.97: - movq $8, %rax + jmp .L.end.114 +.L.else.114: +.L.end.114: + movq $11, %rax push %rax leaq 24(%rbp), %rax movq (%rax), %rax @@ -7679,7 +8921,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.99 + jne .L.else.116 leaq 24(%rbp), %rax movq (%rax), %rax addq $12, %rax @@ -7704,13 +8946,13 @@ gen_expr: movq (%rax), %rax push %rax .data -.L.str.142: +.L.str.154: .byte 99 .byte 109 .byte 112 .byte 0 .text - leaq .L.str.142(%rip), %rax + leaq .L.str.154(%rip), %rax push %rax leaq gen_binop(%rip), %rax movq %rax, %r10 @@ -7726,17 +8968,14 @@ gen_expr: addq $49, %rax movsbl (%rax), %eax cmpq $1, %rax - jne .L.else.100 - leaq (%rsp), %rax - push %rax + jne .L.else.117 .data -.L.str.143: +.L.str.155: .byte 9 .byte 115 .byte 101 .byte 116 - .byte 98 - .byte 101 + .byte 97 .byte 32 .byte 37 .byte 97 @@ -7744,25 +8983,22 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.143(%rip), %rax + leaq .L.str.155(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.100 -.L.else.100: - leaq (%rsp), %rax - push %rax + addq $8, %rsp + jmp .L.end.117 +.L.else.117: .data -.L.str.144: +.L.str.156: .byte 9 .byte 115 .byte 101 .byte 116 - .byte 108 - .byte 101 + .byte 103 .byte 32 .byte 37 .byte 97 @@ -7770,14 +9006,14 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.144(%rip), %rax + leaq .L.str.156(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp -.L.end.100: + addq $8, %rsp +.L.end.117: leaq 24(%rbp), %rax movq (%rax), %rax addq $80, %rax @@ -7792,10 +9028,10 @@ gen_expr: movq %rbp, %rsp pop %rbp retq - jmp .L.end.99 -.L.else.99: -.L.end.99: - movq $9, %rax + jmp .L.end.116 +.L.else.116: +.L.end.116: + movq $8, %rax push %rax leaq 24(%rbp), %rax movq (%rax), %rax @@ -7806,7 +9042,7 @@ gen_expr: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.101 + jne .L.else.118 leaq 24(%rbp), %rax movq (%rax), %rax addq $12, %rax @@ -7831,13 +9067,13 @@ gen_expr: movq (%rax), %rax push %rax .data -.L.str.145: +.L.str.157: .byte 99 .byte 109 .byte 112 .byte 0 .text - leaq .L.str.145(%rip), %rax + leaq .L.str.157(%rip), %rax push %rax leaq gen_binop(%rip), %rax movq %rax, %r10 @@ -7853,16 +9089,15 @@ gen_expr: addq $49, %rax movsbl (%rax), %eax cmpq $1, %rax - jne .L.else.102 - leaq (%rsp), %rax - push %rax + jne .L.else.119 .data -.L.str.146: +.L.str.158: .byte 9 .byte 115 .byte 101 .byte 116 .byte 98 + .byte 101 .byte 32 .byte 37 .byte 97 @@ -7870,24 +9105,23 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.146(%rip), %rax + leaq .L.str.158(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.102 -.L.else.102: - leaq (%rsp), %rax - push %rax + addq $8, %rsp + jmp .L.end.119 +.L.else.119: .data -.L.str.147: +.L.str.159: .byte 9 .byte 115 .byte 101 .byte 116 .byte 108 + .byte 101 .byte 32 .byte 37 .byte 97 @@ -7895,14 +9129,14 @@ gen_expr: .byte 10 .byte 0 .text - leaq .L.str.147(%rip), %rax + leaq .L.str.159(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp -.L.end.102: + addq $8, %rsp +.L.end.119: leaq 24(%rbp), %rax movq (%rax), %rax addq $80, %rax @@ -7917,299 +9151,187 @@ gen_expr: movq %rbp, %rsp pop %rbp retq - jmp .L.end.101 -.L.else.101: -.L.end.101: + jmp .L.end.118 +.L.else.118: +.L.end.118: + movq $9, %rax + push %rax leaq 24(%rbp), %rax movq (%rax), %rax addq $0, %rax movslq (%rax), %rax - push %rax - leaq (%rsp), %rax - push %rax -.data -.L.str.148: - .byte 107 - .byte 105 - .byte 110 - .byte 100 - .byte 58 - .byte 32 - .byte 37 - .byte 100 - .byte 32 - .byte 117 - .byte 110 - .byte 114 - .byte 101 - .byte 97 - .byte 99 - .byte 104 - .byte 97 - .byte 98 - .byte 108 - .byte 101 - .byte 10 - .byte 0 -.text - leaq .L.str.148(%rip), %rax - push %rax - leaq printf(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $24, %rsp - movq $1, %rax - push %rax - leaq exit(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp - leave - ret -.global new_gen -new_gen: - push %rbp - movq %rsp, %rbp - subq $16, %rsp - leaq -8(%rbp), %rax - push %rax - movq $26, %rax - push %rax - leaq alloc(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp pop %rdi - movq %rax, (%rdi) - leaq -8(%rbp), %rax + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.120 + leaq 24(%rbp), %rax movq (%rax), %rax - addq $17, %rax - push %rax - movq $0, %rax - pop %rdi - movb %al, (%rdi) - leaq -8(%rbp), %rax + addq $12, %rax movq (%rax), %rax - addq $0, %rax push %rax - movq $0, %rax - pop %rdi - movl %eax, (%rdi) - leaq -8(%rbp), %rax + leaq 24(%rbp), %rax movq (%rax), %rax addq $4, %rax - push %rax - movq $0, %rax - pop %rdi - movl %eax, (%rdi) - leaq -8(%rbp), %rax - movq (%rax), %rax - movq %rbp, %rsp - pop %rbp - retq - leave - ret -.global parse -parse: - push %rbp - movq %rsp, %rbp - subq $0, %rsp -.L.while.start.103: - movq $5, %rax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $0, %rax movq (%rax), %rax - addq $0, %rax - movslq (%rax), %rax - pop %rdi - cmpl %edi, %eax - setne %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.while.end.103 -.data -.L.str.149: - .byte 102 - .byte 117 - .byte 110 - .byte 99 - .byte 0 -.text - leaq .L.str.149(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $0, %rax - movq (%rax), %rax - addq $28, %rax - movq (%rax), %rax push %rax - leaq strcmp(%rip), %rax + leaq gen_lhs_rhs(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - movzx %al, %eax - cmpq $1, %rax - jne .L.else.104 - leaq 16(%rbp), %rax + addq $24, %rsp + leaq 24(%rbp), %rax + movq (%rax), %rax + addq $80, %rax movq (%rax), %rax push %rax - leaq parse_func(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp - jmp .L.end.104 -.L.else.104: .data -.L.str.150: - .byte 115 - .byte 116 - .byte 114 - .byte 117 +.L.str.160: .byte 99 - .byte 116 + .byte 109 + .byte 112 .byte 0 .text - leaq .L.str.150(%rip), %rax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $0, %rax - movq (%rax), %rax - addq $28, %rax - movq (%rax), %rax + leaq .L.str.160(%rip), %rax push %rax - leaq strcmp(%rip), %rax + leaq gen_binop(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $16, %rsp - movzx %al, %eax - cmpq $1, %rax - jne .L.else.105 - leaq 16(%rbp), %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + addq $4, %rax movq (%rax), %rax + addq $80, %rax + movq (%rax), %rax + addq $49, %rax + movsbl (%rax), %eax + cmpq $1, %rax + jne .L.else.121 +.data +.L.str.161: + .byte 9 + .byte 115 + .byte 101 + .byte 116 + .byte 98 + .byte 32 + .byte 37 + .byte 97 + .byte 108 + .byte 10 + .byte 0 +.text + leaq .L.str.161(%rip), %rax push %rax - leaq parse_struct(%rip), %rax + leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.105 -.L.else.105: + jmp .L.end.121 +.L.else.121: .data -.L.str.151: - .byte 110 - .byte 111 - .byte 110 - .byte 45 - .byte 100 - .byte 101 - .byte 99 - .byte 108 - .byte 97 - .byte 114 - .byte 97 - .byte 116 - .byte 105 - .byte 111 - .byte 110 - .byte 32 - .byte 115 - .byte 116 - .byte 97 - .byte 116 - .byte 101 - .byte 109 - .byte 101 - .byte 110 - .byte 116 - .byte 32 - .byte 111 - .byte 117 - .byte 116 +.L.str.162: + .byte 9 .byte 115 - .byte 105 - .byte 100 .byte 101 - .byte 32 - .byte 102 - .byte 117 - .byte 110 - .byte 99 .byte 116 - .byte 105 - .byte 111 - .byte 110 + .byte 108 .byte 32 - .byte 98 - .byte 111 - .byte 100 - .byte 121 + .byte 37 + .byte 97 + .byte 108 + .byte 10 .byte 0 .text - leaq .L.str.151(%rip), %rax + leaq .L.str.162(%rip), %rax push %rax - leaq 16(%rbp), %rax + leaq printf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp +.L.end.121: + leaq 24(%rbp), %rax movq (%rax), %rax - addq $0, %rax + addq $80, %rax movq (%rax), %rax push %rax - leaq print_error(%rip), %rax + leaq gen_condition_store(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp -.L.end.105: -.L.end.104: - jmp .L.while.start.103 -.L.while.end.103: + addq $8, %rsp movq $0, %rax movq %rbp, %rsp pop %rbp retq - leave - ret -.global parse_func -parse_func: - push %rbp - movq %rsp, %rbp - subq $64, %rsp - leaq 16(%rbp), %rax + jmp .L.end.120 +.L.else.120: +.L.end.120: + leaq 24(%rbp), %rax movq (%rax), %rax - addq $16, %rax + addq $0, %rax + movslq (%rax), %rax push %rax - movq $0, %rax - pop %rdi - movq %rax, (%rdi) + leaq (%rsp), %rax + push %rax + push $1 .data -.L.str.152: - .byte 102 +.L.str.163: + .byte 107 + .byte 105 + .byte 110 + .byte 100 + .byte 58 + .byte 32 + .byte 37 + .byte 100 + .byte 32 .byte 117 .byte 110 + .byte 114 + .byte 101 + .byte 97 .byte 99 + .byte 104 + .byte 97 + .byte 98 + .byte 108 + .byte 101 + .byte 10 .byte 0 .text - leaq .L.str.152(%rip), %rax + leaq .L.str.163(%rip), %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax + leaq printf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $32, %rsp + movq $1, %rax push %rax - leaq parser_skip(%rip), %rax + leaq exit(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp + leave + ret +.global new_gen +new_gen: + push %rbp + movq %rsp, %rbp + subq $16, %rsp leaq -8(%rbp), %rax push %rax - movq $63, %rax + movq $26, %rax push %rax leaq alloc(%rip), %rax movq %rax, %r10 @@ -8220,102 +9342,61 @@ parse_func: movq %rax, (%rdi) leaq -8(%rbp), %rax movq (%rax), %rax - addq $8, %rax + addq $17, %rax push %rax movq $0, %rax pop %rdi - movl %eax, (%rdi) - leaq -16(%rbp), %rax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $0, %rax - movq (%rax), %rax - addq $28, %rax - movq (%rax), %rax - pop %rdi - movq %rax, (%rdi) - leaq -24(%rbp), %rax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $0, %rax - movq (%rax), %rax - pop %rdi - movq %rax, (%rdi) - leaq 16(%rbp), %rax - movq (%rax), %rax - push %rax - leaq parser_next(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp + movb %al, (%rdi) leaq -8(%rbp), %rax movq (%rax), %rax addq $0, %rax push %rax - leaq -16(%rbp), %rax - movq (%rax), %rax + movq $0, %rax pop %rdi - movq %rax, (%rdi) + movl %eax, (%rdi) leaq -8(%rbp), %rax movq (%rax), %rax - addq $54, %rax - push %rax - movq $1, %rax - pop %rdi - movb %al, (%rdi) - leaq -32(%rbp), %rax - push %rax - movq $4, %rax - push %rax - leaq new_type_vec(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp - pop %rdi - movq %rax, (%rdi) - leaq -40(%rbp), %rax - push %rax - movq $4, %rax + addq $4, %rax push %rax - leaq new_object_vec(%rip), %rax - movq %rax, %r10 movq $0, %rax - callq *%r10 - addq $8, %rsp pop %rdi - movq %rax, (%rdi) - leaq -41(%rbp), %rax - push %rax - leaq -40(%rbp), %rax - movq (%rax), %rax - push %rax - leaq -32(%rbp), %rax - movq (%rax), %rax - push %rax + movl %eax, (%rdi) leaq -8(%rbp), %rax movq (%rax), %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global parse +parse: + push %rbp + movq %rsp, %rbp + subq $0, %rsp +.L.while.start.122: + movq $5, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - push %rax - leaq parse_function_params(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $32, %rsp - movzx %al, %eax + addq $0, %rax + movq (%rax), %rax + addq $0, %rax + movslq (%rax), %rax pop %rdi - movb %al, (%rdi) + cmpl %edi, %eax + setne %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.while.end.122 .data -.L.str.153: - .byte 123 +.L.str.164: + .byte 102 + .byte 117 + .byte 110 + .byte 99 .byte 0 .text - leaq .L.str.153(%rip), %rax + leaq .L.str.164(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -8330,14 +9411,29 @@ parse_func: callq *%r10 addq $16, %rsp movzx %al, %eax - cmpq $0, %rax - jne .L.true.107 + cmpq $1, %rax + jne .L.else.123 + leaq 16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq parse_func(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + jmp .L.end.123 +.L.else.123: .data -.L.str.154: - .byte 59 +.L.str.165: + .byte 115 + .byte 116 + .byte 114 + .byte 117 + .byte 99 + .byte 116 .byte 0 .text - leaq .L.str.154(%rip), %rax + leaq .L.str.165(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -8352,52 +9448,70 @@ parse_func: callq *%r10 addq $16, %rsp movzx %al, %eax - cmp $0, %rax - jne .L.true.107 - mov $0, %rax - jmp .L.end.107 -.L.true.107: - mov $1, %rax -.L.end.107: cmpq $1, %rax - jne .L.else.106 + jne .L.else.124 + leaq 16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq parse_struct(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + jmp .L.end.124 +.L.else.124: .data -.L.str.155: - .byte 102 - .byte 117 +.L.str.166: .byte 110 + .byte 111 + .byte 110 + .byte 45 + .byte 100 + .byte 101 .byte 99 + .byte 108 + .byte 97 + .byte 114 + .byte 97 .byte 116 .byte 105 .byte 111 .byte 110 .byte 32 - .byte 109 - .byte 117 .byte 115 .byte 116 - .byte 32 - .byte 104 .byte 97 - .byte 118 + .byte 116 .byte 101 - .byte 32 - .byte 97 - .byte 32 - .byte 114 + .byte 109 .byte 101 + .byte 110 .byte 116 + .byte 32 + .byte 111 .byte 117 - .byte 114 - .byte 110 + .byte 116 + .byte 115 + .byte 105 + .byte 100 + .byte 101 .byte 32 + .byte 102 + .byte 117 + .byte 110 + .byte 99 .byte 116 + .byte 105 + .byte 111 + .byte 110 + .byte 32 + .byte 98 + .byte 111 + .byte 100 .byte 121 - .byte 112 - .byte 101 .byte 0 .text - leaq .L.str.155(%rip), %rax + leaq .L.str.166(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -8409,265 +9523,146 @@ parse_func: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.106 -.L.else.106: -.L.end.106: - leaq -49(%rbp), %rax +.L.end.124: +.L.end.123: + jmp .L.while.start.122 +.L.while.end.122: + movq $0, %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global parse_func +parse_func: + push %rbp + movq %rsp, %rbp + subq $64, %rsp +.data +.L.str.167: + .byte 102 + .byte 117 + .byte 110 + .byte 99 + .byte 0 +.text + leaq .L.str.167(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq parse_ty(%rip), %rax + leaq parser_skip(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $8, %rsp - pop %rdi - movq %rax, (%rdi) - leaq -57(%rbp), %rax - push %rax - leaq -16(%rbp), %rax - movq (%rax), %rax - push %rax + addq $16, %rsp leaq 16(%rbp), %rax movq (%rax), %rax + addq $16, %rax push %rax - leaq find_globals(%rip), %rax - movq %rax, %r10 movq $0, %rax - callq *%r10 - addq $16, %rsp pop %rdi movq %rax, (%rdi) -.data -.L.str.156: - .byte 59 - .byte 0 -.text - leaq .L.str.156(%rip), %rax + leaq -8(%rbp), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $0, %rax movq (%rax), %rax - addq $28, %rax + pop %rdi + movq %rax, (%rdi) + leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq strcmp(%rip), %rax + leaq parser_next(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - movzx %al, %eax - cmpq $1, %rax - jne .L.else.108 -.data -.L.str.157: - .byte 59 - .byte 0 -.text - leaq .L.str.157(%rip), %rax + addq $8, %rsp + leaq -16(%rbp), %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax + movq $4, %rax push %rax - leaq parser_skip(%rip), %rax + leaq new_type_vec(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - movq $0, %rax - push %rax - leaq -57(%rbp), %rax - movq (%rax), %rax + addq $8, %rsp pop %rdi - cmpl %edi, %eax - setne %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.else.109 -.data -.L.str.158: - .byte 102 - .byte 117 - .byte 110 - .byte 99 - .byte 116 - .byte 105 - .byte 111 - .byte 110 - .byte 32 - .byte 105 - .byte 115 - .byte 32 - .byte 97 - .byte 108 - .byte 114 - .byte 101 - .byte 97 - .byte 100 - .byte 121 - .byte 32 - .byte 100 - .byte 101 - .byte 99 - .byte 108 - .byte 97 - .byte 114 - .byte 101 - .byte 100 - .byte 32 - .byte 115 - .byte 111 - .byte 109 - .byte 101 - .byte 119 - .byte 104 - .byte 101 - .byte 114 - .byte 101 - .byte 46 - .byte 0 -.text - leaq .L.str.158(%rip), %rax - push %rax + movq %rax, (%rdi) leaq -24(%rbp), %rax - movq (%rax), %rax push %rax - leaq print_error(%rip), %rax + movq $4, %rax + push %rax + leaq new_object_vec(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.109 -.L.else.109: -.L.end.109: - leaq -8(%rbp), %rax + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + leaq -25(%rbp), %rax + push %rax + leaq -24(%rbp), %rax movq (%rax), %rax - addq $12, %rax push %rax - leaq -41(%rbp), %rax - movsbl (%rax), %eax + leaq -16(%rbp), %rax + movq (%rax), %rax push %rax - leaq -49(%rbp), %rax + leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq -32(%rbp), %rax + leaq parse_function_params(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $24, %rsp + movzx %al, %eax + pop %rdi + movb %al, (%rdi) + leaq -33(%rbp), %rax + push %rax + leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq new_func_type(%rip), %rax + leaq parse_ty(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $8, %rsp pop %rdi movq %rax, (%rdi) - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $40, %rax + leaq -41(%rbp), %rax push %rax - movq $0, %rax - pop %rdi - movq %rax, (%rdi) leaq -8(%rbp), %rax movq (%rax), %rax - addq $52, %rax - push %rax - movq $1, %rax - pop %rdi - movb %al, (%rdi) - leaq -8(%rbp), %rax + addq $28, %rax movq (%rax), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq add_function_object(%rip), %rax + leaq find_globals(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.108 -.L.else.108: + pop %rdi + movq %rax, (%rdi) movq $0, %rax push %rax - leaq -57(%rbp), %rax + leaq -41(%rbp), %rax movq (%rax), %rax pop %rdi cmpl %edi, %eax setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.110 - leaq -57(%rbp), %rax - movq (%rax), %rax - addq $52, %rax - movsbl (%rax), %eax - cmpq $0, %rax - sete %al - movzbq %al, %rax - cmpq $1, %rax - jne .L.else.111 -.data -.L.str.159: - .byte 102 - .byte 117 - .byte 110 - .byte 99 - .byte 116 - .byte 105 - .byte 111 - .byte 110 - .byte 32 - .byte 105 - .byte 115 - .byte 32 - .byte 97 - .byte 108 - .byte 114 - .byte 101 - .byte 97 - .byte 100 - .byte 121 - .byte 32 - .byte 100 - .byte 101 - .byte 102 - .byte 105 - .byte 110 - .byte 101 - .byte 100 - .byte 32 - .byte 115 - .byte 111 - .byte 109 - .byte 101 - .byte 119 - .byte 104 - .byte 101 - .byte 114 - .byte 101 - .byte 0 -.text - leaq .L.str.159(%rip), %rax - push %rax + jne .L.else.125 leaq -24(%rbp), %rax movq (%rax), %rax push %rax - leaq print_error(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - jmp .L.end.111 -.L.else.111: -.L.end.111: - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $32, %rax - movq (%rax), %rax - push %rax - leaq -57(%rbp), %rax + leaq -41(%rbp), %rax movq (%rax), %rax addq $32, %rax movq (%rax), %rax @@ -8682,48 +9677,25 @@ parse_func: sete %al movzbq %al, %rax cmpq $1, %rax - jne .L.else.112 + jne .L.else.126 .data -.L.str.160: - .byte 102 - .byte 117 - .byte 110 - .byte 99 - .byte 116 - .byte 105 - .byte 111 - .byte 110 - .byte 32 - .byte 100 - .byte 101 - .byte 99 - .byte 108 - .byte 97 - .byte 114 - .byte 97 - .byte 116 - .byte 105 - .byte 111 - .byte 110 - .byte 32 - .byte 112 +.L.str.168: .byte 97 .byte 114 - .byte 97 + .byte 103 + .byte 117 .byte 109 - .byte 97 - .byte 116 .byte 101 - .byte 114 + .byte 110 + .byte 116 .byte 115 .byte 32 .byte 100 .byte 111 .byte 101 .byte 115 - .byte 32 .byte 110 - .byte 111 + .byte 39 .byte 116 .byte 32 .byte 109 @@ -8735,21 +9707,20 @@ parse_func: .byte 116 .byte 111 .byte 32 - .byte 100 - .byte 101 - .byte 102 - .byte 105 - .byte 110 - .byte 105 + .byte 112 + .byte 114 + .byte 111 .byte 116 - .byte 105 .byte 111 - .byte 110 + .byte 116 + .byte 121 + .byte 112 + .byte 101 .byte 0 .text - leaq .L.str.160(%rip), %rax + leaq .L.str.168(%rip), %rax push %rax - leaq -24(%rbp), %rax + leaq -8(%rbp), %rax movq (%rax), %rax push %rax leaq print_error(%rip), %rax @@ -8757,17 +9728,17 @@ parse_func: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.112 -.L.else.112: -.L.end.112: - leaq -57(%rbp), %rax + jmp .L.end.126 +.L.else.126: +.L.end.126: + leaq -41(%rbp), %rax movq (%rax), %rax addq $12, %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax push %rax - leaq -49(%rbp), %rax + leaq -33(%rbp), %rax movq (%rax), %rax push %rax leaq cmp_type(%rip), %rax @@ -8780,30 +9751,9 @@ parse_func: sete %al movzbq %al, %rax cmpq $1, %rax - jne .L.else.113 + jne .L.else.127 .data -.L.str.161: - .byte 102 - .byte 117 - .byte 110 - .byte 99 - .byte 116 - .byte 105 - .byte 111 - .byte 110 - .byte 32 - .byte 100 - .byte 101 - .byte 99 - .byte 108 - .byte 97 - .byte 114 - .byte 97 - .byte 116 - .byte 105 - .byte 111 - .byte 110 - .byte 32 +.L.str.169: .byte 114 .byte 101 .byte 116 @@ -8820,9 +9770,8 @@ parse_func: .byte 111 .byte 101 .byte 115 - .byte 32 .byte 110 - .byte 111 + .byte 39 .byte 116 .byte 32 .byte 109 @@ -8834,46 +9783,187 @@ parse_func: .byte 116 .byte 111 .byte 32 - .byte 100 - .byte 101 - .byte 102 - .byte 105 - .byte 110 - .byte 105 + .byte 112 + .byte 114 + .byte 111 .byte 116 - .byte 105 .byte 111 + .byte 116 + .byte 121 + .byte 112 + .byte 101 + .byte 0 +.text + leaq .L.str.169(%rip), %rax + push %rax + leaq -8(%rbp), %rax + movq (%rax), %rax + push %rax + leaq print_error(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp + jmp .L.end.127 +.L.else.127: +.L.end.127: + jmp .L.end.125 +.L.else.125: +.L.end.125: + leaq -49(%rbp), %rax + push %rax + movq $63, %rax + push %rax + leaq alloc(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + movq $0, %rax + push %rax + leaq -49(%rbp), %rax + movq (%rax), %rax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.128 +.data +.L.str.170: + .byte 97 + .byte 108 + .byte 108 + .byte 111 + .byte 99 + .byte 32 + .byte 114 + .byte 101 + .byte 116 + .byte 117 + .byte 114 + .byte 110 + .byte 101 + .byte 100 + .byte 32 .byte 110 + .byte 105 + .byte 108 + .byte 10 .byte 0 .text - leaq .L.str.161(%rip), %rax + leaq .L.str.170(%rip), %rax push %rax - leaq -24(%rbp), %rax + leaq eprintf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + jmp .L.end.128 +.L.else.128: +.L.end.128: +.data +.L.str.171: + .byte 59 + .byte 0 +.text + leaq .L.str.171(%rip), %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $0, %rax + movq (%rax), %rax + addq $28, %rax movq (%rax), %rax push %rax - leaq print_error(%rip), %rax + leaq strcmp(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.113 -.L.else.113: -.L.end.113: - leaq -57(%rbp), %rax - movq (%rax), %rax - addq $24, %rax + movzx %al, %eax + cmpq $1, %rax + jne .L.else.129 +.data +.L.str.172: + .byte 59 + .byte 0 +.text + leaq .L.str.172(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq parse_block(%rip), %rax + leaq parser_skip(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $8, %rsp + addq $16, %rsp + movq $0, %rax + push %rax + leaq -41(%rbp), %rax + movq (%rax), %rax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.130 + leaq -49(%rbp), %rax + movq (%rax), %rax + addq $8, %rax + push %rax + movq $0, %rax + pop %rdi + movl %eax, (%rdi) + leaq -49(%rbp), %rax + movq (%rax), %rax + addq $0, %rax + push %rax + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $28, %rax + movq (%rax), %rax pop %rdi movq %rax, (%rdi) - leaq -57(%rbp), %rax + leaq -49(%rbp), %rax + movq (%rax), %rax + addq $32, %rax + push %rax + leaq -24(%rbp), %rax + movq (%rax), %rax + pop %rdi + movq %rax, (%rdi) + leaq -49(%rbp), %rax + movq (%rax), %rax + addq $54, %rax + push %rax + movq $1, %rax + pop %rdi + movb %al, (%rdi) + leaq -49(%rbp), %rax + movq (%rax), %rax + addq $12, %rax + push %rax + leaq -25(%rbp), %rax + movsbl (%rax), %eax + push %rax + leaq -33(%rbp), %rax + movq (%rax), %rax + push %rax + leaq -16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq new_func_type(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $24, %rsp + pop %rdi + movq %rax, (%rdi) + leaq -49(%rbp), %rax movq (%rax), %rax addq $40, %rax push %rax @@ -8883,36 +9973,82 @@ parse_func: movq (%rax), %rax pop %rdi movq %rax, (%rdi) - leaq -57(%rbp), %rax + leaq -49(%rbp), %rax movq (%rax), %rax addq $52, %rax push %rax - movq $0, %rax + movq $1, %rax pop %rdi movb %al, (%rdi) - leaq -57(%rbp), %rax + leaq -49(%rbp), %rax movq (%rax), %rax - addq $32, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq add_function_object(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp + jmp .L.end.130 +.L.else.130: +.L.end.130: + jmp .L.end.129 +.L.else.129: + movq $0, %rax + push %rax + leaq -41(%rbp), %rax + movq (%rax), %rax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.131 + leaq -49(%rbp), %rax + movq (%rax), %rax + addq $8, %rax + push %rax + movq $0, %rax + pop %rdi + movl %eax, (%rdi) + leaq -49(%rbp), %rax + movq (%rax), %rax + addq $0, %rax push %rax leaq -8(%rbp), %rax movq (%rax), %rax + addq $28, %rax + movq (%rax), %rax + pop %rdi + movq %rax, (%rdi) + leaq -49(%rbp), %rax + movq (%rax), %rax addq $32, %rax + push %rax + leaq -24(%rbp), %rax movq (%rax), %rax pop %rdi movq %rax, (%rdi) - jmp .L.end.110 -.L.else.110: - leaq -8(%rbp), %rax + leaq -49(%rbp), %rax + movq (%rax), %rax + addq $54, %rax + push %rax + movq $1, %rax + pop %rdi + movb %al, (%rdi) + leaq -49(%rbp), %rax movq (%rax), %rax addq $12, %rax push %rax - leaq -41(%rbp), %rax + leaq -25(%rbp), %rax movsbl (%rax), %eax push %rax - leaq -49(%rbp), %rax + leaq -33(%rbp), %rax movq (%rax), %rax push %rax - leaq -32(%rbp), %rax + leaq -16(%rbp), %rax movq (%rax), %rax push %rax leaq new_func_type(%rip), %rax @@ -8922,7 +10058,18 @@ parse_func: addq $24, %rsp pop %rdi movq %rax, (%rdi) - leaq -8(%rbp), %rax + leaq -49(%rbp), %rax + movq (%rax), %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq add_function_object(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp + leaq -49(%rbp), %rax movq (%rax), %rax addq $24, %rax push %rax @@ -8936,7 +10083,7 @@ parse_func: addq $8, %rsp pop %rdi movq %rax, (%rdi) - leaq -8(%rbp), %rax + leaq -49(%rbp), %rax movq (%rax), %rax addq $40, %rax push %rax @@ -8946,26 +10093,101 @@ parse_func: movq (%rax), %rax pop %rdi movq %rax, (%rdi) - leaq -8(%rbp), %rax + jmp .L.end.131 +.L.else.131: + leaq -41(%rbp), %rax + movq (%rax), %rax + addq $52, %rax + movsbl (%rax), %eax + cmpq $1, %rax + jne .L.else.132 + leaq -41(%rbp), %rax movq (%rax), %rax addq $52, %rax push %rax - movq $0, %rax - pop %rdi - movb %al, (%rdi) + movq $0, %rax + pop %rdi + movb %al, (%rdi) + leaq -41(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq parse_block(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + leaq -41(%rbp), %rax + movq (%rax), %rax + addq $40, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $16, %rax + movq (%rax), %rax + pop %rdi + movq %rax, (%rdi) + jmp .L.end.132 +.L.else.132: +.data +.L.str.173: + .byte 102 + .byte 117 + .byte 110 + .byte 99 + .byte 116 + .byte 105 + .byte 111 + .byte 110 + .byte 32 + .byte 105 + .byte 115 + .byte 32 + .byte 97 + .byte 108 + .byte 114 + .byte 101 + .byte 97 + .byte 100 + .byte 121 + .byte 32 + .byte 100 + .byte 101 + .byte 102 + .byte 105 + .byte 110 + .byte 101 + .byte 100 + .byte 32 + .byte 115 + .byte 111 + .byte 109 + .byte 101 + .byte 119 + .byte 104 + .byte 101 + .byte 114 + .byte 101 + .byte 0 +.text + leaq .L.str.173(%rip), %rax + push %rax leaq -8(%rbp), %rax movq (%rax), %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - push %rax - leaq add_function_object(%rip), %rax + leaq print_error(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $16, %rsp -.L.end.110: -.L.end.108: +.L.end.132: +.L.end.131: +.L.end.129: leave ret .global add_function_object @@ -9004,11 +10226,11 @@ parse_function_params: pop %rdi movb %al, (%rdi) .data -.L.str.162: +.L.str.174: .byte 40 .byte 0 .text - leaq .L.str.162(%rip), %rax + leaq .L.str.174(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -9018,13 +10240,13 @@ parse_function_params: movq $0, %rax callq *%r10 addq $16, %rsp -.L.while.start.114: +.L.while.start.133: .data -.L.str.163: +.L.str.175: .byte 41 .byte 0 .text - leaq .L.str.163(%rip), %rax + leaq .L.str.175(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -9043,7 +10265,7 @@ parse_function_params: sete %al movzbq %al, %rax cmpq $1, %rax - jne .L.while.end.114 + jne .L.while.end.133 leaq -9(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -9079,13 +10301,13 @@ parse_function_params: pop %rdi movq %rax, (%rdi) .data -.L.str.164: +.L.str.176: .byte 46 .byte 46 .byte 46 .byte 0 .text - leaq .L.str.164(%rip), %rax + leaq .L.str.176(%rip), %rax push %rax leaq -9(%rbp), %rax movq (%rax), %rax @@ -9097,13 +10319,13 @@ parse_function_params: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.115 + jne .L.else.134 .data -.L.str.165: +.L.str.177: .byte 41 .byte 0 .text - leaq .L.str.165(%rip), %rax + leaq .L.str.177(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -9122,9 +10344,9 @@ parse_function_params: sete %al movzbq %al, %rax cmpq $1, %rax - jne .L.else.116 + jne .L.else.135 .data -.L.str.166: +.L.str.178: .byte 109 .byte 117 .byte 115 @@ -9163,7 +10385,7 @@ parse_function_params: .byte 115 .byte 0 .text - leaq .L.str.166(%rip), %rax + leaq .L.str.178(%rip), %rax push %rax leaq -17(%rbp), %rax movq (%rax), %rax @@ -9173,32 +10395,20 @@ parse_function_params: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.116 -.L.else.116: -.L.end.116: + jmp .L.end.135 +.L.else.135: +.L.end.135: leaq -1(%rbp), %rax push %rax movq $1, %rax pop %rdi movb %al, (%rdi) - leaq -25(%rbp), %rax - push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $96, %rax - movq (%rax), %rax - push %rax - leaq new_pointer_type(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp - pop %rdi - movq %rax, (%rdi) - leaq -25(%rbp), %rax + addq $48, %rax movq (%rax), %rax push %rax - leaq 32(%rbp), %rax + leaq 24(%rbp), %rax movq (%rax), %rax push %rax leaq vec_append_type(%rip), %rax @@ -9206,175 +10416,45 @@ parse_function_params: movq $0, %rax callq *%r10 addq $16, %rsp - leaq -9(%rbp), %rax - push %rax -.data -.L.str.167: - .byte 97 - .byte 114 - .byte 103 - .byte 118 - .byte 0 -.text - leaq .L.str.167(%rip), %rax - pop %rdi - movq %rax, (%rdi) movq $1, %rax push %rax leaq -17(%rbp), %rax movq (%rax), %rax push %rax - leaq -25(%rbp), %rax - movq (%rax), %rax - push %rax - leaq -9(%rbp), %rax - movq (%rax), %rax - push %rax - movq $1, %rax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - push %rax - leaq new_local_object(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $48, %rsp - push %rax - leaq 40(%rbp), %rax - movq (%rax), %rax - push %rax - leaq vec_append_object(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - jmp .L.end.115 -.L.else.115: -.data -.L.str.168: - .byte 46 - .byte 46 - .byte 46 - .byte 0 -.text - leaq .L.str.168(%rip), %rax - push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $0, %rax - movq (%rax), %rax - addq $28, %rax + addq $48, %rax movq (%rax), %rax push %rax - leaq strcmp(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - movzx %al, %eax - cmpq $1, %rax - jne .L.else.117 .data -.L.str.169: - .byte 46 - .byte 46 - .byte 46 +.L.str.179: + .byte 97 + .byte 114 + .byte 103 + .byte 99 .byte 0 .text - leaq .L.str.169(%rip), %rax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax + leaq .L.str.179(%rip), %rax push %rax - leaq parser_skip(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp -.data -.L.str.170: - .byte 41 - .byte 0 -.text - leaq .L.str.170(%rip), %rax + movq $1, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $0, %rax - movq (%rax), %rax - addq $28, %rax - movq (%rax), %rax push %rax - leaq strcmp(%rip), %rax + leaq new_local_object(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - movzx %al, %eax - cmpq $0, %rax - sete %al - movzbq %al, %rax - cmpq $1, %rax - jne .L.else.118 -.data -.L.str.171: - .byte 109 - .byte 117 - .byte 115 - .byte 116 - .byte 32 - .byte 98 - .byte 101 - .byte 32 - .byte 97 - .byte 116 - .byte 32 - .byte 116 - .byte 104 - .byte 101 - .byte 32 - .byte 101 - .byte 110 - .byte 100 - .byte 32 - .byte 111 - .byte 102 - .byte 32 - .byte 116 - .byte 104 - .byte 101 - .byte 32 - .byte 112 - .byte 97 - .byte 114 - .byte 97 - .byte 109 - .byte 97 - .byte 116 - .byte 101 - .byte 114 - .byte 115 - .byte 0 -.text - leaq .L.str.171(%rip), %rax + addq $48, %rsp push %rax - leaq -33(%rbp), %rax + leaq 32(%rbp), %rax movq (%rax), %rax push %rax - leaq print_error(%rip), %rax + leaq vec_append_object(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.118 -.L.else.118: -.L.end.118: - leaq -1(%rbp), %rax - push %rax - movq $1, %rax - pop %rdi - movb %al, (%rdi) leaq -25(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -9392,7 +10472,7 @@ parse_function_params: leaq -25(%rbp), %rax movq (%rax), %rax push %rax - leaq 32(%rbp), %rax + leaq 24(%rbp), %rax movq (%rax), %rax push %rax leaq vec_append_type(%rip), %rax @@ -9408,8 +10488,15 @@ parse_function_params: leaq -25(%rbp), %rax movq (%rax), %rax push %rax - leaq -9(%rbp), %rax - movq (%rax), %rax +.data +.L.str.180: + .byte 97 + .byte 114 + .byte 103 + .byte 118 + .byte 0 +.text + leaq .L.str.180(%rip), %rax push %rax movq $1, %rax push %rax @@ -9422,7 +10509,7 @@ parse_function_params: callq *%r10 addq $48, %rsp push %rax - leaq 40(%rbp), %rax + leaq 32(%rbp), %rax movq (%rax), %rax push %rax leaq vec_append_object(%rip), %rax @@ -9430,8 +10517,8 @@ parse_function_params: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.117 -.L.else.117: + jmp .L.end.134 +.L.else.134: leaq -25(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -9455,9 +10542,9 @@ parse_function_params: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.119 + jne .L.else.136 .data -.L.str.172: +.L.str.181: .byte 117 .byte 110 .byte 115 @@ -9509,7 +10596,7 @@ parse_function_params: .byte 116 .byte 0 .text - leaq .L.str.172(%rip), %rax + leaq .L.str.181(%rip), %rax push %rax leaq -33(%rbp), %rax movq (%rax), %rax @@ -9519,13 +10606,13 @@ parse_function_params: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.119 -.L.else.119: -.L.end.119: + jmp .L.end.136 +.L.else.136: +.L.end.136: leaq -25(%rbp), %rax movq (%rax), %rax push %rax - leaq 32(%rbp), %rax + leaq 24(%rbp), %rax movq (%rax), %rax push %rax leaq vec_append_type(%rip), %rax @@ -9555,7 +10642,7 @@ parse_function_params: callq *%r10 addq $48, %rsp push %rax - leaq 40(%rbp), %rax + leaq 32(%rbp), %rax movq (%rax), %rax push %rax leaq vec_append_object(%rip), %rax @@ -9564,11 +10651,11 @@ parse_function_params: callq *%r10 addq $16, %rsp .data -.L.str.173: +.L.str.182: .byte 41 .byte 0 .text - leaq .L.str.173(%rip), %rax + leaq .L.str.182(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -9587,13 +10674,13 @@ parse_function_params: sete %al movzbq %al, %rax cmpq $0, %rax - je .L.false.121 + je .L.false.138 .data -.L.str.174: +.L.str.183: .byte 44 .byte 0 .text - leaq .L.str.174(%rip), %rax + leaq .L.str.183(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -9612,23 +10699,23 @@ parse_function_params: sete %al movzbq %al, %rax cmpq $0, %rax - je .L.false.121 + je .L.false.138 movq $1, %rax - jmp .L.end.121 -.L.false.121: + jmp .L.end.138 +.L.false.138: movq $0, %rax -.L.end.121: +.L.end.138: cmpq $1, %rax - jne .L.else.120 + jne .L.else.137 jmp .L.parse_function_params.break - jmp .L.end.120 -.L.else.120: + jmp .L.end.137 +.L.else.137: .data -.L.str.175: +.L.str.184: .byte 41 .byte 0 .text - leaq .L.str.175(%rip), %rax + leaq .L.str.184(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -9647,13 +10734,13 @@ parse_function_params: sete %al movzbq %al, %rax cmpq $1, %rax - jne .L.else.122 + jne .L.else.139 .data -.L.str.176: +.L.str.185: .byte 44 .byte 0 .text - leaq .L.str.176(%rip), %rax + leaq .L.str.185(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -9663,21 +10750,20 @@ parse_function_params: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.122 -.L.else.122: -.L.end.122: -.L.end.120: -.L.end.117: -.L.end.115: - jmp .L.while.start.114 -.L.while.end.114: + jmp .L.end.139 +.L.else.139: +.L.end.139: +.L.end.137: +.L.end.134: + jmp .L.while.start.133 +.L.while.end.133: .L.parse_function_params.break: .data -.L.str.177: +.L.str.186: .byte 41 .byte 0 .text - leaq .L.str.177(%rip), %rax + leaq .L.str.186(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -9687,14 +10773,6 @@ parse_function_params: movq $0, %rax callq *%r10 addq $16, %rsp - leaq 24(%rbp), %rax - movq (%rax), %rax - addq $32, %rax - push %rax - leaq 40(%rbp), %rax - movq (%rax), %rax - pop %rdi - movq %rax, (%rdi) leaq -1(%rbp), %rax movsbl (%rax), %eax movq %rbp, %rsp @@ -9707,19 +10785,8 @@ parse_struct: push %rbp movq %rsp, %rbp subq $48, %rsp - leaq -8(%rbp), %rax - push %rax - movq $4, %rax - push %rax - leaq new_member_vec(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp - pop %rdi - movq %rax, (%rdi) .data -.L.str.178: +.L.str.187: .byte 115 .byte 116 .byte 114 @@ -9728,7 +10795,7 @@ parse_struct: .byte 116 .byte 0 .text - leaq .L.str.178(%rip), %rax + leaq .L.str.187(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -9738,17 +10805,7 @@ parse_struct: movq $0, %rax callq *%r10 addq $16, %rsp - leaq -16(%rbp), %rax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $0, %rax - movq (%rax), %rax - addq $28, %rax - movq (%rax), %rax - pop %rdi - movq %rax, (%rdi) - leaq -24(%rbp), %rax + leaq -8(%rbp), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -9764,7 +10821,18 @@ parse_struct: movq $0, %rax callq *%r10 addq $8, %rsp - leaq -32(%rbp), %rax + leaq -16(%rbp), %rax + push %rax + movq $4, %rax + push %rax + leaq new_member_vec(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + leaq -24(%rbp), %rax push %rax movq $59, %rax push %rax @@ -9775,123 +10843,146 @@ parse_struct: addq $8, %rsp pop %rdi movq %rax, (%rdi) - leaq -32(%rbp), %rax + leaq -24(%rbp), %rax movq (%rax), %rax addq $0, %rax push %rax movq $5, %rax pop %rdi movl %eax, (%rdi) - leaq -32(%rbp), %rax + leaq -24(%rbp), %rax movq (%rax), %rax addq $8, %rax push %rax - leaq -16(%rbp), %rax + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $28, %rax movq (%rax), %rax pop %rdi movq %rax, (%rdi) -.data -.L.str.179: - .byte 59 - .byte 0 -.text - leaq .L.str.179(%rip), %rax + leaq -24(%rbp), %rax + movq (%rax), %rax + addq $4, %rax push %rax - leaq 16(%rbp), %rax + movq $0, %rax + pop %rdi + movl %eax, (%rdi) + leaq -24(%rbp), %rax movq (%rax), %rax - addq $0, %rax + addq $16, %rax + push %rax + leaq -16(%rbp), %rax + movq (%rax), %rax + pop %rdi + movq %rax, (%rdi) + leaq -32(%rbp), %rax + push %rax + leaq -8(%rbp), %rax movq (%rax), %rax addq $28, %rax movq (%rax), %rax push %rax - leaq strcmp(%rip), %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq get_user_defined_type(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $16, %rsp - movzx %al, %eax - cmpq $1, %rax - jne .L.else.123 + pop %rdi + movq %rax, (%rdi) + movq $0, %rax + push %rax leaq -32(%rbp), %rax movq (%rax), %rax - addq $50, %rax - push %rax - movq $1, %rax pop %rdi - movb %al, (%rdi) - leaq -32(%rbp), %rax + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.140 + leaq -24(%rbp), %rax movq (%rax), %rax - addq $16, %rax push %rax - leaq -8(%rbp), %rax + leaq 16(%rbp), %rax movq (%rax), %rax - pop %rdi - movq %rax, (%rdi) - leaq -32(%rbp), %rax + addq $24, %rax movq (%rax), %rax - addq $4, %rax push %rax + leaq vec_append_type(%rip), %rax + movq %rax, %r10 movq $0, %rax - pop %rdi - movl %eax, (%rdi) + callq *%r10 + addq $16, %rsp + jmp .L.end.140 +.L.else.140: +.L.end.140: .data -.L.str.180: +.L.str.188: .byte 59 .byte 0 .text - leaq .L.str.180(%rip), %rax + leaq .L.str.188(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax + addq $0, %rax + movq (%rax), %rax + addq $28, %rax + movq (%rax), %rax push %rax - leaq parser_skip(%rip), %rax + leaq strcmp(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $16, %rsp + movzx %al, %eax + cmpq $1, %rax + jne .L.else.141 movq $0, %rax push %rax - leaq -16(%rbp), %rax - movq (%rax), %rax - push %rax - leaq 16(%rbp), %rax + leaq -32(%rbp), %rax movq (%rax), %rax - push %rax - leaq get_user_defined_type(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp pop %rdi cmpl %edi, %eax sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.124 - leaq -32(%rbp), %rax + jne .L.else.142 + leaq -24(%rbp), %rax movq (%rax), %rax + addq $50, %rax + push %rax + movq $1, %rax + pop %rdi + movb %al, (%rdi) + jmp .L.end.142 +.L.else.142: +.L.end.142: +.data +.L.str.189: + .byte 59 + .byte 0 +.text + leaq .L.str.189(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax push %rax - leaq vec_append_type(%rip), %rax + leaq parser_skip(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.124 -.L.else.124: -.L.end.124: - jmp .L.end.123 -.L.else.123: + jmp .L.end.141 +.L.else.141: .data -.L.str.181: +.L.str.190: .byte 123 .byte 0 .text - leaq .L.str.181(%rip), %rax + leaq .L.str.190(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -9901,13 +10992,13 @@ parse_struct: movq $0, %rax callq *%r10 addq $16, %rsp -.L.while.start.125: +.L.while.start.143: .data -.L.str.182: +.L.str.191: .byte 125 .byte 0 .text - leaq .L.str.182(%rip), %rax + leaq .L.str.191(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -9926,7 +11017,7 @@ parse_struct: sete %al movzbq %al, %rax cmpq $1, %rax - jne .L.while.end.125 + jne .L.while.end.143 leaq -40(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -9963,7 +11054,7 @@ parse_struct: callq *%r10 addq $16, %rsp push %rax - leaq -8(%rbp), %rax + leaq -16(%rbp), %rax movq (%rax), %rax push %rax leaq vec_append_member(%rip), %rax @@ -9972,11 +11063,11 @@ parse_struct: callq *%r10 addq $16, %rsp .data -.L.str.183: +.L.str.192: .byte 44 .byte 0 .text - leaq .L.str.183(%rip), %rax + leaq .L.str.192(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -9986,14 +11077,14 @@ parse_struct: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.while.start.125 -.L.while.end.125: + jmp .L.while.start.143 +.L.while.end.143: .data -.L.str.184: +.L.str.193: .byte 125 .byte 0 .text - leaq .L.str.184(%rip), %rax + leaq .L.str.193(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -10003,69 +11094,47 @@ parse_struct: movq $0, %rax callq *%r10 addq $16, %rsp - leaq -32(%rbp), %rax - movq (%rax), %rax - addq $16, %rax - push %rax - leaq -8(%rbp), %rax - movq (%rax), %rax - pop %rdi - movq %rax, (%rdi) - leaq -32(%rbp), %rax - movq (%rax), %rax - addq $4, %rax - push %rax - leaq -8(%rbp), %rax - movq (%rax), %rax - push %rax - leaq calc_sizof_struct_members(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp - pop %rdi - movl %eax, (%rdi) - leaq -48(%rbp), %rax + leaq -44(%rbp), %rax push %rax leaq -16(%rbp), %rax movq (%rax), %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - push %rax - leaq get_user_defined_type(%rip), %rax + leaq calc_sizof_struct_members(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp pop %rdi - movq %rax, (%rdi) + movl %eax, (%rdi) movq $0, %rax push %rax - leaq -48(%rbp), %rax + leaq -32(%rbp), %rax movq (%rax), %rax pop %rdi cmpl %edi, %eax sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.126 - leaq -32(%rbp), %rax + jne .L.else.144 + leaq -24(%rbp), %rax movq (%rax), %rax + addq $4, %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax + leaq -44(%rbp), %rax + movslq (%rax), %rax + pop %rdi + movl %eax, (%rdi) + leaq -24(%rbp), %rax movq (%rax), %rax + addq $16, %rax push %rax - leaq vec_append_type(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - jmp .L.end.126 -.L.else.126: - leaq -48(%rbp), %rax + leaq -16(%rbp), %rax + movq (%rax), %rax + pop %rdi + movq %rax, (%rdi) + jmp .L.end.144 +.L.else.144: + leaq -32(%rbp), %rax movq (%rax), %rax addq $50, %rax movsbl (%rax), %eax @@ -10073,9 +11142,9 @@ parse_struct: sete %al movzbq %al, %rax cmpq $1, %rax - jne .L.else.127 + jne .L.else.145 .data -.L.str.185: +.L.str.194: .byte 115 .byte 116 .byte 114 @@ -10103,9 +11172,9 @@ parse_struct: .byte 100 .byte 0 .text - leaq .L.str.185(%rip), %rax + leaq .L.str.194(%rip), %rax push %rax - leaq -24(%rbp), %rax + leaq -8(%rbp), %rax movq (%rax), %rax push %rax leaq print_error(%rip), %rax @@ -10113,40 +11182,34 @@ parse_struct: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.127 -.L.else.127: - leaq -48(%rbp), %rax + jmp .L.end.145 +.L.else.145: + leaq -32(%rbp), %rax movq (%rax), %rax addq $16, %rax push %rax - leaq -8(%rbp), %rax + leaq -16(%rbp), %rax movq (%rax), %rax pop %rdi movq %rax, (%rdi) - leaq -48(%rbp), %rax - movq (%rax), %rax - addq $4, %rax - push %rax leaq -32(%rbp), %rax movq (%rax), %rax addq $4, %rax + push %rax + leaq -44(%rbp), %rax movslq (%rax), %rax pop %rdi movl %eax, (%rdi) - leaq -48(%rbp), %rax + leaq -32(%rbp), %rax movq (%rax), %rax addq $50, %rax push %rax movq $0, %rax pop %rdi movb %al, (%rdi) -.L.end.127: -.L.end.126: -.L.end.123: - movq $0, %rax - movq %rbp, %rsp - pop %rbp - retq +.L.end.145: +.L.end.144: +.L.end.141: leave ret .global calc_sizof_struct_members @@ -10164,7 +11227,7 @@ calc_sizof_struct_members: movq $0, %rax pop %rdi movl %eax, (%rdi) -.L.while.start.128: +.L.while.start.146: leaq 16(%rbp), %rax movq (%rax), %rax addq $8, %rax @@ -10177,7 +11240,7 @@ calc_sizof_struct_members: setl %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.128 + jne .L.while.end.146 movq $8, %rax push %rax leaq -8(%rbp), %rax @@ -10239,8 +11302,8 @@ calc_sizof_struct_members: movl %eax, (%rdi) pop %rdi subl %edi, %eax - jmp .L.while.start.128 -.L.while.end.128: + jmp .L.while.start.146 +.L.while.end.146: leaq -4(%rbp), %rax movslq (%rax), %rax movq %rbp, %rsp @@ -10345,11 +11408,11 @@ parse_block: pop %rdi movq %rax, (%rdi) .data -.L.str.186: +.L.str.195: .byte 123 .byte 0 .text - leaq .L.str.186(%rip), %rax + leaq .L.str.195(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -10359,13 +11422,13 @@ parse_block: movq $0, %rax callq *%r10 addq $16, %rsp -.L.while.start.129: +.L.while.start.147: .data -.L.str.187: +.L.str.196: .byte 125 .byte 0 .text - leaq .L.str.187(%rip), %rax + leaq .L.str.196(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -10384,7 +11447,7 @@ parse_block: sete %al movzbq %al, %rax cmpq $1, %rax - jne .L.while.end.129 + jne .L.while.end.147 leaq -24(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -10406,7 +11469,7 @@ parse_block: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.130 + jne .L.else.148 leaq -24(%rbp), %rax movq (%rax), %rax push %rax @@ -10429,17 +11492,17 @@ parse_block: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.130 -.L.else.130: -.L.end.130: - jmp .L.while.start.129 -.L.while.end.129: + jmp .L.end.148 +.L.else.148: +.L.end.148: + jmp .L.while.start.147 +.L.while.end.147: .data -.L.str.188: +.L.str.197: .byte 125 .byte 0 .text - leaq .L.str.188(%rip), %rax + leaq .L.str.197(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -10470,13 +11533,13 @@ parse_stmt: movq %rsp, %rbp subq $64, %rsp .data -.L.str.189: +.L.str.198: .byte 118 .byte 97 .byte 114 .byte 0 .text - leaq .L.str.189(%rip), %rax + leaq .L.str.198(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -10492,7 +11555,7 @@ parse_stmt: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.131 + jne .L.else.149 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -10565,11 +11628,11 @@ parse_stmt: pop %rdi movq %rax, (%rdi) .data -.L.str.190: +.L.str.199: .byte 61 .byte 0 .text - leaq .L.str.190(%rip), %rax + leaq .L.str.199(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -10585,13 +11648,13 @@ parse_stmt: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.132 + jne .L.else.150 .data -.L.str.191: +.L.str.200: .byte 61 .byte 0 .text - leaq .L.str.191(%rip), %rax + leaq .L.str.200(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -10648,14 +11711,14 @@ parse_stmt: movq %rbp, %rsp pop %rbp retq - jmp .L.end.132 -.L.else.132: + jmp .L.end.150 +.L.else.150: .data -.L.str.192: +.L.str.201: .byte 59 .byte 0 .text - leaq .L.str.192(%rip), %rax + leaq .L.str.201(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -10669,19 +11732,19 @@ parse_stmt: movq %rbp, %rsp pop %rbp retq -.L.end.132: - jmp .L.end.131 -.L.else.131: -.L.end.131: +.L.end.150: + jmp .L.end.149 +.L.else.149: +.L.end.149: .data -.L.str.193: +.L.str.202: .byte 103 .byte 111 .byte 116 .byte 111 .byte 0 .text - leaq .L.str.193(%rip), %rax + leaq .L.str.202(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -10697,7 +11760,7 @@ parse_stmt: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.133 + jne .L.else.151 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -10725,11 +11788,11 @@ parse_stmt: callq *%r10 addq $8, %rsp .data -.L.str.194: +.L.str.203: .byte 59 .byte 0 .text - leaq .L.str.194(%rip), %rax + leaq .L.str.203(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -10763,9 +11826,9 @@ parse_stmt: movq %rbp, %rsp pop %rbp retq - jmp .L.end.133 -.L.else.133: -.L.end.133: + jmp .L.end.151 +.L.else.151: +.L.end.151: movq $5, %rax push %rax leaq 16(%rbp), %rax @@ -10779,13 +11842,13 @@ parse_stmt: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.134 + jne .L.else.152 .data -.L.str.195: +.L.str.204: .byte 58 .byte 0 .text - leaq .L.str.195(%rip), %rax + leaq .L.str.204(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -10803,7 +11866,7 @@ parse_stmt: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.135 + jne .L.else.153 leaq -56(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -10823,11 +11886,11 @@ parse_stmt: callq *%r10 addq $8, %rsp .data -.L.str.196: +.L.str.205: .byte 58 .byte 0 .text - leaq .L.str.196(%rip), %rax + leaq .L.str.205(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -10861,19 +11924,19 @@ parse_stmt: movq %rbp, %rsp pop %rbp retq - jmp .L.end.135 -.L.else.135: -.L.end.135: - jmp .L.end.134 -.L.else.134: -.L.end.134: + jmp .L.end.153 +.L.else.153: +.L.end.153: + jmp .L.end.152 +.L.else.152: +.L.end.152: .data -.L.str.197: +.L.str.206: .byte 105 .byte 102 .byte 0 .text - leaq .L.str.197(%rip), %rax + leaq .L.str.206(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -10889,7 +11952,7 @@ parse_stmt: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.136 + jne .L.else.154 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -10938,14 +12001,14 @@ parse_stmt: pop %rdi movq %rax, (%rdi) .data -.L.str.198: +.L.str.207: .byte 101 .byte 108 .byte 115 .byte 101 .byte 0 .text - leaq .L.str.198(%rip), %rax + leaq .L.str.207(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -10961,7 +12024,7 @@ parse_stmt: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.137 + jne .L.else.155 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -10984,8 +12047,8 @@ parse_stmt: addq $8, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.137 -.L.else.137: + jmp .L.end.155 +.L.else.155: leaq -8(%rbp), %rax movq (%rax), %rax addq $36, %rax @@ -10999,17 +12062,17 @@ parse_stmt: addq $8, %rsp pop %rdi movq %rax, (%rdi) -.L.end.137: +.L.end.155: leaq -8(%rbp), %rax movq (%rax), %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.136 -.L.else.136: -.L.end.136: + jmp .L.end.154 +.L.else.154: +.L.end.154: .data -.L.str.199: +.L.str.208: .byte 119 .byte 104 .byte 105 @@ -11017,7 +12080,7 @@ parse_stmt: .byte 101 .byte 0 .text - leaq .L.str.199(%rip), %rax + leaq .L.str.208(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -11033,7 +12096,7 @@ parse_stmt: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.138 + jne .L.else.156 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -11054,11 +12117,11 @@ parse_stmt: pop %rdi movq %rax, (%rdi) .data -.L.str.200: +.L.str.209: .byte 123 .byte 0 .text - leaq .L.str.200(%rip), %rax + leaq .L.str.209(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -11077,7 +12140,7 @@ parse_stmt: sete %al movzbq %al, %rax cmpq $1, %rax - jne .L.else.139 + jne .L.else.157 leaq -8(%rbp), %rax movq (%rax), %rax addq $44, %rax @@ -11092,8 +12155,8 @@ parse_stmt: addq $8, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.139 -.L.else.139: + jmp .L.end.157 +.L.else.157: leaq -8(%rbp), %rax movq (%rax), %rax addq $44, %rax @@ -11105,7 +12168,7 @@ parse_stmt: addq $0, %rsp pop %rdi movq %rax, (%rdi) -.L.end.139: +.L.end.157: leaq -8(%rbp), %rax movq (%rax), %rax addq $28, %rax @@ -11125,11 +12188,11 @@ parse_stmt: movq %rbp, %rsp pop %rbp retq - jmp .L.end.138 -.L.else.138: -.L.end.138: + jmp .L.end.156 +.L.else.156: +.L.end.156: .data -.L.str.201: +.L.str.210: .byte 114 .byte 101 .byte 116 @@ -11138,7 +12201,7 @@ parse_stmt: .byte 110 .byte 0 .text - leaq .L.str.201(%rip), %rax + leaq .L.str.210(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -11154,7 +12217,7 @@ parse_stmt: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.140 + jne .L.else.158 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -11193,15 +12256,15 @@ parse_stmt: movq %rbp, %rsp pop %rbp retq - jmp .L.end.140 -.L.else.140: -.L.end.140: + jmp .L.end.158 +.L.else.158: +.L.end.158: .data -.L.str.202: +.L.str.211: .byte 123 .byte 0 .text - leaq .L.str.202(%rip), %rax + leaq .L.str.211(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -11217,7 +12280,7 @@ parse_stmt: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.141 + jne .L.else.159 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -11229,9 +12292,9 @@ parse_stmt: movq %rbp, %rsp pop %rbp retq - jmp .L.end.141 -.L.else.141: -.L.end.141: + jmp .L.end.159 +.L.else.159: +.L.end.159: leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -11276,11 +12339,11 @@ parse_expr_stmt: pop %rdi movq %rax, (%rdi) .data -.L.str.203: +.L.str.212: .byte 59 .byte 0 .text - leaq .L.str.203(%rip), %rax + leaq .L.str.212(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -11314,14 +12377,14 @@ parse_logor: addq $8, %rsp pop %rdi movq %rax, (%rdi) -.L.while.start.142: +.L.while.start.160: .data -.L.str.204: +.L.str.213: .byte 124 .byte 124 .byte 0 .text - leaq .L.str.204(%rip), %rax + leaq .L.str.213(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -11337,7 +12400,7 @@ parse_logor: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.while.end.142 + jne .L.while.end.160 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -11369,8 +12432,8 @@ parse_logor: addq $24, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.while.start.142 -.L.while.end.142: + jmp .L.while.start.160 +.L.while.end.160: leaq -8(%rbp), %rax movq (%rax), %rax movq %rbp, %rsp @@ -11395,14 +12458,14 @@ parse_logand: addq $8, %rsp pop %rdi movq %rax, (%rdi) -.L.while.start.143: +.L.while.start.161: .data -.L.str.205: +.L.str.214: .byte 38 .byte 38 .byte 0 .text - leaq .L.str.205(%rip), %rax + leaq .L.str.214(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -11418,7 +12481,7 @@ parse_logand: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.while.end.143 + jne .L.while.end.161 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -11450,8 +12513,8 @@ parse_logand: addq $24, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.while.start.143 -.L.while.end.143: + jmp .L.while.start.161 +.L.while.end.161: leaq -8(%rbp), %rax movq (%rax), %rax movq %rbp, %rsp @@ -11476,17 +12539,17 @@ parse_equality: addq $8, %rsp pop %rdi movq %rax, (%rdi) -.L.while.start.144: +.L.while.start.162: movq $1, %rax cmpq $1, %rax - jne .L.while.end.144 + jne .L.while.end.162 .data -.L.str.206: +.L.str.215: .byte 61 .byte 61 .byte 0 .text - leaq .L.str.206(%rip), %rax + leaq .L.str.215(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -11502,7 +12565,7 @@ parse_equality: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.145 + jne .L.else.163 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -11531,8 +12594,9 @@ parse_equality: movq $0, %rax callq *%r10 addq $8, %rsp + movzx %al, %eax cmpq $1, %rax - jne .L.else.146 + jne .L.else.164 leaq -8(%rbp), %rax push %rax leaq -16(%rbp), %rax @@ -11550,8 +12614,8 @@ parse_equality: addq $24, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.146 -.L.else.146: + jmp .L.end.164 +.L.else.164: leaq -8(%rbp), %rax movq (%rax), %rax push %rax @@ -11560,8 +12624,9 @@ parse_equality: movq $0, %rax callq *%r10 addq $8, %rsp + movzx %al, %eax cmpq $1, %rax - jne .L.else.147 + jne .L.else.165 leaq -8(%rbp), %rax push %rax leaq -16(%rbp), %rax @@ -11579,8 +12644,8 @@ parse_equality: addq $24, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.147 -.L.else.147: + jmp .L.end.165 +.L.else.165: leaq -8(%rbp), %rax push %rax leaq -16(%rbp), %rax @@ -11598,17 +12663,17 @@ parse_equality: addq $24, %rsp pop %rdi movq %rax, (%rdi) -.L.end.147: -.L.end.146: - jmp .L.end.145 -.L.else.145: +.L.end.165: +.L.end.164: + jmp .L.end.163 +.L.else.163: .data -.L.str.207: +.L.str.216: .byte 33 .byte 61 .byte 0 .text - leaq .L.str.207(%rip), %rax + leaq .L.str.216(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -11624,7 +12689,7 @@ parse_equality: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.148 + jne .L.else.166 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -11653,8 +12718,9 @@ parse_equality: movq $0, %rax callq *%r10 addq $8, %rsp + movzx %al, %eax cmpq $1, %rax - jne .L.else.149 + jne .L.else.167 leaq -8(%rbp), %rax push %rax leaq -16(%rbp), %rax @@ -11672,8 +12738,8 @@ parse_equality: addq $24, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.149 -.L.else.149: + jmp .L.end.167 +.L.else.167: leaq -8(%rbp), %rax movq (%rax), %rax push %rax @@ -11682,8 +12748,9 @@ parse_equality: movq $0, %rax callq *%r10 addq $8, %rsp + movzx %al, %eax cmpq $1, %rax - jne .L.else.150 + jne .L.else.168 leaq -8(%rbp), %rax push %rax leaq -16(%rbp), %rax @@ -11701,8 +12768,8 @@ parse_equality: addq $24, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.150 -.L.else.150: + jmp .L.end.168 +.L.else.168: leaq -8(%rbp), %rax push %rax leaq -16(%rbp), %rax @@ -11720,15 +12787,15 @@ parse_equality: addq $24, %rsp pop %rdi movq %rax, (%rdi) -.L.end.150: -.L.end.149: - jmp .L.end.148 -.L.else.148: +.L.end.168: +.L.end.167: + jmp .L.end.166 +.L.else.166: jmp .L.parse_equality.end -.L.end.148: -.L.end.145: - jmp .L.while.start.144 -.L.while.end.144: +.L.end.166: +.L.end.163: + jmp .L.while.start.162 +.L.while.end.162: .L.parse_equality.end: leaq -8(%rbp), %rax movq (%rax), %rax @@ -11754,17 +12821,17 @@ parse_relational: addq $8, %rsp pop %rdi movq %rax, (%rdi) -.L.while.start.151: +.L.while.start.169: movq $1, %rax cmpq $1, %rax - jne .L.while.end.151 + jne .L.while.end.169 .data -.L.str.208: +.L.str.217: .byte 60 .byte 61 .byte 0 .text - leaq .L.str.208(%rip), %rax + leaq .L.str.217(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -11780,7 +12847,7 @@ parse_relational: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.152 + jne .L.else.170 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -11809,8 +12876,9 @@ parse_relational: movq $0, %rax callq *%r10 addq $8, %rsp + movzx %al, %eax cmpq $1, %rax - jne .L.else.153 + jne .L.else.171 leaq -8(%rbp), %rax push %rax leaq -16(%rbp), %rax @@ -11828,8 +12896,8 @@ parse_relational: addq $24, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.153 -.L.else.153: + jmp .L.end.171 +.L.else.171: leaq -8(%rbp), %rax push %rax leaq -16(%rbp), %rax @@ -11847,16 +12915,16 @@ parse_relational: addq $24, %rsp pop %rdi movq %rax, (%rdi) -.L.end.153: - jmp .L.end.152 -.L.else.152: +.L.end.171: + jmp .L.end.170 +.L.else.170: .data -.L.str.209: +.L.str.218: .byte 62 .byte 61 .byte 0 .text - leaq .L.str.209(%rip), %rax + leaq .L.str.218(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -11872,7 +12940,7 @@ parse_relational: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.154 + jne .L.else.172 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -11901,8 +12969,9 @@ parse_relational: movq $0, %rax callq *%r10 addq $8, %rsp + movzx %al, %eax cmpq $1, %rax - jne .L.else.155 + jne .L.else.173 leaq -8(%rbp), %rax push %rax leaq -16(%rbp), %rax @@ -11920,8 +12989,8 @@ parse_relational: addq $24, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.155 -.L.else.155: + jmp .L.end.173 +.L.else.173: leaq -8(%rbp), %rax push %rax leaq -16(%rbp), %rax @@ -11939,15 +13008,15 @@ parse_relational: addq $24, %rsp pop %rdi movq %rax, (%rdi) -.L.end.155: - jmp .L.end.154 -.L.else.154: +.L.end.173: + jmp .L.end.172 +.L.else.172: .data -.L.str.210: +.L.str.219: .byte 60 .byte 0 .text - leaq .L.str.210(%rip), %rax + leaq .L.str.219(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -11963,7 +13032,7 @@ parse_relational: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.156 + jne .L.else.174 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -11992,8 +13061,9 @@ parse_relational: movq $0, %rax callq *%r10 addq $8, %rsp + movzx %al, %eax cmpq $1, %rax - jne .L.else.157 + jne .L.else.175 leaq -8(%rbp), %rax push %rax leaq -16(%rbp), %rax @@ -12011,8 +13081,8 @@ parse_relational: addq $24, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.157 -.L.else.157: + jmp .L.end.175 +.L.else.175: leaq -8(%rbp), %rax push %rax leaq -16(%rbp), %rax @@ -12030,15 +13100,15 @@ parse_relational: addq $24, %rsp pop %rdi movq %rax, (%rdi) -.L.end.157: - jmp .L.end.156 -.L.else.156: +.L.end.175: + jmp .L.end.174 +.L.else.174: .data -.L.str.211: +.L.str.220: .byte 62 .byte 0 .text - leaq .L.str.211(%rip), %rax + leaq .L.str.220(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -12054,7 +13124,7 @@ parse_relational: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.158 + jne .L.else.176 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -12083,8 +13153,9 @@ parse_relational: movq $0, %rax callq *%r10 addq $8, %rsp + movzx %al, %eax cmpq $1, %rax - jne .L.else.159 + jne .L.else.177 leaq -8(%rbp), %rax push %rax leaq -16(%rbp), %rax @@ -12102,8 +13173,8 @@ parse_relational: addq $24, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.159 -.L.else.159: + jmp .L.end.177 +.L.else.177: leaq -8(%rbp), %rax push %rax leaq -16(%rbp), %rax @@ -12121,16 +13192,16 @@ parse_relational: addq $24, %rsp pop %rdi movq %rax, (%rdi) -.L.end.159: - jmp .L.end.158 -.L.else.158: +.L.end.177: + jmp .L.end.176 +.L.else.176: jmp .L.parse_relational.end -.L.end.158: -.L.end.156: -.L.end.154: -.L.end.152: - jmp .L.while.start.151 -.L.while.end.151: +.L.end.176: +.L.end.174: +.L.end.172: +.L.end.170: + jmp .L.while.start.169 +.L.while.end.169: .L.parse_relational.end: leaq -8(%rbp), %rax movq (%rax), %rax @@ -12152,8 +13223,9 @@ new_equality: movq $0, %rax callq *%r10 addq $8, %rsp + movzx %al, %eax cmpq $1, %rax - jne .L.else.160 + jne .L.else.178 leaq 32(%rbp), %rax movq (%rax), %rax push %rax @@ -12162,8 +13234,9 @@ new_equality: movq $0, %rax callq *%r10 addq $8, %rsp + movzx %al, %eax cmpq $1, %rax - jne .L.else.161 + jne .L.else.179 leaq -8(%rbp), %rax push %rax leaq 32(%rbp), %rax @@ -12237,12 +13310,12 @@ new_equality: movq %rbp, %rsp pop %rbp retq - jmp .L.end.161 -.L.else.161: -.L.end.161: - jmp .L.end.160 -.L.else.160: -.L.end.160: + jmp .L.end.179 +.L.else.179: +.L.end.179: + jmp .L.end.178 +.L.else.178: +.L.end.178: leaq -8(%rbp), %rax push %rax leaq 32(%rbp), %rax @@ -12306,8 +13379,9 @@ new_relational: movq $0, %rax callq *%r10 addq $8, %rsp + movzx %al, %eax cmpq $1, %rax - jne .L.else.162 + jne .L.else.180 leaq 32(%rbp), %rax movq (%rax), %rax push %rax @@ -12316,8 +13390,9 @@ new_relational: movq $0, %rax callq *%r10 addq $8, %rsp + movzx %al, %eax cmpq $1, %rax - jne .L.else.163 + jne .L.else.181 leaq -8(%rbp), %rax push %rax leaq 32(%rbp), %rax @@ -12391,12 +13466,12 @@ new_relational: movq %rbp, %rsp pop %rbp retq - jmp .L.end.163 -.L.else.163: -.L.end.163: - jmp .L.end.162 -.L.else.162: -.L.end.162: + jmp .L.end.181 +.L.else.181: +.L.end.181: + jmp .L.end.180 +.L.else.180: +.L.end.180: leaq -8(%rbp), %rax push %rax leaq 32(%rbp), %rax @@ -12458,7 +13533,7 @@ search_relational_lhs: movq (%rax), %rax pop %rdi movq %rax, (%rdi) -.L.while.start.164: +.L.while.start.182: leaq -8(%rbp), %rax movq (%rax), %rax push %rax @@ -12467,8 +13542,9 @@ search_relational_lhs: movq $0, %rax callq *%r10 addq $8, %rsp + movzx %al, %eax cmpq $1, %rax - jne .L.while.end.164 + jne .L.while.end.182 leaq -8(%rbp), %rax push %rax leaq -8(%rbp), %rax @@ -12477,8 +13553,8 @@ search_relational_lhs: movq (%rax), %rax pop %rdi movq %rax, (%rdi) - jmp .L.while.start.164 -.L.while.end.164: + jmp .L.while.start.182 +.L.while.end.182: leaq -8(%rbp), %rax movq (%rax), %rax movq %rbp, %rsp @@ -12497,7 +13573,7 @@ search_relational_rhs: movq (%rax), %rax pop %rdi movq %rax, (%rdi) -.L.while.start.165: +.L.while.start.183: leaq -8(%rbp), %rax movq (%rax), %rax push %rax @@ -12506,8 +13582,9 @@ search_relational_rhs: movq $0, %rax callq *%r10 addq $8, %rsp + movzx %al, %eax cmpq $1, %rax - jne .L.while.end.165 + jne .L.while.end.183 leaq -8(%rbp), %rax push %rax leaq -8(%rbp), %rax @@ -12516,8 +13593,8 @@ search_relational_rhs: movq (%rax), %rax pop %rdi movq %rax, (%rdi) - jmp .L.while.start.165 -.L.while.end.165: + jmp .L.while.start.183 +.L.while.end.183: leaq -8(%rbp), %rax movq (%rax), %rax movq %rbp, %rsp @@ -12541,14 +13618,14 @@ is_comparison_node: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.166 + jne .L.else.184 movq $1, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.166 -.L.else.166: -.L.end.166: + jmp .L.end.184 +.L.else.184: +.L.end.184: movq $10, %rax push %rax leaq 16(%rbp), %rax @@ -12560,14 +13637,14 @@ is_comparison_node: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.167 + jne .L.else.185 movq $1, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.167 -.L.else.167: -.L.end.167: + jmp .L.end.185 +.L.else.185: +.L.end.185: movq $9, %rax push %rax leaq 16(%rbp), %rax @@ -12579,14 +13656,14 @@ is_comparison_node: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.168 + jne .L.else.186 movq $1, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.168 -.L.else.168: -.L.end.168: + jmp .L.end.186 +.L.else.186: +.L.end.186: movq $11, %rax push %rax leaq 16(%rbp), %rax @@ -12598,14 +13675,14 @@ is_comparison_node: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.169 + jne .L.else.187 movq $1, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.169 -.L.else.169: -.L.end.169: + jmp .L.end.187 +.L.else.187: +.L.end.187: movq $7, %rax push %rax leaq 16(%rbp), %rax @@ -12617,14 +13694,14 @@ is_comparison_node: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.170 + jne .L.else.188 movq $1, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.170 -.L.else.170: -.L.end.170: + jmp .L.end.188 +.L.else.188: +.L.end.188: movq $6, %rax push %rax leaq 16(%rbp), %rax @@ -12636,14 +13713,14 @@ is_comparison_node: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.171 + jne .L.else.189 movq $1, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.171 -.L.else.171: -.L.end.171: + jmp .L.end.189 +.L.else.189: +.L.end.189: movq $26, %rax push %rax leaq 16(%rbp), %rax @@ -12655,14 +13732,14 @@ is_comparison_node: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.172 + jne .L.else.190 movq $1, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.172 -.L.else.172: -.L.end.172: + jmp .L.end.190 +.L.else.190: +.L.end.190: movq $0, %rax movq %rbp, %rsp pop %rbp @@ -12686,17 +13763,17 @@ parse_shift: addq $8, %rsp pop %rdi movq %rax, (%rdi) -.L.while.start.173: +.L.while.start.191: movq $1, %rax cmpq $1, %rax - jne .L.while.end.173 + jne .L.while.end.191 .data -.L.str.212: +.L.str.221: .byte 60 .byte 60 .byte 0 .text - leaq .L.str.212(%rip), %rax + leaq .L.str.221(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -12712,7 +13789,7 @@ parse_shift: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.174 + jne .L.else.192 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -12745,16 +13822,16 @@ parse_shift: pop %rdi movq %rax, (%rdi) jmp .L.parse_shift.continue - jmp .L.end.174 -.L.else.174: -.L.end.174: + jmp .L.end.192 +.L.else.192: +.L.end.192: .data -.L.str.213: +.L.str.222: .byte 62 .byte 62 .byte 0 .text - leaq .L.str.213(%rip), %rax + leaq .L.str.222(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -12770,7 +13847,7 @@ parse_shift: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.175 + jne .L.else.193 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -12803,13 +13880,13 @@ parse_shift: pop %rdi movq %rax, (%rdi) jmp .L.parse_shift.continue - jmp .L.end.175 -.L.else.175: -.L.end.175: + jmp .L.end.193 +.L.else.193: +.L.end.193: jmp .L.parse_shift.break .L.parse_shift.continue: - jmp .L.while.start.173 -.L.while.end.173: + jmp .L.while.start.191 +.L.while.end.191: .L.parse_shift.break: leaq -8(%rbp), %rax movq (%rax), %rax @@ -12835,16 +13912,16 @@ parse_add: addq $8, %rsp pop %rdi movq %rax, (%rdi) -.L.while.start.176: +.L.while.start.194: movq $1, %rax cmpq $1, %rax - jne .L.while.end.176 + jne .L.while.end.194 .data -.L.str.214: +.L.str.223: .byte 43 .byte 0 .text - leaq .L.str.214(%rip), %rax + leaq .L.str.223(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -12860,7 +13937,7 @@ parse_add: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.177 + jne .L.else.195 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -12892,14 +13969,14 @@ parse_add: addq $24, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.177 -.L.else.177: + jmp .L.end.195 +.L.else.195: .data -.L.str.215: +.L.str.224: .byte 45 .byte 0 .text - leaq .L.str.215(%rip), %rax + leaq .L.str.224(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -12915,7 +13992,7 @@ parse_add: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.178 + jne .L.else.196 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -12947,13 +14024,13 @@ parse_add: addq $24, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.178 -.L.else.178: + jmp .L.end.196 +.L.else.196: jmp .L.parse_add.end -.L.end.178: -.L.end.177: - jmp .L.while.start.176 -.L.while.end.176: +.L.end.196: +.L.end.195: + jmp .L.while.start.194 +.L.while.end.194: .L.parse_add.end: leaq -8(%rbp), %rax movq (%rax), %rax @@ -12979,16 +14056,16 @@ parse_mul: addq $8, %rsp pop %rdi movq %rax, (%rdi) -.L.while.start.179: +.L.while.start.197: movq $1, %rax cmpq $1, %rax - jne .L.while.end.179 + jne .L.while.end.197 .data -.L.str.216: +.L.str.225: .byte 42 .byte 0 .text - leaq .L.str.216(%rip), %rax + leaq .L.str.225(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -13004,7 +14081,7 @@ parse_mul: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.180 + jne .L.else.198 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -13036,14 +14113,14 @@ parse_mul: addq $24, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.180 -.L.else.180: + jmp .L.end.198 +.L.else.198: .data -.L.str.217: +.L.str.226: .byte 47 .byte 0 .text - leaq .L.str.217(%rip), %rax + leaq .L.str.226(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -13059,7 +14136,7 @@ parse_mul: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.181 + jne .L.else.199 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -13091,14 +14168,14 @@ parse_mul: addq $24, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.181 -.L.else.181: + jmp .L.end.199 +.L.else.199: .data -.L.str.218: +.L.str.227: .byte 37 .byte 0 .text - leaq .L.str.218(%rip), %rax + leaq .L.str.227(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -13114,7 +14191,7 @@ parse_mul: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.182 + jne .L.else.200 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -13146,14 +14223,14 @@ parse_mul: addq $24, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.182 -.L.else.182: + jmp .L.end.200 +.L.else.200: jmp .L.parse_mul.end -.L.end.182: -.L.end.181: -.L.end.180: - jmp .L.while.start.179 -.L.while.end.179: +.L.end.200: +.L.end.199: +.L.end.198: + jmp .L.while.start.197 +.L.while.end.197: .L.parse_mul.end: leaq -8(%rbp), %rax movq (%rax), %rax @@ -13316,9 +14393,9 @@ parse_deref: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.183 + jne .L.else.201 .data -.L.str.219: +.L.str.228: .byte 105 .byte 110 .byte 118 @@ -13348,7 +14425,7 @@ parse_deref: .byte 101 .byte 0 .text - leaq .L.str.219(%rip), %rax + leaq .L.str.228(%rip), %rax push %rax leaq -8(%rbp), %rax movq (%rax), %rax @@ -13358,9 +14435,9 @@ parse_deref: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.183 -.L.else.183: -.L.end.183: + jmp .L.end.201 +.L.else.201: +.L.end.201: leaq -16(%rbp), %rax movq (%rax), %rax movq %rbp, %rsp @@ -13441,7 +14518,7 @@ search_struct_member: movq $0, %rax pop %rdi movl %eax, (%rdi) -.L.while.start.184: +.L.while.start.202: leaq 16(%rbp), %rax movq (%rax), %rax addq $8, %rax @@ -13454,7 +14531,7 @@ search_struct_member: setl %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.184 + jne .L.while.end.202 leaq 24(%rbp), %rax movq (%rax), %rax push %rax @@ -13482,7 +14559,7 @@ search_struct_member: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.185 + jne .L.else.203 movq $8, %rax push %rax leaq -4(%rbp), %rax @@ -13500,9 +14577,9 @@ search_struct_member: movq %rbp, %rsp pop %rbp retq - jmp .L.end.185 -.L.else.185: -.L.end.185: + jmp .L.end.203 +.L.else.203: +.L.end.203: movq $1, %rax push %rax leaq -4(%rbp), %rax @@ -13517,8 +14594,8 @@ search_struct_member: movl %eax, (%rdi) pop %rdi subl %edi, %eax - jmp .L.while.start.184 -.L.while.end.184: + jmp .L.while.start.202 +.L.while.end.202: movq $0, %rax movq %rbp, %rsp pop %rbp @@ -13543,7 +14620,7 @@ parse_number: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.186 + jne .L.else.204 leaq -8(%rbp), %rax push %rax movq $13, %rax @@ -13581,8 +14658,8 @@ parse_number: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.186 -.L.else.186: + jmp .L.end.204 +.L.else.204: movq $1, %rax push %rax leaq 16(%rbp), %rax @@ -13596,7 +14673,7 @@ parse_number: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.187 + jne .L.else.205 leaq -8(%rbp), %rax push %rax movq $13, %rax @@ -13628,8 +14705,8 @@ parse_number: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.187 -.L.else.187: + jmp .L.end.205 +.L.else.205: movq $3, %rax push %rax leaq 16(%rbp), %rax @@ -13643,7 +14720,7 @@ parse_number: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.188 + jne .L.else.206 leaq -8(%rbp), %rax push %rax movq $12, %rax @@ -13675,16 +14752,16 @@ parse_number: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.188 -.L.else.188: + jmp .L.end.206 +.L.else.206: .data -.L.str.220: +.L.str.229: .byte 110 .byte 105 .byte 108 .byte 0 .text - leaq .L.str.220(%rip), %rax + leaq .L.str.229(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -13700,7 +14777,7 @@ parse_number: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.189 + jne .L.else.207 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -13737,17 +14814,17 @@ parse_number: movq $0, %rax pop %rdi movl %eax, (%rdi) - jmp .L.end.189 -.L.else.189: + jmp .L.end.207 +.L.else.207: .data -.L.str.221: +.L.str.230: .byte 116 .byte 114 .byte 117 .byte 101 .byte 0 .text - leaq .L.str.221(%rip), %rax + leaq .L.str.230(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -13763,7 +14840,7 @@ parse_number: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.190 + jne .L.else.208 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -13800,10 +14877,10 @@ parse_number: movq $1, %rax pop %rdi movl %eax, (%rdi) - jmp .L.end.190 -.L.else.190: + jmp .L.end.208 +.L.else.208: .data -.L.str.222: +.L.str.231: .byte 102 .byte 97 .byte 108 @@ -13811,7 +14888,7 @@ parse_number: .byte 101 .byte 0 .text - leaq .L.str.222(%rip), %rax + leaq .L.str.231(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -13827,7 +14904,7 @@ parse_number: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.191 + jne .L.else.209 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -13864,10 +14941,10 @@ parse_number: movq $0, %rax pop %rdi movl %eax, (%rdi) - jmp .L.end.191 -.L.else.191: + jmp .L.end.209 +.L.else.209: .data -.L.str.223: +.L.str.232: .byte 116 .byte 121 .byte 112 @@ -13878,7 +14955,7 @@ parse_number: .byte 101 .byte 0 .text - leaq .L.str.223(%rip), %rax + leaq .L.str.232(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -13894,7 +14971,7 @@ parse_number: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.192 + jne .L.else.210 leaq -8(%rbp), %rax push %rax movq $13, %rax @@ -13915,11 +14992,11 @@ parse_number: callq *%r10 addq $8, %rsp .data -.L.str.224: +.L.str.233: .byte 40 .byte 0 .text - leaq .L.str.224(%rip), %rax + leaq .L.str.233(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -13956,11 +15033,11 @@ parse_number: pop %rdi movq %rax, (%rdi) .data -.L.str.225: +.L.str.234: .byte 41 .byte 0 .text - leaq .L.str.225(%rip), %rax + leaq .L.str.234(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -13970,10 +15047,10 @@ parse_number: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.192 -.L.else.192: + jmp .L.end.210 +.L.else.210: .data -.L.str.226: +.L.str.235: .byte 115 .byte 105 .byte 122 @@ -13982,7 +15059,7 @@ parse_number: .byte 102 .byte 0 .text - leaq .L.str.226(%rip), %rax + leaq .L.str.235(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -13998,7 +15075,7 @@ parse_number: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.193 + jne .L.else.211 leaq -8(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -14011,8 +15088,8 @@ parse_number: addq $8, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.193 -.L.else.193: + jmp .L.end.211 +.L.else.211: movq $2, %rax push %rax leaq 16(%rbp), %rax @@ -14026,7 +15103,7 @@ parse_number: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.194 + jne .L.else.212 leaq -8(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -14039,14 +15116,14 @@ parse_number: addq $8, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.194 -.L.else.194: + jmp .L.end.212 +.L.else.212: .data -.L.str.227: +.L.str.236: .byte 40 .byte 0 .text - leaq .L.str.227(%rip), %rax + leaq .L.str.236(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -14062,7 +15139,7 @@ parse_number: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.195 + jne .L.else.213 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -14084,11 +15161,11 @@ parse_number: pop %rdi movq %rax, (%rdi) .data -.L.str.228: +.L.str.237: .byte 41 .byte 0 .text - leaq .L.str.228(%rip), %rax + leaq .L.str.237(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -14098,10 +15175,10 @@ parse_number: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.195 -.L.else.195: + jmp .L.end.213 +.L.else.213: .data -.L.str.229: +.L.str.238: .byte 101 .byte 120 .byte 112 @@ -14133,7 +15210,7 @@ parse_number: .byte 114 .byte 0 .text - leaq .L.str.229(%rip), %rax + leaq .L.str.238(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -14152,16 +15229,16 @@ parse_number: movq $0, %rax callq *%r10 addq $8, %rsp -.L.end.195: -.L.end.194: -.L.end.193: -.L.end.192: -.L.end.191: -.L.end.190: -.L.end.189: -.L.end.188: -.L.end.187: -.L.end.186: +.L.end.213: +.L.end.212: +.L.end.211: +.L.end.210: +.L.end.209: +.L.end.208: +.L.end.207: +.L.end.206: +.L.end.205: +.L.end.204: leaq -8(%rbp), %rax movq (%rax), %rax movq %rbp, %rsp @@ -14221,9 +15298,9 @@ parse_ident: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.196 + jne .L.else.214 .data -.L.str.230: +.L.str.239: .byte 117 .byte 110 .byte 107 @@ -14239,7 +15316,7 @@ parse_ident: .byte 116 .byte 0 .text - leaq .L.str.230(%rip), %rax + leaq .L.str.239(%rip), %rax push %rax leaq -8(%rbp), %rax movq (%rax), %rax @@ -14249,9 +15326,9 @@ parse_ident: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.196 -.L.else.196: -.L.end.196: + jmp .L.end.214 +.L.else.214: +.L.end.214: leaq -16(%rbp), %rax movq (%rax), %rax addq $72, %rax @@ -14304,7 +15381,7 @@ find_object: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.197 + jne .L.else.215 leaq -8(%rbp), %rax push %rax leaq 24(%rbp), %rax @@ -14320,9 +15397,9 @@ find_object: addq $16, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.197 -.L.else.197: -.L.end.197: + jmp .L.end.215 +.L.else.215: +.L.end.215: leaq -8(%rbp), %rax movq (%rax), %rax movq %rbp, %rsp @@ -14336,7 +15413,7 @@ parse_sizeof: movq %rsp, %rbp subq $16, %rsp .data -.L.str.231: +.L.str.240: .byte 115 .byte 105 .byte 122 @@ -14345,7 +15422,7 @@ parse_sizeof: .byte 102 .byte 0 .text - leaq .L.str.231(%rip), %rax + leaq .L.str.240(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -14356,11 +15433,11 @@ parse_sizeof: callq *%r10 addq $16, %rsp .data -.L.str.232: +.L.str.241: .byte 40 .byte 0 .text - leaq .L.str.232(%rip), %rax + leaq .L.str.241(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -14383,11 +15460,11 @@ parse_sizeof: pop %rdi movq %rax, (%rdi) .data -.L.str.233: +.L.str.242: .byte 41 .byte 0 .text - leaq .L.str.233(%rip), %rax + leaq .L.str.242(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -14456,11 +15533,11 @@ parse_unary: movq %rsp, %rbp subq $112, %rsp .data -.L.str.234: +.L.str.243: .byte 42 .byte 0 .text - leaq .L.str.234(%rip), %rax + leaq .L.str.243(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -14476,7 +15553,7 @@ parse_unary: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.198 + jne .L.else.216 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -14488,15 +15565,15 @@ parse_unary: movq %rbp, %rsp pop %rbp retq - jmp .L.end.198 -.L.else.198: -.L.end.198: + jmp .L.end.216 +.L.else.216: +.L.end.216: .data -.L.str.235: +.L.str.244: .byte 38 .byte 0 .text - leaq .L.str.235(%rip), %rax + leaq .L.str.244(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -14512,7 +15589,7 @@ parse_unary: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.199 + jne .L.else.217 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -14551,15 +15628,15 @@ parse_unary: movq %rbp, %rsp pop %rbp retq - jmp .L.end.199 -.L.else.199: -.L.end.199: + jmp .L.end.217 +.L.else.217: +.L.end.217: .data -.L.str.236: +.L.str.245: .byte 33 .byte 0 .text - leaq .L.str.236(%rip), %rax + leaq .L.str.245(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -14575,7 +15652,7 @@ parse_unary: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.200 + jne .L.else.218 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -14614,9 +15691,9 @@ parse_unary: movq %rbp, %rsp pop %rbp retq - jmp .L.end.200 -.L.else.200: -.L.end.200: + jmp .L.end.218 +.L.else.218: +.L.end.218: leaq -8(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -14629,16 +15706,16 @@ parse_unary: addq $8, %rsp pop %rdi movq %rax, (%rdi) -.L.while.start.201: +.L.while.start.219: movq $1, %rax cmpq $1, %rax - jne .L.while.end.201 + jne .L.while.end.219 .data -.L.str.237: +.L.str.246: .byte 40 .byte 0 .text - leaq .L.str.237(%rip), %rax + leaq .L.str.246(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -14654,7 +15731,7 @@ parse_unary: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.202 + jne .L.else.220 leaq -16(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -14664,11 +15741,11 @@ parse_unary: pop %rdi movq %rax, (%rdi) .data -.L.str.238: +.L.str.247: .byte 40 .byte 0 .text - leaq .L.str.238(%rip), %rax + leaq .L.str.247(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -14702,9 +15779,9 @@ parse_unary: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.203 + jne .L.else.221 .data -.L.str.239: +.L.str.248: .byte 99 .byte 97 .byte 110 @@ -14747,7 +15824,7 @@ parse_unary: .byte 10 .byte 0 .text - leaq .L.str.239(%rip), %rax + leaq .L.str.248(%rip), %rax push %rax leaq -16(%rbp), %rax movq (%rax), %rax @@ -14757,9 +15834,9 @@ parse_unary: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.203 -.L.else.203: -.L.end.203: + jmp .L.end.221 +.L.else.221: +.L.end.221: leaq -24(%rbp), %rax push %rax movq $25, %rax @@ -14802,11 +15879,11 @@ parse_unary: pop %rdi movq %rax, (%rdi) .data -.L.str.240: +.L.str.249: .byte 41 .byte 0 .text - leaq .L.str.240(%rip), %rax + leaq .L.str.249(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -14823,8 +15900,8 @@ parse_unary: addq $40, %rax movsbl (%rax), %eax cmpq $1, %rax - jne .L.else.204 - movq $1, %rax + jne .L.else.222 + movq $2, %rax push %rax leaq -8(%rbp), %rax movq (%rax), %rax @@ -14848,8 +15925,8 @@ parse_unary: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.205 - movq $1, %rax + jne .L.else.223 + movq $2, %rax push %rax leaq -8(%rbp), %rax movq (%rax), %rax @@ -14873,9 +15950,9 @@ parse_unary: setl %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.206 + jne .L.else.224 .data -.L.str.241: +.L.str.250: .byte 84 .byte 104 .byte 101 @@ -14940,7 +16017,7 @@ parse_unary: .byte 110 .byte 0 .text - leaq .L.str.241(%rip), %rax + leaq .L.str.250(%rip), %rax push %rax leaq -16(%rbp), %rax movq (%rax), %rax @@ -14966,14 +16043,14 @@ parse_unary: movq $0, %rax callq *%r10 addq $32, %rsp - jmp .L.end.206 -.L.else.206: -.L.end.206: - jmp .L.end.205 -.L.else.205: -.L.end.205: - jmp .L.end.204 -.L.else.204: + jmp .L.end.224 +.L.else.224: +.L.end.224: + jmp .L.end.223 +.L.else.223: +.L.end.223: + jmp .L.end.222 +.L.else.222: leaq -8(%rbp), %rax movq (%rax), %rax addq $80, %rax @@ -14994,9 +16071,9 @@ parse_unary: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.207 + jne .L.else.225 .data -.L.str.242: +.L.str.251: .byte 84 .byte 104 .byte 101 @@ -15061,7 +16138,7 @@ parse_unary: .byte 110 .byte 0 .text - leaq .L.str.242(%rip), %rax + leaq .L.str.251(%rip), %rax push %rax leaq -16(%rbp), %rax movq (%rax), %rax @@ -15087,10 +16164,10 @@ parse_unary: movq $0, %rax callq *%r10 addq $32, %rsp - jmp .L.end.207 -.L.else.207: -.L.end.207: -.L.end.204: + jmp .L.end.225 +.L.else.225: +.L.end.225: +.L.end.222: leaq -8(%rbp), %rax push %rax leaq -24(%rbp), %rax @@ -15098,9 +16175,9 @@ parse_unary: pop %rdi movq %rax, (%rdi) jmp .L.parse_unary.continue - jmp .L.end.202 -.L.else.202: -.L.end.202: + jmp .L.end.220 +.L.else.220: +.L.end.220: leaq -40(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -15110,12 +16187,12 @@ parse_unary: pop %rdi movq %rax, (%rdi) .data -.L.str.243: +.L.str.252: .byte 43 .byte 43 .byte 0 .text - leaq .L.str.243(%rip), %rax + leaq .L.str.252(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -15131,7 +16208,7 @@ parse_unary: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.208 + jne .L.else.226 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -15192,16 +16269,16 @@ parse_unary: pop %rdi movq %rax, (%rdi) jmp .L.parse_unary.continue - jmp .L.end.208 -.L.else.208: -.L.end.208: + jmp .L.end.226 +.L.else.226: +.L.end.226: .data -.L.str.244: +.L.str.253: .byte 45 .byte 45 .byte 0 .text - leaq .L.str.244(%rip), %rax + leaq .L.str.253(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -15217,7 +16294,7 @@ parse_unary: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.209 + jne .L.else.227 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -15278,15 +16355,15 @@ parse_unary: pop %rdi movq %rax, (%rdi) jmp .L.parse_unary.continue - jmp .L.end.209 -.L.else.209: -.L.end.209: + jmp .L.end.227 +.L.else.227: +.L.end.227: .data -.L.str.245: +.L.str.254: .byte 91 .byte 0 .text - leaq .L.str.245(%rip), %rax + leaq .L.str.254(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -15302,7 +16379,7 @@ parse_unary: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.210 + jne .L.else.228 leaq -8(%rbp), %rax movq (%rax), %rax push %rax @@ -15335,11 +16412,11 @@ parse_unary: pop %rdi movq %rax, (%rdi) .data -.L.str.246: +.L.str.255: .byte 93 .byte 0 .text - leaq .L.str.246(%rip), %rax + leaq .L.str.255(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -15362,9 +16439,9 @@ parse_unary: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.211 + jne .L.else.229 .data -.L.str.247: +.L.str.256: .byte 96 .byte 91 .byte 93 @@ -15407,7 +16484,7 @@ parse_unary: .byte 46 .byte 0 .text - leaq .L.str.247(%rip), %rax + leaq .L.str.256(%rip), %rax push %rax leaq -40(%rbp), %rax movq (%rax), %rax @@ -15417,9 +16494,9 @@ parse_unary: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.211 -.L.else.211: -.L.end.211: + jmp .L.end.229 +.L.else.229: +.L.end.229: leaq -56(%rbp), %rax push %rax movq $13, %rax @@ -15510,15 +16587,15 @@ parse_unary: pop %rdi movq %rax, (%rdi) jmp .L.parse_unary.continue - jmp .L.end.210 -.L.else.210: -.L.end.210: + jmp .L.end.228 +.L.else.228: +.L.end.228: .data -.L.str.248: +.L.str.257: .byte 46 .byte 0 .text - leaq .L.str.248(%rip), %rax + leaq .L.str.257(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -15534,7 +16611,7 @@ parse_unary: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.212 + jne .L.else.230 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -15593,7 +16670,7 @@ parse_unary: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.213 + jne .L.else.231 movq $5, %rax push %rax leaq -8(%rbp), %rax @@ -15609,9 +16686,9 @@ parse_unary: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.214 + jne .L.else.232 .data -.L.str.249: +.L.str.258: .byte 99 .byte 97 .byte 110 @@ -15649,7 +16726,7 @@ parse_unary: .byte 101 .byte 0 .text - leaq .L.str.249(%rip), %rax + leaq .L.str.258(%rip), %rax push %rax leaq -40(%rbp), %rax movq (%rax), %rax @@ -15659,9 +16736,9 @@ parse_unary: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.214 -.L.else.214: -.L.end.214: + jmp .L.end.232 +.L.else.232: +.L.end.232: leaq -88(%rbp), %rax push %rax leaq -72(%rbp), %rax @@ -15692,9 +16769,9 @@ parse_unary: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.215 + jne .L.else.233 .data -.L.str.250: +.L.str.259: .byte 109 .byte 101 .byte 109 @@ -15718,7 +16795,7 @@ parse_unary: .byte 100 .byte 0 .text - leaq .L.str.250(%rip), %rax + leaq .L.str.259(%rip), %rax push %rax leaq -80(%rbp), %rax movq (%rax), %rax @@ -15737,9 +16814,9 @@ parse_unary: movq $0, %rax callq *%r10 addq $24, %rsp - jmp .L.end.215 -.L.else.215: -.L.end.215: + jmp .L.end.233 +.L.else.233: +.L.end.233: leaq -8(%rbp), %rax push %rax leaq -8(%rbp), %rax @@ -15768,8 +16845,8 @@ parse_unary: addq $40, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.213 -.L.else.213: + jmp .L.end.231 +.L.else.231: movq $5, %rax push %rax leaq -8(%rbp), %rax @@ -15783,9 +16860,9 @@ parse_unary: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.216 + jne .L.else.234 .data -.L.str.251: +.L.str.260: .byte 99 .byte 97 .byte 110 @@ -15823,7 +16900,7 @@ parse_unary: .byte 101 .byte 0 .text - leaq .L.str.251(%rip), %rax + leaq .L.str.260(%rip), %rax push %rax leaq -40(%rbp), %rax movq (%rax), %rax @@ -15833,9 +16910,9 @@ parse_unary: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.216 -.L.else.216: -.L.end.216: + jmp .L.end.234 +.L.else.234: +.L.end.234: leaq -88(%rbp), %rax push %rax leaq -72(%rbp), %rax @@ -15864,9 +16941,9 @@ parse_unary: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.217 + jne .L.else.235 .data -.L.str.252: +.L.str.261: .byte 109 .byte 101 .byte 109 @@ -15890,7 +16967,7 @@ parse_unary: .byte 100 .byte 0 .text - leaq .L.str.252(%rip), %rax + leaq .L.str.261(%rip), %rax push %rax leaq -80(%rbp), %rax movq (%rax), %rax @@ -15907,10 +16984,10 @@ parse_unary: movq $0, %rax callq *%r10 addq $24, %rsp - jmp .L.end.217 -.L.else.217: -.L.end.217: -.L.end.213: + jmp .L.end.235 +.L.else.235: +.L.end.235: +.L.end.231: leaq -92(%rbp), %rax push %rax leaq -88(%rbp), %rax @@ -15953,13 +17030,13 @@ parse_unary: pop %rdi movq %rax, (%rdi) jmp .L.parse_unary.continue - jmp .L.end.212 -.L.else.212: -.L.end.212: + jmp .L.end.230 +.L.else.230: +.L.end.230: jmp .L.parse_unary.break .L.parse_unary.continue: - jmp .L.while.start.201 -.L.while.end.201: + jmp .L.while.start.219 +.L.while.end.219: .L.parse_unary.break: leaq -8(%rbp), %rax movq (%rax), %rax @@ -15984,13 +17061,13 @@ parse_func_call_args: addq $8, %rsp pop %rdi movq %rax, (%rdi) -.L.while.start.218: +.L.while.start.236: .data -.L.str.253: +.L.str.262: .byte 41 .byte 0 .text - leaq .L.str.253(%rip), %rax + leaq .L.str.262(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -16009,7 +17086,7 @@ parse_func_call_args: sete %al movzbq %al, %rax cmpq $1, %rax - jne .L.while.end.218 + jne .L.while.end.236 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -16028,11 +17105,11 @@ parse_func_call_args: callq *%r10 addq $16, %rsp .data -.L.str.254: +.L.str.263: .byte 44 .byte 0 .text - leaq .L.str.254(%rip), %rax + leaq .L.str.263(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -16051,11 +17128,11 @@ parse_func_call_args: sete %al movzbq %al, %rax cmpq $1, %rax - jne .L.else.219 + jne .L.else.237 jmp .L.parse_func_call_args.break - jmp .L.end.219 -.L.else.219: -.L.end.219: + jmp .L.end.237 +.L.else.237: +.L.end.237: leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -16064,8 +17141,8 @@ parse_func_call_args: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.while.start.218 -.L.while.end.218: + jmp .L.while.start.236 +.L.while.end.236: .L.parse_func_call_args.break: leaq -8(%rbp), %rax movq (%rax), %rax @@ -16092,11 +17169,11 @@ parse_expr: pop %rdi movq %rax, (%rdi) .data -.L.str.255: +.L.str.264: .byte 61 .byte 0 .text - leaq .L.str.255(%rip), %rax + leaq .L.str.264(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -16112,7 +17189,7 @@ parse_expr: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.220 + jne .L.else.238 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -16144,9 +17221,9 @@ parse_expr: addq $24, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.220 -.L.else.220: -.L.end.220: + jmp .L.end.238 +.L.else.238: +.L.end.238: leaq -8(%rbp), %rax movq (%rax), %rax movq %rbp, %rsp @@ -16164,13 +17241,13 @@ parse_params_types: movq $0, %rax pop %rdi movb %al, (%rdi) -.L.while.start.221: +.L.while.start.239: .data -.L.str.256: +.L.str.265: .byte 41 .byte 0 .text - leaq .L.str.256(%rip), %rax + leaq .L.str.265(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -16189,15 +17266,15 @@ parse_params_types: sete %al movzbq %al, %rax cmpq $1, %rax - jne .L.while.end.221 + jne .L.while.end.239 .data -.L.str.257: +.L.str.266: .byte 46 .byte 46 .byte 46 .byte 0 .text - leaq .L.str.257(%rip), %rax + leaq .L.str.266(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -16213,7 +17290,7 @@ parse_params_types: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.222 + jne .L.else.240 leaq -1(%rbp), %rax push %rax movq $1, %rax @@ -16227,8 +17304,8 @@ parse_params_types: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.222 -.L.else.222: + jmp .L.end.240 +.L.else.240: leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -16246,13 +17323,13 @@ parse_params_types: movq $0, %rax callq *%r10 addq $16, %rsp -.L.end.222: +.L.end.240: .data -.L.str.258: +.L.str.267: .byte 44 .byte 0 .text - leaq .L.str.258(%rip), %rax + leaq .L.str.267(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -16271,11 +17348,11 @@ parse_params_types: sete %al movzbq %al, %rax cmpq $1, %rax - jne .L.else.223 + jne .L.else.241 jmp .L.parse_params_types.break - jmp .L.end.223 -.L.else.223: -.L.end.223: + jmp .L.end.241 +.L.else.241: +.L.end.241: leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -16284,8 +17361,8 @@ parse_params_types: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.while.start.221 -.L.while.end.221: + jmp .L.while.start.239 +.L.while.end.239: .L.parse_params_types.break: leaq -1(%rbp), %rax movsbl (%rax), %eax @@ -16326,13 +17403,13 @@ parse_ty: callq *%r10 addq $8, %rsp .data -.L.str.259: +.L.str.268: .byte 105 .byte 54 .byte 52 .byte 0 .text - leaq .L.str.259(%rip), %rax + leaq .L.str.268(%rip), %rax push %rax leaq -8(%rbp), %rax movq (%rax), %rax @@ -16344,7 +17421,7 @@ parse_ty: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.224 + jne .L.else.242 leaq -24(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -16353,16 +17430,16 @@ parse_ty: movq (%rax), %rax pop %rdi movq %rax, (%rdi) - jmp .L.end.224 -.L.else.224: + jmp .L.end.242 +.L.else.242: .data -.L.str.260: +.L.str.269: .byte 105 .byte 51 .byte 50 .byte 0 .text - leaq .L.str.260(%rip), %rax + leaq .L.str.269(%rip), %rax push %rax leaq -8(%rbp), %rax movq (%rax), %rax @@ -16374,7 +17451,7 @@ parse_ty: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.225 + jne .L.else.243 leaq -24(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -16383,16 +17460,16 @@ parse_ty: movq (%rax), %rax pop %rdi movq %rax, (%rdi) - jmp .L.end.225 -.L.else.225: + jmp .L.end.243 +.L.else.243: .data -.L.str.261: +.L.str.270: .byte 105 .byte 49 .byte 54 .byte 0 .text - leaq .L.str.261(%rip), %rax + leaq .L.str.270(%rip), %rax push %rax leaq -8(%rbp), %rax movq (%rax), %rax @@ -16404,7 +17481,7 @@ parse_ty: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.226 + jne .L.else.244 leaq -24(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -16413,15 +17490,15 @@ parse_ty: movq (%rax), %rax pop %rdi movq %rax, (%rdi) - jmp .L.end.226 -.L.else.226: + jmp .L.end.244 +.L.else.244: .data -.L.str.262: +.L.str.271: .byte 105 .byte 56 .byte 0 .text - leaq .L.str.262(%rip), %rax + leaq .L.str.271(%rip), %rax push %rax leaq -8(%rbp), %rax movq (%rax), %rax @@ -16433,7 +17510,7 @@ parse_ty: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.227 + jne .L.else.245 leaq -24(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -16442,16 +17519,16 @@ parse_ty: movq (%rax), %rax pop %rdi movq %rax, (%rdi) - jmp .L.end.227 -.L.else.227: + jmp .L.end.245 +.L.else.245: .data -.L.str.263: +.L.str.272: .byte 117 .byte 54 .byte 52 .byte 0 .text - leaq .L.str.263(%rip), %rax + leaq .L.str.272(%rip), %rax push %rax leaq -8(%rbp), %rax movq (%rax), %rax @@ -16463,7 +17540,7 @@ parse_ty: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.228 + jne .L.else.246 leaq -24(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -16472,16 +17549,16 @@ parse_ty: movq (%rax), %rax pop %rdi movq %rax, (%rdi) - jmp .L.end.228 -.L.else.228: + jmp .L.end.246 +.L.else.246: .data -.L.str.264: +.L.str.273: .byte 117 .byte 51 .byte 50 .byte 0 .text - leaq .L.str.264(%rip), %rax + leaq .L.str.273(%rip), %rax push %rax leaq -8(%rbp), %rax movq (%rax), %rax @@ -16493,7 +17570,7 @@ parse_ty: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.229 + jne .L.else.247 leaq -24(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -16502,16 +17579,16 @@ parse_ty: movq (%rax), %rax pop %rdi movq %rax, (%rdi) - jmp .L.end.229 -.L.else.229: + jmp .L.end.247 +.L.else.247: .data -.L.str.265: +.L.str.274: .byte 117 .byte 49 .byte 54 .byte 0 .text - leaq .L.str.265(%rip), %rax + leaq .L.str.274(%rip), %rax push %rax leaq -8(%rbp), %rax movq (%rax), %rax @@ -16523,7 +17600,7 @@ parse_ty: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.230 + jne .L.else.248 leaq -24(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -16532,15 +17609,15 @@ parse_ty: movq (%rax), %rax pop %rdi movq %rax, (%rdi) - jmp .L.end.230 -.L.else.230: + jmp .L.end.248 +.L.else.248: .data -.L.str.266: +.L.str.275: .byte 117 .byte 56 .byte 0 .text - leaq .L.str.266(%rip), %rax + leaq .L.str.275(%rip), %rax push %rax leaq -8(%rbp), %rax movq (%rax), %rax @@ -16552,7 +17629,7 @@ parse_ty: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.231 + jne .L.else.249 leaq -24(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -16561,17 +17638,46 @@ parse_ty: movq (%rax), %rax pop %rdi movq %rax, (%rdi) - jmp .L.end.231 -.L.else.231: + jmp .L.end.249 +.L.else.249: .data -.L.str.267: +.L.str.276: + .byte 117 + .byte 48 + .byte 0 +.text + leaq .L.str.276(%rip), %rax + push %rax + leaq -8(%rbp), %rax + movq (%rax), %rax + push %rax + leaq strcmp(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp + movzx %al, %eax + cmpq $1, %rax + jne .L.else.250 + leaq -24(%rbp), %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $64, %rax + movq (%rax), %rax + pop %rdi + movq %rax, (%rdi) + jmp .L.end.250 +.L.else.250: +.data +.L.str.277: .byte 98 .byte 111 .byte 111 .byte 108 .byte 0 .text - leaq .L.str.267(%rip), %rax + leaq .L.str.277(%rip), %rax push %rax leaq -8(%rbp), %rax movq (%rax), %rax @@ -16583,7 +17689,7 @@ parse_ty: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.232 + jne .L.else.251 leaq -24(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -16592,14 +17698,14 @@ parse_ty: movq (%rax), %rax pop %rdi movq %rax, (%rdi) - jmp .L.end.232 -.L.else.232: + jmp .L.end.251 +.L.else.251: .data -.L.str.268: +.L.str.278: .byte 42 .byte 0 .text - leaq .L.str.268(%rip), %rax + leaq .L.str.278(%rip), %rax push %rax leaq -8(%rbp), %rax movq (%rax), %rax @@ -16611,7 +17717,7 @@ parse_ty: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.233 + jne .L.else.252 leaq -24(%rbp), %rax push %rax leaq 16(%rbp), %rax @@ -16630,17 +17736,17 @@ parse_ty: addq $8, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.233 -.L.else.233: + jmp .L.end.252 +.L.else.252: .data -.L.str.269: +.L.str.279: .byte 102 .byte 117 .byte 110 .byte 99 .byte 0 .text - leaq .L.str.269(%rip), %rax + leaq .L.str.279(%rip), %rax push %rax leaq -8(%rbp), %rax movq (%rax), %rax @@ -16652,13 +17758,13 @@ parse_ty: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.234 + jne .L.else.253 .data -.L.str.270: +.L.str.280: .byte 40 .byte 0 .text - leaq .L.str.270(%rip), %rax + leaq .L.str.280(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -16695,11 +17801,11 @@ parse_ty: pop %rdi movb %al, (%rdi) .data -.L.str.271: +.L.str.281: .byte 41 .byte 0 .text - leaq .L.str.271(%rip), %rax + leaq .L.str.281(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -16733,8 +17839,8 @@ parse_ty: addq $24, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.234 -.L.else.234: + jmp .L.end.253 +.L.else.253: leaq -24(%rbp), %rax push %rax leaq -8(%rbp), %rax @@ -16759,9 +17865,9 @@ parse_ty: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.235 + jne .L.else.254 .data -.L.str.272: +.L.str.282: .byte 117 .byte 110 .byte 107 @@ -16781,7 +17887,7 @@ parse_ty: .byte 100 .byte 0 .text - leaq .L.str.272(%rip), %rax + leaq .L.str.282(%rip), %rax push %rax leaq -16(%rbp), %rax movq (%rax), %rax @@ -16797,7 +17903,7 @@ parse_ty: callq *%r10 addq $24, %rsp .data -.L.str.273: +.L.str.283: .byte 117 .byte 110 .byte 107 @@ -16817,7 +17923,7 @@ parse_ty: .byte 100 .byte 0 .text - leaq .L.str.273(%rip), %rax + leaq .L.str.283(%rip), %rax push %rax leaq -16(%rbp), %rax movq (%rax), %rax @@ -16827,20 +17933,21 @@ parse_ty: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.235 -.L.else.235: -.L.end.235: -.L.end.234: -.L.end.233: -.L.end.232: -.L.end.231: -.L.end.230: -.L.end.229: -.L.end.228: -.L.end.227: -.L.end.226: -.L.end.225: -.L.end.224: + jmp .L.end.254 +.L.else.254: +.L.end.254: +.L.end.253: +.L.end.252: +.L.end.251: +.L.end.250: +.L.end.249: +.L.end.248: +.L.end.247: +.L.end.246: +.L.end.245: +.L.end.244: +.L.end.243: +.L.end.242: leaq -24(%rbp), %rax movq (%rax), %rax movq %rbp, %rsp @@ -16862,20 +17969,20 @@ add_type_block: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.236 + jne .L.else.255 movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.236 -.L.else.236: -.L.end.236: + jmp .L.end.255 +.L.else.255: +.L.end.255: leaq -4(%rbp), %rax push %rax movq $0, %rax pop %rdi movl %eax, (%rdi) -.L.while.start.237: +.L.while.start.256: leaq 24(%rbp), %rax movq (%rax), %rax addq $8, %rax @@ -16888,7 +17995,7 @@ add_type_block: setl %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.237 + jne .L.while.end.256 movq $8, %rax push %rax leaq -4(%rbp), %rax @@ -16926,8 +18033,8 @@ add_type_block: movl %eax, (%rdi) pop %rdi subl %edi, %eax - jmp .L.while.start.237 -.L.while.end.237: + jmp .L.while.start.256 +.L.while.end.256: movq $0, %rax movq %rbp, %rsp pop %rbp @@ -16948,14 +18055,14 @@ add_type: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.238 + jne .L.else.257 movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.238 -.L.else.238: -.L.end.238: + jmp .L.end.257 +.L.else.257: +.L.end.257: movq $0, %rax push %rax leaq 24(%rbp), %rax @@ -16967,14 +18074,14 @@ add_type: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.239 + jne .L.else.258 movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.239 -.L.else.239: -.L.end.239: + jmp .L.end.258 +.L.else.258: +.L.end.258: leaq 24(%rbp), %rax movq (%rax), %rax addq $4, %rax @@ -17064,13 +18171,13 @@ add_type: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.240 + jne .L.else.259 leaq -4(%rbp), %rax push %rax movq $0, %rax pop %rdi movl %eax, (%rdi) -.L.while.start.241: +.L.while.start.260: leaq 24(%rbp), %rax movq (%rax), %rax addq $100, %rax @@ -17085,7 +18192,7 @@ add_type: setl %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.241 + jne .L.while.end.260 movq $8, %rax push %rax leaq -4(%rbp), %rax @@ -17125,11 +18232,11 @@ add_type: movl %eax, (%rdi) pop %rdi subl %edi, %eax - jmp .L.while.start.241 -.L.while.end.241: - jmp .L.end.240 -.L.else.240: -.L.end.240: + jmp .L.while.start.260 +.L.while.end.260: + jmp .L.end.259 +.L.else.259: +.L.end.259: movq $12, %rax push %rax leaq 24(%rbp), %rax @@ -17141,7 +18248,7 @@ add_type: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.242 + jne .L.else.261 leaq 24(%rbp), %rax movq (%rax), %rax addq $80, %rax @@ -17162,9 +18269,9 @@ add_type: movq %rbp, %rsp pop %rbp retq - jmp .L.end.242 -.L.else.242: -.L.end.242: + jmp .L.end.261 +.L.else.261: +.L.end.261: movq $23, %rax push %rax leaq 24(%rbp), %rax @@ -17176,7 +18283,7 @@ add_type: sete %al movzbl %al, %eax cmpq $0, %rax - jne .L.true.247 + jne .L.true.266 movq $24, %rax push %rax leaq 24(%rbp), %rax @@ -17188,14 +18295,14 @@ add_type: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.247 + jne .L.true.266 mov $0, %rax - jmp .L.end.247 -.L.true.247: + jmp .L.end.266 +.L.true.266: mov $1, %rax -.L.end.247: +.L.end.266: cmpq $0, %rax - jne .L.true.246 + jne .L.true.265 movq $15, %rax push %rax leaq 24(%rbp), %rax @@ -17207,14 +18314,14 @@ add_type: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.246 + jne .L.true.265 mov $0, %rax - jmp .L.end.246 -.L.true.246: + jmp .L.end.265 +.L.true.265: mov $1, %rax -.L.end.246: +.L.end.265: cmpq $0, %rax - jne .L.true.245 + jne .L.true.264 movq $16, %rax push %rax leaq 24(%rbp), %rax @@ -17226,14 +18333,14 @@ add_type: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.245 + jne .L.true.264 mov $0, %rax - jmp .L.end.245 -.L.true.245: + jmp .L.end.264 +.L.true.264: mov $1, %rax -.L.end.245: +.L.end.264: cmpq $0, %rax - jne .L.true.244 + jne .L.true.263 movq $18, %rax push %rax leaq 24(%rbp), %rax @@ -17245,21 +18352,21 @@ add_type: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.244 + jne .L.true.263 mov $0, %rax - jmp .L.end.244 -.L.true.244: + jmp .L.end.263 +.L.true.263: mov $1, %rax -.L.end.244: +.L.end.263: cmpq $1, %rax - jne .L.else.243 + jne .L.else.262 movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.243 -.L.else.243: -.L.end.243: + jmp .L.end.262 +.L.else.262: +.L.end.262: movq $25, %rax push %rax leaq 24(%rbp), %rax @@ -17271,7 +18378,7 @@ add_type: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.248 + jne .L.else.267 leaq 24(%rbp), %rax movq (%rax), %rax addq $80, %rax @@ -17290,9 +18397,9 @@ add_type: movq %rbp, %rsp pop %rbp retq - jmp .L.end.248 -.L.else.248: -.L.end.248: + jmp .L.end.267 +.L.else.267: +.L.end.267: movq $0, %rax push %rax leaq 24(%rbp), %rax @@ -17304,7 +18411,7 @@ add_type: sete %al movzbl %al, %eax cmpq $0, %rax - jne .L.true.256 + jne .L.true.275 movq $1, %rax push %rax leaq 24(%rbp), %rax @@ -17316,14 +18423,14 @@ add_type: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.256 + jne .L.true.275 mov $0, %rax - jmp .L.end.256 -.L.true.256: + jmp .L.end.275 +.L.true.275: mov $1, %rax -.L.end.256: +.L.end.275: cmpq $0, %rax - jne .L.true.255 + jne .L.true.274 movq $2, %rax push %rax leaq 24(%rbp), %rax @@ -17335,14 +18442,14 @@ add_type: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.255 + jne .L.true.274 mov $0, %rax - jmp .L.end.255 -.L.true.255: + jmp .L.end.274 +.L.true.274: mov $1, %rax -.L.end.255: +.L.end.274: cmpq $0, %rax - jne .L.true.254 + jne .L.true.273 movq $3, %rax push %rax leaq 24(%rbp), %rax @@ -17354,14 +18461,14 @@ add_type: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.254 + jne .L.true.273 mov $0, %rax - jmp .L.end.254 -.L.true.254: + jmp .L.end.273 +.L.true.273: mov $1, %rax -.L.end.254: +.L.end.273: cmpq $0, %rax - jne .L.true.253 + jne .L.true.272 movq $4, %rax push %rax leaq 24(%rbp), %rax @@ -17373,14 +18480,14 @@ add_type: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.253 + jne .L.true.272 mov $0, %rax - jmp .L.end.253 -.L.true.253: + jmp .L.end.272 +.L.true.272: mov $1, %rax -.L.end.253: +.L.end.272: cmpq $0, %rax - jne .L.true.252 + jne .L.true.271 movq $17, %rax push %rax leaq 24(%rbp), %rax @@ -17392,14 +18499,14 @@ add_type: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.252 + jne .L.true.271 mov $0, %rax - jmp .L.end.252 -.L.true.252: + jmp .L.end.271 +.L.true.271: mov $1, %rax -.L.end.252: +.L.end.271: cmpq $0, %rax - jne .L.true.251 + jne .L.true.270 movq $30, %rax push %rax leaq 24(%rbp), %rax @@ -17411,14 +18518,14 @@ add_type: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.251 + jne .L.true.270 mov $0, %rax - jmp .L.end.251 -.L.true.251: + jmp .L.end.270 +.L.true.270: mov $1, %rax -.L.end.251: +.L.end.270: cmpq $0, %rax - jne .L.true.250 + jne .L.true.269 movq $31, %rax push %rax leaq 24(%rbp), %rax @@ -17430,14 +18537,14 @@ add_type: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.250 + jne .L.true.269 mov $0, %rax - jmp .L.end.250 -.L.true.250: + jmp .L.end.269 +.L.true.269: mov $1, %rax -.L.end.250: +.L.end.269: cmpq $1, %rax - jne .L.else.249 + jne .L.else.268 leaq 24(%rbp), %rax movq (%rax), %rax addq $80, %rax @@ -17454,9 +18561,9 @@ add_type: movq %rbp, %rsp pop %rbp retq - jmp .L.end.249 -.L.else.249: -.L.end.249: + jmp .L.end.268 +.L.else.268: +.L.end.268: movq $5, %rax push %rax leaq 24(%rbp), %rax @@ -17468,7 +18575,7 @@ add_type: sete %al movzbl %al, %eax cmpq $0, %rax - jne .L.true.266 + jne .L.true.285 movq $7, %rax push %rax leaq 24(%rbp), %rax @@ -17480,14 +18587,14 @@ add_type: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.266 + jne .L.true.285 mov $0, %rax - jmp .L.end.266 -.L.true.266: + jmp .L.end.285 +.L.true.285: mov $1, %rax -.L.end.266: +.L.end.285: cmpq $0, %rax - jne .L.true.265 + jne .L.true.284 movq $6, %rax push %rax leaq 24(%rbp), %rax @@ -17499,14 +18606,14 @@ add_type: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.265 + jne .L.true.284 mov $0, %rax - jmp .L.end.265 -.L.true.265: + jmp .L.end.284 +.L.true.284: mov $1, %rax -.L.end.265: +.L.end.284: cmpq $0, %rax - jne .L.true.264 + jne .L.true.283 movq $8, %rax push %rax leaq 24(%rbp), %rax @@ -17518,14 +18625,14 @@ add_type: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.264 + jne .L.true.283 mov $0, %rax - jmp .L.end.264 -.L.true.264: + jmp .L.end.283 +.L.true.283: mov $1, %rax -.L.end.264: +.L.end.283: cmpq $0, %rax - jne .L.true.263 + jne .L.true.282 movq $9, %rax push %rax leaq 24(%rbp), %rax @@ -17537,14 +18644,14 @@ add_type: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.263 + jne .L.true.282 mov $0, %rax - jmp .L.end.263 -.L.true.263: + jmp .L.end.282 +.L.true.282: mov $1, %rax -.L.end.263: +.L.end.282: cmpq $0, %rax - jne .L.true.262 + jne .L.true.281 movq $11, %rax push %rax leaq 24(%rbp), %rax @@ -17556,14 +18663,14 @@ add_type: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.262 + jne .L.true.281 mov $0, %rax - jmp .L.end.262 -.L.true.262: + jmp .L.end.281 +.L.true.281: mov $1, %rax -.L.end.262: +.L.end.281: cmpq $0, %rax - jne .L.true.261 + jne .L.true.280 movq $10, %rax push %rax leaq 24(%rbp), %rax @@ -17575,14 +18682,14 @@ add_type: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.261 + jne .L.true.280 mov $0, %rax - jmp .L.end.261 -.L.true.261: + jmp .L.end.280 +.L.true.280: mov $1, %rax -.L.end.261: +.L.end.280: cmpq $0, %rax - jne .L.true.260 + jne .L.true.279 movq $26, %rax push %rax leaq 24(%rbp), %rax @@ -17594,14 +18701,14 @@ add_type: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.260 + jne .L.true.279 mov $0, %rax - jmp .L.end.260 -.L.true.260: + jmp .L.end.279 +.L.true.279: mov $1, %rax -.L.end.260: +.L.end.279: cmpq $0, %rax - jne .L.true.259 + jne .L.true.278 movq $27, %rax push %rax leaq 24(%rbp), %rax @@ -17613,14 +18720,14 @@ add_type: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.259 + jne .L.true.278 mov $0, %rax - jmp .L.end.259 -.L.true.259: + jmp .L.end.278 +.L.true.278: mov $1, %rax -.L.end.259: +.L.end.278: cmpq $0, %rax - jne .L.true.258 + jne .L.true.277 movq $13, %rax push %rax leaq 24(%rbp), %rax @@ -17632,14 +18739,14 @@ add_type: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.258 + jne .L.true.277 mov $0, %rax - jmp .L.end.258 -.L.true.258: + jmp .L.end.277 +.L.true.277: mov $1, %rax -.L.end.258: +.L.end.277: cmpq $1, %rax - jne .L.else.257 + jne .L.else.276 leaq 24(%rbp), %rax movq (%rax), %rax addq $80, %rax @@ -17654,9 +18761,9 @@ add_type: movq %rbp, %rsp pop %rbp retq - jmp .L.end.257 -.L.else.257: -.L.end.257: + jmp .L.end.276 +.L.else.276: +.L.end.276: movq $14, %rax push %rax leaq 24(%rbp), %rax @@ -17668,7 +18775,7 @@ add_type: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.267 + jne .L.else.286 leaq 24(%rbp), %rax movq (%rax), %rax addq $80, %rax @@ -17685,9 +18792,9 @@ add_type: movq %rbp, %rsp pop %rbp retq - jmp .L.end.267 -.L.else.267: -.L.end.267: + jmp .L.end.286 +.L.else.286: +.L.end.286: movq $19, %rax push %rax leaq 24(%rbp), %rax @@ -17699,7 +18806,7 @@ add_type: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.268 + jne .L.else.287 leaq 24(%rbp), %rax movq (%rax), %rax addq $80, %rax @@ -17722,9 +18829,9 @@ add_type: movq %rbp, %rsp pop %rbp retq - jmp .L.end.268 -.L.else.268: -.L.end.268: + jmp .L.end.287 +.L.else.287: +.L.end.287: movq $20, %rax push %rax leaq 24(%rbp), %rax @@ -17736,7 +18843,7 @@ add_type: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.269 + jne .L.else.288 leaq 24(%rbp), %rax movq (%rax), %rax addq $80, %rax @@ -17755,9 +18862,9 @@ add_type: movq %rbp, %rsp pop %rbp retq - jmp .L.end.269 -.L.else.269: -.L.end.269: + jmp .L.end.288 +.L.else.288: +.L.end.288: movq $22, %rax push %rax leaq 24(%rbp), %rax @@ -17769,7 +18876,7 @@ add_type: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.270 + jne .L.else.289 leaq 24(%rbp), %rax movq (%rax), %rax addq $80, %rax @@ -17786,9 +18893,9 @@ add_type: movq %rbp, %rsp pop %rbp retq - jmp .L.end.270 -.L.else.270: -.L.end.270: + jmp .L.end.289 +.L.else.289: +.L.end.289: movq $0, %rax movq %rbp, %rsp pop %rbp @@ -17834,11 +18941,9 @@ new_local_object: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.271 - leaq (%rsp), %rax - push %rax + jne .L.else.290 .data -.L.str.274: +.L.str.284: .byte 97 .byte 108 .byte 108 @@ -17862,13 +18967,13 @@ new_local_object: .byte 10 .byte 0 .text - leaq .L.str.274(%rip), %rax + leaq .L.str.284(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -17876,9 +18981,9 @@ new_local_object: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.271 -.L.else.271: -.L.end.271: + jmp .L.end.290 +.L.else.290: +.L.end.290: leaq -8(%rbp), %rax movq (%rax), %rax addq $8, %rax @@ -17949,7 +19054,7 @@ check_local_object_already_exist: movq (%rax), %rax pop %rdi movq %rax, (%rdi) -.L.while.start.272: +.L.while.start.291: movq $0, %rax push %rax leaq -8(%rbp), %rax @@ -17959,7 +19064,7 @@ check_local_object_already_exist: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.272 + jne .L.while.end.291 leaq 24(%rbp), %rax movq (%rax), %rax push %rax @@ -17975,9 +19080,9 @@ check_local_object_already_exist: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.273 + jne .L.else.292 .data -.L.str.275: +.L.str.285: .byte 110 .byte 97 .byte 109 @@ -17998,7 +19103,7 @@ check_local_object_already_exist: .byte 116 .byte 0 .text - leaq .L.str.275(%rip), %rax + leaq .L.str.285(%rip), %rax push %rax leaq 32(%rbp), %rax movq (%rax), %rax @@ -18009,13 +19114,13 @@ check_local_object_already_exist: callq *%r10 addq $16, %rsp .data -.L.str.276: +.L.str.286: .byte 46 .byte 46 .byte 46 .byte 0 .text - leaq .L.str.276(%rip), %rax + leaq .L.str.286(%rip), %rax push %rax leaq 32(%rbp), %rax movq (%rax), %rax @@ -18029,11 +19134,9 @@ check_local_object_already_exist: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.274 - leaq (%rsp), %rax - push %rax + jne .L.else.293 .data -.L.str.277: +.L.str.287: .byte 104 .byte 101 .byte 108 @@ -18093,314 +19196,63 @@ check_local_object_already_exist: .byte 32 .byte 117 .byte 115 - .byte 105 - .byte 110 - .byte 103 - .byte 32 - .byte 116 - .byte 104 - .byte 101 - .byte 32 - .byte 98 - .byte 117 - .byte 105 - .byte 108 - .byte 116 - .byte 45 - .byte 105 - .byte 110 - .byte 32 - .byte 118 - .byte 97 - .byte 114 - .byte 105 - .byte 97 - .byte 98 - .byte 108 - .byte 101 - .byte 32 - .byte 96 - .byte 97 - .byte 114 - .byte 103 - .byte 118 - .byte 96 - .byte 44 - .byte 32 - .byte 119 - .byte 104 - .byte 105 - .byte 99 - .byte 104 - .byte 32 - .byte 99 - .byte 97 - .byte 110 - .byte 32 - .byte 98 - .byte 101 - .byte 32 - .byte 114 - .byte 101 - .byte 110 - .byte 97 - .byte 109 - .byte 101 - .byte 100 - .byte 32 - .byte 97 - .byte 115 - .byte 32 - .byte 116 - .byte 104 - .byte 101 - .byte 32 - .byte 102 - .byte 111 - .byte 108 - .byte 108 - .byte 111 - .byte 119 - .byte 105 - .byte 110 - .byte 103 - .byte 32 - .byte 101 - .byte 120 - .byte 97 - .byte 109 - .byte 112 - .byte 108 - .byte 101 - .byte 10 - .byte 0 -.text - leaq .L.str.277(%rip), %rax - push %rax - leaq eprintf(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax -.data -.L.str.278: - .byte 32 - .byte 124 - .byte 10 - .byte 0 -.text - leaq .L.str.278(%rip), %rax - push %rax - leaq eprintf(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax -.data -.L.str.279: - .byte 32 - .byte 124 - .byte 32 - .byte 47 - .byte 47 - .byte 32 - .byte 115 - .byte 105 - .byte 109 - .byte 112 - .byte 108 - .byte 101 - .byte 32 - .byte 101 - .byte 120 - .byte 97 - .byte 109 - .byte 112 - .byte 108 - .byte 101 - .byte 32 - .byte 111 - .byte 102 - .byte 32 - .byte 114 - .byte 101 - .byte 110 - .byte 97 - .byte 109 - .byte 105 - .byte 110 - .byte 103 - .byte 32 - .byte 96 - .byte 97 - .byte 114 - .byte 103 - .byte 118 - .byte 96 - .byte 32 - .byte 116 - .byte 111 - .byte 32 - .byte 96 - .byte 110 - .byte 117 - .byte 109 - .byte 115 - .byte 96 - .byte 46 - .byte 10 - .byte 0 -.text - leaq .L.str.279(%rip), %rax - push %rax - leaq eprintf(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax -.data -.L.str.280: - .byte 32 - .byte 124 - .byte 32 - .byte 102 - .byte 117 - .byte 110 - .byte 99 - .byte 32 - .byte 97 - .byte 100 - .byte 100 - .byte 95 - .byte 110 - .byte 117 - .byte 109 - .byte 115 - .byte 40 - .byte 110 - .byte 117 - .byte 109 - .byte 115 - .byte 32 - .byte 46 - .byte 46 - .byte 46 - .byte 41 - .byte 32 - .byte 105 - .byte 51 - .byte 50 - .byte 32 - .byte 123 - .byte 10 - .byte 0 -.text - leaq .L.str.280(%rip), %rax - push %rax - leaq eprintf(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax -.data -.L.str.281: - .byte 32 - .byte 124 - .byte 32 - .byte 32 - .byte 32 - .byte 32 - .byte 32 - .byte 114 - .byte 101 - .byte 116 - .byte 117 - .byte 114 - .byte 110 - .byte 32 - .byte 110 - .byte 117 - .byte 109 - .byte 115 - .byte 91 - .byte 48 - .byte 93 - .byte 32 - .byte 43 - .byte 32 - .byte 110 - .byte 117 - .byte 109 - .byte 115 - .byte 91 - .byte 49 - .byte 93 + .byte 105 + .byte 110 + .byte 103 .byte 32 - .byte 43 + .byte 116 + .byte 104 + .byte 101 .byte 32 - .byte 110 + .byte 98 .byte 117 - .byte 109 - .byte 115 - .byte 91 - .byte 50 - .byte 93 - .byte 59 - .byte 10 - .byte 0 -.text - leaq .L.str.281(%rip), %rax - push %rax - leaq eprintf(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax -.data -.L.str.282: + .byte 105 + .byte 108 + .byte 116 + .byte 45 + .byte 105 + .byte 110 .byte 32 - .byte 124 + .byte 118 + .byte 97 + .byte 114 + .byte 105 + .byte 97 + .byte 98 + .byte 108 + .byte 101 .byte 32 - .byte 125 - .byte 10 - .byte 0 -.text - leaq .L.str.282(%rip), %rax - push %rax - leaq eprintf(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax -.data -.L.str.283: + .byte 96 + .byte 97 + .byte 114 + .byte 103 + .byte 118 + .byte 96 .byte 32 - .byte 124 + .byte 97 + .byte 110 + .byte 100 + .byte 32 + .byte 96 + .byte 97 + .byte 114 + .byte 103 + .byte 99 + .byte 96 + .byte 46 .byte 10 .byte 0 .text - leaq .L.str.283(%rip), %rax + leaq .L.str.287(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.274 -.L.else.274: -.L.end.274: + addq $8, %rsp + jmp .L.end.293 +.L.else.293: +.L.end.293: movq $1, %rax push %rax leaq exit(%rip), %rax @@ -18408,9 +19260,9 @@ check_local_object_already_exist: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.273 -.L.else.273: -.L.end.273: + jmp .L.end.292 +.L.else.292: +.L.end.292: leaq -8(%rbp), %rax push %rax leaq -8(%rbp), %rax @@ -18419,8 +19271,8 @@ check_local_object_already_exist: movq (%rax), %rax pop %rdi movq %rax, (%rdi) - jmp .L.while.start.272 -.L.while.end.272: + jmp .L.while.start.291 +.L.while.end.291: movq $0, %rax movq %rbp, %rsp pop %rbp @@ -18440,7 +19292,7 @@ find_globals: movq (%rax), %rax pop %rdi movq %rax, (%rdi) -.L.while.start.275: +.L.while.start.294: movq $0, %rax push %rax leaq -8(%rbp), %rax @@ -18450,7 +19302,7 @@ find_globals: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.275 + jne .L.while.end.294 leaq 24(%rbp), %rax movq (%rax), %rax push %rax @@ -18466,15 +19318,15 @@ find_globals: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.276 + jne .L.else.295 leaq -8(%rbp), %rax movq (%rax), %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.276 -.L.else.276: -.L.end.276: + jmp .L.end.295 +.L.else.295: +.L.end.295: leaq -8(%rbp), %rax push %rax leaq -8(%rbp), %rax @@ -18483,8 +19335,8 @@ find_globals: movq (%rax), %rax pop %rdi movq %rax, (%rdi) - jmp .L.while.start.275 -.L.while.end.275: + jmp .L.while.start.294 +.L.while.end.294: movq $0, %rax movq %rbp, %rsp pop %rbp @@ -18504,7 +19356,7 @@ find_locals: movq (%rax), %rax pop %rdi movq %rax, (%rdi) -.L.while.start.277: +.L.while.start.296: movq $0, %rax push %rax leaq -8(%rbp), %rax @@ -18514,7 +19366,7 @@ find_locals: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.277 + jne .L.while.end.296 leaq 24(%rbp), %rax movq (%rax), %rax push %rax @@ -18530,15 +19382,15 @@ find_locals: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.278 + jne .L.else.297 leaq -8(%rbp), %rax movq (%rax), %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.278 -.L.else.278: -.L.end.278: + jmp .L.end.297 +.L.else.297: +.L.end.297: leaq -8(%rbp), %rax push %rax leaq -8(%rbp), %rax @@ -18547,8 +19399,8 @@ find_locals: movq (%rax), %rax pop %rdi movq %rax, (%rdi) - jmp .L.while.start.277 -.L.while.end.277: + jmp .L.while.start.296 +.L.while.end.296: movq $0, %rax movq %rbp, %rsp pop %rbp @@ -18569,7 +19421,7 @@ cmp_func_params: sete %al movzbl %al, %eax cmpq $0, %rax - jne .L.true.280 + jne .L.true.299 movq $0, %rax push %rax leaq 24(%rbp), %rax @@ -18579,18 +19431,16 @@ cmp_func_params: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.280 + jne .L.true.299 mov $0, %rax - jmp .L.end.280 -.L.true.280: + jmp .L.end.299 +.L.true.299: mov $1, %rax -.L.end.280: +.L.end.299: cmpq $1, %rax - jne .L.else.279 - leaq (%rsp), %rax - push %rax + jne .L.else.298 .data -.L.str.284: +.L.str.288: .byte 115 .byte 111 .byte 109 @@ -18647,13 +19497,13 @@ cmp_func_params: .byte 10 .byte 0 .text - leaq .L.str.284(%rip), %rax + leaq .L.str.288(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -18661,9 +19511,9 @@ cmp_func_params: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.279 -.L.else.279: -.L.end.279: + jmp .L.end.298 +.L.else.298: +.L.end.298: leaq 24(%rbp), %rax movq (%rax), %rax addq $8, %rax @@ -18678,20 +19528,20 @@ cmp_func_params: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.281 + jne .L.else.300 movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.281 -.L.else.281: -.L.end.281: + jmp .L.end.300 +.L.else.300: +.L.end.300: leaq -4(%rbp), %rax push %rax movq $0, %rax pop %rdi movl %eax, (%rdi) -.L.while.start.282: +.L.while.start.301: leaq 16(%rbp), %rax movq (%rax), %rax addq $8, %rax @@ -18704,7 +19554,7 @@ cmp_func_params: setl %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.282 + jne .L.while.end.301 movq $8, %rax push %rax leaq -4(%rbp), %rax @@ -18745,14 +19595,14 @@ cmp_func_params: sete %al movzbq %al, %rax cmpq $1, %rax - jne .L.else.283 + jne .L.else.302 movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.283 -.L.else.283: -.L.end.283: + jmp .L.end.302 +.L.else.302: +.L.end.302: movq $1, %rax push %rax leaq -4(%rbp), %rax @@ -18767,8 +19617,8 @@ cmp_func_params: movl %eax, (%rdi) pop %rdi subl %edi, %eax - jmp .L.while.start.282 -.L.while.end.282: + jmp .L.while.start.301 +.L.while.end.301: movq $1, %rax movq %rbp, %rsp pop %rbp @@ -18790,14 +19640,14 @@ cmp_func_param: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.284 + jne .L.else.303 movq $1, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.284 -.L.else.284: -.L.end.284: + jmp .L.end.303 +.L.else.303: +.L.end.303: leaq 24(%rbp), %rax movq (%rax), %rax addq $0, %rax @@ -18818,14 +19668,14 @@ cmp_func_param: sete %al movzbq %al, %rax cmpq $1, %rax - jne .L.else.285 + jne .L.else.304 movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.285 -.L.else.285: -.L.end.285: + jmp .L.end.304 +.L.else.304: +.L.end.304: leaq 24(%rbp), %rax movq (%rax), %rax addq $12, %rax @@ -18843,14 +19693,14 @@ cmp_func_param: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.286 + jne .L.else.305 movq $1, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.286 -.L.else.286: -.L.end.286: + jmp .L.end.305 +.L.else.305: +.L.end.305: movq $0, %rax movq %rbp, %rsp pop %rbp @@ -18876,20 +19726,20 @@ cmp_type_vec: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.287 + jne .L.else.306 movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.287 -.L.else.287: -.L.end.287: + jmp .L.end.306 +.L.else.306: +.L.end.306: leaq -4(%rbp), %rax push %rax movq $0, %rax pop %rdi movl %eax, (%rdi) -.L.while.start.288: +.L.while.start.307: leaq 16(%rbp), %rax movq (%rax), %rax addq $8, %rax @@ -18902,7 +19752,7 @@ cmp_type_vec: setl %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.288 + jne .L.while.end.307 movq $8, %rax push %rax leaq -4(%rbp), %rax @@ -18943,14 +19793,14 @@ cmp_type_vec: sete %al movzbq %al, %rax cmpq $1, %rax - jne .L.else.289 + jne .L.else.308 movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.289 -.L.else.289: -.L.end.289: + jmp .L.end.308 +.L.else.308: +.L.end.308: movq $1, %rax push %rax leaq -4(%rbp), %rax @@ -18965,8 +19815,8 @@ cmp_type_vec: movl %eax, (%rdi) pop %rdi subl %edi, %eax - jmp .L.while.start.288 -.L.while.end.288: + jmp .L.while.start.307 +.L.while.end.307: movq $1, %rax movq %rbp, %rsp pop %rbp @@ -18987,7 +19837,7 @@ cmp_type: sete %al movzbl %al, %eax cmpq $0, %rax - jne .L.true.291 + jne .L.true.310 movq $0, %rax push %rax leaq 24(%rbp), %rax @@ -18997,18 +19847,16 @@ cmp_type: sete %al movzbl %al, %eax cmp $0, %rax - jne .L.true.291 + jne .L.true.310 mov $0, %rax - jmp .L.end.291 -.L.true.291: + jmp .L.end.310 +.L.true.310: mov $1, %rax -.L.end.291: +.L.end.310: cmpq $1, %rax - jne .L.else.290 - leaq (%rsp), %rax - push %rax + jne .L.else.309 .data -.L.str.285: +.L.str.289: .byte 84 .byte 104 .byte 105 @@ -19034,13 +19882,13 @@ cmp_type: .byte 10 .byte 0 .text - leaq .L.str.285(%rip), %rax + leaq .L.str.289(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -19048,9 +19896,9 @@ cmp_type: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.290 -.L.else.290: -.L.end.290: + jmp .L.end.309 +.L.else.309: +.L.end.309: leaq 24(%rbp), %rax movq (%rax), %rax addq $0, %rax @@ -19065,14 +19913,14 @@ cmp_type: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.292 + jne .L.else.311 movq $0, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.292 -.L.else.292: -.L.end.292: + jmp .L.end.311 +.L.else.311: +.L.end.311: movq $6, %rax push %rax leaq 16(%rbp), %rax @@ -19084,7 +19932,7 @@ cmp_type: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.293 + jne .L.else.312 leaq 24(%rbp), %rax movq (%rax), %rax addq $24, %rax @@ -19102,7 +19950,7 @@ cmp_type: addq $16, %rsp movzx %al, %eax cmpq $0, %rax - je .L.false.295 + je .L.false.314 leaq 24(%rbp), %rax movq (%rax), %rax addq $32, %rax @@ -19120,14 +19968,14 @@ cmp_type: addq $16, %rsp movzx %al, %eax cmpq $0, %rax - je .L.false.295 + je .L.false.314 movq $1, %rax - jmp .L.end.295 -.L.false.295: + jmp .L.end.314 +.L.false.314: movq $0, %rax -.L.end.295: +.L.end.314: cmpq $0, %rax - je .L.false.294 + je .L.false.313 leaq 24(%rbp), %rax movq (%rax), %rax addq $40, %rax @@ -19142,18 +19990,18 @@ cmp_type: sete %al movzbl %al, %eax cmpq $0, %rax - je .L.false.294 + je .L.false.313 movq $1, %rax - jmp .L.end.294 -.L.false.294: + jmp .L.end.313 +.L.false.313: movq $0, %rax -.L.end.294: +.L.end.313: movq %rbp, %rsp pop %rbp retq - jmp .L.end.293 -.L.else.293: -.L.end.293: + jmp .L.end.312 +.L.else.312: +.L.end.312: movq $7, %rax push %rax leaq 16(%rbp), %rax @@ -19165,7 +20013,7 @@ cmp_type: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.296 + jne .L.else.315 leaq 24(%rbp), %rax movq (%rax), %rax addq $41, %rax @@ -19185,9 +20033,9 @@ cmp_type: movq %rbp, %rsp pop %rbp retq - jmp .L.end.296 -.L.else.296: -.L.end.296: + jmp .L.end.315 +.L.else.315: +.L.end.315: leaq 24(%rbp), %rax movq (%rax), %rax addq $4, %rax @@ -19202,7 +20050,7 @@ cmp_type: sete %al movzbl %al, %eax cmpq $0, %rax - je .L.false.298 + je .L.false.317 leaq 24(%rbp), %rax movq (%rax), %rax addq $49, %rax @@ -19217,14 +20065,14 @@ cmp_type: sete %al movzbl %al, %eax cmpq $0, %rax - je .L.false.298 + je .L.false.317 movq $1, %rax - jmp .L.end.298 -.L.false.298: + jmp .L.end.317 +.L.false.317: movq $0, %rax -.L.end.298: +.L.end.317: cmpq $0, %rax - je .L.false.297 + je .L.false.316 leaq 24(%rbp), %rax movq (%rax), %rax addq $8, %rax @@ -19242,12 +20090,12 @@ cmp_type: addq $16, %rsp movzx %al, %eax cmpq $0, %rax - je .L.false.297 + je .L.false.316 movq $1, %rax - jmp .L.end.297 -.L.false.297: + jmp .L.end.316 +.L.false.316: movq $0, %rax -.L.end.297: +.L.end.316: movq %rbp, %rsp pop %rbp retq @@ -19275,7 +20123,7 @@ parser_skip: addq $16, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.299 + jne .L.else.318 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -19288,10 +20136,10 @@ parser_skip: movq %rbp, %rsp pop %rbp retq - jmp .L.end.299 -.L.else.299: + jmp .L.end.318 +.L.else.318: .data -.L.str.286: +.L.str.290: .byte 117 .byte 110 .byte 101 @@ -19310,7 +20158,7 @@ parser_skip: .byte 110 .byte 0 .text - leaq .L.str.286(%rip), %rax + leaq .L.str.290(%rip), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -19325,7 +20173,7 @@ parser_skip: movq $0, %rax callq *%r10 addq $24, %rsp -.L.end.299: +.L.end.318: leave ret .global new_node @@ -19353,11 +20201,9 @@ new_node: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.300 - leaq (%rsp), %rax - push %rax + jne .L.else.319 .data -.L.str.287: +.L.str.291: .byte 97 .byte 108 .byte 108 @@ -19381,13 +20227,13 @@ new_node: .byte 10 .byte 0 .text - leaq .L.str.287(%rip), %rax + leaq .L.str.291(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -19395,9 +20241,9 @@ new_node: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.300 -.L.else.300: -.L.end.300: + jmp .L.end.319 +.L.else.319: +.L.end.319: leaq -8(%rbp), %rax movq (%rax), %rax addq $0, %rax @@ -19431,11 +20277,9 @@ parser_next: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.301 - leaq (%rsp), %rax - push %rax + jne .L.else.320 .data -.L.str.288: +.L.str.292: .byte 112 .byte 97 .byte 114 @@ -19461,13 +20305,13 @@ parser_next: .byte 10 .byte 0 .text - leaq .L.str.288(%rip), %rax + leaq .L.str.292(%rip), %rax push %rax leaq printf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -19475,9 +20319,9 @@ parser_next: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.301 -.L.else.301: -.L.end.301: + jmp .L.end.320 +.L.else.320: +.L.end.320: leaq 16(%rbp), %rax movq (%rax), %rax addq $0, %rax @@ -19519,13 +20363,11 @@ new_parser: pop %rdi cmpl %edi, %eax sete %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.else.302 - leaq (%rsp), %rax - push %rax + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.321 .data -.L.str.289: +.L.str.293: .byte 97 .byte 108 .byte 108 @@ -19549,13 +20391,13 @@ new_parser: .byte 10 .byte 0 .text - leaq .L.str.289(%rip), %rax + leaq .L.str.293(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -19563,9 +20405,9 @@ new_parser: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.302 -.L.else.302: -.L.end.302: + jmp .L.end.321 +.L.else.321: +.L.end.321: leaq -8(%rbp), %rax movq (%rax), %rax addq $0, %rax @@ -19601,13 +20443,13 @@ new_parser: movq $0, %rax push %rax .data -.L.str.290: +.L.str.294: .byte 105 .byte 54 .byte 52 .byte 0 .text - leaq .L.str.290(%rip), %rax + leaq .L.str.294(%rip), %rax push %rax movq $8, %rax push %rax @@ -19627,13 +20469,13 @@ new_parser: movq $0, %rax push %rax .data -.L.str.291: +.L.str.295: .byte 105 .byte 51 .byte 50 .byte 0 .text - leaq .L.str.291(%rip), %rax + leaq .L.str.295(%rip), %rax push %rax movq $4, %rax push %rax @@ -19653,13 +20495,13 @@ new_parser: movq $0, %rax push %rax .data -.L.str.292: +.L.str.296: .byte 105 .byte 49 .byte 54 .byte 0 .text - leaq .L.str.292(%rip), %rax + leaq .L.str.296(%rip), %rax push %rax movq $2, %rax push %rax @@ -19679,12 +20521,12 @@ new_parser: movq $0, %rax push %rax .data -.L.str.293: +.L.str.297: .byte 105 .byte 56 .byte 0 .text - leaq .L.str.293(%rip), %rax + leaq .L.str.297(%rip), %rax push %rax movq $1, %rax push %rax @@ -19704,14 +20546,14 @@ new_parser: movq $0, %rax push %rax .data -.L.str.294: +.L.str.298: .byte 98 .byte 111 .byte 111 .byte 108 .byte 0 .text - leaq .L.str.294(%rip), %rax + leaq .L.str.298(%rip), %rax push %rax movq $1, %rax push %rax @@ -19731,13 +20573,13 @@ new_parser: movq $1, %rax push %rax .data -.L.str.295: +.L.str.299: .byte 117 .byte 54 .byte 52 .byte 0 .text - leaq .L.str.295(%rip), %rax + leaq .L.str.299(%rip), %rax push %rax movq $8, %rax push %rax @@ -19757,104 +20599,310 @@ new_parser: movq $1, %rax push %rax .data -.L.str.296: +.L.str.300: .byte 117 .byte 51 .byte 50 .byte 0 .text - leaq .L.str.296(%rip), %rax + leaq .L.str.300(%rip), %rax push %rax movq $4, %rax push %rax - movq $9, %rax + movq $9, %rax + push %rax + leaq new_builtin_type(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $32, %rsp + pop %rdi + movq %rax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $80, %rax + push %rax + movq $1, %rax + push %rax +.data +.L.str.301: + .byte 117 + .byte 49 + .byte 54 + .byte 0 +.text + leaq .L.str.301(%rip), %rax + push %rax + movq $2, %rax + push %rax + movq $10, %rax + push %rax + leaq new_builtin_type(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $32, %rsp + pop %rdi + movq %rax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $72, %rax + push %rax + movq $1, %rax + push %rax +.data +.L.str.302: + .byte 117 + .byte 56 + .byte 0 +.text + leaq .L.str.302(%rip), %rax + push %rax + movq $1, %rax + push %rax + movq $11, %rax + push %rax + leaq new_builtin_type(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $32, %rsp + pop %rdi + movq %rax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $64, %rax + push %rax + movq $1, %rax + push %rax +.data +.L.str.303: + .byte 117 + .byte 48 + .byte 0 +.text + leaq .L.str.303(%rip), %rax + push %rax + movq $0, %rax + push %rax + movq $12, %rax + push %rax + leaq new_builtin_type(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $32, %rsp + pop %rdi + movq %rax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $112, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + pop %rdi + movq %rax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global new_func_type +new_func_type: + push %rbp + movq %rsp, %rbp + subq $16, %rsp + leaq -8(%rbp), %rax + push %rax + movq $59, %rax + push %rax + leaq alloc(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + movq $0, %rax + push %rax + leaq -8(%rbp), %rax + movq (%rax), %rax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.322 +.data +.L.str.304: + .byte 97 + .byte 108 + .byte 108 + .byte 111 + .byte 99 + .byte 32 + .byte 114 + .byte 101 + .byte 116 + .byte 117 + .byte 114 + .byte 110 + .byte 101 + .byte 100 + .byte 32 + .byte 110 + .byte 105 + .byte 108 + .byte 10 + .byte 0 +.text + leaq .L.str.304(%rip), %rax + push %rax + leaq eprintf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + movq $1, %rax + push %rax + leaq exit(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + jmp .L.end.322 +.L.else.322: +.L.end.322: + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $0, %rax + push %rax + movq $6, %rax + pop %rdi + movl %eax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $4, %rax + push %rax + movq $8, %rax + pop %rdi + movl %eax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $32, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + pop %rdi + movq %rax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + push %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + pop %rdi + movq %rax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $40, %rax + push %rax + leaq 32(%rbp), %rax + movsbl (%rax), %eax + pop %rdi + movb %al, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global new_pointer_type +new_pointer_type: + push %rbp + movq %rsp, %rbp + subq $16, %rsp + leaq -8(%rbp), %rax + push %rax + movq $59, %rax push %rax - leaq new_builtin_type(%rip), %rax + leaq alloc(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $32, %rsp + addq $8, %rsp pop %rdi movq %rax, (%rdi) + movq $0, %rax + push %rax leaq -8(%rbp), %rax movq (%rax), %rax - addq $80, %rax - push %rax - movq $1, %rax - push %rax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.323 .data -.L.str.297: +.L.str.305: + .byte 97 + .byte 108 + .byte 108 + .byte 111 + .byte 99 + .byte 32 + .byte 114 + .byte 101 + .byte 116 .byte 117 - .byte 49 - .byte 54 + .byte 114 + .byte 110 + .byte 101 + .byte 100 + .byte 32 + .byte 110 + .byte 105 + .byte 108 + .byte 10 .byte 0 .text - leaq .L.str.297(%rip), %rax - push %rax - movq $2, %rax - push %rax - movq $10, %rax + leaq .L.str.305(%rip), %rax push %rax - leaq new_builtin_type(%rip), %rax + leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $32, %rsp - pop %rdi - movq %rax, (%rdi) - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $72, %rax - push %rax - movq $1, %rax - push %rax -.data -.L.str.298: - .byte 117 - .byte 56 - .byte 0 -.text - leaq .L.str.298(%rip), %rax - push %rax + addq $8, %rsp movq $1, %rax push %rax - movq $11, %rax - push %rax - leaq new_builtin_type(%rip), %rax + leaq exit(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $32, %rsp - pop %rdi - movq %rax, (%rdi) + addq $8, %rsp + jmp .L.end.323 +.L.else.323: +.L.end.323: leaq -8(%rbp), %rax movq (%rax), %rax - addq $64, %rax - push %rax - movq $1, %rax - push %rax -.data -.L.str.299: - .byte 117 - .byte 48 - .byte 0 -.text - leaq .L.str.299(%rip), %rax - push %rax - movq $0, %rax + addq $0, %rax push %rax - movq $12, %rax + movq $7, %rax + pop %rdi + movl %eax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $4, %rax push %rax - leaq new_builtin_type(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $32, %rsp + movq $8, %rax pop %rdi - movq %rax, (%rdi) + movl %eax, (%rdi) leaq -8(%rbp), %rax movq (%rax), %rax - addq $112, %rax + addq $41, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -19867,8 +20915,8 @@ new_parser: retq leave ret -.global new_func_type -new_func_type: +.global new_builtin_type +new_builtin_type: push %rbp movq %rsp, %rbp subq $16, %rsp @@ -19892,11 +20940,9 @@ new_func_type: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.303 - leaq (%rsp), %rax - push %rax + jne .L.else.324 .data -.L.str.300: +.L.str.306: .byte 97 .byte 108 .byte 108 @@ -19918,13 +20964,13 @@ new_func_type: .byte 10 .byte 0 .text - leaq .L.str.300(%rip), %rax + leaq .L.str.306(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -19932,44 +20978,45 @@ new_func_type: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.303 -.L.else.303: -.L.end.303: + jmp .L.end.324 +.L.else.324: +.L.end.324: leaq -8(%rbp), %rax movq (%rax), %rax addq $0, %rax push %rax - movq $6, %rax + leaq 16(%rbp), %rax + movslq (%rax), %rax pop %rdi movl %eax, (%rdi) leaq -8(%rbp), %rax movq (%rax), %rax addq $4, %rax push %rax - movq $8, %rax + leaq 24(%rbp), %rax + movslq (%rax), %rax pop %rdi movl %eax, (%rdi) leaq -8(%rbp), %rax movq (%rax), %rax - addq $32, %rax + addq $8, %rax push %rax - leaq 16(%rbp), %rax + leaq 32(%rbp), %rax movq (%rax), %rax pop %rdi movq %rax, (%rdi) leaq -8(%rbp), %rax movq (%rax), %rax - addq $24, %rax + addq $41, %rax push %rax - leaq 24(%rbp), %rax - movq (%rax), %rax + movq $0, %rax pop %rdi movq %rax, (%rdi) leaq -8(%rbp), %rax movq (%rax), %rax - addq $40, %rax + addq $49, %rax push %rax - leaq 32(%rbp), %rax + leaq 40(%rbp), %rax movsbl (%rax), %eax pop %rdi movb %al, (%rdi) @@ -19980,302 +21027,349 @@ new_func_type: retq leave ret -.global new_pointer_type -new_pointer_type: +.global get_user_defined_type +get_user_defined_type: push %rbp movq %rsp, %rbp subq $16, %rsp - leaq -8(%rbp), %rax + leaq -4(%rbp), %rax + push %rax + movq $0, %rax + pop %rdi + movl %eax, (%rdi) +.L.while.start.325: + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax + addq $8, %rax + movslq (%rax), %rax + push %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + cmpl %edi, %eax + setl %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.while.end.325 + leaq 24(%rbp), %rax + movq (%rax), %rax + push %rax + movq $8, %rax + push %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + imull %edi, %eax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax + addq $0, %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + movq (%rax), %rax + addq $8, %rax + movq (%rax), %rax + push %rax + leaq strcmp(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp + movzx %al, %eax + cmpq $1, %rax + jne .L.else.326 + movq $8, %rax + push %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + imull %edi, %eax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax + addq $0, %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + movq (%rax), %rax + movq %rbp, %rsp + pop %rbp + retq + jmp .L.end.326 +.L.else.326: +.L.end.326: + movq $1, %rax + push %rax + leaq -4(%rbp), %rax + push %rax + movq $1, %rax + push %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + addl %edi, %eax + pop %rdi + movl %eax, (%rdi) + pop %rdi + subl %edi, %eax + jmp .L.while.start.325 +.L.while.end.325: + movq $0, %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global strcmp +strcmp: + push %rbp + movq %rsp, %rbp + subq $16, %rsp + leaq -4(%rbp), %rax + push %rax + movq $0, %rax + pop %rdi + movl %eax, (%rdi) +.L.while.start.327: + movq $1, %rax + cmpq $1, %rax + jne .L.while.end.327 + movq $1, %rax push %rax - movq $59, %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + imull %edi, %eax push %rax - leaq alloc(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp + leaq 24(%rbp), %rax + movq (%rax), %rax pop %rdi - movq %rax, (%rdi) - movq $0, %rax + addq %rdi, %rax + movzbl (%rax), %eax push %rax - leaq -8(%rbp), %rax + movq $1, %rax + push %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + imull %edi, %eax + push %rax + leaq 16(%rbp), %rax movq (%rax), %rax pop %rdi + addq %rdi, %rax + movzbl (%rax), %eax + pop %rdi cmpl %edi, %eax sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.304 - leaq (%rsp), %rax + jne .L.else.328 + movq $0, %rax push %rax -.data -.L.str.301: - .byte 97 - .byte 108 - .byte 108 - .byte 111 - .byte 99 - .byte 32 - .byte 114 - .byte 101 - .byte 116 - .byte 117 - .byte 114 - .byte 110 - .byte 101 - .byte 100 - .byte 32 - .byte 110 - .byte 105 - .byte 108 - .byte 10 - .byte 0 -.text - leaq .L.str.301(%rip), %rax + movq $1, %rax push %rax - leaq eprintf(%rip), %rax - movq %rax, %r10 + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + imull %edi, %eax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.329 + movq $1, %rax + movq %rbp, %rsp + pop %rbp + retq + jmp .L.end.329 +.L.else.329: +.L.end.329: + jmp .L.end.328 +.L.else.328: movq $0, %rax - callq *%r10 - addq $16, %rsp + movq %rbp, %rsp + pop %rbp + retq +.L.end.328: movq $1, %rax push %rax - leaq exit(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp - jmp .L.end.304 -.L.else.304: -.L.end.304: - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $0, %rax + leaq -4(%rbp), %rax push %rax - movq $7, %rax - pop %rdi - movl %eax, (%rdi) - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $4, %rax + movq $1, %rax push %rax - movq $8, %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + addl %edi, %eax pop %rdi movl %eax, (%rdi) - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $41, %rax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax pop %rdi - movq %rax, (%rdi) - leaq -8(%rbp), %rax - movq (%rax), %rax + subl %edi, %eax + jmp .L.while.start.327 +.L.while.end.327: + movq $0, %rax movq %rbp, %rsp pop %rbp retq leave ret -.global new_builtin_type -new_builtin_type: +.global unexpected_token_error +unexpected_token_error: push %rbp movq %rsp, %rbp - subq $16, %rsp - leaq -8(%rbp), %rax + subq $0, %rsp + leaq 32(%rbp), %rax + movq (%rax), %rax push %rax - movq $59, %rax + leaq 24(%rbp), %rax + movq (%rax), %rax push %rax - leaq alloc(%rip), %rax + leaq print_error_with_code(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $8, %rsp - pop %rdi - movq %rax, (%rdi) - movq $0, %rax + addq $16, %rsp + leaq 24(%rbp), %rax + movq (%rax), %rax + addq $28, %rax + movq (%rax), %rax push %rax - leaq -8(%rbp), %rax + leaq 16(%rbp), %rax movq (%rax), %rax - pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.else.305 + push %rax leaq (%rsp), %rax push %rax + push $2 .data -.L.str.302: - .byte 97 - .byte 108 +.L.str.307: + .byte 104 + .byte 101 .byte 108 - .byte 111 - .byte 99 + .byte 112 + .byte 58 .byte 32 - .byte 114 .byte 101 + .byte 120 + .byte 112 + .byte 101 + .byte 99 .byte 116 - .byte 117 - .byte 114 - .byte 110 .byte 101 .byte 100 .byte 32 - .byte 110 - .byte 105 - .byte 108 + .byte 96 + .byte 37 + .byte 115 + .byte 96 + .byte 32 + .byte 98 + .byte 117 + .byte 116 + .byte 32 + .byte 103 + .byte 111 + .byte 116 + .byte 32 + .byte 96 + .byte 37 + .byte 115 + .byte 96 .byte 10 .byte 0 .text - leaq .L.str.302(%rip), %rax + leaq .L.str.307(%rip), %rax push %rax leaq eprintf(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - movq $1, %rax - push %rax - leaq exit(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp - jmp .L.end.305 -.L.else.305: -.L.end.305: - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $0, %rax - push %rax - leaq 16(%rbp), %rax - movslq (%rax), %rax - pop %rdi - movl %eax, (%rdi) - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $4, %rax - push %rax - leaq 24(%rbp), %rax - movslq (%rax), %rax - pop %rdi - movl %eax, (%rdi) - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $8, %rax - push %rax - leaq 32(%rbp), %rax - movq (%rax), %rax - pop %rdi - movq %rax, (%rdi) - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $41, %rax - push %rax - movq $0, %rax - pop %rdi - movq %rax, (%rdi) - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $49, %rax - push %rax - leaq 40(%rbp), %rax - movsbl (%rax), %eax - pop %rdi - movb %al, (%rdi) - leaq -8(%rbp), %rax - movq (%rax), %rax - movq %rbp, %rsp - pop %rbp - retq + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $40, %rsp + movq $1, %rax + push %rax + leaq exit(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp leave ret -.global get_user_defined_type -get_user_defined_type: +.global vec_append_object +vec_append_object: push %rbp movq %rsp, %rbp - subq $16, %rsp - leaq -4(%rbp), %rax - push %rax - movq $0, %rax - pop %rdi - movl %eax, (%rdi) -.L.while.start.306: + subq $0, %rsp leaq 16(%rbp), %rax movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax - addq $8, %rax + addq $12, %rax movslq (%rax), %rax push %rax - leaq -4(%rbp), %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $8, %rax movslq (%rax), %rax pop %rdi cmpl %edi, %eax - setl %al + setge %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.306 - leaq 24(%rbp), %rax - movq (%rax), %rax - push %rax - movq $8, %rax - push %rax - leaq -4(%rbp), %rax - movslq (%rax), %rax - pop %rdi - imull %edi, %eax - push %rax + jne .L.else.330 leaq 16(%rbp), %rax movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax - addq $0, %rax - movq (%rax), %rax - pop %rdi - addq %rdi, %rax - movq (%rax), %rax - addq $8, %rax - movq (%rax), %rax push %rax - leaq strcmp(%rip), %rax + leaq object_vec_realloc(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - movzx %al, %eax - cmpq $1, %rax - jne .L.else.307 + addq $8, %rsp + jmp .L.end.330 +.L.else.330: +.L.end.330: movq $8, %rax push %rax - leaq -4(%rbp), %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $8, %rax movslq (%rax), %rax pop %rdi imull %edi, %eax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax addq $0, %rax movq (%rax), %rax pop %rdi addq %rdi, %rax + push %rax + leaq 24(%rbp), %rax movq (%rax), %rax - movq %rbp, %rsp - pop %rbp - retq - jmp .L.end.307 -.L.else.307: -.L.end.307: + pop %rdi + movq %rax, (%rdi) movq $1, %rax push %rax - leaq -4(%rbp), %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $8, %rax push %rax movq $1, %rax push %rax - leaq -4(%rbp), %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $8, %rax movslq (%rax), %rax pop %rdi addl %edi, %eax @@ -20283,185 +21377,215 @@ get_user_defined_type: movl %eax, (%rdi) pop %rdi subl %edi, %eax - jmp .L.while.start.306 -.L.while.end.306: movq $0, %rax movq %rbp, %rsp pop %rbp retq leave ret -.global strcmp -strcmp: +.global object_vec_realloc +object_vec_realloc: push %rbp movq %rsp, %rbp subq $16, %rsp - leaq -4(%rbp), %rax + leaq -8(%rbp), %rax push %rax - movq $0, %rax - pop %rdi - movl %eax, (%rdi) -.L.while.start.308: - movq $1, %rax - cmpq $1, %rax - jne .L.while.end.308 - movq $1, %rax + movq $2, %rax push %rax - leaq -4(%rbp), %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $12, %rax movslq (%rax), %rax + push %rax + movq $8, %rax pop %rdi imull %edi, %eax - push %rax - leaq 24(%rbp), %rax - movq (%rax), %rax pop %rdi - addq %rdi, %rax - movzbl (%rax), %eax - push %rax - movq $1, %rax + imull %edi, %eax push %rax - leaq -4(%rbp), %rax - movslq (%rax), %rax + leaq alloc(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp pop %rdi - imull %edi, %eax + movq %rax, (%rdi) + movq $0, %rax push %rax - leaq 16(%rbp), %rax + leaq -8(%rbp), %rax movq (%rax), %rax pop %rdi - addq %rdi, %rax - movzbl (%rax), %eax - pop %rdi cmpl %edi, %eax sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.309 - movq $0, %rax + jne .L.else.331 +.data +.L.str.308: + .byte 97 + .byte 108 + .byte 108 + .byte 111 + .byte 99 + .byte 32 + .byte 114 + .byte 101 + .byte 116 + .byte 117 + .byte 114 + .byte 110 + .byte 101 + .byte 100 + .byte 32 + .byte 110 + .byte 105 + .byte 108 + .byte 10 + .byte 0 +.text + leaq .L.str.308(%rip), %rax push %rax + leaq eprintf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp movq $1, %rax push %rax - leaq -4(%rbp), %rax + leaq exit(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + jmp .L.end.331 +.L.else.331: +.L.end.331: + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $12, %rax movslq (%rax), %rax + push %rax + movq $8, %rax pop %rdi imull %edi, %eax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - pop %rdi - addq %rdi, %rax - movzbl (%rax), %eax - pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.else.310 - movq $1, %rax - movq %rbp, %rsp - pop %rbp - retq - jmp .L.end.310 -.L.else.310: -.L.end.310: - jmp .L.end.309 -.L.else.309: - movq $0, %rax - movq %rbp, %rsp - pop %rbp - retq -.L.end.309: - movq $1, %rax + addq $0, %rax + movq (%rax), %rax push %rax - leaq -4(%rbp), %rax + leaq -8(%rbp), %rax + movq (%rax), %rax push %rax - movq $1, %rax + leaq memcpy(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $24, %rsp + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $12, %rax push %rax - leaq -4(%rbp), %rax + movq $2, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $12, %rax movslq (%rax), %rax pop %rdi - addl %edi, %eax + imull %edi, %eax pop %rdi movl %eax, (%rdi) + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $0, %rax + push %rax + leaq -8(%rbp), %rax + movq (%rax), %rax pop %rdi - subl %edi, %eax - jmp .L.while.start.308 -.L.while.end.308: + movq %rax, (%rdi) movq $0, %rax movq %rbp, %rsp pop %rbp retq leave ret -.global unexpected_token_error -unexpected_token_error: +.global new_object_vec +new_object_vec: push %rbp movq %rsp, %rbp - subq $0, %rsp - leaq 32(%rbp), %rax - movq (%rax), %rax + subq $16, %rsp + leaq -8(%rbp), %rax push %rax - leaq 24(%rbp), %rax - movq (%rax), %rax + movq $16, %rax push %rax - leaq print_error_with_code(%rip), %rax + leaq alloc(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq 24(%rbp), %rax - movq (%rax), %rax - addq $28, %rax + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + leaq -8(%rbp), %rax movq (%rax), %rax + addq $0, %rax + push %rax + leaq 16(%rbp), %rax + movslq (%rax), %rax + push %rax + movq $8, %rax + pop %rdi + imull %edi, %eax + push %rax + leaq alloc(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + movq $0, %rax push %rax - leaq 16(%rbp), %rax + leaq -8(%rbp), %rax movq (%rax), %rax - push %rax - leaq (%rsp), %rax - push %rax + addq $0, %rax + movq (%rax), %rax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.332 .data -.L.str.303: - .byte 104 - .byte 101 +.L.str.309: + .byte 97 .byte 108 - .byte 112 - .byte 58 + .byte 108 + .byte 111 + .byte 99 .byte 32 + .byte 114 .byte 101 - .byte 120 - .byte 112 - .byte 101 - .byte 99 .byte 116 + .byte 117 + .byte 114 + .byte 110 .byte 101 .byte 100 .byte 32 - .byte 96 - .byte 37 - .byte 115 - .byte 96 - .byte 32 - .byte 98 - .byte 117 - .byte 116 - .byte 32 - .byte 103 - .byte 111 - .byte 116 - .byte 32 - .byte 96 - .byte 37 - .byte 115 - .byte 96 + .byte 110 + .byte 105 + .byte 108 .byte 10 .byte 0 .text - leaq .L.str.303(%rip), %rax + leaq .L.str.309(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $32, %rsp + addq $8, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -20469,10 +21593,33 @@ unexpected_token_error: movq $0, %rax callq *%r10 addq $8, %rsp + jmp .L.end.332 +.L.else.332: +.L.end.332: + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $8, %rax + push %rax + movq $0, %rax + pop %rdi + movl %eax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $12, %rax + push %rax + leaq 16(%rbp), %rax + movslq (%rax), %rax + pop %rdi + movl %eax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + movq %rbp, %rsp + pop %rbp + retq leave ret -.global vec_append_object -vec_append_object: +.global vec_append_node +vec_append_node: push %rbp movq %rsp, %rbp subq $0, %rsp @@ -20490,18 +21637,18 @@ vec_append_object: setge %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.311 + jne .L.else.333 leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq object_vec_realloc(%rip), %rax + leaq node_vec_realloc(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.311 -.L.else.311: -.L.end.311: + jmp .L.end.333 +.L.else.333: +.L.end.333: movq $8, %rax push %rax leaq 16(%rbp), %rax @@ -20546,8 +21693,8 @@ vec_append_object: retq leave ret -.global object_vec_realloc -object_vec_realloc: +.global node_vec_realloc +node_vec_realloc: push %rbp movq %rsp, %rbp subq $16, %rsp @@ -20582,11 +21729,9 @@ object_vec_realloc: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.312 - leaq (%rsp), %rax - push %rax + jne .L.else.334 .data -.L.str.304: +.L.str.310: .byte 97 .byte 108 .byte 108 @@ -20608,13 +21753,13 @@ object_vec_realloc: .byte 10 .byte 0 .text - leaq .L.str.304(%rip), %rax + leaq .L.str.310(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -20622,9 +21767,9 @@ object_vec_realloc: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.312 -.L.else.312: -.L.end.312: + jmp .L.end.334 +.L.else.334: +.L.end.334: leaq 16(%rbp), %rax movq (%rax), %rax addq $12, %rax @@ -20675,8 +21820,8 @@ object_vec_realloc: retq leave ret -.global new_object_vec -new_object_vec: +.global new_node_vec +new_node_vec: push %rbp movq %rsp, %rbp subq $16, %rsp @@ -20720,11 +21865,9 @@ new_object_vec: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.313 - leaq (%rsp), %rax - push %rax + jne .L.else.335 .data -.L.str.305: +.L.str.311: .byte 97 .byte 108 .byte 108 @@ -20746,13 +21889,13 @@ new_object_vec: .byte 10 .byte 0 .text - leaq .L.str.305(%rip), %rax + leaq .L.str.311(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -20760,9 +21903,9 @@ new_object_vec: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.313 -.L.else.313: -.L.end.313: + jmp .L.end.335 +.L.else.335: +.L.end.335: leaq -8(%rbp), %rax movq (%rax), %rax addq $8, %rax @@ -20785,166 +21928,129 @@ new_object_vec: retq leave ret -.global vec_append_node -vec_append_node: +.global unkown_member_error +unkown_member_error: push %rbp movq %rsp, %rbp - subq $0, %rsp - leaq 16(%rbp), %rax + subq $16, %rsp + leaq 32(%rbp), %rax movq (%rax), %rax - addq $12, %rax - movslq (%rax), %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $8, %rax - movslq (%rax), %rax - pop %rdi - cmpl %edi, %eax - setge %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.else.314 - leaq 16(%rbp), %rax + leaq 24(%rbp), %rax movq (%rax), %rax push %rax - leaq node_vec_realloc(%rip), %rax + leaq print_error_with_code(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $8, %rsp - jmp .L.end.314 -.L.else.314: -.L.end.314: - movq $8, %rax + addq $16, %rsp + movq $0, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $8, %rax movslq (%rax), %rax pop %rdi - imull %edi, %eax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $0, %rax - movq (%rax), %rax - pop %rdi - addq %rdi, %rax - push %rax - leaq 24(%rbp), %rax - movq (%rax), %rax - pop %rdi - movq %rax, (%rdi) - movq $1, %rax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $8, %rax - push %rax + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.336 movq $1, %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $8, %rax - movslq (%rax), %rax - pop %rdi - addl %edi, %eax - pop %rdi - movl %eax, (%rdi) - pop %rdi - subl %edi, %eax + leaq exit(%rip), %rax + movq %rax, %r10 movq $0, %rax - movq %rbp, %rsp - pop %rbp - retq - leave - ret -.global node_vec_realloc -node_vec_realloc: - push %rbp - movq %rsp, %rbp - subq $16, %rsp - leaq -8(%rbp), %rax - push %rax - movq $2, %rax - push %rax + callq *%r10 + addq $8, %rsp + jmp .L.end.336 +.L.else.336: leaq 16(%rbp), %rax movq (%rax), %rax - addq $12, %rax + addq $8, %rax movslq (%rax), %rax push %rax - movq $8, %rax - pop %rdi - imull %edi, %eax - pop %rdi - imull %edi, %eax - push %rax - leaq alloc(%rip), %rax + leaq plural_or_singular2(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp - pop %rdi - movq %rax, (%rdi) - movq $0, %rax push %rax - leaq -8(%rbp), %rax - movq (%rax), %rax - pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.else.315 leaq (%rsp), %rax push %rax + push $1 .data -.L.str.306: - .byte 97 - .byte 108 +.L.str.312: + .byte 104 + .byte 101 .byte 108 - .byte 111 - .byte 99 + .byte 112 + .byte 58 .byte 32 - .byte 114 - .byte 101 - .byte 116 - .byte 117 - .byte 114 - .byte 110 - .byte 101 + .byte 37 .byte 100 .byte 32 - .byte 110 + .byte 112 + .byte 111 + .byte 115 + .byte 115 + .byte 105 + .byte 98 .byte 105 .byte 108 - .byte 10 + .byte 105 + .byte 116 + .byte 58 .byte 0 .text - leaq .L.str.306(%rip), %rax + leaq .L.str.312(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - movq $1, %rax + addq $32, %rsp +.L.end.336: + leaq -4(%rbp), %rax push %rax - leaq exit(%rip), %rax - movq %rax, %r10 movq $0, %rax - callq *%r10 - addq $8, %rsp - jmp .L.end.315 -.L.else.315: -.L.end.315: + pop %rdi + movl %eax, (%rdi) +.L.while.start.337: leaq 16(%rbp), %rax movq (%rax), %rax - addq $12, %rax + addq $8, %rax + movslq (%rax), %rax + push %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + cmpl %edi, %eax + setl %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.while.end.337 + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $8, %rax movslq (%rax), %rax push %rax + movq $1, %rax + push %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + addl %edi, %eax + pop %rdi + cmpl %edi, %eax + setl %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.338 movq $8, %rax + push %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax pop %rdi imull %edi, %eax push %rax @@ -20952,121 +22058,99 @@ node_vec_realloc: movq (%rax), %rax addq $0, %rax movq (%rax), %rax - push %rax - leaq -8(%rbp), %rax + pop %rdi + addq %rdi, %rax + movq (%rax), %rax + addq $8, %rax movq (%rax), %rax push %rax - leaq memcpy(%rip), %rax + leaq (%rsp), %rax + push %rax + push $1 +.data +.L.str.313: + .byte 32 + .byte 96 + .byte 37 + .byte 115 + .byte 96 + .byte 44 + .byte 0 +.text + leaq .L.str.313(%rip), %rax + push %rax + leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $12, %rax - push %rax - movq $2, %rax + addq $32, %rsp + jmp .L.end.338 +.L.else.338: + movq $8, %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $12, %rax + leaq -4(%rbp), %rax movslq (%rax), %rax pop %rdi imull %edi, %eax - pop %rdi - movl %eax, (%rdi) + push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $0, %rax - push %rax - leaq -8(%rbp), %rax movq (%rax), %rax pop %rdi - movq %rax, (%rdi) - movq $0, %rax - movq %rbp, %rsp - pop %rbp - retq - leave - ret -.global new_node_vec -new_node_vec: - push %rbp - movq %rsp, %rbp - subq $16, %rsp - leaq -8(%rbp), %rax + addq %rdi, %rax + movq (%rax), %rax + addq $8, %rax + movq (%rax), %rax push %rax - movq $16, %rax + leaq (%rsp), %rax push %rax - leaq alloc(%rip), %rax + push $1 +.data +.L.str.314: + .byte 32 + .byte 96 + .byte 37 + .byte 115 + .byte 96 + .byte 0 +.text + leaq .L.str.314(%rip), %rax + push %rax + leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $8, %rsp - pop %rdi - movq %rax, (%rdi) - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $0, %rax + addq $32, %rsp +.L.end.338: + movq $1, %rax push %rax - leaq 16(%rbp), %rax - movslq (%rax), %rax + leaq -4(%rbp), %rax push %rax - movq $8, %rax - pop %rdi - imull %edi, %eax + movq $1, %rax push %rax - leaq alloc(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp + leaq -4(%rbp), %rax + movslq (%rax), %rax pop %rdi - movq %rax, (%rdi) - movq $0, %rax - push %rax - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $0, %rax - movq (%rax), %rax + addl %edi, %eax pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.else.316 - leaq (%rsp), %rax - push %rax + movl %eax, (%rdi) + pop %rdi + subl %edi, %eax + jmp .L.while.start.337 +.L.while.end.337: .data -.L.str.307: - .byte 97 - .byte 108 - .byte 108 - .byte 111 - .byte 99 - .byte 32 - .byte 114 - .byte 101 - .byte 116 - .byte 117 - .byte 114 - .byte 110 - .byte 101 - .byte 100 - .byte 32 - .byte 110 - .byte 105 - .byte 108 +.L.str.315: .byte 10 .byte 0 .text - leaq .L.str.307(%rip), %rax + leaq .L.str.315(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -21074,33 +22158,10 @@ new_node_vec: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.316 -.L.else.316: -.L.end.316: - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $8, %rax - push %rax - movq $0, %rax - pop %rdi - movl %eax, (%rdi) - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $12, %rax - push %rax - leaq 16(%rbp), %rax - movslq (%rax), %rax - pop %rdi - movl %eax, (%rdi) - leaq -8(%rbp), %rax - movq (%rax), %rax - movq %rbp, %rsp - pop %rbp - retq leave ret -.global unkown_member_error -unkown_member_error: +.global unkown_type_error +unkown_type_error: push %rbp movq %rsp, %rbp subq $16, %rsp @@ -21126,7 +22187,7 @@ unkown_member_error: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.317 + jne .L.else.339 movq $1, %rax push %rax leaq exit(%rip), %rax @@ -21134,8 +22195,8 @@ unkown_member_error: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.317 -.L.else.317: + jmp .L.end.339 +.L.else.339: leaq 16(%rbp), %rax movq (%rax), %rax addq $8, %rax @@ -21149,8 +22210,9 @@ unkown_member_error: push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.308: +.L.str.316: .byte 104 .byte 101 .byte 108 @@ -21170,23 +22232,25 @@ unkown_member_error: .byte 108 .byte 105 .byte 116 + .byte 37 + .byte 115 .byte 58 .byte 0 .text - leaq .L.str.308(%rip), %rax + leaq .L.str.316(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp -.L.end.317: + addq $32, %rsp +.L.end.339: leaq -4(%rbp), %rax push %rax movq $0, %rax pop %rdi movl %eax, (%rdi) -.L.while.start.318: +.L.while.start.340: leaq 16(%rbp), %rax movq (%rax), %rax addq $8, %rax @@ -21199,7 +22263,7 @@ unkown_member_error: setl %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.318 + jne .L.while.end.340 leaq 16(%rbp), %rax movq (%rax), %rax addq $8, %rax @@ -21216,7 +22280,7 @@ unkown_member_error: setl %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.319 + jne .L.else.341 movq $8, %rax push %rax leaq -4(%rbp), %rax @@ -21236,8 +22300,9 @@ unkown_member_error: push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.309: +.L.str.317: .byte 32 .byte 96 .byte 37 @@ -21246,15 +22311,15 @@ unkown_member_error: .byte 44 .byte 0 .text - leaq .L.str.309(%rip), %rax + leaq .L.str.317(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp - jmp .L.end.319 -.L.else.319: + addq $32, %rsp + jmp .L.end.341 +.L.else.341: movq $8, %rax push %rax leaq -4(%rbp), %rax @@ -21274,8 +22339,9 @@ unkown_member_error: push %rax leaq (%rsp), %rax push %rax + push $1 .data -.L.str.310: +.L.str.318: .byte 32 .byte 96 .byte 37 @@ -21283,14 +22349,14 @@ unkown_member_error: .byte 96 .byte 0 .text - leaq .L.str.310(%rip), %rax + leaq .L.str.318(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp -.L.end.319: + addq $32, %rsp +.L.end.341: movq $1, %rax push %rax leaq -4(%rbp), %rax @@ -21305,22 +22371,20 @@ unkown_member_error: movl %eax, (%rdi) pop %rdi subl %edi, %eax - jmp .L.while.start.318 -.L.while.end.318: - leaq (%rsp), %rax - push %rax + jmp .L.while.start.340 +.L.while.end.340: .data -.L.str.311: +.L.str.319: .byte 10 .byte 0 .text - leaq .L.str.311(%rip), %rax + leaq .L.str.319(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -21330,15 +22394,15 @@ unkown_member_error: addq $8, %rsp leave ret -.global unkown_type_error -unkown_type_error: +.global func_call_args_length_error +func_call_args_length_error: push %rbp movq %rsp, %rbp - subq $16, %rsp - leaq 32(%rbp), %rax + subq $0, %rsp + leaq 40(%rbp), %rax movq (%rax), %rax push %rax - leaq 24(%rbp), %rax + leaq 32(%rbp), %rax movq (%rax), %rax push %rax leaq print_error_with_code(%rip), %rax @@ -21346,152 +22410,348 @@ unkown_type_error: movq $0, %rax callq *%r10 addq $16, %rsp - movq $0, %rax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $8, %rax + leaq 24(%rbp), %rax movslq (%rax), %rax - pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.else.320 - movq $1, %rax push %rax - leaq exit(%rip), %rax + leaq plural_or_singular(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.320 -.L.else.320: + push %rax + leaq 24(%rbp), %rax + movslq (%rax), %rax + push %rax leaq 16(%rbp), %rax - movq (%rax), %rax - addq $8, %rax movslq (%rax), %rax push %rax - leaq plural_or_singular2(%rip), %rax + leaq plural_or_singular(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp push %rax + leaq 16(%rbp), %rax + movslq (%rax), %rax + push %rax leaq (%rsp), %rax push %rax + push $4 .data -.L.str.312: +.L.str.320: .byte 104 .byte 101 .byte 108 .byte 112 .byte 58 .byte 32 - .byte 37 - .byte 100 + .byte 116 + .byte 104 + .byte 105 + .byte 115 .byte 32 - .byte 112 + .byte 102 + .byte 117 + .byte 110 + .byte 99 + .byte 116 + .byte 105 .byte 111 + .byte 110 + .byte 32 + .byte 116 + .byte 97 + .byte 107 + .byte 101 .byte 115 + .byte 32 + .byte 37 + .byte 100 + .byte 32 + .byte 97 + .byte 114 + .byte 103 + .byte 117 + .byte 109 + .byte 101 + .byte 110 + .byte 116 + .byte 37 .byte 115 - .byte 105 + .byte 32 .byte 98 - .byte 105 - .byte 108 - .byte 105 + .byte 117 + .byte 116 + .byte 32 + .byte 37 + .byte 100 + .byte 32 + .byte 97 + .byte 114 + .byte 103 + .byte 117 + .byte 109 + .byte 101 + .byte 110 .byte 116 .byte 37 .byte 115 - .byte 58 + .byte 32 + .byte 119 + .byte 101 + .byte 114 + .byte 101 + .byte 32 + .byte 115 + .byte 117 + .byte 112 + .byte 112 + .byte 108 + .byte 105 + .byte 101 + .byte 100 + .byte 10 .byte 0 .text - leaq .L.str.312(%rip), %rax + leaq .L.str.320(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp -.L.end.320: - leaq -4(%rbp), %rax + addq $56, %rsp + movq $1, %rax push %rax + leaq exit(%rip), %rax + movq %rax, %r10 movq $0, %rax + callq *%r10 + addq $8, %rsp + leave + ret +.global plural_or_singular2 +plural_or_singular2: + push %rbp + movq %rsp, %rbp + subq $0, %rsp + movq $1, %rax + push %rax + leaq 16(%rbp), %rax + movslq (%rax), %rax pop %rdi - movl %eax, (%rdi) -.L.while.start.321: + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.342 +.data +.L.str.321: + .byte 121 + .byte 0 +.text + leaq .L.str.321(%rip), %rax + jmp .L.end.342 +.L.else.342: +.data +.L.str.322: + .byte 105 + .byte 101 + .byte 115 + .byte 0 +.text + leaq .L.str.322(%rip), %rax +.L.end.342: + leave + ret +.global plural_or_singular +plural_or_singular: + push %rbp + movq %rsp, %rbp + subq $0, %rsp + movq $1, %rax + push %rax + leaq 16(%rbp), %rax + movslq (%rax), %rax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.343 +.data +.L.str.323: + .byte 0 +.text + leaq .L.str.323(%rip), %rax + jmp .L.end.343 +.L.else.343: +.data +.L.str.324: + .byte 115 + .byte 0 +.text + leaq .L.str.324(%rip), %rax +.L.end.343: + leave + ret +.global vec_append_type +vec_append_type: + push %rbp + movq %rsp, %rbp + subq $0, %rsp leaq 16(%rbp), %rax movq (%rax), %rax - addq $8, %rax + addq $12, %rax movslq (%rax), %rax push %rax - leaq -4(%rbp), %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $8, %rax movslq (%rax), %rax pop %rdi cmpl %edi, %eax - setl %al + setge %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.321 + jne .L.else.344 + leaq 16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq type_vec_realloc(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + jmp .L.end.344 +.L.else.344: +.L.end.344: + movq $8, %rax + push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $8, %rax movslq (%rax), %rax + pop %rdi + imull %edi, %eax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $0, %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + push %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + pop %rdi + movq %rax, (%rdi) + movq $1, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $8, %rax push %rax movq $1, %rax push %rax - leaq -4(%rbp), %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $8, %rax movslq (%rax), %rax pop %rdi addl %edi, %eax pop %rdi - cmpl %edi, %eax - setl %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.else.322 - movq $8, %rax + movl %eax, (%rdi) + pop %rdi + subl %edi, %eax + movq $0, %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global type_vec_realloc +type_vec_realloc: + push %rbp + movq %rsp, %rbp + subq $16, %rsp + leaq -8(%rbp), %rax push %rax - leaq -4(%rbp), %rax + movq $2, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $12, %rax movslq (%rax), %rax + push %rax + movq $8, %rax pop %rdi imull %edi, %eax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $0, %rax - movq (%rax), %rax pop %rdi - addq %rdi, %rax - movq (%rax), %rax - addq $8, %rax - movq (%rax), %rax + imull %edi, %eax push %rax - leaq (%rsp), %rax + leaq alloc(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + movq $0, %rax push %rax + leaq -8(%rbp), %rax + movq (%rax), %rax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.345 .data -.L.str.313: +.L.str.325: + .byte 97 + .byte 108 + .byte 108 + .byte 111 + .byte 99 .byte 32 - .byte 96 - .byte 37 - .byte 115 - .byte 96 - .byte 44 + .byte 114 + .byte 101 + .byte 116 + .byte 117 + .byte 114 + .byte 110 + .byte 101 + .byte 100 + .byte 32 + .byte 110 + .byte 105 + .byte 108 + .byte 10 .byte 0 .text - leaq .L.str.313(%rip), %rax + leaq .L.str.325(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp - jmp .L.end.322 -.L.else.322: - movq $8, %rax + addq $8, %rsp + movq $1, %rax push %rax - leaq -4(%rbp), %rax + leaq exit(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + jmp .L.end.345 +.L.else.345: +.L.end.345: + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $12, %rax movslq (%rax), %rax + push %rax + movq $8, %rax pop %rdi imull %edi, %eax push %rax @@ -21499,195 +22759,119 @@ unkown_type_error: movq (%rax), %rax addq $0, %rax movq (%rax), %rax - pop %rdi - addq %rdi, %rax - movq (%rax), %rax - addq $8, %rax - movq (%rax), %rax - push %rax - leaq (%rsp), %rax push %rax -.data -.L.str.314: - .byte 32 - .byte 96 - .byte 37 - .byte 115 - .byte 96 - .byte 0 -.text - leaq .L.str.314(%rip), %rax + leaq -8(%rbp), %rax + movq (%rax), %rax push %rax - leaq eprintf(%rip), %rax + leaq memcpy(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $24, %rsp -.L.end.322: - movq $1, %rax - push %rax - leaq -4(%rbp), %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $12, %rax push %rax - movq $1, %rax + movq $2, %rax push %rax - leaq -4(%rbp), %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $12, %rax movslq (%rax), %rax pop %rdi - addl %edi, %eax + imull %edi, %eax pop %rdi movl %eax, (%rdi) - pop %rdi - subl %edi, %eax - jmp .L.while.start.321 -.L.while.end.321: - leaq (%rsp), %rax - push %rax -.data -.L.str.315: - .byte 10 - .byte 0 -.text - leaq .L.str.315(%rip), %rax - push %rax - leaq eprintf(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - movq $1, %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $0, %rax push %rax - leaq exit(%rip), %rax - movq %rax, %r10 + leaq -8(%rbp), %rax + movq (%rax), %rax + pop %rdi + movq %rax, (%rdi) movq $0, %rax - callq *%r10 - addq $8, %rsp + movq %rbp, %rsp + pop %rbp + retq leave ret -.global func_call_args_length_error -func_call_args_length_error: +.global new_type_vec +new_type_vec: push %rbp movq %rsp, %rbp - subq $0, %rsp - leaq 40(%rbp), %rax - movq (%rax), %rax - push %rax - leaq 32(%rbp), %rax - movq (%rax), %rax + subq $16, %rsp + leaq -8(%rbp), %rax push %rax - leaq print_error_with_code(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - leaq 24(%rbp), %rax - movslq (%rax), %rax + movq $16, %rax push %rax - leaq plural_or_singular(%rip), %rax + leaq alloc(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp - push %rax - leaq 24(%rbp), %rax - movslq (%rax), %rax + pop %rdi + movq %rax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $0, %rax push %rax leaq 16(%rbp), %rax movslq (%rax), %rax push %rax - leaq plural_or_singular(%rip), %rax + movq $8, %rax + pop %rdi + imull %edi, %eax + push %rax + leaq alloc(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + movq $0, %rax push %rax - leaq 16(%rbp), %rax - movslq (%rax), %rax - push %rax - leaq (%rsp), %rax - push %rax + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $0, %rax + movq (%rax), %rax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.346 .data -.L.str.316: - .byte 104 - .byte 101 +.L.str.326: + .byte 97 + .byte 108 .byte 108 - .byte 112 - .byte 58 - .byte 32 - .byte 116 - .byte 104 - .byte 105 - .byte 115 - .byte 32 - .byte 102 - .byte 117 - .byte 110 - .byte 99 - .byte 116 - .byte 105 .byte 111 - .byte 110 - .byte 32 - .byte 116 - .byte 97 - .byte 107 - .byte 101 - .byte 115 - .byte 32 - .byte 37 - .byte 100 + .byte 99 .byte 32 - .byte 97 .byte 114 - .byte 103 - .byte 117 - .byte 109 .byte 101 - .byte 110 .byte 116 - .byte 37 - .byte 115 - .byte 32 - .byte 98 .byte 117 - .byte 116 - .byte 32 - .byte 37 - .byte 100 - .byte 32 - .byte 97 .byte 114 - .byte 103 - .byte 117 - .byte 109 - .byte 101 .byte 110 - .byte 116 - .byte 37 - .byte 115 - .byte 32 - .byte 119 - .byte 101 - .byte 114 - .byte 101 - .byte 32 - .byte 115 - .byte 117 - .byte 112 - .byte 112 - .byte 108 - .byte 105 .byte 101 .byte 100 + .byte 32 + .byte 110 + .byte 105 + .byte 108 .byte 10 .byte 0 .text - leaq .L.str.316(%rip), %rax + leaq .L.str.326(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $48, %rsp + addq $8, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -21695,75 +22879,33 @@ func_call_args_length_error: movq $0, %rax callq *%r10 addq $8, %rsp - leave - ret -.global plural_or_singular2 -plural_or_singular2: - push %rbp - movq %rsp, %rbp - subq $0, %rsp - movq $1, %rax + jmp .L.end.346 +.L.else.346: +.L.end.346: + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $8, %rax push %rax - leaq 16(%rbp), %rax - movslq (%rax), %rax + movq $0, %rax pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.else.323 -.data -.L.str.317: - .byte 121 - .byte 0 -.text - leaq .L.str.317(%rip), %rax - jmp .L.end.323 -.L.else.323: -.data -.L.str.318: - .byte 105 - .byte 101 - .byte 115 - .byte 0 -.text - leaq .L.str.318(%rip), %rax -.L.end.323: - leave - ret -.global plural_or_singular -plural_or_singular: - push %rbp - movq %rsp, %rbp - subq $0, %rsp - movq $1, %rax + movl %eax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $12, %rax push %rax leaq 16(%rbp), %rax movslq (%rax), %rax pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.else.324 -.data -.L.str.319: - .byte 0 -.text - leaq .L.str.319(%rip), %rax - jmp .L.end.324 -.L.else.324: -.data -.L.str.320: - .byte 115 - .byte 0 -.text - leaq .L.str.320(%rip), %rax -.L.end.324: + movl %eax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + movq %rbp, %rsp + pop %rbp + retq leave ret -.global vec_append_type -vec_append_type: +.global vec_append_member +vec_append_member: push %rbp movq %rsp, %rbp subq $0, %rsp @@ -21781,18 +22923,18 @@ vec_append_type: setge %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.325 + jne .L.else.347 leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq type_vec_realloc(%rip), %rax + leaq member_vec_realloc(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.325 -.L.else.325: -.L.end.325: + jmp .L.end.347 +.L.else.347: +.L.end.347: movq $8, %rax push %rax leaq 16(%rbp), %rax @@ -21837,8 +22979,8 @@ vec_append_type: retq leave ret -.global type_vec_realloc -type_vec_realloc: +.global member_vec_realloc +member_vec_realloc: push %rbp movq %rsp, %rbp subq $16, %rsp @@ -21873,11 +23015,9 @@ type_vec_realloc: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.326 - leaq (%rsp), %rax - push %rax + jne .L.else.348 .data -.L.str.321: +.L.str.327: .byte 97 .byte 108 .byte 108 @@ -21899,13 +23039,13 @@ type_vec_realloc: .byte 10 .byte 0 .text - leaq .L.str.321(%rip), %rax + leaq .L.str.327(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -21913,9 +23053,9 @@ type_vec_realloc: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.326 -.L.else.326: -.L.end.326: + jmp .L.end.348 +.L.else.348: +.L.end.348: leaq 16(%rbp), %rax movq (%rax), %rax addq $12, %rax @@ -21966,8 +23106,8 @@ type_vec_realloc: retq leave ret -.global new_type_vec -new_type_vec: +.global new_member_vec +new_member_vec: push %rbp movq %rsp, %rbp subq $16, %rsp @@ -22011,11 +23151,9 @@ new_type_vec: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.327 - leaq (%rsp), %rax - push %rax + jne .L.else.349 .data -.L.str.322: +.L.str.328: .byte 97 .byte 108 .byte 108 @@ -22037,13 +23175,13 @@ new_type_vec: .byte 10 .byte 0 .text - leaq .L.str.322(%rip), %rax + leaq .L.str.328(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -22051,9 +23189,9 @@ new_type_vec: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.327 -.L.else.327: -.L.end.327: + jmp .L.end.349 +.L.else.349: +.L.end.349: leaq -8(%rbp), %rax movq (%rax), %rax addq $8, %rax @@ -22076,8 +23214,8 @@ new_type_vec: retq leave ret -.global vec_append_member -vec_append_member: +.global vec_append_str +vec_append_str: push %rbp movq %rsp, %rbp subq $0, %rsp @@ -22095,18 +23233,18 @@ vec_append_member: setge %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.328 + jne .L.else.350 leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq member_vec_realloc(%rip), %rax + leaq str_vec_realloc(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.328 -.L.else.328: -.L.end.328: + jmp .L.end.350 +.L.else.350: +.L.end.350: movq $8, %rax push %rax leaq 16(%rbp), %rax @@ -22144,32 +23282,166 @@ vec_append_member: pop %rdi movl %eax, (%rdi) pop %rdi - subl %edi, %eax + subl %edi, %eax + movq $0, %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global str_vec_realloc +str_vec_realloc: + push %rbp + movq %rsp, %rbp + subq $16, %rsp + leaq -8(%rbp), %rax + push %rax + movq $2, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $12, %rax + movslq (%rax), %rax + push %rax + movq $8, %rax + pop %rdi + imull %edi, %eax + pop %rdi + imull %edi, %eax + push %rax + leaq alloc(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + movq $0, %rax + push %rax + leaq -8(%rbp), %rax + movq (%rax), %rax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.351 +.data +.L.str.329: + .byte 97 + .byte 108 + .byte 108 + .byte 111 + .byte 99 + .byte 32 + .byte 114 + .byte 101 + .byte 116 + .byte 117 + .byte 114 + .byte 110 + .byte 101 + .byte 100 + .byte 32 + .byte 110 + .byte 105 + .byte 108 + .byte 10 + .byte 0 +.text + leaq .L.str.329(%rip), %rax + push %rax + leaq eprintf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + movq $1, %rax + push %rax + leaq exit(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + jmp .L.end.351 +.L.else.351: +.L.end.351: + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $12, %rax + movslq (%rax), %rax + push %rax + movq $8, %rax + pop %rdi + imull %edi, %eax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $0, %rax + movq (%rax), %rax + push %rax + leaq -8(%rbp), %rax + movq (%rax), %rax + push %rax + leaq memcpy(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $24, %rsp + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $12, %rax + push %rax + movq $2, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $12, %rax + movslq (%rax), %rax + pop %rdi + imull %edi, %eax + pop %rdi + movl %eax, (%rdi) + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $0, %rax + push %rax + leaq -8(%rbp), %rax + movq (%rax), %rax + pop %rdi + movq %rax, (%rdi) movq $0, %rax movq %rbp, %rsp pop %rbp retq leave ret -.global member_vec_realloc -member_vec_realloc: +.global new_str_vec +new_str_vec: push %rbp movq %rsp, %rbp subq $16, %rsp leaq -8(%rbp), %rax push %rax - movq $2, %rax + movq $16, %rax push %rax - leaq 16(%rbp), %rax + leaq alloc(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + leaq -8(%rbp), %rax movq (%rax), %rax - addq $12, %rax + addq $0, %rax + push %rax + leaq 16(%rbp), %rax movslq (%rax), %rax push %rax movq $8, %rax pop %rdi imull %edi, %eax - pop %rdi - imull %edi, %eax push %rax leaq alloc(%rip), %rax movq %rax, %r10 @@ -22182,16 +23454,16 @@ member_vec_realloc: push %rax leaq -8(%rbp), %rax movq (%rax), %rax + addq $0, %rax + movq (%rax), %rax pop %rdi cmpl %edi, %eax sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.329 - leaq (%rsp), %rax - push %rax + jne .L.else.352 .data -.L.str.323: +.L.str.330: .byte 97 .byte 108 .byte 108 @@ -22213,13 +23485,13 @@ member_vec_realloc: .byte 10 .byte 0 .text - leaq .L.str.323(%rip), %rax + leaq .L.str.330(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -22227,270 +23499,407 @@ member_vec_realloc: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.329 -.L.else.329: -.L.end.329: - leaq 16(%rbp), %rax + jmp .L.end.352 +.L.else.352: +.L.end.352: + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $8, %rax + push %rax + movq $0, %rax + pop %rdi + movl %eax, (%rdi) + leaq -8(%rbp), %rax movq (%rax), %rax addq $12, %rax + push %rax + leaq 16(%rbp), %rax movslq (%rax), %rax + pop %rdi + movl %eax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global tokenize +tokenize: + push %rbp + movq %rsp, %rbp + subq $80, %rsp + leaq -65(%rbp), %rax push %rax - movq $8, %rax + leaq -57(%rbp), %rax pop %rdi - imull %edi, %eax + movq %rax, (%rdi) +.L.while.start.353: + movq $0, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $0, %rax + addq $24, %rax movq (%rax), %rax - push %rax - leaq -8(%rbp), %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + setne %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.while.end.353 + leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq memcpy(%rip), %rax + leaq skip_single_line_comment(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $24, %rsp + addq $8, %rsp leaq 16(%rbp), %rax movq (%rax), %rax - addq $12, %rax + addq $24, %rax + movq (%rax), %rax + movzbl (%rax), %eax push %rax - movq $2, %rax + leaq isdigit(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + movzx %al, %eax + cmpq $1, %rax + jne .L.else.354 + leaq -65(%rbp), %rax + push %rax + leaq -65(%rbp), %rax + movq (%rax), %rax + addq $49, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $12, %rax - movslq (%rax), %rax + push %rax + leaq tokenize_number(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp pop %rdi - imull %edi, %eax + movq %rax, (%rdi) pop %rdi - movl %eax, (%rdi) + movq %rax, (%rdi) + jmp .L.end.354 +.L.else.354: leaq 16(%rbp), %rax movq (%rax), %rax - addq $0, %rax + addq $24, %rax + movq (%rax), %rax + movzbl (%rax), %eax push %rax - leaq -8(%rbp), %rax + leaq isalpha(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + movzx %al, %eax + cmpq $1, %rax + jne .L.else.355 + leaq -65(%rbp), %rax + push %rax + leaq -65(%rbp), %rax + movq (%rax), %rax + addq $49, %rax + push %rax + leaq 16(%rbp), %rax movq (%rax), %rax + push %rax + leaq tokenize_ident(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) pop %rdi movq %rax, (%rdi) + jmp .L.end.355 +.L.else.355: + movq $39, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.356 + leaq -65(%rbp), %rax + push %rax + leaq -65(%rbp), %rax + movq (%rax), %rax + addq $49, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq tokenize_char(%rip), %rax + movq %rax, %r10 movq $0, %rax - movq %rbp, %rsp - pop %rbp - retq - leave - ret -.global new_member_vec -new_member_vec: - push %rbp - movq %rsp, %rbp - subq $16, %rsp - leaq -8(%rbp), %rax + callq *%r10 + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + pop %rdi + movq %rax, (%rdi) + jmp .L.end.356 +.L.else.356: + movq $34, %rax push %rax - movq $16, %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.357 + leaq -65(%rbp), %rax push %rax - leaq alloc(%rip), %rax + leaq -65(%rbp), %rax + movq (%rax), %rax + addq $49, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq tokenize_string(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp pop %rdi movq %rax, (%rdi) - leaq -8(%rbp), %rax + pop %rdi + movq %rax, (%rdi) + jmp .L.end.357 +.L.else.357: + leaq 16(%rbp), %rax movq (%rax), %rax - addq $0, %rax + addq $24, %rax + movq (%rax), %rax + push %rax + leaq is_two_c_punct(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + movzx %al, %eax + cmpq $1, %rax + jne .L.else.358 + leaq -65(%rbp), %rax + push %rax + leaq -65(%rbp), %rax + movq (%rax), %rax + addq $49, %rax + push %rax + movq $4, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq new_token(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp + pop %rdi + movq %rax, (%rdi) + pop %rdi + movq %rax, (%rdi) + leaq -65(%rbp), %rax + movq (%rax), %rax + addq $28, %rax push %rax - leaq 16(%rbp), %rax - movslq (%rax), %rax + movq $2, %rax push %rax - movq $8, %rax - pop %rdi - imull %edi, %eax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax push %rax - leaq alloc(%rip), %rax + leaq strndup(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $8, %rsp + addq $16, %rsp pop %rdi movq %rax, (%rdi) - movq $0, %rax - push %rax - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $0, %rax + leaq -65(%rbp), %rax movq (%rax), %rax + addq $36, %rax + push %rax + movq $2, %rax pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.else.330 - leaq (%rsp), %rax + movl %eax, (%rdi) + movq $2, %rax push %rax -.data -.L.str.324: - .byte 97 - .byte 108 - .byte 108 - .byte 111 - .byte 99 - .byte 32 - .byte 114 - .byte 101 - .byte 116 - .byte 117 - .byte 114 - .byte 110 - .byte 101 - .byte 100 - .byte 32 - .byte 110 - .byte 105 - .byte 108 - .byte 10 - .byte 0 -.text - leaq .L.str.324(%rip), %rax + leaq 16(%rbp), %rax + movq (%rax), %rax push %rax - leaq eprintf(%rip), %rax + leaq tokenizer_n_next(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $16, %rsp - movq $1, %rax + jmp .L.end.358 +.L.else.358: + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax push %rax - leaq exit(%rip), %rax + leaq is_three_c_punct(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.330 -.L.else.330: -.L.end.330: - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $8, %rax + movzx %al, %eax + cmpq $1, %rax + jne .L.else.359 + leaq -65(%rbp), %rax push %rax - movq $0, %rax - pop %rdi - movl %eax, (%rdi) - leaq -8(%rbp), %rax + leaq -65(%rbp), %rax movq (%rax), %rax - addq $12, %rax + addq $49, %rax + push %rax + movq $4, %rax push %rax leaq 16(%rbp), %rax - movslq (%rax), %rax - pop %rdi - movl %eax, (%rdi) - leaq -8(%rbp), %rax movq (%rax), %rax - movq %rbp, %rsp - pop %rbp - retq - leave - ret -.global tokenize -tokenize: - push %rbp - movq %rsp, %rbp - subq $80, %rsp - leaq -65(%rbp), %rax push %rax - leaq -57(%rbp), %rax + leaq new_token(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp pop %rdi movq %rax, (%rdi) -.L.while.start.331: - movq $0, %rax + pop %rdi + movq %rax, (%rdi) + leaq -65(%rbp), %rax + movq (%rax), %rax + addq $28, %rax + push %rax + movq $3, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax - movzbl (%rax), %eax + push %rax + leaq strndup(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp pop %rdi - cmpl %edi, %eax - setne %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.while.end.331 + movq %rax, (%rdi) + leaq -65(%rbp), %rax + movq (%rax), %rax + addq $36, %rax + push %rax + movq $3, %rax + pop %rdi + movl %eax, (%rdi) + movq $3, %rax + push %rax leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq skip_single_line_comment(%rip), %rax + leaq tokenizer_n_next(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $8, %rsp + addq $16, %rsp + jmp .L.end.359 +.L.else.359: leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax movzbl (%rax), %eax push %rax - leaq isdigit(%rip), %rax + leaq ispunct(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp movzx %al, %eax cmpq $1, %rax - jne .L.else.332 + jne .L.else.360 leaq -65(%rbp), %rax push %rax leaq -65(%rbp), %rax movq (%rax), %rax addq $49, %rax push %rax + movq $4, %rax + push %rax leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq tokenize_number(%rip), %rax + leaq new_token(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $8, %rsp + addq $16, %rsp pop %rdi movq %rax, (%rdi) pop %rdi movq %rax, (%rdi) - jmp .L.end.332 -.L.else.332: + leaq -65(%rbp), %rax + movq (%rax), %rax + addq $28, %rax + push %rax + movq $1, %rax + push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax - movzbl (%rax), %eax push %rax - leaq isalpha(%rip), %rax + leaq strndup(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $8, %rsp - movzx %al, %eax - cmpq $1, %rax - jne .L.else.333 - leaq -65(%rbp), %rax - push %rax + addq $16, %rsp + pop %rdi + movq %rax, (%rdi) leaq -65(%rbp), %rax movq (%rax), %rax - addq $49, %rax + addq $36, %rax push %rax + movq $1, %rax + pop %rdi + movl %eax, (%rdi) leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq tokenize_ident(%rip), %rax + leaq tokenizer_next(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp - pop %rdi - movq %rax, (%rdi) - pop %rdi - movq %rax, (%rdi) - jmp .L.end.333 -.L.else.333: - movq $39, %rax + jmp .L.end.360 +.L.else.360: + movq $32, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -22502,28 +23911,41 @@ tokenize: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.334 - leaq -65(%rbp), %rax - push %rax - leaq -65(%rbp), %rax + jne .L.else.361 + leaq 16(%rbp), %rax movq (%rax), %rax - addq $49, %rax push %rax + leaq tokenizer_next(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + jmp .L.end.361 +.L.else.361: + movq $10, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.362 leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq tokenize_char(%rip), %rax + leaq tokenizer_next(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp - pop %rdi - movq %rax, (%rdi) - pop %rdi - movq %rax, (%rdi) - jmp .L.end.334 -.L.else.334: - movq $34, %rax + jmp .L.end.362 +.L.else.362: + movq $9, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -22535,47 +23957,111 @@ tokenize: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.335 - leaq -65(%rbp), %rax + jne .L.else.363 + leaq 16(%rbp), %rax + movq (%rax), %rax push %rax - leaq -65(%rbp), %rax + leaq tokenizer_next(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + jmp .L.end.363 +.L.else.363: + leaq -73(%rbp), %rax + push %rax + movq $6, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq new_token(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp + pop %rdi + movq %rax, (%rdi) + leaq -73(%rbp), %rax movq (%rax), %rax - addq $49, %rax + addq $28, %rax + push %rax + movq $1, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax push %rax - leaq tokenize_string(%rip), %rax + leaq strndup(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $8, %rsp - pop %rdi - movq %rax, (%rdi) + addq $16, %rsp pop %rdi movq %rax, (%rdi) - jmp .L.end.335 -.L.else.335: - leaq 16(%rbp), %rax + leaq -73(%rbp), %rax movq (%rax), %rax - addq $24, %rax + addq $36, %rax + push %rax + movq $1, %rax + pop %rdi + movl %eax, (%rdi) +.data +.L.str.331: + .byte 117 + .byte 110 + .byte 107 + .byte 111 + .byte 119 + .byte 110 + .byte 32 + .byte 99 + .byte 104 + .byte 97 + .byte 114 + .byte 97 + .byte 99 + .byte 116 + .byte 101 + .byte 114 + .byte 32 + .byte 102 + .byte 111 + .byte 117 + .byte 110 + .byte 100 + .byte 0 +.text + leaq .L.str.331(%rip), %rax + push %rax + leaq -73(%rbp), %rax movq (%rax), %rax push %rax - leaq is_two_c_punct(%rip), %rax + leaq print_error(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $8, %rsp - movzx %al, %eax - cmpq $1, %rax - jne .L.else.336 + addq $16, %rsp +.L.end.363: +.L.end.362: +.L.end.361: +.L.end.360: +.L.end.359: +.L.end.358: +.L.end.357: +.L.end.356: +.L.end.355: +.L.end.354: + jmp .L.while.start.353 +.L.while.end.353: leaq -65(%rbp), %rax push %rax leaq -65(%rbp), %rax movq (%rax), %rax addq $49, %rax push %rax - movq $4, %rax + movq $5, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -22593,82 +24079,141 @@ tokenize: movq (%rax), %rax addq $28, %rax push %rax +.data +.L.str.332: + .byte 69 + .byte 79 + .byte 70 + .byte 0 +.text + leaq .L.str.332(%rip), %rax + pop %rdi + movq %rax, (%rdi) + leaq -65(%rbp), %rax + movq (%rax), %rax + addq $36, %rax + push %rax + movq $1, %rax + pop %rdi + movl %eax, (%rdi) + leaq -57(%rbp), %rax + addq $49, %rax + movq (%rax), %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global tokenize_ident +tokenize_ident: + push %rbp + movq %rsp, %rbp + subq $16, %rsp + leaq -8(%rbp), %rax + push %rax movq $2, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax push %rax - leaq strndup(%rip), %rax + leaq new_token(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $16, %rsp pop %rdi movq %rax, (%rdi) - leaq -65(%rbp), %rax - movq (%rax), %rax - addq $36, %rax + leaq -16(%rbp), %rax push %rax - movq $2, %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax pop %rdi - movl %eax, (%rdi) - movq $2, %rax - push %rax + movq %rax, (%rdi) +.L.while.start.364: leaq 16(%rbp), %rax movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax + movzbl (%rax), %eax push %rax - leaq tokenizer_n_next(%rip), %rax + leaq isalpha(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - jmp .L.end.336 -.L.else.336: + addq $8, %rsp + movzx %al, %eax + cmpq $0, %rax + jne .L.true.366 leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax + movzbl (%rax), %eax push %rax - leaq is_three_c_punct(%rip), %rax + leaq isdigit(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp movzx %al, %eax - cmpq $1, %rax - jne .L.else.337 - leaq -65(%rbp), %rax + cmp $0, %rax + jne .L.true.366 + mov $0, %rax + jmp .L.end.366 +.L.true.366: + mov $1, %rax +.L.end.366: + cmpq $0, %rax + jne .L.true.365 + movq $95, %rax push %rax - leaq -65(%rbp), %rax + leaq 16(%rbp), %rax movq (%rax), %rax - addq $49, %rax - push %rax - movq $4, %rax - push %rax + addq $24, %rax + movq (%rax), %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmp $0, %rax + jne .L.true.365 + mov $0, %rax + jmp .L.end.365 +.L.true.365: + mov $1, %rax +.L.end.365: + cmpq $1, %rax + jne .L.while.end.364 leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq new_token(%rip), %rax + leaq tokenizer_next(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - pop %rdi - movq %rax, (%rdi) - pop %rdi - movq %rax, (%rdi) - leaq -65(%rbp), %rax + addq $8, %rsp + jmp .L.while.start.364 +.L.while.end.364: +.L.tokenize_ident.ident_end: + leaq -8(%rbp), %rax movq (%rax), %rax addq $28, %rax push %rax - movq $3, %rax + leaq -16(%rbp), %rax + movq (%rax), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax + pop %rdi + subq %rdi, %rax + push %rax + leaq -16(%rbp), %rax + movq (%rax), %rax push %rax leaq strndup(%rip), %rax movq %rax, %r10 @@ -22677,62 +24222,81 @@ tokenize: addq $16, %rsp pop %rdi movq %rax, (%rdi) - leaq -65(%rbp), %rax + leaq -8(%rbp), %rax movq (%rax), %rax addq $36, %rax push %rax - movq $3, %rax + leaq -16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax + pop %rdi + subq %rdi, %rax pop %rdi movl %eax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global tokenize_string +tokenize_string: + push %rbp + movq %rsp, %rbp + subq $48, %rsp + leaq -8(%rbp), %rax + push %rax movq $3, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq tokenizer_n_next(%rip), %rax + leaq new_token(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.337 -.L.else.337: + pop %rdi + movq %rax, (%rdi) + leaq -16(%rbp), %rax + push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax - movzbl (%rax), %eax + pop %rdi + movq %rax, (%rdi) + leaq 16(%rbp), %rax + movq (%rax), %rax push %rax - leaq ispunct(%rip), %rax + leaq tokenizer_next(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp - movzx %al, %eax - cmpq $1, %rax - jne .L.else.338 - leaq -65(%rbp), %rax + leaq -24(%rbp), %rax push %rax - leaq -65(%rbp), %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax movq (%rax), %rax - addq $49, %rax - push %rax - movq $4, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq new_token(%rip), %rax + leaq string_end(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $16, %rsp pop %rdi movq %rax, (%rdi) - pop %rdi - movq %rax, (%rdi) - leaq -65(%rbp), %rax - movq (%rax), %rax - addq $28, %rax + leaq -32(%rbp), %rax push %rax movq $1, %rax push %rax @@ -22741,54 +24305,40 @@ tokenize: addq $24, %rax movq (%rax), %rax push %rax - leaq strndup(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - pop %rdi - movq %rax, (%rdi) - leaq -65(%rbp), %rax - movq (%rax), %rax - addq $36, %rax - push %rax - movq $1, %rax - pop %rdi - movl %eax, (%rdi) - leaq 16(%rbp), %rax + leaq -24(%rbp), %rax movq (%rax), %rax + pop %rdi + subq %rdi, %rax + pop %rdi + addq %rdi, %rax push %rax - leaq tokenizer_next(%rip), %rax + leaq alloc(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.338 -.L.else.338: - movq $32, %rax + pop %rdi + movq %rax, (%rdi) + leaq -36(%rbp), %rax + push %rax + movq $0, %rax + pop %rdi + movl %eax, (%rdi) +.L.while.start.367: + leaq -24(%rbp), %rax + movq (%rax), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax - movzbl (%rax), %eax pop %rdi cmpl %edi, %eax - sete %al + setl %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.339 - leaq 16(%rbp), %rax - movq (%rax), %rax - push %rax - leaq tokenizer_next(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp - jmp .L.end.339 -.L.else.339: - movq $10, %rax + jne .L.while.end.367 + movq $92, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -22800,18 +24350,66 @@ tokenize: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.340 + jne .L.else.368 + movq $1, %rax + push %rax + movq $1, %rax + push %rax + leaq -36(%rbp), %rax + push %rax + movq $1, %rax + push %rax + leaq -36(%rbp), %rax + movslq (%rax), %rax + pop %rdi + addl %edi, %eax + pop %rdi + movl %eax, (%rdi) + pop %rdi + subl %edi, %eax + pop %rdi + imull %edi, %eax + push %rax + leaq -32(%rbp), %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + push %rax leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq tokenizer_next(%rip), %rax + leaq read_escaped_char(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.340 -.L.else.340: - movq $9, %rax + pop %rdi + movb %al, (%rdi) + jmp .L.end.368 +.L.else.368: + movq $1, %rax + push %rax + movq $1, %rax + push %rax + leaq -36(%rbp), %rax + push %rax + movq $1, %rax + push %rax + leaq -36(%rbp), %rax + movslq (%rax), %rax + pop %rdi + addl %edi, %eax + pop %rdi + movl %eax, (%rdi) + pop %rdi + subl %edi, %eax + pop %rdi + imull %edi, %eax + push %rax + leaq -32(%rbp), %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -22819,11 +24417,8 @@ tokenize: movq (%rax), %rax movzbl (%rax), %eax pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.else.341 + movb %al, (%rdi) +.L.end.368: leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -22832,32 +24427,47 @@ tokenize: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.341 -.L.else.341: - leaq -73(%rbp), %rax + jmp .L.while.start.367 +.L.while.end.367: + movq $1, %rax push %rax - movq $6, %rax + leaq -36(%rbp), %rax + movslq (%rax), %rax + pop %rdi + imull %edi, %eax + push %rax + leaq -32(%rbp), %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax push %rax + movq $0, %rax + pop %rdi + movb %al, (%rdi) leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq new_token(%rip), %rax + leaq tokenizer_next(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - pop %rdi - movq %rax, (%rdi) - leaq -73(%rbp), %rax + addq $8, %rsp + leaq -8(%rbp), %rax movq (%rax), %rax addq $28, %rax push %rax - movq $1, %rax + leaq -16(%rbp), %rax + movq (%rax), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax + pop %rdi + subq %rdi, %rax + push %rax + leaq -16(%rbp), %rax + movq (%rax), %rax push %rax leaq strndup(%rip), %rax movq %rax, %r10 @@ -22866,118 +24476,44 @@ tokenize: addq $16, %rsp pop %rdi movq %rax, (%rdi) - leaq -73(%rbp), %rax + leaq -8(%rbp), %rax movq (%rax), %rax addq $36, %rax push %rax - movq $1, %rax - pop %rdi - movl %eax, (%rdi) -.data -.L.str.325: - .byte 117 - .byte 110 - .byte 107 - .byte 111 - .byte 119 - .byte 110 - .byte 32 - .byte 99 - .byte 104 - .byte 97 - .byte 114 - .byte 97 - .byte 99 - .byte 116 - .byte 101 - .byte 114 - .byte 32 - .byte 102 - .byte 111 - .byte 117 - .byte 110 - .byte 100 - .byte 0 -.text - leaq .L.str.325(%rip), %rax - push %rax - leaq -73(%rbp), %rax - movq (%rax), %rax - push %rax - leaq print_error(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp -.L.end.341: -.L.end.340: -.L.end.339: -.L.end.338: -.L.end.337: -.L.end.336: -.L.end.335: -.L.end.334: -.L.end.333: -.L.end.332: - jmp .L.while.start.331 -.L.while.end.331: - leaq -65(%rbp), %rax - push %rax - leaq -65(%rbp), %rax + leaq -16(%rbp), %rax movq (%rax), %rax - addq $49, %rax - push %rax - movq $5, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - push %rax - leaq new_token(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp + addq $24, %rax + movq (%rax), %rax pop %rdi - movq %rax, (%rdi) + subq %rdi, %rax pop %rdi - movq %rax, (%rdi) - leaq -65(%rbp), %rax + movl %eax, (%rdi) + leaq -8(%rbp), %rax movq (%rax), %rax - addq $28, %rax + addq $40, %rax push %rax -.data -.L.str.326: - .byte 69 - .byte 79 - .byte 70 - .byte 0 -.text - leaq .L.str.326(%rip), %rax - pop %rdi - movq %rax, (%rdi) - leaq -65(%rbp), %rax + leaq -32(%rbp), %rax movq (%rax), %rax - addq $36, %rax - push %rax - movq $1, %rax pop %rdi - movl %eax, (%rdi) - leaq -57(%rbp), %rax - addq $49, %rax + movq %rax, (%rdi) + leaq -8(%rbp), %rax movq (%rax), %rax movq %rbp, %rsp pop %rbp retq leave ret -.global tokenize_ident -tokenize_ident: +.global tokenize_char +tokenize_char: push %rbp movq %rsp, %rbp - subq $16, %rsp + subq $32, %rsp leaq -8(%rbp), %rax push %rax - movq $2, %rax + movq $1, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -22997,43 +24533,42 @@ tokenize_ident: movq (%rax), %rax pop %rdi movq %rax, (%rdi) -.L.while.start.342: leaq 16(%rbp), %rax movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax - movzbl (%rax), %eax push %rax - leaq isalpha(%rip), %rax + leaq tokenizer_next(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp - movzx %al, %eax - cmpq $0, %rax - jne .L.true.344 + movq $92, %rax + push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.369 + leaq -20(%rbp), %rax push %rax - leaq isdigit(%rip), %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq read_escaped_char(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp - movzx %al, %eax - cmp $0, %rax - jne .L.true.344 - mov $0, %rax - jmp .L.end.344 -.L.true.344: - mov $1, %rax -.L.end.344: - cmpq $0, %rax - jne .L.true.343 - movq $95, %rax + pop %rdi + movl %eax, (%rdi) + jmp .L.end.369 +.L.else.369: + leaq -20(%rbp), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -23041,18 +24576,16 @@ tokenize_ident: movq (%rax), %rax movzbl (%rax), %eax pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmp $0, %rax - jne .L.true.343 - mov $0, %rax - jmp .L.end.343 -.L.true.343: - mov $1, %rax -.L.end.343: - cmpq $1, %rax - jne .L.while.end.342 + movl %eax, (%rdi) +.L.end.369: + leaq 16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq tokenizer_next(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -23061,9 +24594,6 @@ tokenize_ident: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.while.start.342 -.L.while.end.342: -.L.tokenize_ident.ident_end: leaq -8(%rbp), %rax movq (%rax), %rax addq $28, %rax @@ -23105,186 +24635,191 @@ tokenize_ident: movl %eax, (%rdi) leaq -8(%rbp), %rax movq (%rax), %rax + addq $48, %rax + push %rax + leaq -20(%rbp), %rax + movslq (%rax), %rax + pop %rdi + movb %al, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax movq %rbp, %rsp pop %rbp retq leave ret -.global tokenize_string -tokenize_string: +.global read_escaped_char +read_escaped_char: push %rbp movq %rsp, %rbp - subq $48, %rsp - leaq -8(%rbp), %rax - push %rax - movq $3, %rax - push %rax + subq $16, %rsp leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq new_token(%rip), %rax + leaq tokenizer_next(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - pop %rdi - movq %rax, (%rdi) - leaq -16(%rbp), %rax - push %rax + addq $8, %rsp leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax - pop %rdi - movq %rax, (%rdi) - leaq 16(%rbp), %rax - movq (%rax), %rax + movzbl (%rax), %eax push %rax - leaq tokenizer_next(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp - leaq -24(%rbp), %rax + movq $48, %rax + pop %rdi + cmpl %edi, %eax + setle %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.371 + movq $55, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - push %rax - leaq string_end(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp + movzbl (%rax), %eax pop %rdi - movq %rax, (%rdi) - leaq -32(%rbp), %rax - push %rax + cmpl %edi, %eax + setbe %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.371 movq $1, %rax + jmp .L.end.371 +.L.false.371: + movq $0, %rax +.L.end.371: + cmpq $1, %rax + jne .L.else.370 + leaq -4(%rbp), %rax + push %rax + movq $48, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax - push %rax - leaq -24(%rbp), %rax - movq (%rax), %rax - pop %rdi - subq %rdi, %rax - pop %rdi - addq %rdi, %rax - push %rax - leaq alloc(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp + movzbl (%rax), %eax pop %rdi - movq %rax, (%rdi) - leaq -36(%rbp), %rax - push %rax - movq $0, %rax + subl %edi, %eax pop %rdi movl %eax, (%rdi) -.L.while.start.345: - leaq -24(%rbp), %rax - movq (%rax), %rax + movq $1, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax pop %rdi + addq %rdi, %rax + movzbl (%rax), %eax + push %rax + movq $48, %rax + pop %rdi cmpl %edi, %eax - setl %al + setle %al movzbl %al, %eax - cmpq $1, %rax - jne .L.while.end.345 - movq $92, %rax + cmpq $0, %rax + je .L.false.373 + movq $55, %rax + push %rax + movq $1, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax + pop %rdi + addq %rdi, %rax movzbl (%rax), %eax pop %rdi cmpl %edi, %eax - sete %al + setbe %al movzbl %al, %eax - cmpq $1, %rax - jne .L.else.346 - movq $1, %rax - push %rax - movq $1, %rax - push %rax - leaq -36(%rbp), %rax - push %rax + cmpq $0, %rax + je .L.false.373 movq $1, %rax - push %rax - leaq -36(%rbp), %rax - movslq (%rax), %rax - pop %rdi - addl %edi, %eax - pop %rdi - movl %eax, (%rdi) - pop %rdi - subl %edi, %eax - pop %rdi - imull %edi, %eax - push %rax - leaq -32(%rbp), %rax - movq (%rax), %rax - pop %rdi - addq %rdi, %rax - push %rax + jmp .L.end.373 +.L.false.373: + movq $0, %rax +.L.end.373: + cmpq $1, %rax + jne .L.else.372 leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq read_escaped_char(%rip), %rax + leaq tokenizer_next(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp - pop %rdi - movb %al, (%rdi) - jmp .L.end.346 -.L.else.346: - movq $1, %rax + leaq -4(%rbp), %rax push %rax - movq $1, %rax + movq $48, %rax push %rax - leaq -36(%rbp), %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax + movzbl (%rax), %eax + pop %rdi + subl %edi, %eax push %rax - movq $1, %rax + movq $3, %rax push %rax - leaq -36(%rbp), %rax + leaq -4(%rbp), %rax movslq (%rax), %rax pop %rdi + movq %rdi, %rcx + shl %cl, %eax + pop %rdi addl %edi, %eax pop %rdi movl %eax, (%rdi) - pop %rdi - subl %edi, %eax - pop %rdi - imull %edi, %eax + movq $1, %rax push %rax - leaq -32(%rbp), %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax movq (%rax), %rax pop %rdi addq %rdi, %rax + movzbl (%rax), %eax + push %rax + movq $48, %rax + pop %rdi + cmpl %edi, %eax + setle %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.375 + movq $55, %rax + push %rax + movq $1, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax + pop %rdi + addq %rdi, %rax movzbl (%rax), %eax pop %rdi - movb %al, (%rdi) -.L.end.346: + cmpl %edi, %eax + setbe %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.375 + movq $1, %rax + jmp .L.end.375 +.L.false.375: + movq $0, %rax +.L.end.375: + cmpq $1, %rax + jne .L.else.374 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -23293,23 +24828,56 @@ tokenize_string: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.while.start.345 -.L.while.end.345: - movq $1, %rax + leaq -4(%rbp), %rax push %rax - leaq -36(%rbp), %rax + movq $48, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax + movzbl (%rax), %eax + pop %rdi + subl %edi, %eax + push %rax + movq $3, %rax + push %rax + leaq -4(%rbp), %rax movslq (%rax), %rax pop %rdi - imull %edi, %eax + movq %rdi, %rcx + shl %cl, %eax + pop %rdi + addl %edi, %eax + pop %rdi + movl %eax, (%rdi) + jmp .L.end.374 +.L.else.374: +.L.end.374: + jmp .L.end.372 +.L.else.372: +.L.end.372: + leaq -4(%rbp), %rax + movslq (%rax), %rax + movq %rbp, %rsp + pop %rbp + retq + jmp .L.end.370 +.L.else.370: +.L.end.370: + movq $120, %rax push %rax - leaq -32(%rbp), %rax + leaq 16(%rbp), %rax movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax + movzbl (%rax), %eax pop %rdi - addq %rdi, %rax - push %rax - movq $0, %rax - pop %rdi - movb %al, (%rdi) + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.376 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -23318,87 +24886,165 @@ tokenize_string: movq $0, %rax callq *%r10 addq $8, %rsp - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $28, %rax - push %rax - leaq -16(%rbp), %rax - movq (%rax), %rax - push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax - pop %rdi - subq %rdi, %rax - push %rax - leaq -16(%rbp), %rax - movq (%rax), %rax + movzbl (%rax), %eax push %rax - leaq strndup(%rip), %rax + leaq is_hex_digit(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - pop %rdi - movq %rax, (%rdi) - leaq -8(%rbp), %rax + addq $8, %rsp + movzx %al, %eax + cmpq $0, %rax + sete %al + movzbq %al, %rax + cmpq $1, %rax + jne .L.else.377 + leaq 16(%rbp), %rax movq (%rax), %rax - addq $36, %rax + addq $16, %rax + movslq (%rax), %rax push %rax - leaq -16(%rbp), %rax + leaq 16(%rbp), %rax movq (%rax), %rax + addq $20, %rax + movslq (%rax), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax - pop %rdi - subq %rdi, %rax - pop %rdi - movl %eax, (%rdi) - leaq -8(%rbp), %rax + addq $0, %rax movq (%rax), %rax - addq $40, %rax push %rax - leaq -32(%rbp), %rax - movq (%rax), %rax - pop %rdi - movq %rax, (%rdi) - leaq -8(%rbp), %rax - movq (%rax), %rax - movq %rbp, %rsp - pop %rbp - retq - leave - ret -.global tokenize_char -tokenize_char: - push %rbp - movq %rsp, %rbp - subq $32, %rsp - leaq -8(%rbp), %rax + leaq (%rsp), %rax + push %rax + push $3 +.data +.L.str.333: + .byte 27 + .byte 91 + .byte 49 + .byte 109 + .byte 27 + .byte 91 + .byte 51 + .byte 49 + .byte 109 + .byte 45 + .byte 45 + .byte 62 + .byte 32 + .byte 37 + .byte 115 + .byte 58 + .byte 37 + .byte 100 + .byte 58 + .byte 37 + .byte 100 + .byte 58 + .byte 32 + .byte 101 + .byte 114 + .byte 114 + .byte 111 + .byte 114 + .byte 58 + .byte 32 + .byte 105 + .byte 110 + .byte 118 + .byte 97 + .byte 108 + .byte 105 + .byte 100 + .byte 32 + .byte 104 + .byte 101 + .byte 120 + .byte 32 + .byte 101 + .byte 115 + .byte 99 + .byte 97 + .byte 112 + .byte 101 + .byte 32 + .byte 115 + .byte 101 + .byte 113 + .byte 117 + .byte 101 + .byte 110 + .byte 99 + .byte 101 + .byte 27 + .byte 91 + .byte 48 + .byte 109 + .byte 10 + .byte 0 +.text + leaq .L.str.333(%rip), %rax push %rax + leaq eprintf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $48, %rsp movq $1, %rax push %rax + leaq exit(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + jmp .L.end.377 +.L.else.377: +.L.end.377: +.L.while.start.378: leaq 16(%rbp), %rax movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax + movzbl (%rax), %eax push %rax - leaq new_token(%rip), %rax + leaq is_hex_digit(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - pop %rdi - movq %rax, (%rdi) - leaq -16(%rbp), %rax + addq $8, %rsp + movzx %al, %eax + cmpq $1, %rax + jne .L.while.end.378 + leaq -4(%rbp), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax + movzbl (%rax), %eax + push %rax + leaq from_hex(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + movzx %al, %eax + push %rax + movq $4, %rax + push %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax pop %rdi - movq %rax, (%rdi) + movq %rdi, %rcx + shl %cl, %eax + pop %rdi + addl %edi, %eax + pop %rdi + movl %eax, (%rdi) leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -23407,7 +25053,12 @@ tokenize_char: movq $0, %rax callq *%r10 addq $8, %rsp - movq $92, %rax + jmp .L.while.start.378 +.L.while.end.378: + jmp .L.end.376 +.L.else.376: +.L.end.376: + movq $97, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -23419,22 +25070,15 @@ tokenize_char: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.347 - leaq -20(%rbp), %rax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - push %rax - leaq read_escaped_char(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp - pop %rdi - movl %eax, (%rdi) - jmp .L.end.347 -.L.else.347: - leaq -20(%rbp), %rax + jne .L.else.379 + movq $7, %rax + movq %rbp, %rsp + pop %rbp + retq + jmp .L.end.379 +.L.else.379: +.L.end.379: + movq $98, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax @@ -23442,95 +25086,134 @@ tokenize_char: movq (%rax), %rax movzbl (%rax), %eax pop %rdi - movl %eax, (%rdi) -.L.end.347: - leaq 16(%rbp), %rax - movq (%rax), %rax + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.380 + movq $8, %rax + movq %rbp, %rsp + pop %rbp + retq + jmp .L.end.380 +.L.else.380: +.L.end.380: + movq $116, %rax push %rax - leaq tokenizer_next(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp leaq 16(%rbp), %rax movq (%rax), %rax - push %rax - leaq tokenizer_next(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $28, %rax - push %rax - leaq -16(%rbp), %rax + addq $24, %rax movq (%rax), %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.381 + movq $9, %rax + movq %rbp, %rsp + pop %rbp + retq + jmp .L.end.381 +.L.else.381: +.L.end.381: + movq $110, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax + movzbl (%rax), %eax pop %rdi - subq %rdi, %rax + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.382 + movq $10, %rax + movq %rbp, %rsp + pop %rbp + retq + jmp .L.end.382 +.L.else.382: +.L.end.382: + movq $118, %rax push %rax - leaq -16(%rbp), %rax + leaq 16(%rbp), %rax movq (%rax), %rax - push %rax - leaq strndup(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - pop %rdi - movq %rax, (%rdi) - leaq -8(%rbp), %rax + addq $24, %rax movq (%rax), %rax - addq $36, %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.383 + movq $11, %rax + movq %rbp, %rsp + pop %rbp + retq + jmp .L.end.383 +.L.else.383: +.L.end.383: + movq $102, %rax push %rax - leaq -16(%rbp), %rax + leaq 16(%rbp), %rax movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.384 + movq $12, %rax + movq %rbp, %rsp + pop %rbp + retq + jmp .L.end.384 +.L.else.384: +.L.end.384: + movq $114, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax + movzbl (%rax), %eax pop %rdi - subq %rdi, %rax - pop %rdi - movl %eax, (%rdi) - leaq -8(%rbp), %rax + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.385 + movq $13, %rax + movq %rbp, %rsp + pop %rbp + retq + jmp .L.end.385 +.L.else.385: +.L.end.385: + leaq 16(%rbp), %rax movq (%rax), %rax - addq $48, %rax - push %rax - leaq -20(%rbp), %rax - movslq (%rax), %rax - pop %rdi - movb %al, (%rdi) - leaq -8(%rbp), %rax + addq $24, %rax movq (%rax), %rax + movzbl (%rax), %eax movq %rbp, %rsp pop %rbp retq leave ret -.global read_escaped_char -read_escaped_char: +.global from_hex +from_hex: push %rbp movq %rsp, %rbp - subq $16, %rsp - leaq 16(%rbp), %rax - movq (%rax), %rax - push %rax - leaq tokenizer_next(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp + subq $0, %rsp leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax movzbl (%rax), %eax push %rax movq $48, %rax @@ -23539,120 +25222,100 @@ read_escaped_char: setle %al movzbl %al, %eax cmpq $0, %rax - je .L.false.349 - movq $55, %rax + je .L.false.387 + movq $57, %rax push %rax leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax movzbl (%rax), %eax pop %rdi cmpl %edi, %eax setbe %al movzbl %al, %eax cmpq $0, %rax - je .L.false.349 + je .L.false.387 movq $1, %rax - jmp .L.end.349 -.L.false.349: + jmp .L.end.387 +.L.false.387: movq $0, %rax -.L.end.349: +.L.end.387: cmpq $1, %rax - jne .L.else.348 - leaq -4(%rbp), %rax - push %rax + jne .L.else.386 movq $48, %rax push %rax leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax movzbl (%rax), %eax pop %rdi subl %edi, %eax - pop %rdi - movl %eax, (%rdi) - movq $1, %rax - push %rax + movq %rbp, %rsp + pop %rbp + retq + jmp .L.end.386 +.L.else.386: +.L.end.386: leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax - pop %rdi - addq %rdi, %rax movzbl (%rax), %eax push %rax - movq $48, %rax + movq $97, %rax pop %rdi cmpl %edi, %eax setle %al movzbl %al, %eax cmpq $0, %rax - je .L.false.351 - movq $55, %rax - push %rax - movq $1, %rax + je .L.false.389 + movq $102, %rax push %rax leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax - pop %rdi - addq %rdi, %rax movzbl (%rax), %eax pop %rdi cmpl %edi, %eax setbe %al movzbl %al, %eax cmpq $0, %rax - je .L.false.351 + je .L.false.389 movq $1, %rax - jmp .L.end.351 -.L.false.351: + jmp .L.end.389 +.L.false.389: movq $0, %rax -.L.end.351: +.L.end.389: cmpq $1, %rax - jne .L.else.350 - leaq 16(%rbp), %rax - movq (%rax), %rax - push %rax - leaq tokenizer_next(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp - leaq -4(%rbp), %rax + jne .L.else.388 + movq $10, %rax push %rax - movq $48, %rax + movq $97, %rax push %rax leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax movzbl (%rax), %eax pop %rdi subl %edi, %eax + pop %rdi + addl %edi, %eax + movq %rbp, %rsp + pop %rbp + retq + jmp .L.end.388 +.L.else.388: +.L.end.388: + movq $10, %rax push %rax - movq $3, %rax + movq $65, %rax push %rax - leaq -4(%rbp), %rax - movslq (%rax), %rax + leaq 16(%rbp), %rax + movzbl (%rax), %eax pop %rdi - movq %rdi, %rcx - shl %cl, %eax + subl %edi, %eax pop %rdi addl %edi, %eax - pop %rdi - movl %eax, (%rdi) - movq $1, %rax - push %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global is_hex_digit +is_hex_digit: + push %rbp + movq %rsp, %rbp + subq $0, %rsp leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax - pop %rdi - addq %rdi, %rax movzbl (%rax), %eax push %rax movq $48, %rax @@ -23661,114 +25324,141 @@ read_escaped_char: setle %al movzbl %al, %eax cmpq $0, %rax - je .L.false.353 - movq $55, %rax - push %rax - movq $1, %rax + je .L.false.392 + movq $57, %rax push %rax leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax - pop %rdi - addq %rdi, %rax movzbl (%rax), %eax pop %rdi cmpl %edi, %eax setbe %al movzbl %al, %eax cmpq $0, %rax - je .L.false.353 + je .L.false.392 movq $1, %rax - jmp .L.end.353 -.L.false.353: + jmp .L.end.392 +.L.false.392: movq $0, %rax -.L.end.353: - cmpq $1, %rax - jne .L.else.352 +.L.end.392: + cmpq $0, %rax + jne .L.true.391 leaq 16(%rbp), %rax - movq (%rax), %rax + movzbl (%rax), %eax push %rax - leaq tokenizer_next(%rip), %rax - movq %rax, %r10 + movq $65, %rax + pop %rdi + cmpl %edi, %eax + setle %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.393 + movq $70, %rax + push %rax + leaq 16(%rbp), %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + setbe %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.393 + movq $1, %rax + jmp .L.end.393 +.L.false.393: movq $0, %rax - callq *%r10 - addq $8, %rsp - leaq -4(%rbp), %rax +.L.end.393: + cmp $0, %rax + jne .L.true.391 + mov $0, %rax + jmp .L.end.391 +.L.true.391: + mov $1, %rax +.L.end.391: + cmpq $0, %rax + jne .L.true.390 + leaq 16(%rbp), %rax + movzbl (%rax), %eax push %rax - movq $48, %rax + movq $97, %rax + pop %rdi + cmpl %edi, %eax + setle %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.394 + movq $102, %rax push %rax leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax movzbl (%rax), %eax pop %rdi - subl %edi, %eax - push %rax - movq $3, %rax - push %rax - leaq -4(%rbp), %rax - movslq (%rax), %rax - pop %rdi - movq %rdi, %rcx - shl %cl, %eax - pop %rdi - addl %edi, %eax - pop %rdi - movl %eax, (%rdi) - jmp .L.end.352 -.L.else.352: -.L.end.352: - jmp .L.end.350 -.L.else.350: -.L.end.350: - leaq -4(%rbp), %rax - movslq (%rax), %rax + cmpl %edi, %eax + setbe %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.394 + movq $1, %rax + jmp .L.end.394 +.L.false.394: + movq $0, %rax +.L.end.394: + cmp $0, %rax + jne .L.true.390 + mov $0, %rax + jmp .L.end.390 +.L.true.390: + mov $1, %rax +.L.end.390: movq %rbp, %rsp pop %rbp retq - jmp .L.end.348 -.L.else.348: -.L.end.348: - movq $120, %rax + leave + ret +.global string_end +string_end: + push %rbp + movq %rsp, %rbp + subq $0, %rsp +.L.while.start.395: + movq $34, %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax + leaq 24(%rbp), %rax movq (%rax), %rax movzbl (%rax), %eax pop %rdi cmpl %edi, %eax - sete %al + setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.354 - leaq 16(%rbp), %rax - movq (%rax), %rax + jne .L.while.end.395 + movq $10, %rax push %rax - leaq tokenizer_next(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax + leaq 24(%rbp), %rax movq (%rax), %rax movzbl (%rax), %eax - push %rax - leaq is_hex_digit(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp - movzx %al, %eax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax cmpq $0, %rax + jne .L.true.397 + movq $0, %rax + push %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax sete %al - movzbq %al, %rax + movzbl %al, %eax + cmp $0, %rax + jne .L.true.397 + mov $0, %rax + jmp .L.end.397 +.L.true.397: + mov $1, %rax +.L.end.397: cmpq $1, %rax - jne .L.else.355 + jne .L.else.396 leaq 16(%rbp), %rax movq (%rax), %rax addq $16, %rax @@ -23786,8 +25476,9 @@ read_escaped_char: push %rax leaq (%rsp), %rax push %rax + push $3 .data -.L.str.327: +.L.str.334: .byte 27 .byte 91 .byte 49 @@ -23818,33 +25509,29 @@ read_escaped_char: .byte 114 .byte 58 .byte 32 - .byte 105 + .byte 117 .byte 110 - .byte 118 - .byte 97 + .byte 99 .byte 108 - .byte 105 - .byte 100 - .byte 32 - .byte 104 - .byte 101 - .byte 120 - .byte 32 - .byte 101 + .byte 111 .byte 115 - .byte 99 - .byte 97 - .byte 112 .byte 101 + .byte 100 .byte 32 .byte 115 - .byte 101 - .byte 113 - .byte 117 - .byte 101 + .byte 116 + .byte 114 + .byte 105 .byte 110 - .byte 99 + .byte 103 + .byte 32 + .byte 108 + .byte 105 + .byte 116 .byte 101 + .byte 114 + .byte 97 + .byte 108 .byte 27 .byte 91 .byte 48 @@ -23852,64 +25539,221 @@ read_escaped_char: .byte 10 .byte 0 .text - leaq .L.str.327(%rip), %rax + leaq .L.str.334(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $40, %rsp + addq $48, %rsp + movq $1, %rax + push %rax + leaq exit(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + jmp .L.end.396 +.L.else.396: +.L.end.396: + movq $92, %rax + push %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.398 + movq $1, %rax + push %rax + leaq 24(%rbp), %rax + push %rax + movq $1, %rax + push %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + pop %rdi + movq %rax, (%rdi) + pop %rdi + subq %rdi, %rax + jmp .L.end.398 +.L.else.398: +.L.end.398: + movq $1, %rax + push %rax + leaq 24(%rbp), %rax + push %rax + movq $1, %rax + push %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + pop %rdi + movq %rax, (%rdi) + pop %rdi + subq %rdi, %rax + jmp .L.while.start.395 +.L.while.end.395: + leaq 24(%rbp), %rax + movq (%rax), %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global skip_single_line_comment +skip_single_line_comment: + push %rbp + movq %rsp, %rbp + subq $0, %rsp + movq $47, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.400 + movq $47, %rax + push %rax + movq $1, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.400 + movq $1, %rax + jmp .L.end.400 +.L.false.400: + movq $0, %rax +.L.end.400: + cmpq $1, %rax + jne .L.else.399 + movq $2, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + push %rax + leaq tokenizer_n_next(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp +.L.while.start.401: + movq $10, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + setne %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.402 + movq $0, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + setne %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.402 movq $1, %rax + jmp .L.end.402 +.L.false.402: + movq $0, %rax +.L.end.402: + cmpq $1, %rax + jne .L.while.end.401 + leaq 16(%rbp), %rax + movq (%rax), %rax push %rax - leaq exit(%rip), %rax + leaq tokenizer_next(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.355 -.L.else.355: -.L.end.355: -.L.while.start.356: + jmp .L.while.start.401 +.L.while.end.401: + jmp .L.end.399 +.L.else.399: +.L.end.399: + movq $0, %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global tokenize_number +tokenize_number: + push %rbp + movq %rsp, %rbp + subq $16, %rsp + leaq -8(%rbp), %rax + push %rax + movq $0, %rax + push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax - movzbl (%rax), %eax push %rax - leaq is_hex_digit(%rip), %rax + leaq new_token(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $8, %rsp - movzx %al, %eax - cmpq $1, %rax - jne .L.while.end.356 - leaq -4(%rbp), %rax + addq $16, %rsp + pop %rdi + movq %rax, (%rdi) + leaq -16(%rbp), %rax push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax + pop %rdi + movq %rax, (%rdi) +.L.while.start.403: leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax movzbl (%rax), %eax push %rax - leaq from_hex(%rip), %rax + leaq isdigit(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp movzx %al, %eax - push %rax - movq $4, %rax - push %rax - leaq -4(%rbp), %rax - movslq (%rax), %rax - pop %rdi - movq %rdi, %rcx - shl %cl, %eax - pop %rdi - addl %edi, %eax - pop %rdi - movl %eax, (%rdi) + cmpq $1, %rax + jne .L.while.end.403 leaq 16(%rbp), %rax movq (%rax), %rax push %rax @@ -23918,136 +25762,105 @@ read_escaped_char: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.while.start.356 -.L.while.end.356: - jmp .L.end.354 -.L.else.354: -.L.end.354: - movq $97, %rax - push %rax - leaq 16(%rbp), %rax + jmp .L.while.start.403 +.L.while.end.403: + leaq -8(%rbp), %rax movq (%rax), %rax - addq $24, %rax + addq $28, %rax + push %rax + leaq -16(%rbp), %rax movq (%rax), %rax - movzbl (%rax), %eax - pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.else.357 - movq $7, %rax - movq %rbp, %rsp - pop %rbp - retq - jmp .L.end.357 -.L.else.357: -.L.end.357: - movq $98, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax - movzbl (%rax), %eax pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.else.358 - movq $8, %rax - movq %rbp, %rsp - pop %rbp - retq - jmp .L.end.358 -.L.else.358: -.L.end.358: - movq $116, %rax + subq %rdi, %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax + leaq -16(%rbp), %rax movq (%rax), %rax - movzbl (%rax), %eax - pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.else.359 - movq $9, %rax - movq %rbp, %rsp - pop %rbp - retq - jmp .L.end.359 -.L.else.359: -.L.end.359: - movq $110, %rax push %rax - leaq 16(%rbp), %rax + leaq strndup(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp + pop %rdi + movq %rax, (%rdi) + leaq -8(%rbp), %rax movq (%rax), %rax - addq $24, %rax + addq $36, %rax + push %rax + leaq -16(%rbp), %rax movq (%rax), %rax - movzbl (%rax), %eax - pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.else.360 - movq $10, %rax - movq %rbp, %rsp - pop %rbp - retq - jmp .L.end.360 -.L.else.360: -.L.end.360: - movq $118, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax movq (%rax), %rax - movzbl (%rax), %eax pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.else.361 - movq $11, %rax + subq %rdi, %rax + pop %rdi + movl %eax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.361 -.L.else.361: -.L.end.361: - movq $102, %rax + leave + ret +.global ispunct +ispunct: + push %rbp + movq %rsp, %rbp + subq $16, %rsp + leaq -8(%rbp), %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax +.data +.L.str.335: + .byte 43 + .byte 45 + .byte 60 + .byte 62 + .byte 59 + .byte 58 + .byte 123 + .byte 125 + .byte 61 + .byte 44 + .byte 40 + .byte 41 + .byte 91 + .byte 93 + .byte 46 + .byte 42 + .byte 35 + .byte 33 + .byte 37 + .byte 38 + .byte 47 + .byte 0 +.text + leaq .L.str.335(%rip), %rax + pop %rdi + movq %rax, (%rdi) +.L.while.start.404: + movq $0, %rax + push %rax + leaq -8(%rbp), %rax movq (%rax), %rax movzbl (%rax), %eax pop %rdi cmpl %edi, %eax - sete %al + setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.362 - movq $12, %rax - movq %rbp, %rsp - pop %rbp - retq - jmp .L.end.362 -.L.else.362: -.L.end.362: - movq $114, %rax - push %rax + jne .L.while.end.404 leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax + movzbl (%rax), %eax + push %rax + leaq -8(%rbp), %rax movq (%rax), %rax movzbl (%rax), %eax pop %rdi @@ -24055,448 +25868,405 @@ read_escaped_char: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.363 - movq $13, %rax + jne .L.else.405 + movq $1, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.363 -.L.else.363: -.L.end.363: - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax + jmp .L.end.405 +.L.else.405: +.L.end.405: + movq $1, %rax + push %rax + leaq -8(%rbp), %rax + push %rax + movq $1, %rax + push %rax + leaq -8(%rbp), %rax movq (%rax), %rax - movzbl (%rax), %eax + pop %rdi + addq %rdi, %rax + pop %rdi + movq %rax, (%rdi) + pop %rdi + subq %rdi, %rax + jmp .L.while.start.404 +.L.while.end.404: + movq $0, %rax movq %rbp, %rsp pop %rbp retq leave ret -.global from_hex -from_hex: +.global new_token +new_token: push %rbp movq %rsp, %rbp - subq $0, %rsp - leaq 16(%rbp), %rax - movzbl (%rax), %eax + subq $16, %rsp + leaq -8(%rbp), %rax push %rax - movq $48, %rax - pop %rdi - cmpl %edi, %eax - setle %al - movzbl %al, %eax - cmpq $0, %rax - je .L.false.365 movq $57, %rax push %rax - leaq 16(%rbp), %rax - movzbl (%rax), %eax - pop %rdi - cmpl %edi, %eax - setbe %al - movzbl %al, %eax - cmpq $0, %rax - je .L.false.365 - movq $1, %rax - jmp .L.end.365 -.L.false.365: + leaq alloc(%rip), %rax + movq %rax, %r10 movq $0, %rax -.L.end.365: - cmpq $1, %rax - jne .L.else.364 - movq $48, %rax - push %rax - leaq 16(%rbp), %rax - movzbl (%rax), %eax + callq *%r10 + addq $8, %rsp pop %rdi - subl %edi, %eax - movq %rbp, %rsp - pop %rbp - retq - jmp .L.end.364 -.L.else.364: -.L.end.364: - leaq 16(%rbp), %rax - movzbl (%rax), %eax + movq %rax, (%rdi) + movq $0, %rax push %rax - movq $97, %rax + leaq -8(%rbp), %rax + movq (%rax), %rax pop %rdi cmpl %edi, %eax - setle %al + sete %al movzbl %al, %eax - cmpq $0, %rax - je .L.false.367 - movq $102, %rax + cmpq $1, %rax + jne .L.else.406 +.data +.L.str.336: + .byte 97 + .byte 108 + .byte 108 + .byte 111 + .byte 99 + .byte 40 + .byte 41 + .byte 32 + .byte 114 + .byte 101 + .byte 116 + .byte 117 + .byte 114 + .byte 110 + .byte 101 + .byte 100 + .byte 32 + .byte 110 + .byte 105 + .byte 108 + .byte 10 + .byte 0 +.text + leaq .L.str.336(%rip), %rax push %rax - leaq 16(%rbp), %rax - movzbl (%rax), %eax - pop %rdi - cmpl %edi, %eax - setbe %al - movzbl %al, %eax - cmpq $0, %rax - je .L.false.367 + leaq eprintf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp movq $1, %rax - jmp .L.end.367 -.L.false.367: + push %rax + leaq exit(%rip), %rax + movq %rax, %r10 movq $0, %rax -.L.end.367: - cmpq $1, %rax - jne .L.else.366 - movq $10, %rax + callq *%r10 + addq $8, %rsp + jmp .L.end.406 +.L.else.406: +.L.end.406: + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $20, %rax push %rax - movq $97, %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $20, %rax + movslq (%rax), %rax + pop %rdi + movl %eax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $24, %rax push %rax leaq 16(%rbp), %rax - movzbl (%rax), %eax + movq (%rax), %rax + addq $16, %rax + movslq (%rax), %rax pop %rdi - subl %edi, %eax + movl %eax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $4, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $0, %rax + movq (%rax), %rax pop %rdi - addl %edi, %eax - movq %rbp, %rsp - pop %rbp - retq - jmp .L.end.366 -.L.else.366: -.L.end.366: - movq $10, %rax + movq %rax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $0, %rax push %rax - movq $65, %rax + leaq 24(%rbp), %rax + movslq (%rax), %rax + pop %rdi + movl %eax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax + addq $12, %rax push %rax leaq 16(%rbp), %rax - movzbl (%rax), %eax - pop %rdi - subl %edi, %eax + movq (%rax), %rax + addq $8, %rax + movq (%rax), %rax pop %rdi - addl %edi, %eax + movq %rax, (%rdi) + leaq -8(%rbp), %rax + movq (%rax), %rax movq %rbp, %rsp pop %rbp retq leave ret -.global is_hex_digit -is_hex_digit: +.global tokenizer_n_next +tokenizer_n_next: push %rbp movq %rsp, %rbp - subq $0, %rsp - leaq 16(%rbp), %rax - movzbl (%rax), %eax + subq $16, %rsp + leaq -4(%rbp), %rax push %rax - movq $48, %rax + movq $0, %rax pop %rdi - cmpl %edi, %eax - setle %al - movzbl %al, %eax - cmpq $0, %rax - je .L.false.370 - movq $57, %rax + movl %eax, (%rdi) +.L.while.start.407: + leaq 24(%rbp), %rax + movslq (%rax), %rax push %rax - leaq 16(%rbp), %rax - movzbl (%rax), %eax + leaq -4(%rbp), %rax + movslq (%rax), %rax pop %rdi cmpl %edi, %eax - setbe %al + setl %al movzbl %al, %eax - cmpq $0, %rax - je .L.false.370 - movq $1, %rax - jmp .L.end.370 -.L.false.370: - movq $0, %rax -.L.end.370: - cmpq $0, %rax - jne .L.true.369 + cmpq $1, %rax + jne .L.while.end.407 leaq 16(%rbp), %rax - movzbl (%rax), %eax + movq (%rax), %rax push %rax - movq $65, %rax - pop %rdi - cmpl %edi, %eax - setle %al - movzbl %al, %eax - cmpq $0, %rax - je .L.false.371 - movq $70, %rax + leaq tokenizer_next(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + movq $1, %rax + push %rax + leaq -4(%rbp), %rax push %rax - leaq 16(%rbp), %rax - movzbl (%rax), %eax - pop %rdi - cmpl %edi, %eax - setbe %al - movzbl %al, %eax - cmpq $0, %rax - je .L.false.371 movq $1, %rax - jmp .L.end.371 -.L.false.371: - movq $0, %rax -.L.end.371: - cmp $0, %rax - jne .L.true.369 - mov $0, %rax - jmp .L.end.369 -.L.true.369: - mov $1, %rax -.L.end.369: - cmpq $0, %rax - jne .L.true.368 - leaq 16(%rbp), %rax - movzbl (%rax), %eax push %rax - movq $97, %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax pop %rdi - cmpl %edi, %eax - setle %al - movzbl %al, %eax - cmpq $0, %rax - je .L.false.372 - movq $102, %rax - push %rax - leaq 16(%rbp), %rax - movzbl (%rax), %eax + addl %edi, %eax pop %rdi - cmpl %edi, %eax - setbe %al - movzbl %al, %eax - cmpq $0, %rax - je .L.false.372 - movq $1, %rax - jmp .L.end.372 -.L.false.372: + movl %eax, (%rdi) + pop %rdi + subl %edi, %eax + jmp .L.while.start.407 +.L.while.end.407: movq $0, %rax -.L.end.372: - cmp $0, %rax - jne .L.true.368 - mov $0, %rax - jmp .L.end.368 -.L.true.368: - mov $1, %rax -.L.end.368: movq %rbp, %rsp pop %rbp retq leave ret -.global string_end -string_end: +.global tokenizer_next +tokenizer_next: push %rbp movq %rsp, %rbp subq $0, %rsp -.L.while.start.373: - movq $34, %rax + movq $10, %rax push %rax - leaq 24(%rbp), %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax movq (%rax), %rax movzbl (%rax), %eax pop %rdi cmpl %edi, %eax - setne %al + sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.373 - movq $10, %rax + jne .L.else.408 + movq $1, %rax push %rax - leaq 24(%rbp), %rax + leaq 16(%rbp), %rax movq (%rax), %rax - movzbl (%rax), %eax + addq $20, %rax + push %rax + movq $1, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $20, %rax + movslq (%rax), %rax pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $0, %rax - jne .L.true.375 + addl %edi, %eax + pop %rdi + movl %eax, (%rdi) + pop %rdi + subl %edi, %eax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $16, %rax + push %rax movq $0, %rax + pop %rdi + movl %eax, (%rdi) + movq $1, %rax push %rax - leaq 24(%rbp), %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + push %rax + movq $1, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax movq (%rax), %rax - movzbl (%rax), %eax pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmp $0, %rax - jne .L.true.375 - mov $0, %rax - jmp .L.end.375 -.L.true.375: - mov $1, %rax -.L.end.375: - cmpq $1, %rax - jne .L.else.374 + addq %rdi, %rax + pop %rdi + movq %rax, (%rdi) + pop %rdi + subq %rdi, %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $8, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax + pop %rdi + movq %rax, (%rdi) + jmp .L.end.408 +.L.else.408: + movq $1, %rax + push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $16, %rax - movslq (%rax), %rax + push %rax + movq $1, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $20, %rax + addq $16, %rax movslq (%rax), %rax + pop %rdi + addl %edi, %eax + pop %rdi + movl %eax, (%rdi) + pop %rdi + subl %edi, %eax + movq $1, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $0, %rax - movq (%rax), %rax + addq $24, %rax push %rax - leaq (%rsp), %rax + movq $1, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + pop %rdi + movq %rax, (%rdi) + pop %rdi + subq %rdi, %rax +.L.end.408: + movq $0, %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global is_two_c_punct +is_two_c_punct: + push %rbp + movq %rsp, %rbp + subq $16, %rsp + leaq -8(%rbp), %rax push %rax .data -.L.str.328: - .byte 27 - .byte 91 - .byte 49 - .byte 109 - .byte 27 - .byte 91 - .byte 51 - .byte 49 - .byte 109 +.L.str.337: + .byte 61 + .byte 61 + .byte 60 + .byte 61 + .byte 62 + .byte 61 + .byte 33 + .byte 61 + .byte 43 + .byte 43 .byte 45 .byte 45 + .byte 124 + .byte 124 + .byte 38 + .byte 38 + .byte 60 + .byte 60 + .byte 62 .byte 62 - .byte 32 - .byte 37 - .byte 115 - .byte 58 - .byte 37 - .byte 100 - .byte 58 - .byte 37 - .byte 100 - .byte 58 - .byte 32 - .byte 101 - .byte 114 - .byte 114 - .byte 111 - .byte 114 - .byte 58 - .byte 32 - .byte 117 - .byte 110 - .byte 99 - .byte 108 - .byte 111 - .byte 115 - .byte 101 - .byte 100 - .byte 32 - .byte 115 - .byte 116 - .byte 114 - .byte 105 - .byte 110 - .byte 103 - .byte 32 - .byte 108 - .byte 105 - .byte 116 - .byte 101 - .byte 114 - .byte 97 - .byte 108 - .byte 27 - .byte 91 - .byte 48 - .byte 109 - .byte 10 .byte 0 .text - leaq .L.str.328(%rip), %rax + leaq .L.str.337(%rip), %rax + pop %rdi + movq %rax, (%rdi) + leaq -12(%rbp), %rax push %rax - leaq eprintf(%rip), %rax - movq %rax, %r10 movq $0, %rax - callq *%r10 - addq $40, %rsp - movq $1, %rax + pop %rdi + movl %eax, (%rdi) +.L.while.start.409: + leaq -8(%rbp), %rax + movq (%rax), %rax push %rax - leaq exit(%rip), %rax + leaq strlen(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.374 -.L.else.374: -.L.end.374: - movq $92, %rax push %rax - leaq 24(%rbp), %rax - movq (%rax), %rax - movzbl (%rax), %eax + leaq -12(%rbp), %rax + movslq (%rax), %rax pop %rdi cmpl %edi, %eax - sete %al + setl %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.376 - movq $1, %rax - push %rax - leaq 24(%rbp), %rax - push %rax + jne .L.while.end.409 movq $1, %rax push %rax - leaq 24(%rbp), %rax - movq (%rax), %rax - pop %rdi - addq %rdi, %rax - pop %rdi - movq %rax, (%rdi) + leaq -12(%rbp), %rax + movslq (%rax), %rax pop %rdi - subq %rdi, %rax - jmp .L.end.376 -.L.else.376: -.L.end.376: - movq $1, %rax - push %rax - leaq 24(%rbp), %rax - push %rax - movq $1, %rax + imull %edi, %eax push %rax - leaq 24(%rbp), %rax + leaq -8(%rbp), %rax movq (%rax), %rax pop %rdi addq %rdi, %rax - pop %rdi - movq %rax, (%rdi) - pop %rdi - subq %rdi, %rax - jmp .L.while.start.373 -.L.while.end.373: - leaq 24(%rbp), %rax - movq (%rax), %rax - movq %rbp, %rsp - pop %rbp - retq - leave - ret -.global skip_single_line_comment -skip_single_line_comment: - push %rbp - movq %rsp, %rbp - subq $0, %rsp - movq $47, %rax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax movzbl (%rax), %eax - pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $0, %rax - je .L.false.378 - movq $47, %rax push %rax movq $1, %rax push %rax + movq $0, %rax + pop %rdi + imull %edi, %eax + push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax pop %rdi addq %rdi, %rax movzbl (%rax), %eax @@ -24505,271 +26275,174 @@ skip_single_line_comment: sete %al movzbl %al, %eax cmpq $0, %rax - je .L.false.378 + je .L.false.411 movq $1, %rax - jmp .L.end.378 -.L.false.378: - movq $0, %rax -.L.end.378: - cmpq $1, %rax - jne .L.else.377 - movq $2, %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax + movq $1, %rax push %rax - leaq tokenizer_n_next(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp -.L.while.start.379: - movq $10, %rax + leaq -12(%rbp), %rax + movslq (%rax), %rax + pop %rdi + addl %edi, %eax + pop %rdi + imull %edi, %eax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax + leaq -8(%rbp), %rax movq (%rax), %rax + pop %rdi + addq %rdi, %rax movzbl (%rax), %eax + push %rax + movq $1, %rax + push %rax + movq $1, %rax pop %rdi - cmpl %edi, %eax - setne %al - movzbl %al, %eax - cmpq $0, %rax - je .L.false.380 - movq $0, %rax + imull %edi, %eax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax + pop %rdi + addq %rdi, %rax movzbl (%rax), %eax pop %rdi cmpl %edi, %eax - setne %al + sete %al movzbl %al, %eax cmpq $0, %rax - je .L.false.380 + je .L.false.411 movq $1, %rax - jmp .L.end.380 -.L.false.380: + jmp .L.end.411 +.L.false.411: movq $0, %rax -.L.end.380: +.L.end.411: cmpq $1, %rax - jne .L.while.end.379 - leaq 16(%rbp), %rax - movq (%rax), %rax + jne .L.else.410 + movq $1, %rax + movq %rbp, %rsp + pop %rbp + retq + jmp .L.end.410 +.L.else.410: +.L.end.410: + movq $1, %rax push %rax - leaq tokenizer_next(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp - jmp .L.while.start.379 -.L.while.end.379: - jmp .L.end.377 -.L.else.377: -.L.end.377: + leaq -12(%rbp), %rax + push %rax + movq $1, %rax + push %rax + leaq -12(%rbp), %rax + movslq (%rax), %rax + pop %rdi + addl %edi, %eax + pop %rdi + movl %eax, (%rdi) + pop %rdi + subl %edi, %eax + jmp .L.while.start.409 +.L.while.end.409: movq $0, %rax movq %rbp, %rsp pop %rbp retq leave ret -.global tokenize_number -tokenize_number: +.global is_three_c_punct +is_three_c_punct: push %rbp movq %rsp, %rbp - subq $16, %rsp - leaq -8(%rbp), %rax - push %rax - movq $0, %rax + subq $0, %rsp + movq $46, %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax + movq $1, %rax push %rax - leaq new_token(%rip), %rax - movq %rax, %r10 movq $0, %rax - callq *%r10 - addq $16, %rsp pop %rdi - movq %rax, (%rdi) - leaq -16(%rbp), %rax + imull %edi, %eax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax pop %rdi - movq %rax, (%rdi) -.L.while.start.381: - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax + addq %rdi, %rax movzbl (%rax), %eax - push %rax - leaq isdigit(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp - movzx %al, %eax - cmpq $1, %rax - jne .L.while.end.381 - leaq 16(%rbp), %rax - movq (%rax), %rax - push %rax - leaq tokenizer_next(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp - jmp .L.while.start.381 -.L.while.end.381: - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $28, %rax - push %rax - leaq -16(%rbp), %rax - movq (%rax), %rax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax pop %rdi - subq %rdi, %rax + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.414 + movq $46, %rax push %rax - leaq -16(%rbp), %rax - movq (%rax), %rax + movq $1, %rax push %rax - leaq strndup(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp + movq $1, %rax pop %rdi - movq %rax, (%rdi) - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $36, %rax - push %rax - leaq -16(%rbp), %rax - movq (%rax), %rax + imull %edi, %eax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $24, %rax - movq (%rax), %rax pop %rdi - subq %rdi, %rax - pop %rdi - movl %eax, (%rdi) - leaq -8(%rbp), %rax - movq (%rax), %rax - movq %rbp, %rsp - pop %rbp - retq - leave - ret -.global ispunct -ispunct: - push %rbp - movq %rsp, %rbp - subq $16, %rsp - leaq -8(%rbp), %rax - push %rax -.data -.L.str.329: - .byte 43 - .byte 45 - .byte 60 - .byte 62 - .byte 59 - .byte 58 - .byte 123 - .byte 125 - .byte 61 - .byte 44 - .byte 40 - .byte 41 - .byte 91 - .byte 93 - .byte 46 - .byte 42 - .byte 35 - .byte 33 - .byte 37 - .byte 38 - .byte 47 - .byte 0 -.text - leaq .L.str.329(%rip), %rax + addq %rdi, %rax + movzbl (%rax), %eax pop %rdi - movq %rax, (%rdi) -.L.while.start.382: + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.414 + movq $1, %rax + jmp .L.end.414 +.L.false.414: movq $0, %rax +.L.end.414: + cmpq $0, %rax + je .L.false.413 + movq $46, %rax push %rax - leaq -8(%rbp), %rax - movq (%rax), %rax - movzbl (%rax), %eax + movq $1, %rax + push %rax + movq $2, %rax pop %rdi - cmpl %edi, %eax - setne %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.while.end.382 - leaq 16(%rbp), %rax - movzbl (%rax), %eax + imull %edi, %eax push %rax - leaq -8(%rbp), %rax + leaq 16(%rbp), %rax movq (%rax), %rax + pop %rdi + addq %rdi, %rax movzbl (%rax), %eax pop %rdi cmpl %edi, %eax sete %al movzbl %al, %eax + cmpq $0, %rax + je .L.false.413 + movq $1, %rax + jmp .L.end.413 +.L.false.413: + movq $0, %rax +.L.end.413: cmpq $1, %rax - jne .L.else.383 + jne .L.else.412 movq $1, %rax movq %rbp, %rsp pop %rbp retq - jmp .L.end.383 -.L.else.383: -.L.end.383: - movq $1, %rax - push %rax - leaq -8(%rbp), %rax - push %rax - movq $1, %rax - push %rax - leaq -8(%rbp), %rax - movq (%rax), %rax - pop %rdi - addq %rdi, %rax - pop %rdi - movq %rax, (%rdi) - pop %rdi - subq %rdi, %rax - jmp .L.while.start.382 -.L.while.end.382: + jmp .L.end.412 +.L.else.412: +.L.end.412: movq $0, %rax movq %rbp, %rsp pop %rbp retq leave ret -.global new_token -new_token: +.global new_tokenizer +new_tokenizer: push %rbp movq %rsp, %rbp subq $16, %rsp leaq -8(%rbp), %rax push %rax - movq $57, %rax + movq $32, %rax push %rax leaq alloc(%rip), %rax movq %rax, %r10 @@ -24787,11 +26460,9 @@ new_token: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.384 - leaq (%rsp), %rax - push %rax + jne .L.else.415 .data -.L.str.330: +.L.str.338: .byte 97 .byte 108 .byte 108 @@ -24815,13 +26486,13 @@ new_token: .byte 10 .byte 0 .text - leaq .L.str.330(%rip), %rax + leaq .L.str.338(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -24829,55 +26500,45 @@ new_token: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.384 -.L.else.384: -.L.end.384: + jmp .L.end.415 +.L.else.415: +.L.end.415: leaq -8(%rbp), %rax movq (%rax), %rax addq $20, %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $20, %rax - movslq (%rax), %rax + movq $1, %rax pop %rdi movl %eax, (%rdi) leaq -8(%rbp), %rax movq (%rax), %rax - addq $24, %rax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax addq $16, %rax - movslq (%rax), %rax + push %rax + movq $0, %rax pop %rdi movl %eax, (%rdi) leaq -8(%rbp), %rax movq (%rax), %rax - addq $4, %rax + addq $24, %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $0, %rax + leaq 24(%rbp), %rax movq (%rax), %rax pop %rdi movq %rax, (%rdi) leaq -8(%rbp), %rax movq (%rax), %rax - addq $0, %rax + addq $8, %rax push %rax leaq 24(%rbp), %rax - movslq (%rax), %rax + movq (%rax), %rax pop %rdi - movl %eax, (%rdi) + movq %rax, (%rdi) leaq -8(%rbp), %rax movq (%rax), %rax - addq $12, %rax + addq $0, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $8, %rax - movq (%rax), %rax pop %rdi movq %rax, (%rdi) leaq -8(%rbp), %rax @@ -24887,160 +26548,219 @@ new_token: retq leave ret -.global tokenizer_n_next -tokenizer_n_next: +.global print_error +print_error: push %rbp movq %rsp, %rbp - subq $16, %rsp - leaq -4(%rbp), %rax - push %rax - movq $0, %rax - pop %rdi - movl %eax, (%rdi) -.L.while.start.385: + subq $0, %rsp leaq 24(%rbp), %rax - movslq (%rax), %rax + movq (%rax), %rax push %rax - leaq -4(%rbp), %rax - movslq (%rax), %rax - pop %rdi - cmpl %edi, %eax - setl %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.while.end.385 leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq tokenizer_next(%rip), %rax + leaq print_error_with_code(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $8, %rsp - movq $1, %rax - push %rax - leaq -4(%rbp), %rax - push %rax + addq $16, %rsp movq $1, %rax push %rax - leaq -4(%rbp), %rax - movslq (%rax), %rax - pop %rdi - addl %edi, %eax - pop %rdi - movl %eax, (%rdi) - pop %rdi - subl %edi, %eax - jmp .L.while.start.385 -.L.while.end.385: + leaq exit(%rip), %rax + movq %rax, %r10 movq $0, %rax - movq %rbp, %rsp - pop %rbp - retq + callq *%r10 + addq $8, %rsp leave ret -.global tokenizer_next -tokenizer_next: +.global print_error_with_code +print_error_with_code: push %rbp movq %rsp, %rbp subq $0, %rsp - movq $10, %rax - push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $24, %rax - movq (%rax), %rax - movzbl (%rax), %eax - pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.else.386 - movq $1, %rax + movslq (%rax), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax addq $20, %rax - push %rax - movq $1, %rax + movslq (%rax), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $20, %rax - movslq (%rax), %rax - pop %rdi - addl %edi, %eax - pop %rdi - movl %eax, (%rdi) - pop %rdi - subl %edi, %eax - leaq 16(%rbp), %rax + addq $4, %rax movq (%rax), %rax - addq $16, %rax push %rax + leaq (%rsp), %rax + push %rax + push $3 +.data +.L.str.339: + .byte 27 + .byte 91 + .byte 49 + .byte 109 + .byte 27 + .byte 91 + .byte 51 + .byte 49 + .byte 109 + .byte 45 + .byte 45 + .byte 62 + .byte 32 + .byte 37 + .byte 115 + .byte 58 + .byte 37 + .byte 100 + .byte 58 + .byte 37 + .byte 100 + .byte 58 + .byte 32 + .byte 101 + .byte 114 + .byte 114 + .byte 111 + .byte 114 + .byte 58 + .byte 27 + .byte 91 + .byte 48 + .byte 109 + .byte 10 + .byte 0 +.text + leaq .L.str.339(%rip), %rax + push %rax + leaq eprintf(%rip), %rax + movq %rax, %r10 movq $0, %rax - pop %rdi - movl %eax, (%rdi) - movq $1, %rax + callq *%r10 + addq $48, %rsp +.data +.L.str.340: + .byte 32 + .byte 124 + .byte 32 + .byte 10 + .byte 0 +.text + leaq .L.str.340(%rip), %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax + leaq eprintf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp +.data +.L.str.341: + .byte 32 + .byte 124 + .byte 32 + .byte 0 +.text + leaq .L.str.341(%rip), %rax push %rax - movq $1, %rax + leaq eprintf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp +.L.while.start.416: + movq $10, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $24, %rax + addq $12, %rax movq (%rax), %rax + movzbl (%rax), %eax pop %rdi - addq %rdi, %rax - pop %rdi - movq %rax, (%rdi) - pop %rdi - subq %rdi, %rax + cmpl %edi, %eax + setne %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.417 + movq $0, %rax + push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $8, %rax + addq $12, %rax + movq (%rax), %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + setne %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.417 + movq $1, %rax + jmp .L.end.417 +.L.false.417: + movq $0, %rax +.L.end.417: + cmpq $1, %rax + jne .L.while.end.416 + movq $9, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $24, %rax + addq $12, %rax movq (%rax), %rax + movzbl (%rax), %eax pop %rdi - movq %rax, (%rdi) - jmp .L.end.386 -.L.else.386: + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.418 movq $1, %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $16, %rax +.data +.L.str.342: + .byte 32 + .byte 0 +.text + leaq .L.str.342(%rip), %rax + push %rax + movq $2, %rax push %rax + leaq write(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $24, %rsp + jmp .L.end.418 +.L.else.418: movq $1, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $16, %rax - movslq (%rax), %rax - pop %rdi - addl %edi, %eax - pop %rdi - movl %eax, (%rdi) - pop %rdi - subl %edi, %eax + addq $12, %rax + movq (%rax), %rax + push %rax + movq $2, %rax + push %rax + leaq write(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $24, %rsp +.L.end.418: movq $1, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $24, %rax + addq $12, %rax push %rax movq $1, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $24, %rax + addq $12, %rax movq (%rax), %rax pop %rdi addq %rdi, %rax @@ -25048,155 +26768,178 @@ tokenizer_next: movq %rax, (%rdi) pop %rdi subq %rdi, %rax -.L.end.386: - movq $0, %rax - movq %rbp, %rsp - pop %rbp - retq - leave - ret -.global is_two_c_punct -is_two_c_punct: - push %rbp - movq %rsp, %rbp - subq $16, %rsp - leaq -8(%rbp), %rax + jmp .L.while.start.416 +.L.while.end.416: +.data +.L.str.343: + .byte 10 + .byte 0 +.text + leaq .L.str.343(%rip), %rax push %rax + leaq eprintf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp .data -.L.str.331: - .byte 61 - .byte 61 - .byte 60 - .byte 61 - .byte 62 - .byte 61 - .byte 33 - .byte 61 - .byte 43 - .byte 43 - .byte 45 - .byte 45 - .byte 124 +.L.str.344: + .byte 32 .byte 124 - .byte 38 - .byte 38 - .byte 60 - .byte 60 - .byte 62 - .byte 62 + .byte 32 .byte 0 .text - leaq .L.str.331(%rip), %rax - pop %rdi - movq %rax, (%rdi) - leaq -12(%rbp), %rax + leaq .L.str.344(%rip), %rax push %rax + leaq eprintf(%rip), %rax + movq %rax, %r10 movq $0, %rax - pop %rdi - movl %eax, (%rdi) -.L.while.start.387: - leaq -8(%rbp), %rax - movq (%rax), %rax + callq *%r10 + addq $8, %rsp +.data +.L.str.345: + .byte 27 + .byte 91 + .byte 49 + .byte 109 + .byte 27 + .byte 91 + .byte 51 + .byte 49 + .byte 109 + .byte 0 +.text + leaq .L.str.345(%rip), %rax push %rax - leaq strlen(%rip), %rax + leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $8, %rsp - push %rax - leaq -12(%rbp), %rax - movslq (%rax), %rax - pop %rdi - cmpl %edi, %eax - setl %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.while.end.387 - movq $1, %rax - push %rax - leaq -12(%rbp), %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + addq $24, %rax movslq (%rax), %rax - pop %rdi - imull %edi, %eax push %rax - leaq -8(%rbp), %rax - movq (%rax), %rax - pop %rdi - addq %rdi, %rax - movzbl (%rax), %eax +.data +.L.str.346: + .byte 32 + .byte 0 +.text + leaq .L.str.346(%rip), %rax push %rax - movq $1, %rax + movq $2, %rax push %rax + leaq frepeat_str(%rip), %rax + movq %rax, %r10 movq $0, %rax - pop %rdi - imull %edi, %eax - push %rax + callq *%r10 + addq $24, %rsp leaq 16(%rbp), %rax movq (%rax), %rax - pop %rdi - addq %rdi, %rax - movzbl (%rax), %eax - pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $0, %rax - je .L.false.389 - movq $1, %rax + addq $36, %rax + movslq (%rax), %rax push %rax - movq $1, %rax +.data +.L.str.347: + .byte 94 + .byte 0 +.text + leaq .L.str.347(%rip), %rax push %rax - leaq -12(%rbp), %rax - movslq (%rax), %rax - pop %rdi - addl %edi, %eax - pop %rdi - imull %edi, %eax + movq $2, %rax push %rax - leaq -8(%rbp), %rax + leaq frepeat_str(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $24, %rsp + leaq 24(%rbp), %rax movq (%rax), %rax - pop %rdi - addq %rdi, %rax - movzbl (%rax), %eax push %rax - movq $1, %rax + leaq (%rsp), %rax + push %rax + push $1 +.data +.L.str.348: + .byte 32 + .byte 37 + .byte 115 + .byte 27 + .byte 91 + .byte 48 + .byte 109 + .byte 10 + .byte 0 +.text + leaq .L.str.348(%rip), %rax + push %rax + leaq eprintf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $32, %rsp +.data +.L.str.349: + .byte 32 + .byte 124 + .byte 32 + .byte 10 + .byte 0 +.text + leaq .L.str.349(%rip), %rax + push %rax + leaq eprintf(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + movq $0, %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global frepeat_str +frepeat_str: + push %rbp + movq %rsp, %rbp + subq $16, %rsp + leaq -4(%rbp), %rax push %rax - movq $1, %rax + movq $0, %rax pop %rdi - imull %edi, %eax + movl %eax, (%rdi) +.L.while.start.419: + leaq 32(%rbp), %rax + movslq (%rax), %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - pop %rdi - addq %rdi, %rax - movzbl (%rax), %eax + leaq -4(%rbp), %rax + movslq (%rax), %rax pop %rdi cmpl %edi, %eax - sete %al + setl %al movzbl %al, %eax - cmpq $0, %rax - je .L.false.389 - movq $1, %rax - jmp .L.end.389 -.L.false.389: - movq $0, %rax -.L.end.389: cmpq $1, %rax - jne .L.else.388 - movq $1, %rax - movq %rbp, %rsp - pop %rbp - retq - jmp .L.end.388 -.L.else.388: -.L.end.388: + jne .L.while.end.419 + leaq 24(%rbp), %rax + movq (%rax), %rax + push %rax + leaq 16(%rbp), %rax + movslq (%rax), %rax + push %rax + leaq fputs(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $16, %rsp movq $1, %rax push %rax - leaq -12(%rbp), %rax + leaq -4(%rbp), %rax push %rax movq $1, %rax push %rax - leaq -12(%rbp), %rax + leaq -4(%rbp), %rax movslq (%rax), %rax pop %rdi addl %edi, %eax @@ -25204,267 +26947,138 @@ is_two_c_punct: movl %eax, (%rdi) pop %rdi subl %edi, %eax - jmp .L.while.start.387 -.L.while.end.387: + jmp .L.while.start.419 +.L.while.end.419: movq $0, %rax movq %rbp, %rsp pop %rbp retq leave ret -.global is_three_c_punct -is_three_c_punct: +.global get_program_line_length +get_program_line_length: push %rbp movq %rsp, %rbp - subq $0, %rsp - movq $46, %rax - push %rax - movq $1, %rax + subq $16, %rsp + leaq -8(%rbp), %rax push %rax - movq $0, %rax + leaq 16(%rbp), %rax + movq (%rax), %rax pop %rdi - imull %edi, %eax + movq %rax, (%rdi) +.L.while.start.420: + movq $10, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - pop %rdi - addq %rdi, %rax movzbl (%rax), %eax pop %rdi cmpl %edi, %eax - sete %al + setne %al movzbl %al, %eax cmpq $0, %rax - je .L.false.392 - movq $46, %rax - push %rax - movq $1, %rax - push %rax - movq $1, %rax - pop %rdi - imull %edi, %eax + je .L.false.421 + movq $0, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - pop %rdi - addq %rdi, %rax movzbl (%rax), %eax pop %rdi cmpl %edi, %eax - sete %al + setne %al movzbl %al, %eax cmpq $0, %rax - je .L.false.392 + je .L.false.421 movq $1, %rax - jmp .L.end.392 -.L.false.392: + jmp .L.end.421 +.L.false.421: movq $0, %rax -.L.end.392: - cmpq $0, %rax - je .L.false.391 - movq $46, %rax - push %rax +.L.end.421: + cmpq $1, %rax + jne .L.while.end.420 movq $1, %rax push %rax - movq $2, %rax - pop %rdi - imull %edi, %eax + leaq 16(%rbp), %rax + push %rax + movq $1, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax pop %rdi addq %rdi, %rax - movzbl (%rax), %eax pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $0, %rax - je .L.false.391 - movq $1, %rax - jmp .L.end.391 -.L.false.391: - movq $0, %rax -.L.end.391: - cmpq $1, %rax - jne .L.else.390 - movq $1, %rax - movq %rbp, %rsp - pop %rbp - retq - jmp .L.end.390 -.L.else.390: -.L.end.390: - movq $0, %rax + movq %rax, (%rdi) + pop %rdi + subq %rdi, %rax + jmp .L.while.start.420 +.L.while.end.420: + leaq -8(%rbp), %rax + movq (%rax), %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + pop %rdi + subq %rdi, %rax movq %rbp, %rsp pop %rbp retq leave ret -.global print_error -print_error: +.global sprintf +sprintf: push %rbp movq %rsp, %rbp subq $0, %rsp + leaq 40(%rbp), %rax + movq (%rax), %rax + push %rax leaq 24(%rbp), %rax movq (%rax), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax push %rax - leaq print_error_with_code(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - movq $1, %rax - push %rax - leaq exit(%rip), %rax + leaq vsprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $8, %rsp + addq $24, %rsp + movq %rbp, %rsp + pop %rbp + retq leave ret -.global print_error_with_code -print_error_with_code: +.global vsprintf +vsprintf: push %rbp - movq %rsp, %rbp - subq $0, %rsp - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax - movslq (%rax), %rax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $20, %rax - movslq (%rax), %rax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $4, %rax - movq (%rax), %rax - push %rax - leaq (%rsp), %rax - push %rax -.data -.L.str.332: - .byte 27 - .byte 91 - .byte 49 - .byte 109 - .byte 27 - .byte 91 - .byte 51 - .byte 49 - .byte 109 - .byte 45 - .byte 45 - .byte 62 - .byte 32 - .byte 37 - .byte 115 - .byte 58 - .byte 37 - .byte 100 - .byte 58 - .byte 37 - .byte 100 - .byte 58 - .byte 32 - .byte 101 - .byte 114 - .byte 114 - .byte 111 - .byte 114 - .byte 58 - .byte 27 - .byte 91 - .byte 48 - .byte 109 - .byte 10 - .byte 0 -.text - leaq .L.str.332(%rip), %rax - push %rax - leaq eprintf(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $40, %rsp - leaq (%rsp), %rax - push %rax -.data -.L.str.333: - .byte 32 - .byte 124 - .byte 32 - .byte 10 - .byte 0 -.text - leaq .L.str.333(%rip), %rax - push %rax - leaq eprintf(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax - push %rax -.data -.L.str.334: - .byte 32 - .byte 124 - .byte 32 - .byte 0 -.text - leaq .L.str.334(%rip), %rax - push %rax - leaq eprintf(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp -.L.while.start.393: - movq $10, %rax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $12, %rax - movq (%rax), %rax - movzbl (%rax), %eax - pop %rdi - cmpl %edi, %eax - setne %al - movzbl %al, %eax - cmpq $0, %rax - je .L.false.394 - movq $0, %rax + movq %rsp, %rbp + subq $32, %rsp + leaq -8(%rbp), %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax - addq $12, %rax + pop %rdi + movq %rax, (%rdi) + leaq -12(%rbp), %rax + push %rax + movq $0, %rax + pop %rdi + movl %eax, (%rdi) +.L.while.start.422: + movq $0, %rax + push %rax + leaq 24(%rbp), %rax movq (%rax), %rax movzbl (%rax), %eax pop %rdi cmpl %edi, %eax setne %al movzbl %al, %eax - cmpq $0, %rax - je .L.false.394 - movq $1, %rax - jmp .L.end.394 -.L.false.394: - movq $0, %rax -.L.end.394: cmpq $1, %rax - jne .L.while.end.393 - movq $9, %rax + jne .L.while.end.422 + movq $37, %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $12, %rax + leaq 24(%rbp), %rax movq (%rax), %rax movzbl (%rax), %eax pop %rdi @@ -25472,51 +27086,14 @@ print_error_with_code: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.395 - movq $1, %rax - push %rax -.data -.L.str.335: - .byte 32 - .byte 0 -.text - leaq .L.str.335(%rip), %rax - push %rax - movq $2, %rax - push %rax - leaq write(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $24, %rsp - jmp .L.end.395 -.L.else.395: - movq $1, %rax - push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $12, %rax - movq (%rax), %rax - push %rax - movq $2, %rax - push %rax - leaq write(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $24, %rsp -.L.end.395: + jne .L.else.423 movq $1, %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $12, %rax + leaq 24(%rbp), %rax push %rax movq $1, %rax push %rax - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $12, %rax + leaq 24(%rbp), %rax movq (%rax), %rax pop %rdi addq %rdi, %rax @@ -25524,185 +27101,117 @@ print_error_with_code: movq %rax, (%rdi) pop %rdi subq %rdi, %rax - jmp .L.while.start.393 -.L.while.end.393: - leaq (%rsp), %rax - push %rax -.data -.L.str.336: - .byte 10 - .byte 0 -.text - leaq .L.str.336(%rip), %rax + movq $115, %rax push %rax - leaq eprintf(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.424 + leaq -16(%rbp), %rax push %rax -.data -.L.str.337: - .byte 32 - .byte 124 - .byte 32 - .byte 0 -.text - leaq .L.str.337(%rip), %rax + movq $8, %rax push %rax - leaq eprintf(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - leaq (%rsp), %rax + leaq -12(%rbp), %rax + movslq (%rax), %rax + pop %rdi + imull %edi, %eax push %rax -.data -.L.str.338: - .byte 27 - .byte 91 - .byte 49 - .byte 109 - .byte 27 - .byte 91 - .byte 51 - .byte 49 - .byte 109 - .byte 0 -.text - leaq .L.str.338(%rip), %rax + leaq 32(%rbp), %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + movq (%rax), %rax push %rax - leaq eprintf(%rip), %rax + leaq strlen(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $24, %rax + addq $8, %rsp + pop %rdi + movl %eax, (%rdi) + leaq -16(%rbp), %rax movslq (%rax), %rax push %rax -.data -.L.str.339: - .byte 32 - .byte 0 -.text - leaq .L.str.339(%rip), %rax - push %rax - movq $2, %rax + movq $8, %rax push %rax - leaq frepeat_str(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $24, %rsp - leaq 16(%rbp), %rax - movq (%rax), %rax - addq $36, %rax + leaq -12(%rbp), %rax movslq (%rax), %rax + pop %rdi + imull %edi, %eax push %rax -.data -.L.str.340: - .byte 94 - .byte 0 -.text - leaq .L.str.340(%rip), %rax + leaq 32(%rbp), %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + movq (%rax), %rax push %rax - movq $2, %rax + leaq 16(%rbp), %rax + movq (%rax), %rax push %rax - leaq frepeat_str(%rip), %rax + leaq memcpy(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 addq $24, %rsp - leaq 24(%rbp), %rax - movq (%rax), %rax - push %rax - leaq (%rsp), %rax + leaq 16(%rbp), %rax push %rax -.data -.L.str.341: - .byte 32 - .byte 37 - .byte 115 - .byte 27 - .byte 91 - .byte 48 - .byte 109 - .byte 10 - .byte 0 -.text - leaq .L.str.341(%rip), %rax + leaq -16(%rbp), %rax + movslq (%rax), %rax push %rax - leaq eprintf(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $24, %rsp - leaq (%rsp), %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + pop %rdi + movq %rax, (%rdi) + movq $1, %rax push %rax -.data -.L.str.342: - .byte 32 - .byte 124 - .byte 32 - .byte 10 - .byte 0 -.text - leaq .L.str.342(%rip), %rax + leaq -12(%rbp), %rax push %rax - leaq eprintf(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp - movq $0, %rax - movq %rbp, %rsp - pop %rbp - retq - leave - ret -.global frepeat_str -frepeat_str: - push %rbp - movq %rsp, %rbp - subq $16, %rsp - leaq -4(%rbp), %rax + movq $1, %rax push %rax - movq $0, %rax + leaq -12(%rbp), %rax + movslq (%rax), %rax + pop %rdi + addl %edi, %eax pop %rdi movl %eax, (%rdi) -.L.while.start.396: - leaq 32(%rbp), %rax - movslq (%rax), %rax + pop %rdi + subl %edi, %eax + jmp .L.end.424 +.L.else.424: + movq $100, %rax push %rax - leaq -4(%rbp), %rax - movslq (%rax), %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + movzbl (%rax), %eax pop %rdi cmpl %edi, %eax - setl %al + sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.396 - leaq 24(%rbp), %rax - movq (%rax), %rax + jne .L.else.425 + leaq 16(%rbp), %rax + push %rax + movq $10, %rax push %rax leaq 16(%rbp), %rax - movslq (%rax), %rax + movq (%rax), %rax + push %rax + movq $8, %rax push %rax - leaq fputs(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp movq $1, %rax push %rax - leaq -4(%rbp), %rax + leaq -12(%rbp), %rax push %rax movq $1, %rax push %rax - leaq -4(%rbp), %rax + leaq -12(%rbp), %rax movslq (%rax), %rax pop %rdi addl %edi, %eax @@ -25710,55 +27219,35 @@ frepeat_str: movl %eax, (%rdi) pop %rdi subl %edi, %eax - jmp .L.while.start.396 -.L.while.end.396: - movq $0, %rax - movq %rbp, %rsp - pop %rbp - retq - leave - ret -.global get_program_line_length -get_program_line_length: - push %rbp - movq %rsp, %rbp - subq $16, %rsp - leaq -8(%rbp), %rax + pop %rdi + imull %edi, %eax push %rax - leaq 16(%rbp), %rax + leaq 32(%rbp), %rax movq (%rax), %rax pop %rdi - movq %rax, (%rdi) -.L.while.start.397: - movq $10, %rax + addq %rdi, %rax + movq (%rax), %rax + push %rax + leaq itoa(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $24, %rsp push %rax leaq 16(%rbp), %rax movq (%rax), %rax - movzbl (%rax), %eax pop %rdi - cmpl %edi, %eax - setne %al - movzbl %al, %eax - cmpq $0, %rax - je .L.false.398 - movq $0, %rax - push %rax + addq %rdi, %rax + pop %rdi + movq %rax, (%rdi) + jmp .L.end.425 +.L.else.425: leaq 16(%rbp), %rax movq (%rax), %rax - movzbl (%rax), %eax + push %rax + movq $37, %rax pop %rdi - cmpl %edi, %eax - setne %al - movzbl %al, %eax - cmpq $0, %rax - je .L.false.398 - movq $1, %rax - jmp .L.end.398 -.L.false.398: - movq $0, %rax -.L.end.398: - cmpq $1, %rax - jne .L.while.end.397 + movb %al, (%rdi) movq $1, %rax push %rax leaq 16(%rbp), %rax @@ -25773,130 +27262,91 @@ get_program_line_length: movq %rax, (%rdi) pop %rdi subq %rdi, %rax - jmp .L.while.start.397 -.L.while.end.397: - leaq -8(%rbp), %rax - movq (%rax), %rax + movq $1, %rax push %rax - leaq 16(%rbp), %rax + leaq 24(%rbp), %rax + push %rax + movq $1, %rax + push %rax + leaq 24(%rbp), %rax movq (%rax), %rax pop %rdi subq %rdi, %rax - movq %rbp, %rsp - pop %rbp - retq - leave - ret -.global new_tokenizer -new_tokenizer: - push %rbp - movq %rsp, %rbp - subq $16, %rsp - leaq -8(%rbp), %rax - push %rax - movq $32, %rax - push %rax - leaq alloc(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp pop %rdi movq %rax, (%rdi) - movq $0, %rax + pop %rdi + addq %rdi, %rax +.L.end.425: +.L.end.424: + jmp .L.end.423 +.L.else.423: + leaq 16(%rbp), %rax + movq (%rax), %rax push %rax - leaq -8(%rbp), %rax + leaq 24(%rbp), %rax movq (%rax), %rax + movzbl (%rax), %eax pop %rdi - cmpl %edi, %eax - sete %al - movzbl %al, %eax - cmpq $1, %rax - jne .L.else.399 - leaq (%rsp), %rax + movb %al, (%rdi) + movq $1, %rax push %rax -.data -.L.str.343: - .byte 97 - .byte 108 - .byte 108 - .byte 111 - .byte 99 - .byte 40 - .byte 41 - .byte 32 - .byte 114 - .byte 101 - .byte 116 - .byte 117 - .byte 114 - .byte 110 - .byte 101 - .byte 100 - .byte 32 - .byte 110 - .byte 105 - .byte 108 - .byte 10 - .byte 0 -.text - leaq .L.str.343(%rip), %rax + leaq 16(%rbp), %rax push %rax - leaq eprintf(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $16, %rsp movq $1, %rax push %rax - leaq exit(%rip), %rax - movq %rax, %r10 - movq $0, %rax - callq *%r10 - addq $8, %rsp - jmp .L.end.399 -.L.else.399: -.L.end.399: - leaq -8(%rbp), %rax + leaq 16(%rbp), %rax movq (%rax), %rax - addq $20, %rax - push %rax - movq $1, %rax pop %rdi - movl %eax, (%rdi) - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $16, %rax - push %rax - movq $0, %rax + addq %rdi, %rax pop %rdi - movl %eax, (%rdi) - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $24, %rax + movq %rax, (%rdi) + pop %rdi + subq %rdi, %rax +.L.end.423: + movq $1, %rax push %rax leaq 24(%rbp), %rax - movq (%rax), %rax - pop %rdi - movq %rax, (%rdi) - leaq -8(%rbp), %rax - movq (%rax), %rax - addq $8, %rax + push %rax + movq $1, %rax push %rax leaq 24(%rbp), %rax movq (%rax), %rax pop %rdi + addq %rdi, %rax + pop %rdi movq %rax, (%rdi) + pop %rdi + subq %rdi, %rax + jmp .L.while.start.422 +.L.while.end.422: + leaq -20(%rbp), %rax + push %rax leaq -8(%rbp), %rax movq (%rax), %rax - addq $0, %rax push %rax leaq 16(%rbp), %rax movq (%rax), %rax pop %rdi - movq %rax, (%rdi) - leaq -8(%rbp), %rax + subq %rdi, %rax + pop %rdi + movl %eax, (%rdi) + movq $1, %rax + push %rax + leaq -20(%rbp), %rax + movslq (%rax), %rax + pop %rdi + imull %edi, %eax + push %rax + leaq 16(%rbp), %rax movq (%rax), %rax + pop %rdi + addq %rdi, %rax + push %rax + movq $0, %rax + pop %rdi + movb %al, (%rdi) + leaq -20(%rbp), %rax + movslq (%rax), %rax movq %rbp, %rsp pop %rbp retq @@ -25921,7 +27371,7 @@ itoa: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.400 + jne .L.else.426 movq $1, %rax push %rax movq $1, %rax @@ -25969,10 +27419,43 @@ itoa: movq %rbp, %rsp pop %rbp retq - jmp .L.end.400 -.L.else.400: -.L.end.400: -.L.while.start.401: + jmp .L.end.426 +.L.else.426: +.L.end.426: + leaq -5(%rbp), %rax + push %rax + movq $0, %rax + pop %rdi + movb %al, (%rdi) + movq $0, %rax + push %rax + leaq 16(%rbp), %rax + movslq (%rax), %rax + pop %rdi + cmpl %edi, %eax + setl %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.427 + leaq -5(%rbp), %rax + push %rax + movq $1, %rax + pop %rdi + movb %al, (%rdi) + leaq 16(%rbp), %rax + push %rax + leaq 16(%rbp), %rax + movslq (%rax), %rax + push %rax + movq $0, %rax + pop %rdi + subl %edi, %eax + pop %rdi + movl %eax, (%rdi) + jmp .L.end.427 +.L.else.427: +.L.end.427: +.L.while.start.428: movq $0, %rax push %rax leaq 16(%rbp), %rax @@ -25982,8 +27465,8 @@ itoa: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.401 - leaq -8(%rbp), %rax + jne .L.while.end.428 + leaq -9(%rbp), %rax push %rax leaq 32(%rbp), %rax movslq (%rax), %rax @@ -25998,14 +27481,14 @@ itoa: movl %eax, (%rdi) movq $9, %rax push %rax - leaq -8(%rbp), %rax + leaq -9(%rbp), %rax movslq (%rax), %rax pop %rdi cmpl %edi, %eax setg %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.402 + jne .L.else.429 movq $1, %rax push %rax movq $1, %rax @@ -26034,7 +27517,7 @@ itoa: push %rax movq $10, %rax push %rax - leaq -8(%rbp), %rax + leaq -9(%rbp), %rax movslq (%rax), %rax pop %rdi subl %edi, %eax @@ -26042,8 +27525,8 @@ itoa: addl %edi, %eax pop %rdi movb %al, (%rdi) - jmp .L.end.402 -.L.else.402: + jmp .L.end.429 +.L.else.429: movq $1, %rax push %rax movq $1, %rax @@ -26070,13 +27553,13 @@ itoa: push %rax movq $48, %rax push %rax - leaq -8(%rbp), %rax + leaq -9(%rbp), %rax movslq (%rax), %rax pop %rdi addl %edi, %eax pop %rdi movb %al, (%rdi) -.L.end.402: +.L.end.429: leaq 16(%rbp), %rax push %rax leaq 32(%rbp), %rax @@ -26089,13 +27572,29 @@ itoa: idivl %edi pop %rdi movl %eax, (%rdi) - jmp .L.while.start.401 -.L.while.end.401: + jmp .L.while.start.428 +.L.while.end.428: + leaq -5(%rbp), %rax + movsbl (%rax), %eax + cmpq $1, %rax + jne .L.else.430 + movq $1, %rax + push %rax + movq $1, %rax + push %rax + leaq -4(%rbp), %rax + push %rax movq $1, %rax push %rax leaq -4(%rbp), %rax movslq (%rax), %rax pop %rdi + addl %edi, %eax + pop %rdi + movl %eax, (%rdi) + pop %rdi + subl %edi, %eax + pop %rdi imull %edi, %eax push %rax leaq 24(%rbp), %rax @@ -26103,9 +27602,12 @@ itoa: pop %rdi addq %rdi, %rax push %rax - movq $0, %rax + movq $45, %rax pop %rdi movb %al, (%rdi) + jmp .L.end.430 +.L.else.430: +.L.end.430: leaq -4(%rbp), %rax movslq (%rax), %rax push %rax @@ -26117,8 +27619,23 @@ itoa: movq $0, %rax callq *%r10 addq $16, %rsp + movq $1, %rax + push %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + imull %edi, %eax + push %rax leaq 24(%rbp), %rax movq (%rax), %rax + pop %rdi + addq %rdi, %rax + push %rax + movq $0, %rax + pop %rdi + movb %al, (%rdi) + leaq -4(%rbp), %rax + movslq (%rax), %rax movq %rbp, %rsp pop %rbp retq @@ -26144,7 +27661,7 @@ reverse: subl %edi, %eax pop %rdi movl %eax, (%rdi) -.L.while.start.403: +.L.while.start.431: leaq -8(%rbp), %rax movslq (%rax), %rax push %rax @@ -26155,7 +27672,7 @@ reverse: setl %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.403 + jne .L.while.end.431 leaq -9(%rbp), %rax push %rax movq $1, %rax @@ -26242,8 +27759,8 @@ reverse: movl %eax, (%rdi) pop %rdi subl %edi, %eax - jmp .L.while.start.403 -.L.while.end.403: + jmp .L.while.start.431 +.L.while.end.431: leave ret .global strndup @@ -26276,11 +27793,9 @@ strndup: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.404 - leaq (%rsp), %rax - push %rax + jne .L.else.432 .data -.L.str.344: +.L.str.350: .byte 97 .byte 108 .byte 108 @@ -26304,13 +27819,13 @@ strndup: .byte 10 .byte 0 .text - leaq .L.str.344(%rip), %rax + leaq .L.str.350(%rip), %rax push %rax leaq eprintf(%rip), %rax movq %rax, %r10 movq $0, %rax callq *%r10 - addq $16, %rsp + addq $8, %rsp movq $1, %rax push %rax leaq exit(%rip), %rax @@ -26318,15 +27833,15 @@ strndup: movq $0, %rax callq *%r10 addq $8, %rsp - jmp .L.end.404 -.L.else.404: -.L.end.404: + jmp .L.end.432 +.L.else.432: +.L.end.432: leaq -12(%rbp), %rax push %rax movq $0, %rax pop %rdi movl %eax, (%rdi) -.L.while.start.405: +.L.while.start.433: leaq 24(%rbp), %rax movslq (%rax), %rax push %rax @@ -26337,7 +27852,7 @@ strndup: setl %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.405 + jne .L.while.end.433 movq $1, %rax push %rax leaq -12(%rbp), %rax @@ -26378,8 +27893,8 @@ strndup: movl %eax, (%rdi) pop %rdi subl %edi, %eax - jmp .L.while.start.405 -.L.while.end.405: + jmp .L.while.start.433 +.L.while.end.433: movq $1, %rax push %rax leaq 24(%rbp), %rax @@ -26441,7 +27956,7 @@ atoi: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.406 + jne .L.else.434 leaq -9(%rbp), %rax push %rax movq $1, %rax @@ -26461,10 +27976,10 @@ atoi: movl %eax, (%rdi) pop %rdi subl %edi, %eax - jmp .L.end.406 -.L.else.406: -.L.end.406: -.L.while.start.407: + jmp .L.end.434 +.L.else.434: +.L.end.434: +.L.while.start.435: movq $0, %rax push %rax movq $1, %rax @@ -26484,7 +27999,7 @@ atoi: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.407 + jne .L.while.end.435 leaq -8(%rbp), %rax push %rax movq $48, %rax @@ -26526,48 +28041,309 @@ atoi: subl %edi, %eax pop %rdi movl %eax, (%rdi) - jmp .L.while.start.407 -.L.while.end.407: + jmp .L.while.start.435 +.L.while.end.435: leaq -9(%rbp), %rax movsbl (%rax), %eax cmpq $1, %rax - jne .L.else.408 + jne .L.else.436 + leaq -8(%rbp), %rax + push %rax + leaq -8(%rbp), %rax + movslq (%rax), %rax + push %rax + movq $0, %rax + pop %rdi + subl %edi, %eax + pop %rdi + movl %eax, (%rdi) + jmp .L.end.436 +.L.else.436: +.L.end.436: leaq -8(%rbp), %rax + movslq (%rax), %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global isdigit +isdigit: + push %rbp + movq %rsp, %rbp + subq $0, %rsp + leaq 16(%rbp), %rax + movzbl (%rax), %eax + push %rax + movq $48, %rax + pop %rdi + cmpl %edi, %eax + setle %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.438 + movq $57, %rax + push %rax + leaq 16(%rbp), %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + setbe %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.438 + movq $1, %rax + jmp .L.end.438 +.L.false.438: + movq $0, %rax +.L.end.438: + cmpq $1, %rax + jne .L.else.437 + movq $1, %rax + movq %rbp, %rsp + pop %rbp + retq + jmp .L.end.437 +.L.else.437: +.L.end.437: + movq $0, %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global isalpha +isalpha: + push %rbp + movq %rsp, %rbp + subq $0, %rsp + leaq 16(%rbp), %rax + movzbl (%rax), %eax + push %rax + movq $65, %rax + pop %rdi + cmpl %edi, %eax + setle %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.441 + movq $90, %rax + push %rax + leaq 16(%rbp), %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + setbe %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.441 + movq $1, %rax + jmp .L.end.441 +.L.false.441: + movq $0, %rax +.L.end.441: + cmpq $0, %rax + jne .L.true.440 + leaq 16(%rbp), %rax + movzbl (%rax), %eax + push %rax + movq $97, %rax + pop %rdi + cmpl %edi, %eax + setle %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.442 + movq $122, %rax + push %rax + leaq 16(%rbp), %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + setbe %al + movzbl %al, %eax + cmpq $0, %rax + je .L.false.442 + movq $1, %rax + jmp .L.end.442 +.L.false.442: + movq $0, %rax +.L.end.442: + cmp $0, %rax + jne .L.true.440 + mov $0, %rax + jmp .L.end.440 +.L.true.440: + mov $1, %rax +.L.end.440: + cmpq $1, %rax + jne .L.else.439 + movq $1, %rax + movq %rbp, %rsp + pop %rbp + retq + jmp .L.end.439 +.L.else.439: +.L.end.439: + movq $0, %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global memcpy +memcpy: + push %rbp + movq %rsp, %rbp + subq $16, %rsp + leaq -4(%rbp), %rax + push %rax + movq $0, %rax + pop %rdi + movl %eax, (%rdi) +.L.while.start.443: + leaq 32(%rbp), %rax + movslq (%rax), %rax + push %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + cmpl %edi, %eax + setl %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.while.end.443 + movq $1, %rax + push %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + imull %edi, %eax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + push %rax + movq $1, %rax + push %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + imull %edi, %eax push %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + movzbl (%rax), %eax + pop %rdi + movb %al, (%rdi) + movq $1, %rax + push %rax + leaq -4(%rbp), %rax + push %rax + movq $1, %rax + push %rax + leaq -4(%rbp), %rax + movslq (%rax), %rax + pop %rdi + addl %edi, %eax + pop %rdi + movl %eax, (%rdi) + pop %rdi + subl %edi, %eax + jmp .L.while.start.443 +.L.while.end.443: + leaq 16(%rbp), %rax + movq (%rax), %rax + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global strrchr +strrchr: + push %rbp + movq %rsp, %rbp + subq $16, %rsp leaq -8(%rbp), %rax + push %rax + movq $0, %rax + pop %rdi + movq %rax, (%rdi) +.L.while.start.444: + movq $0, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + setne %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.while.end.444 + leaq 24(%rbp), %rax movslq (%rax), %rax push %rax - movq $0, %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + movzbl (%rax), %eax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.445 + leaq -8(%rbp), %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + pop %rdi + movq %rax, (%rdi) + jmp .L.end.445 +.L.else.445: +.L.end.445: + movq $1, %rax + push %rax + leaq 16(%rbp), %rax + push %rax + movq $1, %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax pop %rdi - subl %edi, %eax + addq %rdi, %rax pop %rdi - movl %eax, (%rdi) - jmp .L.end.408 -.L.else.408: -.L.end.408: + movq %rax, (%rdi) + pop %rdi + subq %rdi, %rax + jmp .L.while.start.444 +.L.while.end.444: leaq -8(%rbp), %rax - movslq (%rax), %rax + movq (%rax), %rax movq %rbp, %rsp pop %rbp retq leave ret -.global isdigit -isdigit: +.global byte_to_upper +byte_to_upper: push %rbp movq %rsp, %rbp subq $0, %rsp leaq 16(%rbp), %rax movzbl (%rax), %eax push %rax - movq $48, %rax + movq $65, %rax pop %rdi cmpl %edi, %eax setle %al movzbl %al, %eax cmpq $0, %rax - je .L.false.410 - movq $57, %rax + je .L.false.447 + movq $90, %rax push %rax leaq 16(%rbp), %rax movzbl (%rax), %eax @@ -26576,29 +28352,35 @@ isdigit: setbe %al movzbl %al, %eax cmpq $0, %rax - je .L.false.410 + je .L.false.447 movq $1, %rax - jmp .L.end.410 -.L.false.410: + jmp .L.end.447 +.L.false.447: movq $0, %rax -.L.end.410: +.L.end.447: cmpq $1, %rax - jne .L.else.409 - movq $1, %rax + jne .L.else.446 + movq $32, %rax + push %rax + leaq 16(%rbp), %rax + movzbl (%rax), %eax + pop %rdi + subl %edi, %eax movq %rbp, %rsp pop %rbp retq - jmp .L.end.409 -.L.else.409: -.L.end.409: - movq $0, %rax + jmp .L.end.446 +.L.else.446: +.L.end.446: + leaq 16(%rbp), %rax + movzbl (%rax), %eax movq %rbp, %rsp pop %rbp retq leave ret -.global isalpha -isalpha: +.global byte_to_lower +byte_to_lower: push %rbp movq %rsp, %rbp subq $0, %rsp @@ -26611,7 +28393,7 @@ isalpha: setle %al movzbl %al, %eax cmpq $0, %rax - je .L.false.413 + je .L.false.449 movq $90, %rax push %rax leaq 16(%rbp), %rax @@ -26621,103 +28403,162 @@ isalpha: setbe %al movzbl %al, %eax cmpq $0, %rax - je .L.false.413 + je .L.false.449 movq $1, %rax - jmp .L.end.413 -.L.false.413: + jmp .L.end.449 +.L.false.449: movq $0, %rax -.L.end.413: - cmpq $0, %rax - jne .L.true.412 - leaq 16(%rbp), %rax - movzbl (%rax), %eax - push %rax - movq $97, %rax - pop %rdi - cmpl %edi, %eax - setle %al - movzbl %al, %eax - cmpq $0, %rax - je .L.false.414 - movq $122, %rax +.L.end.449: + cmpq $1, %rax + jne .L.else.448 + movq $32, %rax push %rax leaq 16(%rbp), %rax movzbl (%rax), %eax pop %rdi - cmpl %edi, %eax - setbe %al - movzbl %al, %eax - cmpq $0, %rax - je .L.false.414 - movq $1, %rax - jmp .L.end.414 -.L.false.414: - movq $0, %rax -.L.end.414: - cmp $0, %rax - jne .L.true.412 - mov $0, %rax - jmp .L.end.412 -.L.true.412: - mov $1, %rax -.L.end.412: - cmpq $1, %rax - jne .L.else.411 - movq $1, %rax + addl %edi, %eax movq %rbp, %rsp pop %rbp retq - jmp .L.end.411 -.L.else.411: -.L.end.411: - movq $0, %rax + jmp .L.end.448 +.L.else.448: +.L.end.448: + leaq 16(%rbp), %rax + movzbl (%rax), %eax movq %rbp, %rsp pop %rbp retq leave ret -.global memcpy -memcpy: +.global memmove +memmove: push %rbp movq %rsp, %rbp - subq $16, %rsp - leaq -4(%rbp), %rax + subq $32, %rsp + leaq -8(%rbp), %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + pop %rdi + movq %rax, (%rdi) + leaq -16(%rbp), %rax + push %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + pop %rdi + movq %rax, (%rdi) + leaq -24(%rbp), %rax + push %rax + leaq 32(%rbp), %rax + movslq (%rax), %rax + push %rax + movq $1, %rax + pop %rdi + imull %edi, %eax + push %rax + leaq alloc(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $8, %rsp + pop %rdi + movq %rax, (%rdi) + movq $0, %rax + push %rax + leaq -24(%rbp), %rax + movq (%rax), %rax + pop %rdi + cmpl %edi, %eax + sete %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.else.450 + movq $0, %rax + movq %rbp, %rsp + pop %rbp + retq + jmp .L.end.450 +.L.else.450: + leaq -28(%rbp), %rax push %rax movq $0, %rax pop %rdi movl %eax, (%rdi) -.L.while.start.415: +.L.while.start.451: leaq 32(%rbp), %rax movslq (%rax), %rax push %rax - leaq -4(%rbp), %rax + leaq -28(%rbp), %rax movslq (%rax), %rax pop %rdi cmpl %edi, %eax - setl %al + setb %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.415 - movq $1, %rax - push %rax - leaq -4(%rbp), %rax + jne .L.while.end.451 + leaq -28(%rbp), %rax movslq (%rax), %rax + push %rax + leaq -24(%rbp), %rax + movq (%rax), %rax pop %rdi - imull %edi, %eax + addq %rdi, %rax push %rax - leaq 16(%rbp), %rax + leaq -28(%rbp), %rax + movslq (%rax), %rax + push %rax + leaq -16(%rbp), %rax movq (%rax), %rax pop %rdi addq %rdi, %rax + movzbl (%rax), %eax + pop %rdi + movb %al, (%rdi) + movq $1, %rax + push %rax + leaq -28(%rbp), %rax push %rax movq $1, %rax push %rax - leaq -4(%rbp), %rax + leaq -28(%rbp), %rax movslq (%rax), %rax pop %rdi - imull %edi, %eax + addl %edi, %eax + pop %rdi + movl %eax, (%rdi) + pop %rdi + subl %edi, %eax + jmp .L.while.start.451 +.L.while.end.451: + leaq -28(%rbp), %rax push %rax - leaq 24(%rbp), %rax + movq $0, %rax + pop %rdi + movl %eax, (%rdi) +.L.while.start.452: + leaq 32(%rbp), %rax + movslq (%rax), %rax + push %rax + leaq -28(%rbp), %rax + movslq (%rax), %rax + pop %rdi + cmpl %edi, %eax + setb %al + movzbl %al, %eax + cmpq $1, %rax + jne .L.while.end.452 + leaq -28(%rbp), %rax + movslq (%rax), %rax + push %rax + leaq -8(%rbp), %rax + movq (%rax), %rax + pop %rdi + addq %rdi, %rax + push %rax + leaq -28(%rbp), %rax + movslq (%rax), %rax + push %rax + leaq -24(%rbp), %rax movq (%rax), %rax pop %rdi addq %rdi, %rax @@ -26726,11 +28567,11 @@ memcpy: movb %al, (%rdi) movq $1, %rax push %rax - leaq -4(%rbp), %rax + leaq -28(%rbp), %rax push %rax movq $1, %rax push %rax - leaq -4(%rbp), %rax + leaq -28(%rbp), %rax movslq (%rax), %rax pop %rdi addl %edi, %eax @@ -26738,8 +28579,9 @@ memcpy: movl %eax, (%rdi) pop %rdi subl %edi, %eax - jmp .L.while.start.415 -.L.while.end.415: + jmp .L.while.start.452 +.L.while.end.452: +.L.end.450: leaq 16(%rbp), %rax movq (%rax), %rax movq %rbp, %rsp @@ -26784,7 +28626,7 @@ eprintf: push %rbp movq %rsp, %rbp subq $0, %rsp - leaq 24(%rbp), %rax + leaq 32(%rbp), %rax movq (%rax), %rax push %rax leaq 16(%rbp), %rax @@ -26808,7 +28650,7 @@ printf: push %rbp movq %rsp, %rbp subq $0, %rsp - leaq 24(%rbp), %rax + leaq 32(%rbp), %rax movq (%rax), %rax push %rax leaq 16(%rbp), %rax @@ -26821,7 +28663,30 @@ printf: movq $0, %rax callq *%r10 addq $24, %rsp + movq %rbp, %rsp + pop %rbp + retq + leave + ret +.global fprintf +fprintf: + push %rbp + movq %rsp, %rbp + subq $0, %rsp + leaq 40(%rbp), %rax + movq (%rax), %rax + push %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + push %rax + leaq 16(%rbp), %rax + movslq (%rax), %rax + push %rax + leaq vfprintf(%rip), %rax + movq %rax, %r10 movq $0, %rax + callq *%r10 + addq $24, %rsp movq %rbp, %rsp pop %rbp retq @@ -26846,7 +28711,7 @@ vfprintf: movq $0, %rax pop %rdi movl %eax, (%rdi) -.L.while.start.416: +.L.while.start.453: movq $0, %rax push %rax leaq 24(%rbp), %rax @@ -26857,7 +28722,7 @@ vfprintf: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.416 + jne .L.while.end.453 movq $37, %rax push %rax leaq 24(%rbp), %rax @@ -26868,7 +28733,7 @@ vfprintf: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.417 + jne .L.else.454 movq $1, %rax push %rax leaq 24(%rbp), %rax @@ -26893,7 +28758,7 @@ vfprintf: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.418 + jne .L.else.455 movq $8, %rax push %rax movq $1, %rax @@ -26927,8 +28792,8 @@ vfprintf: movq $0, %rax callq *%r10 addq $16, %rsp - jmp .L.end.418 -.L.else.418: + jmp .L.end.455 +.L.else.455: movq $100, %rax push %rax leaq 24(%rbp), %rax @@ -26939,7 +28804,7 @@ vfprintf: sete %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.419 + jne .L.else.456 leaq -12(%rbp), %rax push %rax movq $8, %rax @@ -26977,15 +28842,15 @@ vfprintf: setl %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.420 + jne .L.else.457 movq $1, %rax push %rax .data -.L.str.345: +.L.str.351: .byte 45 .byte 0 .text - leaq .L.str.345(%rip), %rax + leaq .L.str.351(%rip), %rax push %rax leaq 16(%rbp), %rax movslq (%rax), %rax @@ -27006,9 +28871,9 @@ vfprintf: imull %edi, %eax pop %rdi movl %eax, (%rdi) - jmp .L.end.420 -.L.else.420: -.L.end.420: + jmp .L.end.457 +.L.else.457: +.L.end.457: movq $10, %rax push %rax leaq -12(%rbp), %rax @@ -27022,16 +28887,16 @@ vfprintf: movq $0, %rax callq *%r10 addq $24, %rsp - jmp .L.end.419 -.L.else.419: + jmp .L.end.456 +.L.else.456: movq $1, %rax push %rax .data -.L.str.346: +.L.str.352: .byte 37 .byte 0 .text - leaq .L.str.346(%rip), %rax + leaq .L.str.352(%rip), %rax push %rax leaq 16(%rbp), %rax movslq (%rax), %rax @@ -27055,10 +28920,10 @@ vfprintf: movq %rax, (%rdi) pop %rdi addq %rdi, %rax -.L.end.419: -.L.end.418: - jmp .L.end.417 -.L.else.417: +.L.end.456: +.L.end.455: + jmp .L.end.454 +.L.else.454: movq $1, %rax push %rax leaq 24(%rbp), %rax @@ -27072,7 +28937,7 @@ vfprintf: movq $0, %rax callq *%r10 addq $24, %rsp -.L.end.417: +.L.end.454: movq $1, %rax push %rax leaq 24(%rbp), %rax @@ -27087,8 +28952,8 @@ vfprintf: movq %rax, (%rdi) pop %rdi subq %rdi, %rax - jmp .L.while.start.416 -.L.while.end.416: + jmp .L.while.start.453 +.L.while.end.453: movq $0, %rax movq %rbp, %rsp pop %rbp @@ -27110,7 +28975,7 @@ fputnum: setge %al movzbl %al, %eax cmpq $1, %rax - jne .L.else.421 + jne .L.else.458 leaq 32(%rbp), %rax movslq (%rax), %rax push %rax @@ -27131,9 +28996,9 @@ fputnum: movq $0, %rax callq *%r10 addq $24, %rsp - jmp .L.end.421 -.L.else.421: -.L.end.421: + jmp .L.end.458 +.L.else.458: +.L.end.458: movq $1, %rax push %rax movq $1, %rax @@ -27151,7 +29016,7 @@ fputnum: imull %edi, %eax push %rax .data -.L.str.347: +.L.str.353: .byte 48 .byte 49 .byte 50 @@ -27170,7 +29035,7 @@ fputnum: .byte 70 .byte 0 .text - leaq .L.str.347(%rip), %rax + leaq .L.str.353(%rip), %rax pop %rdi addq %rdi, %rax push %rax @@ -27230,7 +29095,7 @@ strlen: movq (%rax), %rax pop %rdi movq %rax, (%rdi) -.L.while.start.422: +.L.while.start.459: movq $0, %rax push %rax leaq 16(%rbp), %rax @@ -27241,7 +29106,7 @@ strlen: setne %al movzbl %al, %eax cmpq $1, %rax - jne .L.while.end.422 + jne .L.while.end.459 movq $1, %rax push %rax leaq 16(%rbp), %rax @@ -27256,8 +29121,8 @@ strlen: movq %rax, (%rdi) pop %rdi subq %rdi, %rax - jmp .L.while.start.422 -.L.while.end.422: + jmp .L.while.start.459 +.L.while.end.459: leaq -8(%rbp), %rax movq (%rax), %rax push %rax @@ -27270,6 +29135,32 @@ strlen: retq leave ret +.global readlink +readlink: + push %rbp + movq %rsp, %rbp + subq $0, %rsp + leaq 32(%rbp), %rax + movq (%rax), %rax + push %rax + leaq 24(%rbp), %rax + movq (%rax), %rax + push %rax + leaq 16(%rbp), %rax + movq (%rax), %rax + push %rax + movq $89, %rax + push %rax + leaq syscall(%rip), %rax + movq %rax, %r10 + movq $0, %rax + callq *%r10 + addq $32, %rsp + movq %rbp, %rsp + pop %rbp + retq + leave + ret .global exit exit: push %rbp diff --git a/example/age.ibu b/example/age.ibu index 4731eb1..3db9869 100644 --- a/example/age.ibu +++ b/example/age.ibu @@ -1,5 +1,5 @@ -#include "src/std.ibu" +#include "std.ibu" func main() i32 { var age i8; diff --git a/example/fizzbuzz.ibu b/example/fizzbuzz.ibu index 68d7d2d..ada1584 100644 --- a/example/fizzbuzz.ibu +++ b/example/fizzbuzz.ibu @@ -1,5 +1,5 @@ -#include "src/std.ibu" +#include "std.ibu" func main() i32 { var c i32 = 1; diff --git a/example/link.ibu b/example/link.ibu index 6d40d4d..fbed642 100644 --- a/example/link.ibu +++ b/example/link.ibu @@ -1,14 +1,11 @@ -#include "src/std.ibu" +#include "std.ibu" -struct User; struct User { name *u8, next *User, } -func user_print_names(user *User) i32; - func user_print_names(user *User) i32 { printf("%s\n", user.name); diff --git a/lib/linux-syscall.ibu b/lib/linux-syscall.ibu new file mode 100644 index 0000000..e526374 --- /dev/null +++ b/lib/linux-syscall.ibu @@ -0,0 +1,342 @@ + +#define SYS_READ 0 +#define SYS_WRITE 1 +#define SYS_OPEN 2 +#define SYS_CLOSE 3 +#define SYS_STAT 4 +#define SYS_FSTAT 5 +#define SYS_LSTAT 6 +#define SYS_POLL 7 +#define SYS_LSEEK 8 +#define SYS_MMAP 9 +#define SYS_MPROTECT 10 +#define SYS_MUNMAP 11 +#define SYS_BRK 12 +#define SYS_RT_SIGACTION 13 +#define SYS_RT_SIGPROCMASK 14 +#define SYS_RT_SIGRETURN 15 +#define SYS_IOCTL 16 +#define SYS_PREAD64 17 +#define SYS_PWRITE64 18 +#define SYS_READV 19 +#define SYS_WRITEV 20 +#define SYS_ACCESS 21 +#define SYS_PIPE 22 +#define SYS_SELECT 23 +#define SYS_SCHED_YIELD 24 +#define SYS_MREMAP 25 +#define SYS_MSYNC 26 +#define SYS_MINCORE 27 +#define SYS_MADVISE 28 +#define SYS_SHMGET 29 +#define SYS_SHMAT 30 +#define SYS_SHMCTL 31 +#define SYS_DUP 32 +#define SYS_DUP2 33 +#define SYS_PAUSE 34 +#define SYS_NANOSLEEP 35 +#define SYS_GETITIMER 36 +#define SYS_ALARM 37 +#define SYS_SETITIMER 38 +#define SYS_GETPID 39 +#define SYS_SENDFILE 40 +#define SYS_SOCKET 41 +#define SYS_CONNECT 42 +#define SYS_ACCEPT 43 +#define SYS_SENDTO 44 +#define SYS_RECVFROM 45 +#define SYS_SENDMSG 46 +#define SYS_RECVMSG 47 +#define SYS_SHUTDOWN 48 +#define SYS_BIND 49 +#define SYS_LISTEN 50 +#define SYS_GETSOCKNAME 51 +#define SYS_GETPEERNAME 52 +#define SYS_SOCKETPAIR 53 +#define SYS_SETSOCKOPT 54 +#define SYS_GETSOCKOPT 55 +#define SYS_CLONE 56 +#define SYS_FORK 57 +#define SYS_VFORK 58 +#define SYS_EXECVE 59 +#define SYS_EXIT 60 +#define SYS_WAIT4 61 +#define SYS_KILL 62 +#define SYS_UNAME 63 +#define SYS_SEMGET 64 +#define SYS_SEMOP 65 +#define SYS_SEMCTL 66 +#define SYS_SHMDT 67 +#define SYS_MSGGET 68 +#define SYS_MSGSND 69 +#define SYS_MSGRCV 70 +#define SYS_MSGCTL 71 +#define SYS_FCNTL 72 +#define SYS_FLOCK 73 +#define SYS_FSYNC 74 +#define SYS_FDATASYNC 75 +#define SYS_TRUNCATE 76 +#define SYS_FTRUNCATE 77 +#define SYS_GETDENTS 78 +#define SYS_GETCWD 79 +#define SYS_CHDIR 80 +#define SYS_FCHDIR 81 +#define SYS_RENAME 82 +#define SYS_MKDIR 83 +#define SYS_RMDIR 84 +#define SYS_CREAT 85 +#define SYS_LINK 86 +#define SYS_UNLINK 87 +#define SYS_SYMLINK 88 +#define SYS_READLINK 89 +#define SYS_CHMOD 90 +#define SYS_FCHMOD 91 +#define SYS_CHOWN 92 +#define SYS_FCHOWN 93 +#define SYS_LCHOWN 94 +#define SYS_UMASK 95 +#define SYS_GETTIMEOFDAY 96 +#define SYS_GETRLIMIT 97 +#define SYS_GETRUSAGE 98 +#define SYS_SYSINFO 99 +#define SYS_TIMES 100 +#define SYS_PTRACE 101 +#define SYS_GETUID 102 +#define SYS_SYSLOG 103 +#define SYS_GETGID 104 +#define SYS_SETUID 105 +#define SYS_SETGID 106 +#define SYS_GETEUID 107 +#define SYS_GETEGID 108 +#define SYS_SETPGID 109 +#define SYS_GETPPID 110 +#define SYS_GETPGRP 111 +#define SYS_SETSID 112 +#define SYS_SETREUID 113 +#define SYS_SETREGID 114 +#define SYS_GETGROUPS 115 +#define SYS_SETGROUPS 116 +#define SYS_SETRESUID 117 +#define SYS_GETRESUID 118 +#define SYS_SETRESGID 119 +#define SYS_GETRESGID 120 +#define SYS_GETPGID 121 +#define SYS_SETFSUID 122 +#define SYS_SETFSGID 123 +#define SYS_GETSID 124 +#define SYS_CAPGET 125 +#define SYS_CAPSET 126 +#define SYS_RT_SIGPENDING 127 +#define SYS_RT_SIGTIMEDWAIT 128 +#define SYS_RT_SIGQUEUEINFO 129 +#define SYS_RT_SIGSUSPEND 130 +#define SYS_SIGALTSTACK 131 +#define SYS_UTIME 132 +#define SYS_MKNOD 133 +#define SYS_USELIB 134 +#define SYS_PERSONALITY 135 +#define SYS_USTAT 136 +#define SYS_STATFS 137 +#define SYS_FSTATFS 138 +#define SYS_SYSFS 139 +#define SYS_GETPRIORITY 140 +#define SYS_SETPRIORITY 141 +#define SYS_SCHED_SETPARAM 142 +#define SYS_SCHED_GETPARAM 143 +#define SYS_SCHED_SETSCHEDULER 144 +#define SYS_SCHED_GETSCHEDULER 145 +#define SYS_SCHED_GET_PRIORITY_MAX 146 +#define SYS_SCHED_GET_PRIORITY_MIN 147 +#define SYS_SCHED_RR_GET_INTERVAL 148 +#define SYS_MLOCK 149 +#define SYS_MUNLOCK 150 +#define SYS_MLOCKALL 151 +#define SYS_MUNLOCKALL 152 +#define SYS_VHANGUP 153 +#define SYS_MODIFY_LDT 154 +#define SYS_PIVOT_ROOT 155 +#define SYS__SYSCTL 156 +#define SYS_PRCTL 157 +#define SYS_ARCH_PRCTL 158 +#define SYS_ADJTIMEX 159 +#define SYS_SETRLIMIT 160 +#define SYS_CHROOT 161 +#define SYS_SYNC 162 +#define SYS_ACCT 163 +#define SYS_SETTIMEOFDAY 164 +#define SYS_MOUNT 165 +#define SYS_UMOUNT2 166 +#define SYS_SWAPON 167 +#define SYS_SWAPOFF 168 +#define SYS_REBOOT 169 +#define SYS_SETHOSTNAME 170 +#define SYS_SETDOMAINNAME 171 +#define SYS_IOPL 172 +#define SYS_IOPERM 173 +#define SYS_CREATE_MODULE 174 +#define SYS_INIT_MODULE 175 +#define SYS_DELETE_MODULE 176 +#define SYS_GET_KERNEL_SYMS 177 +#define SYS_QUERY_MODULE 178 +#define SYS_QUOTACTL 179 +#define SYS_NFSSERVCTL 180 +#define SYS_GETPMSG 181 +#define SYS_PUTPMSG 182 +#define SYS_AFS_SYSCALL 183 +#define SYS_TUXCALL 184 +#define SYS_SECURITY 185 +#define SYS_GETTID 186 +#define SYS_READAHEAD 187 +#define SYS_SETXATTR 188 +#define SYS_LSETXATTR 189 +#define SYS_FSETXATTR 190 +#define SYS_GETXATTR 191 +#define SYS_LGETXATTR 192 +#define SYS_FGETXATTR 193 +#define SYS_LISTXATTR 194 +#define SYS_LLISTXATTR 195 +#define SYS_FLISTXATTR 196 +#define SYS_REMOVEXATTR 197 +#define SYS_LREMOVEXATTR 198 +#define SYS_FREMOVEXATTR 199 +#define SYS_TKILL 200 +#define SYS_TIME 201 +#define SYS_FUTEX 202 +#define SYS_SCHED_SETAFFINITY 203 +#define SYS_SCHED_GETAFFINITY 204 +#define SYS_SET_THREAD_AREA 205 +#define SYS_IO_SETUP 206 +#define SYS_IO_DESTROY 207 +#define SYS_IO_GETEVENTS 208 +#define SYS_IO_SUBMIT 209 +#define SYS_IO_CANCEL 210 +#define SYS_GET_THREAD_AREA 211 +#define SYS_LOOKUP_DCOOKIE 212 +#define SYS_EPOLL_CREATE 213 +#define SYS_EPOLL_CTL_OLD 214 +#define SYS_EPOLL_WAIT_OLD 215 +#define SYS_REMAP_FILE_PAGES 216 +#define SYS_GETDENTS64 217 +#define SYS_SET_TID_ADDRESS 218 +#define SYS_RESTART_SYSCALL 219 +#define SYS_SEMTIMEDOP 220 +#define SYS_FADVISE64 221 +#define SYS_TIMER_CREATE 222 +#define SYS_TIMER_SETTIME 223 +#define SYS_TIMER_GETTIME 224 +#define SYS_TIMER_GETOVERRUN 225 +#define SYS_TIMER_DELETE 226 +#define SYS_CLOCK_SETTIME 227 +#define SYS_CLOCK_GETTIME 228 +#define SYS_CLOCK_GETRES 229 +#define SYS_CLOCK_NANOSLEEP 230 +#define SYS_EXIT_GROUP 231 +#define SYS_EPOLL_WAIT 232 +#define SYS_EPOLL_CTL 233 +#define SYS_TGKILL 234 +#define SYS_UTIMES 235 +#define SYS_VSERVER 236 +#define SYS_MBIND 237 +#define SYS_SET_MEMPOLICY 238 +#define SYS_GET_MEMPOLICY 239 +#define SYS_MQ_OPEN 240 +#define SYS_MQ_UNLINK 241 +#define SYS_MQ_TIMEDSEND 242 +#define SYS_MQ_TIMEDRECEIVE 243 +#define SYS_MQ_NOTIFY 244 +#define SYS_MQ_GETSETATTR 245 +#define SYS_KEXEC_LOAD 246 +#define SYS_WAITID 247 +#define SYS_ADD_KEY 248 +#define SYS_REQUEST_KEY 249 +#define SYS_KEYCTL 250 +#define SYS_IOPRIO_SET 251 +#define SYS_IOPRIO_GET 252 +#define SYS_INOTIFY_INIT 253 +#define SYS_INOTIFY_ADD_WATCH 254 +#define SYS_INOTIFY_RM_WATCH 255 +#define SYS_MIGRATE_PAGES 256 +#define SYS_OPENAT 257 +#define SYS_MKDIRAT 258 +#define SYS_MKNODAT 259 +#define SYS_FCHOWNAT 260 +#define SYS_FUTIMESAT 261 +#define SYS_NEWFSTATAT 262 +#define SYS_UNLINKAT 263 +#define SYS_RENAMEAT 264 +#define SYS_LINKAT 265 +#define SYS_SYMLINKAT 266 +#define SYS_READLINKAT 267 +#define SYS_FCHMODAT 268 +#define SYS_FACCESSAT 269 +#define SYS_PSELECT6 270 +#define SYS_PPOLL 271 +#define SYS_UNSHARE 272 +#define SYS_SET_ROBUST_LIST 273 +#define SYS_GET_ROBUST_LIST 274 +#define SYS_SPLICE 275 +#define SYS_TEE 276 +#define SYS_SYNC_FILE_RANGE 277 +#define SYS_VMSPLICE 278 +#define SYS_MOVE_PAGES 279 +#define SYS_UTIMENSAT 280 +#define SYS_EPOLL_PWAIT 281 +#define SYS_SIGNALFD 282 +#define SYS_TIMERFD_CREATE 283 +#define SYS_EVENTFD 284 +#define SYS_FALLOCATE 285 +#define SYS_TIMERFD_SETTIME 286 +#define SYS_TIMERFD_GETTIME 287 +#define SYS_ACCEPT4 288 +#define SYS_SIGNALFD4 289 +#define SYS_EVENTFD2 290 +#define SYS_EPOLL_CREATE1 291 +#define SYS_DUP3 292 +#define SYS_PIPE2 293 +#define SYS_INOTIFY_INIT1 294 +#define SYS_PREADV 295 +#define SYS_PWRITEV 296 +#define SYS_RT_TGSIGQUEUEINFO 297 +#define SYS_PERF_EVENT_OPEN 298 +#define SYS_RECVMMSG 299 +#define SYS_FANOTIFY_INIT 300 +#define SYS_FANOTIFY_MARK 301 +#define SYS_PRLIMIT64 302 +#define SYS_NAME_TO_HANDLE_AT 303 +#define SYS_OPEN_BY_HANDLE_AT 304 +#define SYS_CLOCK_ADJTIME 305 +#define SYS_SYNCFS 306 +#define SYS_SENDMMSG 307 +#define SYS_SETNS 308 +#define SYS_GETCPU 309 +#define SYS_PROCESS_VM_READV 310 +#define SYS_PROCESS_VM_WRITEV 311 +#define SYS_KCMP 312 +#define SYS_FINIT_MODULE 313 + +func syscall(trap u64, a1 u64, a2 u64, a3 u64) i64; // src/builtin.s + +func open(file_name *u8, flags i32, mode i32) i64 { + return syscall(SYS_OPEN, file_name, flags, mode); +} + +func read(fd i32, buf *u8, size i32) i64 { + return syscall(SYS_READ, fd, buf, size); +} + +func close(fd i32) i64 { + return syscall(SYS_CLOSE, fd, 0, 0); +} + +func write(fn i32, buf *u8, size i32) i64 { + return syscall(SYS_WRITE, fn, buf, size); +} + +func exit(code i32) i64 { + return syscall(SYS_EXIT, code, 0, 0); +} + +func readlink(path *u8, buf *u8, buf_size i64) i64 { + return syscall(SYS_READLINK, path, buf, buf_size); +} + diff --git a/src/std.ibu b/lib/std.ibu similarity index 57% rename from src/std.ibu rename to lib/std.ibu index fa00ff9..d4c2f85 100644 --- a/src/std.ibu +++ b/lib/std.ibu @@ -1,5 +1,5 @@ -#include "src/linux-syscall.ibu" +#include "linux-syscall.ibu" #define STDIN 0 #define STDIO 1 @@ -20,7 +20,6 @@ func fputs(fd i32, str *u8) i32 { return 0; } -func fputnum(fd i32, n i32, r i32) i32; func fputnum(fd i32, n i32, r i32) i32 { if n >= r { fputnum(fd, n / r, r); @@ -55,12 +54,15 @@ func vfprintf(fd i32, fmt *u8, args *u64) i32 { fmt++; } - return 0; + return 0; // TODO: return the number of characters that are printed. +} + +func fprintf(fd i32, fmt *u8, ...) i32 { + return vfprintf(fd, fmt, argv); } func printf(fmt *u8, ...) i32 { - vfprintf(STDIO, fmt, argv); - return 0; + return vfprintf(STDIO, fmt, argv); } func eprintf(fmt *u8, ...) i32 { @@ -72,6 +74,58 @@ func align_to(n i32, align i32) i32 { return (n + align - 1) / align * align; } +func memmove(dest *u8, src *u8, n u32) i32 { + var p_dest *u8 = dest; + var p_src *u8 = src; + + var tmp *u8 = alloc(typesize(u8) * n); // TODO: free() before return + + if tmp == nil { + return nil; + } else { + var i u32 = 0; + while i < n { + *(tmp + i) = *(p_src + i); + i++; + } + + i = 0; + while i < n { + *(p_dest + i) = *(tmp + i); + i++; + } + } + + return dest; +} + +func byte_to_lower(c u8) u8 { + if 'A' <= c <= 'Z' { + return c + 32; + } + return c; +} + +func byte_to_upper(c u8) u8 { + if 'A' <= c <= 'Z' { + return c - 32; + } + return c; +} + +func strrchr(str *u8, ch i32) *u8 { + var last_occurrence *u8 = nil; + + while *str != '\0' { + if *str == ch { + last_occurrence = str; + } + str++; + } + + return last_occurrence; +} + func memcpy(dest *u8, source *u8, size i32) *u8 { var i i32 = 0; while i < size { @@ -144,7 +198,7 @@ func reverse(str *u8, length i32) i32 { } } -func itoa(num i32, str *u8, base i32) *u8 { +func itoa(num i32, str *u8, base i32) i32 { var i i32 = 0; if (num == 0) { @@ -152,6 +206,13 @@ func itoa(num i32, str *u8, base i32) *u8 { str[i] = 0; return str; } + + var is_neg bool = false; + + if num < 0 { + is_neg = true; + num = 0 - num; + } while num != 0 { var rem i32 = num % base; @@ -162,11 +223,53 @@ func itoa(num i32, str *u8, base i32) *u8 { } num = num / base; } + + if is_neg { + str[i++] = '-'; + } - str[i] = 0; + reverse(str, i); - reverse(str, i); + str[i] = 0; - return str; + return i; +} + +func vsprintf(buf *u8, fmt *u8, argv *u64) i32 { + var buf_start *u8 = buf; + + var i i32 = 0; + + while *fmt != 0 { + if *fmt == '%' { + fmt++; + if *fmt == 's' { // %s + var str_length i32 = strlen(argv[i]); + memcpy(buf, argv[i], str_length); + buf = buf + str_length; + i++; + } else if *fmt == 'd' { // %d + buf = buf + itoa(argv[i++], buf, 10); + } else { + *buf = '%'; + buf++; + fmt--; + } + } else { + *buf = *fmt; + buf++; + } + fmt++; + } + + var length i32 = buf - buf_start; + + buf[length] = '\0'; + + return length; +} + +func sprintf(buf *u8, fmt *u8, ...) i32 { + return vsprintf(buf, fmt, argv); } diff --git a/main.ibu b/main.ibu index e9769b7..293023d 100644 --- a/main.ibu +++ b/main.ibu @@ -1,5 +1,5 @@ -#include "src/std.ibu" +#include "std.ibu" func main() i32 { printf("Hello, world!\n"); diff --git a/src/gen.ibu b/src/gen.ibu new file mode 100644 index 0000000..fafc434 --- /dev/null +++ b/src/gen.ibu @@ -0,0 +1,550 @@ + +struct Gen { + label_count i32, + str_label_count i32, + cur_func_name *u8, + has_main bool, + no_deref bool, + + offset i32, + stack_offset i32, +} + +func new_gen() *Gen { + var g *Gen = alloc(typesize(Gen)); + g.no_deref = false; + + g.label_count = 0; + g.str_label_count = 0; + return g; +} + +func gen_expr(g *Gen, node *Node) i32; + +func gen_lhs_rhs(g *Gen, lhs *Node, rhs *Node) i32 { + gen_expr(g, rhs); + printf("\tpush %rax\n"); + gen_expr(g, lhs); + printf("\tpop %rdi\n"); +} + +func gen_addr(g *Gen, node *Node) i32 { + if node.kind == ND_MEMBER_ACCESS { + gen_addr(g, node.lhs); + printf("\taddq $%d, %rax\n", node.offset); + } else if node.kind == ND_VAR { + if node.obj.is_global { + g.no_deref = true; + printf("\tleaq %s(%rip), %rax\n", node.obj.name); + } else { + printf("\tleaq %d(%rbp), %rax\n", node.obj.offset); + } + } else if node.kind == ND_DEREF { + gen_expr(g, node.lhs); + } + return 0; +} + +func gen_store(ty *Type) i32 { + if ty.kind == TY_STRUCT { + var idx i32 = 0; + while idx < ty.size { + printf("\tmovb %d(%rax), %r8b\n", idx); + printf("\tmovb %r8b, %d(%rdi)\n", idx); + idx++; + } + return 0; + } + if ty.size == 1 { + printf("\tmovb %al, (%rdi)\n"); + } else if ty.size == 2 { + printf("\tmovw %ax, (%rdi)\n"); + } else if ty.size == 4 { + printf("\tmovl %eax, (%rdi)\n"); + } else if ty.size == 8 { + printf("\tmovq %rax, (%rdi)\n"); + } else { + eprintf("unreachable\n"); + exit(1); + } + return 0; +} + +func load_instr(ty *Type) *u8 { + if ty.is_unsigned { + "movz"; + } else { + "movs"; + } +} + +func gen_load(g *Gen, ty *Type) i32 { + var instr *u8; + + if ty.kind == TY_STRUCT { + return 0; + } + if g.no_deref { + g.no_deref = false; + return 0; + } + + if ty.is_unsigned { + instr = "movz"; + } else { + instr = "movs"; + } + + if ty.size == 8 { + printf("\tmovq (%rax), %rax\n"); + } else if ty.size == 4 { + printf("\tmovslq (%rax), %rax\n"); + } else if ty.size == 2 { + printf("\t%swl (%rax), %eax\n", instr); + } else if ty.size == 1 { + printf("\t%sbl (%rax), %eax\n", instr); + } else { + eprintf("unreachable\n"); + exit(1); + } + return 0; +} + +func gen_binop(instr_name *u8, ty *Type) i32 { + if ty.kind == TY_PTR { + printf("\t%sq %rdi, %rax\n", instr_name); + } else { + printf("\t%sl %edi, %eax\n", instr_name); + } + return 0; +} + +func gen_condition_store(ty *Type) i32 { + if ty.kind == TY_PTR { + printf("\tmovzbq %al, %rax\n"); + } else if ty.kind == TY_I64 { + printf("\tmovzbq %al, %rax\n"); + } else { + printf("\tmovzbl %al, %eax\n"); + } +} + +func func_call_args_to_stack(g *Gen, args *NodeVec, ty *Type) i32 { + if args.len == 0 { + return 0; + } + + var stack i32 = 0; + + var idx i32 = args.len - 1; + while 0 <= idx { + gen_expr(g, args.ptr[idx]); + printf("\tpush %rax\n"); + stack = stack + 8; + + if ty.is_variadic && idx-1 == (ty.params.len - 2 - 1) { + var argc i32 = 0; + if args.len > (ty.params.len - 2) { + argc = args.len - (ty.params.len - 2); + } + printf("\tleaq (%rsp), %rax\n"); + printf("\tpush %rax\n"); + printf("\tpush $%d\n", argc); + stack = stack + 16; + } + + idx--; + } + + return stack; +} + +func binop_ax_by_type_size(ty *Type) *u8 { + if ty.size == 8 { + "%rax"; + } else { + "%eax"; + } +} + +func gen_expr(g *Gen, node *Node) i32 { + var c i32 = 0; + if node.kind == ND_EMPTY { + return 0; + } + if node.kind == ND_MEMBER_ACCESS { + gen_addr(g, node); + gen_load(g, node.ty); + return 0; + } + if node.kind == ND_STR { + c = g.str_label_count++; + printf(".data\n"); + printf(".L.str.%d:\n", c); + + var str *u8 = node.str_val; + while *str != nil { + printf("\t.byte %d\n", *str); + str++; + } + printf("\t.byte 0\n"); + + printf(".text\n"); + printf("\tleaq .L.str.%d(%rip), %rax\n", c); + return 0; + } + if node.kind == ND_NUM { + printf("\tmovq $%d, %rax\n", node.int_val); + return 0; + } + if node.kind == ND_ASSIGN { + gen_addr(g, node.lhs); + printf("\tpush %rax\n"); + gen_expr(g, node.rhs); + printf("\tpop %rdi\n"); + gen_store(node.ty); + return 0; + } + if node.kind == ND_VAR { + gen_addr(g, node); + gen_load(g, node.ty); + return 0; + } + if node.kind == ND_FUNC_CALL { + var stack i32 = 0; + stack = func_call_args_to_stack(g, node.args, node.lhs.ty); + + gen_expr(g, node.lhs); + printf("\tmovq %rax, %r10\n"); + printf("\tmovq $0, %rax\n"); + + printf("\tcallq *%r10\n"); + printf("\taddq $%d, %rsp\n", stack); + + if node.ty.kind == TY_BOOL { + printf("\tmovzx %al, %eax\n"); + } else if node.ty.kind == TY_I8 { + printf("\tmovsbl %al, %eax\n"); + } else if node.ty.kind == TY_U8 { + printf("\tmovzbl %al, %eax\n"); + } else if node.ty.kind == TY_I16 { + printf("\tmovswl %ax, %eax\n"); + } else if node.ty.kind == TY_U16 { + printf("\tmovzwl %ax, %eax\n"); + } else {} + + return 0; + } + if node.kind == ND_EXPR_STMT { + gen_expr(g, node.lhs); + return 0; + } + if node.kind == ND_REF { + gen_addr(g, node.lhs); + return 0; + } + if node.kind == ND_DEREF { + gen_expr(g, node.lhs); + gen_load(g, node.ty); + return 0; + } + if node.kind == ND_NOT { + gen_expr(g, node.lhs); + printf("\tcmpq $0, %rax\n"); + printf("\tsete %al\n"); + printf("\tmovzbq %al, %rax\n"); + return 0; + } + if node.kind == ND_ADD { + gen_lhs_rhs(g, node.lhs, node.rhs); + gen_binop("add", node.ty); + return 0; + } + if node.kind == ND_SHL { + gen_lhs_rhs(g, node.lhs, node.rhs); + printf("\tmovq %rdi, %rcx\n"); + printf("\tshl %cl, %s\n", binop_ax_by_type_size(node.lhs.ty)); + return 0; + } + if node.kind == ND_SHR { + gen_lhs_rhs(g, node.lhs, node.rhs); + printf("\tmovq %rdi, %rcx\n"); + printf("\tshr %cl, %s\n", binop_ax_by_type_size(node.lhs.ty)); + return 0; + } + if node.kind == ND_SUB { + gen_lhs_rhs(g, node.lhs, node.rhs); + gen_binop("sub", node.ty); + return 0; + } + if node.kind == ND_MUL { + gen_lhs_rhs(g, node.lhs, node.rhs); + gen_binop("imul", node.ty); + return 0; + } + if node.kind == ND_DIV || node.kind == ND_MOD { + gen_lhs_rhs(g, node.lhs, node.rhs); + + if node.ty.is_unsigned { + if node.ty.size == 8 { + printf("\tmov $0, %rdx\n"); + printf("\tdivq %rdi\n"); + } else { + printf("\tmov $0, %edx\n"); + printf("\tdivl %edi\n"); + } + } else { + if node.lhs.ty.size == 8 { + printf("\tcqto\n"); + } else { + printf("\tcltd\n"); + } + if node.ty.size == 8 { + printf("\tidivq %rdi\n"); + } else { + printf("\tidivl %edi\n"); + } + } + if node.kind == ND_MOD { + printf("\tmovq %rdx, %rax\n"); + } + return 0; + } + if node.kind == ND_EQ { + gen_lhs_rhs(g, node.lhs, node.rhs); + gen_binop("cmp", node.ty); + printf("\tsete %al\n"); + gen_condition_store(node.ty); + return 0; + } + if node.kind == ND_NE { + gen_lhs_rhs(g, node.lhs, node.rhs); + gen_binop("cmp", node.ty); + printf("\tsetne %al\n"); + gen_condition_store(node.ty); + return 0; + } + if node.kind == ND_LOGAND { + c = g.label_count++; + gen_expr(g, node.lhs); + printf("\tcmpq $0, %rax\n"); + printf("\tje .L.false.%d\n", c); + gen_expr(g, node.rhs); + printf("\tcmpq $0, %rax\n"); + printf("\tje .L.false.%d\n", c); + printf("\tmovq $1, %rax\n"); + printf("\tjmp .L.end.%d\n", c); + printf(".L.false.%d:\n", c); + printf("\tmovq $0, %rax\n"); + printf(".L.end.%d:\n", c); + return 0; + } + if node.kind == ND_LOGOR { + c = g.label_count++; + gen_expr(g, node.lhs); + printf("\tcmpq $0, %rax\n"); + printf("\tjne .L.true.%d\n", c); + gen_expr(g, node.rhs); + printf("\tcmp $0, %rax\n"); + printf("\tjne .L.true.%d\n", c); + printf("\tmov $0, %rax\n"); + printf("\tjmp .L.end.%d\n", c); + printf(".L.true.%d:\n", c); + printf("\tmov $1, %rax\n"); + printf(".L.end.%d:\n", c); + return 0; + } + if node.kind == ND_GE { + gen_lhs_rhs(g, node.lhs, node.rhs); + gen_binop("cmp", node.ty); + if node.lhs.ty.is_unsigned { + printf("\tsetae %al\n"); + } else { + printf("\tsetge %al\n"); + } + gen_condition_store(node.ty); + return 0; + } + if node.kind == ND_GT { + gen_lhs_rhs(g, node.lhs, node.rhs); + gen_binop("cmp", node.ty); + if node.lhs.ty.is_unsigned { + printf("\tseta %al\n"); + } else { + printf("\tsetg %al\n"); + } + gen_condition_store(node.ty); + return 0; + } + if node.kind == ND_LE { + gen_lhs_rhs(g, node.lhs, node.rhs); + gen_binop("cmp", node.ty); + if node.lhs.ty.is_unsigned { + printf("\tsetbe %al\n"); + } else { + printf("\tsetle %al\n"); + } + gen_condition_store(node.ty); + return 0; + } + if node.kind == ND_LT { + gen_lhs_rhs(g, node.lhs, node.rhs); + gen_binop("cmp", node.ty); + if node.lhs.ty.is_unsigned { + printf("\tsetb %al\n"); + } else { + printf("\tsetl %al\n"); + } + gen_condition_store(node.ty); + return 0; + } + printf("kind: %d unreachable\n", node.kind); + exit(1); +} + +func gen_stmt(g *Gen, node *Node) i32; + +func gen_node_block(g *Gen, stmts *NodeVec) i32 { + var idx i32 = 0; + while idx < stmts.len { + gen_stmt(g, stmts.ptr[idx]); + idx++; + } + return 0; +} + +func gen_stmt(g *Gen, node *Node) i32 { + var c i32 = 0; + if node.kind == ND_EMPTY { + return 0; + } + if node.kind == ND_BLOCK { + gen_node_block(g, node.body); + return 0; + } + if node.kind == ND_EXPR_STMT { + gen_expr(g, node.lhs); + return 0; + } + if node.kind == ND_RETURN { + gen_expr(g, node.lhs); + printf("\tmovq %rbp, %rsp\n"); + printf("\tpop %rbp\n"); + printf("\tretq\n"); + return 0; + } + if node.kind == ND_IF { + c = g.label_count++; + gen_expr(g, node.cond); + printf("\tcmpq $1, %rax\n"); + printf("\tjne .L.else.%d\n", c); + gen_stmt(g, node.then_block); + printf("\tjmp .L.end.%d\n", c); + printf(".L.else.%d:\n", c); + if node.else_block != nil { + gen_stmt(g, node.else_block); + } + printf(".L.end.%d:\n", c); + return 0; + } + if node.kind == ND_GOTO { + printf("\tjmp .L.%s.%s\n", g.cur_func_name, node.label_name); + return 0; + } + if node.kind == ND_LABEL { + printf(".L.%s.%s:\n", g.cur_func_name, node.label_name); + return 0; + } + if node.kind == ND_WHILE { + c = g.label_count++; + printf(".L.while.start.%d:\n", c); + gen_expr(g, node.cond); + printf("\tcmpq $1, %rax\n"); + printf("\tjne .L.while.end.%d\n", c); + gen_stmt(g, node.then_block); + printf("\tjmp .L.while.start.%d\n", c); + printf(".L.while.end.%d:\n", c); + return 0; + } + if node.kind == ND_ASSIGN { + gen_addr(g, node.lhs); + printf("\tpush %rax\n"); + gen_expr(g, node.rhs); + printf("\tpop %rdi\n"); + gen_store(node.ty); + return 0; + } + eprintf("unreachable\n"); + exit(1); +} + +func assign_offset(g *Gen, obj *Object) i32 { + if obj == nil { + return align_to(g.offset, 16); + } + if obj.next != nil { + assign_offset(g, obj.next); + } + if obj.is_func_param { + obj.offset = g.stack_offset; + g.stack_offset = g.stack_offset + 8; + } else { + g.offset = g.offset + obj.ty.size; + obj.offset = g.offset - g.offset * 2; + } + return align_to(g.offset, 16); +} + +func check_global_objects(g *Gen, object *Object) i32 { + while object != nil { + if strcmp(object.name, "main") { + g.has_main = true; + } + object = object.next; + } + return 0; +} + +func gen(g *Gen, object *Object) i32 { + check_global_objects(g, object); + + printf(".text\n"); + + if g.has_main { + printf(".global _start\n"); + printf("_start:\n"); + printf("\tpush %rbp\n"); + printf("\tmovq %rsp, %rbp\n"); + printf("\tleaq 16(%rbp), %rax\n"); + printf("\tpush %rax\n"); + printf("\tpushq 8(%rbp)\n"); + printf("\tcallq main\n"); + printf("\tmovq %rax, %rdi\n"); + printf("\tmovq $60, %rax\n"); + printf("\tsyscall\n"); + } + + while object != nil { + if object.kind == OBJ_FUNC && !object.is_declaration { + g.cur_func_name = object.name; + + g.offset = 0; + g.stack_offset = 16; + object.stack_size = assign_offset(g, object.locals); + + printf(".global %s\n", object.name); + printf("%s:\n", object.name); + printf("\tpush %rbp\n"); + printf("\tmovq %rsp, %rbp\n"); + printf("\tsubq $%d, %rsp\n", object.stack_size); + + gen_stmt(g, object.body); + printf("\tleave\n"); + printf("\tret\n"); + } + object = object.next; + } + + return 0; +} + diff --git a/src/linux-syscall.ibu b/src/linux-syscall.ibu deleted file mode 100644 index 14e2742..0000000 --- a/src/linux-syscall.ibu +++ /dev/null @@ -1,29 +0,0 @@ - -#define SYS_READ 0 -#define SYS_WRITE 1 -#define SYS_OPEN 2 -#define SYS_CLOSE 3 -#define SYS_EXIT 60 - -func syscall(trap u64, a1 u64, a2 u64, a3 u64) i64; // src/builtin.s - -func open(file_name *u8, flags i32, mode i32) i64 { - return syscall(SYS_OPEN, file_name, flags, mode); -} - -func read(fd i32, buf *u8, size i32) i64 { - return syscall(SYS_READ, fd, buf, size); -} - -func close(fd i32) i64 { - return syscall(SYS_CLOSE, fd, 0, 0); -} - -func write(fn i32, buf *u8, size i32) i64 { - return syscall(SYS_WRITE, fn, buf, size); -} - -func exit(code i32) i64 { - return syscall(SYS_EXIT, code, 0, 0); -} - diff --git a/src/main.ibu b/src/main.ibu new file mode 100644 index 0000000..e60a0fd --- /dev/null +++ b/src/main.ibu @@ -0,0 +1,49 @@ + +#define PROGRAM_MAX_SIZE 40000 + +#include "std.ibu" +#include "tokenizer.ibu" +#include "parser.ibu" +#include "gen.ibu" +#include "preprocessor.ibu" + +func main(argc i32, argv **u8) i32 { + if argc != 2 { + printf("usage\n\tibuc .ibu\n"); + exit(0); + } + + var file_name *u8 = argv[1]; + + var fd i32; + if strcmp(file_name, "-") { + fd = STDIN; + } else { + fd = open(file_name, 0, 420); + if fd < 0 { + eprintf("\033[1m\033[31merror\033[0m: opening file %s\n", file_name); + exit(1); + } + } + + var buf *u8 = alloc(PROGRAM_MAX_SIZE); + read(fd, buf, PROGRAM_MAX_SIZE); + var file_full_path *u8 = fd_get_file_full_path(fd); + close(fd); + + var t *Tokenizer = new_tokenizer(file_name, buf); + var tokens *Token = tokenize(t); + + var preprocessor *Preprocessor = new_preprocessor(); + preprocess(tokens, preprocessor); + + var p *Parser = new_parser(buf, tokens); + parse(p); + + var g *Gen = new_gen(); + gen(g, p.globals); + + return 0; +} + + diff --git a/src/compiler.ibu b/src/parser.ibu similarity index 56% rename from src/compiler.ibu rename to src/parser.ibu index 098989b..c396a80 100644 --- a/src/compiler.ibu +++ b/src/parser.ibu @@ -1,410 +1,92 @@ -#include "src/std.ibu" - -#define PROGRAM_MAX_SIZE 60000 - -// ---------------------------------- -// Tokenizer -// ---------------------------------- - -struct Tokenizer { - file_name *u8, - cur_line *u8, - col i32, - line i32, - program *u8, -} - -// Tokens -#define TokenKind i32 -#define TK_NUM 0 -#define TK_CHAR 1 -#define TK_IDENT 2 -#define TK_STR 3 -#define TK_PUNCT 4 -#define TK_EOF 5 -#define TK_UNKOWN 6 +#define NodeKind i32 +#define ND_ADD 0 +#define ND_SUB 1 +#define ND_MUL 2 +#define ND_DIV 3 +#define ND_MOD 4 +#define ND_NOT 5 +#define ND_NE 6 +#define ND_EQ 7 +#define ND_LE 8 +#define ND_LT 9 +#define ND_GE 10 +#define ND_GT 11 +#define ND_STR 12 +#define ND_NUM 13 +#define ND_VAR 14 +#define ND_IF 15 +#define ND_WHILE 16 +#define ND_ASSIGN 17 +#define ND_RETURN 18 +#define ND_REF 19 +#define ND_DEREF 20 +#define ND_BLOCK 21 +#define ND_EXPR_STMT 22 +#define ND_GOTO 23 +#define ND_LABEL 24 +#define ND_FUNC_CALL 25 +#define ND_LOGAND 26 +#define ND_LOGOR 27 +#define ND_MEMBER_ACCESS 28 +#define ND_EMPTY 29 +#define ND_SHL 30 +#define ND_SHR 31 -struct Token; +#define TypeKind i32 +#define TY_I64 0 +#define TY_I32 1 +#define TY_I16 2 +#define TY_I8 3 +#define TY_BOOL 4 +#define TY_STRUCT 5 +#define TY_FUNC 6 +#define TY_PTR 7 +#define TY_U64 8 +#define TY_U32 9 +#define TY_U16 10 +#define TY_U8 11 +#define TY_U0 12 -struct Token { - kind TokenKind, - file_name *u8, - program *u8, - line i32, - col i32, - lit *u8, +struct StrVec { + ptr **u8, len i32, - str_val *u8, - char_val u8, - next *Token, + cap i32, } -func new_tokenizer(file_name *u8, program *u8) *Tokenizer { - var t *Tokenizer = alloc(typesize(Tokenizer)); - if t == nil { - eprintf("alloc() returned nil\n"); +func new_str_vec(cap i32) *StrVec { + var vec *StrVec = alloc(typesize(StrVec)); + vec.ptr = alloc(typesize(*u8) * cap); + if vec.ptr == nil { + eprintf("alloc returned nil\n"); exit(1); } - t.line = 1; - t.col = 0; - t.program = program; - t.cur_line = program; - t.file_name = file_name; - return t; -} - -func get_program_line_length(str *u8) i32 { - var start *u8 = str; - while (*str != '\n') && (*str != '\0') { - str++; - } - return str - start; -} - -func frepeat_str(fd i32, str *u8, n i32) i32 { - var i i32 = 0; - while i < n { - fputs(fd, str); - i++; - } - return 0; -} - -func print_error_with_code(tok *Token, msg *u8) i32 { - eprintf("\033[1m\033[31m--> %s:%d:%d: error:\033[0m\n", tok.file_name, tok.line, tok.col); - - eprintf(" | \n"); - - eprintf(" | "); - while (*tok.program != 10) && (*tok.program != 0) { - if *tok.program == 9 { - write(2, " ", 1); - } else { - write(2, tok.program, 1); - } - tok.program++; - } - eprintf("\n"); - - eprintf(" | "); - - eprintf("\033[1m\033[31m"); - frepeat_str(STDERR, " ", tok.col); - frepeat_str(STDERR, "^", tok.len); - - eprintf(" %s\033[0m\n", msg); - - eprintf(" | \n"); - - return 0; -} - -func print_error(tok *Token, msg *u8) i32 { - print_error_with_code(tok, msg); - exit(1); -} - -func is_three_c_punct(a *u8) bool { - if a[0] == '.' && a[1] == '.' && a[2] == '.' { - return true; - } - return false; -} - -func is_two_c_punct(a *u8) bool { - var puncts *u8 = "==<=>=!=++--||&&<<>>"; - var idx i32 = 0; - while idx < strlen(puncts) { - if a[0] == puncts[idx] && a[1] == puncts[idx+1] { - return true; - } - idx++; - } - return false; -} - -func tokenizer_next(t *Tokenizer) i32 { - if *t.program == '\n' { // new line - t.line++; - t.col = 0; - t.program++; - t.cur_line = t.program; - } else { - t.col++; - t.program++; - } - return 0; -} - -func tokenizer_n_next(t *Tokenizer, n i32) i32 { - var idx i32 = 0; - while idx < n { - tokenizer_next(t); - idx++; - } - return 0; + vec.len = 0; + vec.cap = cap; + return vec; } -func new_token(t *Tokenizer, kind TokenKind) *Token { - var tok *Token = alloc(typesize(Token)); - if tok == nil { - eprintf("alloc() returned nil\n"); +func str_vec_realloc(vec *StrVec) i32 { + var new_ptr *u8 = alloc(typesize(*u8) * vec.cap * 2); + if new_ptr == nil { + eprintf("alloc returned nil\n"); exit(1); } - - tok.line = t.line; - tok.col = t.col; - tok.file_name = t.file_name; - tok.kind = kind; - tok.program = t.cur_line; - - return tok; -} - -func ispunct(c u8) bool { - var punct_list *u8 = "+-<>;:{}=,()[].*#!%&/"; - - while *punct_list != nil { - if *punct_list == c { - return true; - } - punct_list++; - } - - return false; -} - -func tokenize_number(t *Tokenizer) *Token { - var tok *Token = new_token(t, TK_NUM); - - var digit_start *u8 = t.program; - while isdigit(*t.program) { - tokenizer_next(t); - } - - tok.lit = strndup(digit_start, t.program-digit_start); - tok.len = t.program-digit_start; - - return tok; -} - -func skip_single_line_comment(t *Tokenizer) i32 { - if (*t.program == '/') && (*(t.program+1) == '/') { - tokenizer_n_next(t, 2); - while (*t.program != '\n') && (*t.program != '\0') { - tokenizer_next(t); - } - } + memcpy(new_ptr, vec.ptr, (typesize(*u8) * vec.cap)); + vec.cap = vec.cap * 2; + vec.ptr = new_ptr; return 0; } -func string_end(t *Tokenizer, str *u8) *u8 { - while *str != '\"' { - if *str == '\n' || *str == '\0' { - eprintf("\033[1m\033[31m--> %s:%d:%d: error: unclosed string literal\033[0m\n", t.file_name, t.line, t.col); - exit(1); - } - if *str == '\\' { // back slash - str++; - } - str++; - } - return str; -} - -func is_hex_digit(c u8) bool { - return ('0' <= c <= '9') || ('A' <= c <= 'F') || ('a' <= c <= 'f'); -} - -func from_hex(c u8) bool { - if '0' <= c <= '9' { - return c - '0'; - } - if 'a' <= c <= 'f' { - return c - 'a' + 10; - } - return c - 'A' + 10; -} - -func read_escaped_char(t *Tokenizer) i32 { - var c i32; - tokenizer_next(t); - if '0' <= *t.program <= '7' { - c = *t.program - '0'; - if '0' <= *(t.program+1) <= '7' { - tokenizer_next(t); - c = (c << 3) + (*t.program - '0'); - if '0' <= *(t.program+1) <= '7' { - tokenizer_next(t); - c = (c << 3) + (*t.program - '0'); - } - } - return c; - } - - if *t.program == 'x' { - tokenizer_next(t); - if !is_hex_digit(*t.program) { - eprintf("\033[1m\033[31m--> %s:%d:%d: error: invalid hex escape sequence\033[0m\n", t.file_name, t.line, t.col); - exit(1); - } - - while is_hex_digit(*t.program) { - c = (c << 4) + from_hex(*t.program); - tokenizer_next(t); - } - } - - if *t.program == 'a' { - return '\a'; - } - if *t.program == 'b' { - return '\b'; - } - if *t.program == 't' { - return '\t'; - } - if *t.program == 'n' { - return '\n'; - } - if *t.program == 'v' { - return '\v'; - } - if *t.program == 'f' { - return '\f'; - } - if *t.program == 'r' { - return '\r'; - } - - return *t.program; -} - -func tokenize_char(t *Tokenizer) *Token { - var tok *Token = new_token(t, TK_CHAR); - var char_start *u8 = t.program; - tokenizer_next(t); // skip start '\'' - - var c i32; - if *t.program == '\\' { - c = read_escaped_char(t); - } else { - c = *t.program; - } - tokenizer_next(t); - tokenizer_next(t); // skip end '\'' - - tok.lit = strndup(char_start, t.program - char_start); - tok.len = t.program - char_start; - tok.char_val = c; - - return tok; -} - -func tokenize_string(t *Tokenizer) *Token { - var tok *Token = new_token(t, TK_STR); - - var string_start *u8 = t.program; - - tokenizer_next(t); // skip start `"` - - var end *u8 = string_end(t, t.program); - var buf *u8 = alloc(end - t.program + 1); - var len i32 = 0; - - while t.program < end { - if *t.program == '\\' { - buf[len++] = read_escaped_char(t); - } else { - buf[len++] = *t.program; - } - - tokenizer_next(t); - } - buf[len] = 0; // null terminator - - tokenizer_next(t); // skip end `"` - - tok.lit = strndup(string_start, t.program - string_start); - tok.len = t.program - string_start; - - tok.str_val = buf; - - return tok; -} - -func tokenize_ident(t *Tokenizer) *Token { - var tok *Token = new_token(t, TK_IDENT); - - var ident_start *u8 = t.program; - while isalpha(*t.program) || isdigit(*t.program) || *t.program == 95 { - tokenizer_next(t); - } - ident_end: - - tok.lit = strndup(ident_start, t.program-ident_start); - tok.len = t.program-ident_start; - - return tok; -} - -func tokenize(t *Tokenizer) *Token { - var head Token; - var cur *Token = &head; - - while *t.program != nil { - skip_single_line_comment(t); - - if isdigit(*t.program) { - cur = cur.next = tokenize_number(t); - } else if isalpha(*t.program) { - cur = cur.next = tokenize_ident(t); - } else if *t.program == '\'' { - cur = cur.next = tokenize_char(t); - } else if *t.program == '\"' { - cur = cur.next = tokenize_string(t); - } else if is_two_c_punct(t.program) { - cur = cur.next = new_token(t, TK_PUNCT); - cur.lit = strndup(t.program, 2); - cur.len = 2; - tokenizer_n_next(t, 2); - } else if is_three_c_punct(t.program) { // ... - cur = cur.next = new_token(t, TK_PUNCT); - cur.lit = strndup(t.program, 3); - cur.len = 3; - tokenizer_n_next(t, 3); - } else if ispunct(*t.program) { - cur = cur.next = new_token(t, TK_PUNCT); - cur.lit = strndup(t.program, 1); - cur.len = 1; - tokenizer_next(t); - } else if *t.program == ' ' { // Space - tokenizer_next(t); - } else if *t.program == '\n' { // New line - tokenizer_next(t); - } else if *t.program == '\t' { // Tab - tokenizer_next(t); - } else { - var invalid *Token = new_token(t, TK_UNKOWN); - invalid.lit = strndup(t.program, 1); - invalid.len = 1; - print_error(invalid, "unkown character found"); - } +func vec_append_str(vec *StrVec, ty *u8) i32 { + if vec.len >= vec.cap { + str_vec_realloc(vec); } - - cur = cur.next = new_token(t, TK_EOF); - cur.lit = "EOF"; - cur.len = 1; - - return head.next; + vec.ptr[vec.len] = ty; + vec.len++; + return 0; } -// ---------------------------------- -// Parser -// ---------------------------------- - -struct Member; struct Type; struct Member { @@ -495,55 +177,6 @@ func vec_append_type(vec *TypeVec, ty *Type) i32 { return 0; } -#define NodeKind i32 -#define ND_ADD 0 -#define ND_SUB 1 -#define ND_MUL 2 -#define ND_DIV 3 -#define ND_MOD 4 -#define ND_NOT 5 -#define ND_NE 6 -#define ND_EQ 7 -#define ND_LE 8 -#define ND_LT 9 -#define ND_GE 10 -#define ND_GT 11 -#define ND_STR 12 -#define ND_NUM 13 -#define ND_VAR 14 -#define ND_IF 15 -#define ND_WHILE 16 -#define ND_ASSIGN 17 -#define ND_RETURN 18 -#define ND_REF 19 -#define ND_DEREF 20 -#define ND_BLOCK 21 -#define ND_EXPR_STMT 22 -#define ND_GOTO 23 -#define ND_LABEL 24 -#define ND_FUNC_CALL 25 -#define ND_LOGAND 26 -#define ND_LOGOR 27 -#define ND_MEMBER_ACCESS 28 -#define ND_EMPTY 29 -#define ND_SHL 30 -#define ND_SHR 31 - -#define TypeKind i32 -#define TY_I64 0 -#define TY_I32 1 -#define TY_I16 2 -#define TY_I8 3 -#define TY_BOOL 4 -#define TY_STRUCT 5 -#define TY_FUNC 6 -#define TY_PTR 7 -#define TY_U64 8 -#define TY_U32 9 -#define TY_U16 10 -#define TY_U8 11 -#define TY_U0 12 - struct Type { kind TypeKind, size i32, @@ -1023,13 +656,7 @@ func check_local_object_already_exist(p *Parser, name *u8, tok *Token) i32 { if strcmp(locals.name, name) { print_error_with_code(tok, "name already exist"); if strcmp(tok.lit, "...") { - eprintf("help: by default, variable-length arguments are accessed using the built-in variable `argv`, which can be renamed as the following example\n"); - eprintf(" |\n"); - eprintf(" | // simple example of renaming `argv` to `nums`.\n"); - eprintf(" | func add_nums(nums ...) i32 {\n"); - eprintf(" | return nums[0] + nums[1] + nums[2];\n"); - eprintf(" | }\n"); - eprintf(" |\n"); + eprintf("help: by default, variable-length arguments are accessed using the built-in variable `argv` and `argc`.\n"); } exit(1); } @@ -1189,6 +816,7 @@ func parse_ty(p *Parser) *Type { else if strcmp(name, "u32") { ty = p.ty_u32; } else if strcmp(name, "u16") { ty = p.ty_u16; } else if strcmp(name, "u8") { ty = p.ty_u8; } + else if strcmp(name, "u0") { ty = p.ty_u0; } else if strcmp(name, "bool") { ty = p.ty_bool; } else if strcmp(name, "*") { ty = new_pointer_type(parse_ty(p)); } else if strcmp(name, "func") { @@ -1265,9 +893,7 @@ func parse_ident(p *Parser) *Node { parser_next(p); - //if !strcmp(p.tokens.lit, "(") { - return var_node; - //} + return var_node; } func parse_number(p *Parser) *Node { @@ -1414,9 +1040,9 @@ func parse_unary(p *Parser) *Node { parser_skip(p, ")"); if node.ty.is_variadic { - // subtract builtin params. argv etc... - if func_call_node.args.len != (node.ty.params.len-1) { - if func_call_node.args.len < (node.ty.params.len-1) { + // subtract builtin params. argv argc + if func_call_node.args.len != (node.ty.params.len-2) { + if func_call_node.args.len < (node.ty.params.len-2) { func_call_args_length_error(node.ty.params.len, func_call_node.args.len, lpar_tok, "The number of arguments does not match the function definition"); } } @@ -1566,7 +1192,7 @@ break: return node; } -func is_comparison_node(node *Node) i32 { +func is_comparison_node(node *Node) bool { if node.kind == ND_LE { return true; } @@ -1891,57 +1517,55 @@ func calc_sizof_struct_members(members *MemberVec) i32 { } func parse_struct(p *Parser) i32 { - var members *MemberVec = new_member_vec(4); - parser_skip(p, "struct"); - var name *u8 = p.tokens.lit; - var name_token *Token = p.tokens; + var name_tok *Token = p.tokens; parser_next(p); + var members *MemberVec = new_member_vec(4); + var ty *Type = alloc(typesize(Type)); ty.kind = TY_STRUCT; - ty.name = name; + ty.name = name_tok.lit; + ty.size = 0; + ty.members = members; - if strcmp(p.tokens.lit, ";") { - ty.is_declaration = true; - ty.members = members; - ty.size = 0; - parser_skip(p, ";"); + var user_defined_struct *Type = get_user_defined_type(p, name_tok.lit); + + if user_defined_struct == nil { + vec_append_type(p.user_defined_types, ty); + } - if get_user_defined_type(p, name) == nil { - vec_append_type(p.user_defined_types, ty); + if strcmp(p.tokens.lit, ";") { + if user_defined_struct == nil { + ty.is_declaration = true; } + parser_skip(p, ";"); } else { parser_skip(p, "{"); - while !strcmp(p.tokens.lit, "}") { var member_name *u8 = p.tokens.lit; parser_next(p); vec_append_member(members, new_member(member_name, parse_ty(p))); parser_skip(p, ","); } - parser_skip(p, "}"); - ty.members = members; - ty.size = calc_sizof_struct_members(members); + var struct_size i32 = calc_sizof_struct_members(members); - var user_defined_struct *Type = get_user_defined_type(p, name); if user_defined_struct == nil { - vec_append_type(p.user_defined_types, ty); + ty.size = struct_size; + ty.members = members; } else if !user_defined_struct.is_declaration { - print_error(name_token, "struct is already defined"); + print_error(name_tok, "struct is already defined"); } else { user_defined_struct.members = members; - user_defined_struct.size = ty.size; + user_defined_struct.size = struct_size; user_defined_struct.is_declaration = false; } } - - return 0; } -func parse_function_params(p *Parser, fn *Object, types *TypeVec, params *ObjectVec) bool { +func parse_function_params(p *Parser, types *TypeVec, params *ObjectVec) bool { var is_variadic bool = false; parser_skip(p, "("); @@ -1958,19 +1582,13 @@ func parse_function_params(p *Parser, fn *Object, types *TypeVec, params *Object print_error(params_name_tok, "must be at the end of the paramaters"); } is_variadic = true; + + vec_append_type(types, p.ty_i32); + vec_append_object(params, new_local_object(p, OBJ_VAR, "argc", p.ty_i32, params_name_tok, true)); + ty = new_pointer_type(p.ty_u64); vec_append_type(types, ty); - params_name = "argv"; - vec_append_object(params, new_local_object(p, OBJ_VAR, params_name, ty, params_name_tok, true)); - } else if strcmp(p.tokens.lit, "...") { - parser_skip(p, "..."); - if !strcmp(p.tokens.lit, ")") { - print_error(ty_tok, "must be at the end of the paramaters"); - } - is_variadic = true; - ty = new_pointer_type(p.ty_u64); - vec_append_type(types, ty); - vec_append_object(params, new_local_object(p, OBJ_VAR, params_name, ty, params_name_tok, true)); + vec_append_object(params, new_local_object(p, OBJ_VAR, "argv", ty, params_name_tok, true)); } else { ty = parse_ty(p); if ty.kind == TY_STRUCT { @@ -1991,8 +1609,6 @@ break: parser_skip(p, ")"); - fn.params = params; - return is_variadic; } @@ -2002,62 +1618,62 @@ func add_function_object(p *Parser, fn *Object) i32 { } func parse_func(p *Parser) i32 { - p.locals = nil; // init local variables - parser_skip(p, "func"); - var fn *Object = alloc(typesize(Object)); - fn.kind = OBJ_FUNC; + p.locals = nil; - var name *u8 = p.tokens.lit; var name_tok *Token = p.tokens; parser_next(p); - fn.name = name; - fn.is_global = true; - var types *TypeVec = new_type_vec(4); var params *ObjectVec = new_object_vec(4); + var is_variadic bool = parse_function_params(p, types, params); + var func_return_ty *Type = parse_ty(p); + var found_obj *Object = find_globals(p, name_tok.lit); - var is_variadic bool = parse_function_params(p, fn, types, params); - - if strcmp(p.tokens.lit, "{") || strcmp(p.tokens.lit, ";") { - print_error(p.tokens, "function must have a return type"); + if found_obj != nil { + if !cmp_func_params(found_obj.params, params) { + print_error(name_tok, "arguments doesn't match to prototype"); + } + if !cmp_type(func_return_ty, found_obj.ty.return_type) { + print_error(name_tok, "return type doesn't match to prototype"); + } } - var func_return_ty *Type = parse_ty(p); - var found_func *Object = find_globals(p, name); + var fn *Object = alloc(typesize(Object)); + if fn == nil { + eprintf("alloc returned nil\n"); + } - if strcmp(p.tokens.lit, ";") { // function declartion + if strcmp(p.tokens.lit, ";") { parser_skip(p, ";"); - if found_func != nil { - print_error(name_tok, "function is already declared somewhere."); + if found_obj == nil { + fn.kind = OBJ_FUNC; + fn.name = name_tok.lit; + fn.params = params; + fn.is_global = true; + fn.ty = new_func_type(types, func_return_ty, is_variadic); + fn.locals = p.locals; + fn.is_declaration = true; + add_function_object(p, fn); } - fn.ty = new_func_type(types, func_return_ty, is_variadic); - fn.locals = nil; - fn.is_declaration = true; - - add_function_object(p, fn); - } else if found_func != nil { - if !found_func.is_declaration { + } else { + if found_obj == nil { + fn.kind = OBJ_FUNC; + fn.name = name_tok.lit; + fn.params = params; + fn.is_global = true; + fn.ty = new_func_type(types, func_return_ty, is_variadic); + add_function_object(p, fn); + fn.body = parse_block(p); + fn.locals = p.locals; + } else if found_obj.is_declaration { + found_obj.is_declaration = false; + found_obj.body = parse_block(p); + found_obj.locals = p.locals; + } else { print_error(name_tok, "function is already defined somewhere"); } - if !cmp_func_params(found_func.params, fn.params) { - print_error(name_tok, "function declaration paramaters does not match to definition"); - } - if !cmp_type(func_return_ty, found_func.ty.return_type) { - print_error(name_tok, "function declaration return type does not match to definition"); - } - found_func.body = parse_block(p); - found_func.locals = p.locals; - found_func.is_declaration = false; - found_func.params = fn.params; - } else { - fn.ty = new_func_type(types, func_return_ty, is_variadic); - fn.body = parse_block(p); - fn.locals = p.locals; - fn.is_declaration = false; - add_function_object(p, fn); } } @@ -2075,690 +1691,3 @@ func parse(p *Parser) i32 { return 0; } - -// ---------------------------------- -// Asm Gen -// ---------------------------------- - -struct Gen { - label_count i32, - str_label_count i32, - cur_func_name *u8, - has_main bool, - no_deref bool, - - offset i32, - stack_offset i32, -} - -func new_gen() *Gen { - var g *Gen = alloc(typesize(Gen)); - g.no_deref = false; - - g.label_count = 0; - g.str_label_count = 0; - return g; -} - -func gen_expr(g *Gen, node *Node) i32; - -func gen_lhs_rhs(g *Gen, lhs *Node, rhs *Node) i32 { - gen_expr(g, rhs); - printf("\tpush %rax\n"); - gen_expr(g, lhs); - printf("\tpop %rdi\n"); -} - -func gen_addr(g *Gen, node *Node) i32; -func gen_addr(g *Gen, node *Node) i32 { - if node.kind == ND_MEMBER_ACCESS { - gen_addr(g, node.lhs); - printf("\taddq $%d, %rax\n", node.offset); - } else if node.kind == ND_VAR { - if node.obj.is_global { - g.no_deref = true; - printf("\tleaq %s(%rip), %rax\n", node.obj.name); - } else { - printf("\tleaq %d(%rbp), %rax\n", node.obj.offset); - } - } else if node.kind == ND_DEREF { - gen_expr(g, node.lhs); - } - return 0; -} - -func gen_store(ty *Type) i32 { - if ty.kind == TY_STRUCT { - var idx i32 = 0; - while idx < ty.size { - printf("\tmovb %d(%rax), %r8b\n", idx); - printf("\tmovb %r8b, %d(%rdi)\n", idx); - idx++; - } - return 0; - } - if ty.size == 1 { - printf("\tmovb %al, (%rdi)\n"); - } else if ty.size == 2 { - printf("\tmovw %ax, (%rdi)\n"); - } else if ty.size == 4 { - printf("\tmovl %eax, (%rdi)\n"); - } else if ty.size == 8 { - printf("\tmovq %rax, (%rdi)\n"); - } else { - eprintf("unreachable\n"); - exit(1); - } - return 0; -} - -func load_instr(ty *Type) *u8 { - if ty.is_unsigned { - "movz"; - } else { - "movs"; - } -} - -func gen_load(g *Gen, ty *Type) i32 { - var instr *u8; - - if ty.kind == TY_STRUCT { - return 0; - } - if g.no_deref { - g.no_deref = false; - return 0; - } - - if ty.is_unsigned { - instr = "movz"; - } else { - instr = "movs"; - } - - if ty.size == 8 { - printf("\tmovq (%rax), %rax\n"); - } else if ty.size == 4 { - printf("\tmovslq (%rax), %rax\n"); - } else if ty.size == 2 { - printf("\t%swl (%rax), %eax\n", instr); - } else if ty.size == 1 { - printf("\t%sbl (%rax), %eax\n", instr); - } else { - eprintf("unreachable\n"); - exit(1); - } - return 0; -} - -func gen_binop(instr_name *u8, ty *Type) i32 { - if ty.kind == TY_PTR { - printf("\t%sq %rdi, %rax\n", instr_name); - } else { - printf("\t%sl %edi, %eax\n", instr_name); - } - return 0; -} - -func gen_condition_store(ty *Type) i32 { - if ty.kind == TY_PTR { - printf("\tmovzbq %al, %rax\n"); - } else if ty.kind == TY_I64 { - printf("\tmovzbq %al, %rax\n"); - } else { - printf("\tmovzbl %al, %eax\n"); - } -} - -func func_call_args_to_stack(g *Gen, args *NodeVec, ty *Type) i32 { - if args.len == 0 { - return 0; - } - - var stack i32 = 0; - - var idx i32 = args.len - 1; - while 0 <= idx { - if ty.is_variadic && idx == (ty.params.len - 2) { - printf("\tleaq (%rsp), %rax\n"); - printf("\tpush %rax\n"); - stack = stack + 8; - } - gen_expr(g, args.ptr[idx]); - printf("\tpush %rax\n"); - stack = stack + 8; - idx--; - } - - return stack; -} - -func binop_ax_by_type_size(ty *Type) *u8 { - if ty.size == 8 { - "%rax"; - } else { - "%eax"; - } -} - -func gen_expr(g *Gen, node *Node) i32 { - var c i32 = 0; - if node.kind == ND_EMPTY { - return 0; - } - if node.kind == ND_MEMBER_ACCESS { - gen_addr(g, node); - gen_load(g, node.ty); - return 0; - } - if node.kind == ND_STR { - c = g.str_label_count++; - printf(".data\n"); - printf(".L.str.%d:\n", c); - - var str *u8 = node.str_val; - while *str != nil { - printf("\t.byte %d\n", *str); - str++; - } - printf("\t.byte 0\n"); - - printf(".text\n"); - printf("\tleaq .L.str.%d(%rip), %rax\n", c); - return 0; - } - if node.kind == ND_NUM { - printf("\tmovq $%d, %rax\n", node.int_val); - return 0; - } - if node.kind == ND_ASSIGN { - gen_addr(g, node.lhs); - printf("\tpush %rax\n"); - gen_expr(g, node.rhs); - printf("\tpop %rdi\n"); - gen_store(node.ty); - return 0; - } - if node.kind == ND_VAR { - gen_addr(g, node); - gen_load(g, node.ty); - return 0; - } - if node.kind == ND_FUNC_CALL { - var stack i32 = 0; - stack = func_call_args_to_stack(g, node.args, node.lhs.ty); - - gen_expr(g, node.lhs); - printf("\tmovq %rax, %r10\n"); - printf("\tmovq $0, %rax\n"); - - printf("\tcallq *%r10\n"); - printf("\taddq $%d, %rsp\n", stack); - - if node.ty.kind == TY_BOOL { - printf("\tmovzx %al, %eax\n"); - } else if node.ty.kind == TY_I8 { - printf("\tmovsbl %al, %eax\n"); - } else if node.ty.kind == TY_U8 { - printf("\tmovzbl %al, %eax\n"); - } else if node.ty.kind == TY_I16 { - printf("\tmovswl %ax, %eax\n"); - } else if node.ty.kind == TY_U16 { - printf("\tmovzwl %ax, %eax\n"); - } else {} - - return 0; - } - if node.kind == ND_EXPR_STMT { - gen_expr(g, node.lhs); - return 0; - } - if node.kind == ND_REF { - gen_addr(g, node.lhs); - return 0; - } - if node.kind == ND_DEREF { - gen_expr(g, node.lhs); - gen_load(g, node.ty); - return 0; - } - if node.kind == ND_NOT { - gen_expr(g, node.lhs); - printf("\tcmpq $0, %rax\n"); - printf("\tsete %al\n"); - printf("\tmovzbq %al, %rax\n"); - return 0; - } - if node.kind == ND_ADD { - gen_lhs_rhs(g, node.lhs, node.rhs); - gen_binop("add", node.ty); - return 0; - } - if node.kind == ND_SHL { - gen_lhs_rhs(g, node.lhs, node.rhs); - printf("\tmovq %rdi, %rcx\n"); - printf("\tshl %cl, %s\n", binop_ax_by_type_size(node.lhs.ty)); - return 0; - } - if node.kind == ND_SHR { - gen_lhs_rhs(g, node.lhs, node.rhs); - printf("\tmovq %rdi, %rcx\n"); - printf("\tshr %cl, %s\n", binop_ax_by_type_size(node.lhs.ty)); - return 0; - } - if node.kind == ND_SUB { - gen_lhs_rhs(g, node.lhs, node.rhs); - gen_binop("sub", node.ty); - return 0; - } - if node.kind == ND_MUL { - gen_lhs_rhs(g, node.lhs, node.rhs); - gen_binop("imul", node.ty); - return 0; - } - if node.kind == ND_DIV || node.kind == ND_MOD { - gen_lhs_rhs(g, node.lhs, node.rhs); - - if node.ty.is_unsigned { - if node.ty.size == 8 { - printf("\tmov $0, %rdx\n"); - printf("\tdivq %rdi\n"); - } else { - printf("\tmov $0, %edx\n"); - printf("\tdivl %edi\n"); - } - } else { - if node.lhs.ty.size == 8 { - printf("\tcqto\n"); - } else { - printf("\tcltd\n"); - } - if node.ty.size == 8 { - printf("\tidivq %rdi\n"); - } else { - printf("\tidivl %edi\n"); - } - } - if node.kind == ND_MOD { - printf("\tmovq %rdx, %rax\n"); - } - return 0; - } - if node.kind == ND_EQ { - gen_lhs_rhs(g, node.lhs, node.rhs); - gen_binop("cmp", node.ty); - printf("\tsete %al\n"); - gen_condition_store(node.ty); - return 0; - } - if node.kind == ND_NE { - gen_lhs_rhs(g, node.lhs, node.rhs); - gen_binop("cmp", node.ty); - printf("\tsetne %al\n"); - gen_condition_store(node.ty); - return 0; - } - if node.kind == ND_LOGAND { - c = g.label_count++; - gen_expr(g, node.lhs); - printf("\tcmpq $0, %rax\n"); - printf("\tje .L.false.%d\n", c); - gen_expr(g, node.rhs); - printf("\tcmpq $0, %rax\n"); - printf("\tje .L.false.%d\n", c); - printf("\tmovq $1, %rax\n"); - printf("\tjmp .L.end.%d\n", c); - printf(".L.false.%d:\n", c); - printf("\tmovq $0, %rax\n"); - printf(".L.end.%d:\n", c); - return 0; - } - if node.kind == ND_LOGOR { - c = g.label_count++; - gen_expr(g, node.lhs); - printf("\tcmpq $0, %rax\n"); - printf("\tjne .L.true.%d\n", c); - gen_expr(g, node.rhs); - printf("\tcmp $0, %rax\n"); - printf("\tjne .L.true.%d\n", c); - printf("\tmov $0, %rax\n"); - printf("\tjmp .L.end.%d\n", c); - printf(".L.true.%d:\n", c); - printf("\tmov $1, %rax\n"); - printf(".L.end.%d:\n", c); - return 0; - } - if node.kind == ND_GE { - gen_lhs_rhs(g, node.lhs, node.rhs); - gen_binop("cmp", node.ty); - if node.lhs.ty.is_unsigned { - printf("\tsetae %al\n"); - } else { - printf("\tsetge %al\n"); - } - gen_condition_store(node.ty); - return 0; - } - if node.kind == ND_GT { - gen_lhs_rhs(g, node.lhs, node.rhs); - gen_binop("cmp", node.ty); - if node.lhs.ty.is_unsigned { - printf("\tseta %al\n"); - } else { - printf("\tsetg %al\n"); - } - gen_condition_store(node.ty); - return 0; - } - if node.kind == ND_LE { - gen_lhs_rhs(g, node.lhs, node.rhs); - gen_binop("cmp", node.ty); - if node.lhs.ty.is_unsigned { - printf("\tsetbe %al\n"); - } else { - printf("\tsetle %al\n"); - } - gen_condition_store(node.ty); - return 0; - } - if node.kind == ND_LT { - gen_lhs_rhs(g, node.lhs, node.rhs); - gen_binop("cmp", node.ty); - if node.lhs.ty.is_unsigned { - printf("\tsetb %al\n"); - } else { - printf("\tsetl %al\n"); - } - gen_condition_store(node.ty); - return 0; - } - printf("kind: %d unreachable\n", node.kind); - exit(1); -} - -func gen_stmt(g *Gen, node *Node) i32; - -func gen_node_block(g *Gen, stmts *NodeVec) i32 { - var idx i32 = 0; - while idx < stmts.len { - gen_stmt(g, stmts.ptr[idx]); - idx++; - } - return 0; -} - -func gen_stmt(g *Gen, node *Node) i32 { - var c i32 = 0; - if node.kind == ND_EMPTY { - return 0; - } - if node.kind == ND_BLOCK { - gen_node_block(g, node.body); - return 0; - } - if node.kind == ND_EXPR_STMT { - gen_expr(g, node.lhs); - return 0; - } - if node.kind == ND_RETURN { - gen_expr(g, node.lhs); - printf("\tmovq %rbp, %rsp\n"); - printf("\tpop %rbp\n"); - printf("\tretq\n"); - return 0; - } - if node.kind == ND_IF { - c = g.label_count++; - gen_expr(g, node.cond); - printf("\tcmpq $1, %rax\n"); - printf("\tjne .L.else.%d\n", c); - gen_stmt(g, node.then_block); - printf("\tjmp .L.end.%d\n", c); - printf(".L.else.%d:\n", c); - if node.else_block != nil { - gen_stmt(g, node.else_block); - } - printf(".L.end.%d:\n", c); - return 0; - } - if node.kind == ND_GOTO { - printf("\tjmp .L.%s.%s\n", g.cur_func_name, node.label_name); - return 0; - } - if node.kind == ND_LABEL { - printf(".L.%s.%s:\n", g.cur_func_name, node.label_name); - return 0; - } - if node.kind == ND_WHILE { - c = g.label_count++; - printf(".L.while.start.%d:\n", c); - gen_expr(g, node.cond); - printf("\tcmpq $1, %rax\n"); - printf("\tjne .L.while.end.%d\n", c); - gen_stmt(g, node.then_block); - printf("\tjmp .L.while.start.%d\n", c); - printf(".L.while.end.%d:\n", c); - return 0; - } - if node.kind == ND_ASSIGN { - gen_addr(g, node.lhs); - printf("\tpush %rax\n"); - gen_expr(g, node.rhs); - printf("\tpop %rdi\n"); - gen_store(node.ty); - return 0; - } - eprintf("unreachable\n"); - exit(1); -} - -func assign_offset(g *Gen, obj *Object) i32; -func assign_offset(g *Gen, obj *Object) i32 { - if obj == nil { - return align_to(g.offset, 16); - } - if obj.next != nil { - assign_offset(g, obj.next); - } - if obj.is_func_param { - obj.offset = g.stack_offset; - g.stack_offset = g.stack_offset + 8; - } else { - g.offset = g.offset + obj.ty.size; - obj.offset = g.offset - g.offset * 2; - } - return align_to(g.offset, 16); -} - -func check_global_objects(g *Gen, object *Object) i32 { - while object != nil { - if strcmp(object.name, "main") { - g.has_main = true; - } - object = object.next; - } - return 0; -} - -func gen(g *Gen, object *Object) i32 { - check_global_objects(g, object); - - printf(".text\n"); - - if g.has_main { - printf(".global _start\n"); - printf("_start:\n"); - printf("\tpush %rbp\n"); - printf("\tmovq %rsp, %rbp\n"); - printf("\tleaq 16(%rbp), %rax\n"); - printf("\tpush %rax\n"); - printf("\tpushq 8(%rbp)\n"); - printf("\tcallq main\n"); - printf("\tmovq %rax, %rdi\n"); - printf("\tmovq $60, %rax\n"); - printf("\tsyscall\n"); - } - - while object != nil { - if object.kind == OBJ_FUNC && !object.is_declaration { - g.cur_func_name = object.name; - - g.offset = 0; - g.stack_offset = 16; - object.stack_size = assign_offset(g, object.locals); - - printf(".global %s\n", object.name); - printf("%s:\n", object.name); - printf("\tpush %rbp\n"); - printf("\tmovq %rsp, %rbp\n"); - printf("\tsubq $%d, %rsp\n", object.stack_size); - - gen_stmt(g, object.body); - printf("\tleave\n"); - printf("\tret\n"); - } - object = object.next; - } - - return 0; -} - -// ---------------------------------- -// Preprocessor -// ---------------------------------- - -struct Macro; -struct Macro { - name *u8, - tok *Token, - next *Macro, -} - -struct Preprocessor { - macros *Macro, -} - -func new_macro(name *u8, tok *Token) *Macro { - var macro *Macro = alloc(typesize(Macro)); - macro.name = name; - macro.tok = tok; - macro.next = nil; - return macro; -} - -func find_macro(name *u8, p *Preprocessor) *Macro { - var m *Macro = p.macros; - while m != nil { - if strcmp(m.name, name) { - return m; - } - m = m.next; - } - return nil; -} - -func copy_token(source *Token, dest *Token) i32 { - var tok *Token = *dest; - tok.lit = source.lit; - tok.kind = source.kind; - tok.file_name = source.file_name; - tok.line = source.line; - tok.col = source.col; - return 0; -} - -func get_eof_from_tokens(tokens *Token) *Token { - while tokens.kind != TK_EOF { - tokens = tokens.next; - } - return tokens; -} - -func preprocess(tok *Token, p *Preprocessor) i32; -func preprocess(tok *Token, p *Preprocessor) i32 { - while { - if tok.next != nil && strcmp(tok.lit, "#") && strcmp(tok.next.lit, "define") { - var macro *Macro = new_macro(tok.next.next.lit, tok.next.next.next); - macro.next = p.macros; - p.macros = macro; - *tok = *tok.next.next.next.next; - } else if tok.next != nil && strcmp(tok.lit, "#") && strcmp(tok.next.lit, "include") { - var file_name *u8 = tok.next.next.str_val; - - var fd i32 = open(file_name, 0, 420); - if fd < 0 { - eprintf("\033[1m\033[31merror\033[0m: opening file %s\n", file_name); - exit(1); - } - - var buf *u8 = alloc(PROGRAM_MAX_SIZE); - read(fd, buf, PROGRAM_MAX_SIZE); - close(fd); - - var tokens *Token = tokenize(new_tokenizer(file_name, buf)); - *get_eof_from_tokens(tokens) = *tok.next.next.next; - *tok = *tokens; - } else { - goto break; - } - } - -break: - - var m *Macro = find_macro(tok.lit, p); - if m != nil { - copy_token(m.tok, tok); - } - - if tok.next != nil { - preprocess(tok.next, p); - } - - return 0; -} - -// ---------------------------------- -// Start -// ---------------------------------- - -func main(argc i32, argv **u8) i32 { - if argc != 2 { - printf("usage\n\tibuc .ibu\n"); - exit(0); - } - - var file_name *u8 = argv[1]; - - var fd i32; - if strcmp(file_name, "-") { - fd = STDIN; - } else { - fd = open(file_name, 0, 420); - if fd < 0 { - eprintf("\033[1m\033[31merror\033[0m: opening file %s\n", file_name); - exit(1); - } - } - - var buf *u8 = alloc(PROGRAM_MAX_SIZE); - read(fd, buf, PROGRAM_MAX_SIZE); - close(fd); - - var t *Tokenizer = new_tokenizer(file_name, buf); - var tokens *Token = tokenize(t); - - var preprocessor *Preprocessor = alloc(typesize(Preprocessor)); - preprocessor.macros = nil; - preprocess(tokens, preprocessor); - - var p *Parser = new_parser(buf, tokens); - parse(p); - - var g *Gen = new_gen(); - gen(g, p.globals); - - return 0; -} - - diff --git a/src/preprocessor.ibu b/src/preprocessor.ibu new file mode 100644 index 0000000..7dddbeb --- /dev/null +++ b/src/preprocessor.ibu @@ -0,0 +1,225 @@ + +struct Macro { + name *u8, + tok *Token, + next *Macro, +} + +struct Preprocessor { + macros *Macro, + imported_names *StrVec, +} + +func new_preprocessor() *Preprocessor { + var p *Preprocessor = alloc(typesize(Preprocessor)); + p.macros = nil; + p.imported_names = new_str_vec(4); + return p; +} + +func new_macro(name *u8, tok *Token) *Macro { + var macro *Macro = alloc(typesize(Macro)); + macro.name = name; + macro.tok = tok; + macro.next = nil; + return macro; +} + +func find_macro(name *u8, p *Preprocessor) *Macro { + var m *Macro = p.macros; + while m != nil { + if strcmp(m.name, name) { + return m; + } + m = m.next; + } + return nil; +} + +func copy_token(source *Token, dest *Token) i32 { + var tok *Token = *dest; + tok.lit = source.lit; + tok.kind = source.kind; + tok.file_name = source.file_name; + tok.line = source.line; + tok.col = source.col; + return 0; +} + +func get_eof_from_tokens(tokens *Token) *Token { + while tokens.kind != TK_EOF { + tokens = tokens.next; + } + return tokens; +} + +func dirname(path *u8) *u8 { + var length i32 = strlen(path); + + if (length >= 2) && (path[0] == '.') && (path[1] == '/') { + memmove(path, path+2, length - 2); + path[length - 2] = '\0'; + } + + while (length > 0) && (path[length - 1] == '/') { + length--; + path[length] = '\0'; + } + + var last_slash *u8 = strrchr(path, '/'); + + if (last_slash == nil) { + memcpy(path, ".", 2); + } else { + if (last_slash == path) { + last_slash[1] = '\0'; + } else { + *last_slash = '\0'; + } + } + + return path; +} + +#define MAX_PATH_LENGTH 4096 + +func get_ibu_lib_path(file_name *u8) *u8 { + var ibu_exe_path *u8 = alloc(MAX_PATH_LENGTH); + if ibu_exe_path == nil { + eprintf("alloc returned nil\n"); + exit(1); + } + + var ibu_exe_path_len i32 = readlink("/proc/self/exe", ibu_exe_path, MAX_PATH_LENGTH-1); + + if ibu_exe_path_len < 0 { + eprintf("failed at reading /proc/self/exe to get ibu_exe path\n"); + exit(1); + } + ibu_exe_path[ibu_exe_path_len] = '\0'; + + var ibu_root_path *u8 = dirname(strndup(ibu_exe_path, ibu_exe_path_len)); + + var ibu_lib_path *u8 = alloc( + strlen(ibu_root_path) + + strlen("/lib/") + + strlen(file_name) + + 1 + ); + + if ibu_lib_path == nil { + eprintf("alloc returned nil\n"); + exit(1); + } + + sprintf(ibu_lib_path, "%s/lib/%s", ibu_root_path, file_name); + + return ibu_lib_path; +} + +func fd_get_file_full_path(fd i32) *u8 { + var result *u8 = alloc(MAX_PATH_LENGTH); + if result == nil { + eprintf("alloc returned nil\n"); + exit(1); + } + + var path *u8 = alloc(64); + + sprintf(path, "/proc/self/fd/%d", fd); + + var len i32 = readlink(path, result, MAX_PATH_LENGTH-1); + + if len < 0 { + eprintf("failed at reading /proc/self/fd to get exe path\n"); + return 1; + } + result[len] = '\0'; + + return result; +} + +func preprocess(tok *Token, p *Preprocessor) i32 { + var start_folder_name *u8 = strndup(tok.file_name, strlen(tok.file_name)); + dirname(start_folder_name); + + while { + if tok.next != nil && strcmp(tok.lit, "#") && strcmp(tok.next.lit, "define") { + var macro *Macro = new_macro(tok.next.next.lit, tok.next.next.next); + macro.next = p.macros; + p.macros = macro; + *tok = *tok.next.next.next.next; + } else if tok.next != nil && strcmp(tok.lit, "#") && strcmp(tok.next.lit, "include") { + var file_name_tok *Token = tok.next.next; + + if file_name_tok.kind != TK_STR { + print_error(file_name_tok, "expected token string"); + } + + var new_file_name *u8 = alloc( + strlen(start_folder_name) + + strlen("/") + + strlen(file_name_tok.str_val) + + 1 + ); + + if new_file_name == nil { + eprintf("alloc returned nil\n"); + exit(1); + } + + sprintf(new_file_name, "%s/%s", start_folder_name, file_name_tok.str_val); + + var fd i32 = open(new_file_name, 0, 420); + if fd < 0 { + fd = open(get_ibu_lib_path(file_name_tok.str_val), 0, 420); + if fd < 0 { + print_error(file_name_tok, "no such file or directory"); + } + } + + var file_full_path *u8 = fd_get_file_full_path(fd); + + var already_imported bool = false; + + var i i32 = 0; + while i < p.imported_names.len { + if strcmp(file_full_path, p.imported_names.ptr[i]) { + already_imported = true; + } + i++; + } + + if !already_imported { + vec_append_str(p.imported_names, file_full_path); + + var buf *u8 = alloc(PROGRAM_MAX_SIZE); + read(fd, buf, PROGRAM_MAX_SIZE); + close(fd); + + var tokens *Token = tokenize(new_tokenizer(new_file_name, buf)); + preprocess(tokens, p); + + *get_eof_from_tokens(tokens) = *tok.next.next.next; + *tok = *tokens; + } else { + *tok = *tok.next.next.next; + } + } else { + goto break; + } + } + +break: + + var m *Macro = find_macro(tok.lit, p); + if m != nil { + copy_token(m.tok, tok); + } + + if tok.next != nil { + preprocess(tok.next, p); + } + + return 0; +} diff --git a/src/tokenizer.ibu b/src/tokenizer.ibu new file mode 100644 index 0000000..472bd58 --- /dev/null +++ b/src/tokenizer.ibu @@ -0,0 +1,392 @@ + +struct Tokenizer { + file_name *u8, + cur_line *u8, + col i32, + line i32, + program *u8, +} + +#define TokenKind i32 +#define TK_NUM 0 +#define TK_CHAR 1 +#define TK_IDENT 2 +#define TK_STR 3 +#define TK_PUNCT 4 +#define TK_EOF 5 +#define TK_UNKOWN 6 + +struct Token { + kind TokenKind, + file_name *u8, + program *u8, + line i32, + col i32, + lit *u8, + len i32, + str_val *u8, + char_val u8, + next *Token, +} + +func get_program_line_length(str *u8) i32 { + var start *u8 = str; + while (*str != '\n') && (*str != '\0') { + str++; + } + return str - start; +} + +func frepeat_str(fd i32, str *u8, n i32) i32 { + var i i32 = 0; + while i < n { + fputs(fd, str); + i++; + } + return 0; +} + +func print_error_with_code(tok *Token, msg *u8) i32 { + eprintf("\033[1m\033[31m--> %s:%d:%d: error:\033[0m\n", tok.file_name, tok.line, tok.col); + + eprintf(" | \n"); + + eprintf(" | "); + while (*tok.program != '\n') && (*tok.program != '\0') { + if *tok.program == '\t' { + write(STDERR, " ", 1); + } else { + write(STDERR, tok.program, 1); + } + tok.program++; + } + eprintf("\n"); + + eprintf(" | "); + + eprintf("\033[1m\033[31m"); + frepeat_str(STDERR, " ", tok.col); + frepeat_str(STDERR, "^", tok.len); + + eprintf(" %s\033[0m\n", msg); + + eprintf(" | \n"); + + return 0; +} + +func print_error(tok *Token, msg *u8) i32 { + print_error_with_code(tok, msg); + exit(1); +} + +func new_tokenizer(file_name *u8, program *u8) *Tokenizer { + var t *Tokenizer = alloc(typesize(Tokenizer)); + if t == nil { + eprintf("alloc() returned nil\n"); + exit(1); + } + t.line = 1; + t.col = 0; + t.program = program; + t.cur_line = program; + t.file_name = file_name; + return t; +} + +func is_three_c_punct(a *u8) bool { + if a[0] == '.' && a[1] == '.' && a[2] == '.' { + return true; + } + return false; +} + +func is_two_c_punct(a *u8) bool { + var puncts *u8 = "==<=>=!=++--||&&<<>>"; + var idx i32 = 0; + while idx < strlen(puncts) { + if a[0] == puncts[idx] && a[1] == puncts[idx+1] { + return true; + } + idx++; + } + return false; +} + +func tokenizer_next(t *Tokenizer) i32 { + if *t.program == '\n' { // new line + t.line++; + t.col = 0; + t.program++; + t.cur_line = t.program; + } else { + t.col++; + t.program++; + } + return 0; +} + +func tokenizer_n_next(t *Tokenizer, n i32) i32 { + var idx i32 = 0; + while idx < n { + tokenizer_next(t); + idx++; + } + return 0; +} + +func new_token(t *Tokenizer, kind TokenKind) *Token { + var tok *Token = alloc(typesize(Token)); + if tok == nil { + eprintf("alloc() returned nil\n"); + exit(1); + } + + tok.line = t.line; + tok.col = t.col; + tok.file_name = t.file_name; + tok.kind = kind; + tok.program = t.cur_line; + + return tok; +} + +func ispunct(c u8) bool { + var punct_list *u8 = "+-<>;:{}=,()[].*#!%&/"; + + while *punct_list != nil { + if *punct_list == c { + return true; + } + punct_list++; + } + + return false; +} + +func tokenize_number(t *Tokenizer) *Token { + var tok *Token = new_token(t, TK_NUM); + + var digit_start *u8 = t.program; + while isdigit(*t.program) { + tokenizer_next(t); + } + + tok.lit = strndup(digit_start, t.program-digit_start); + tok.len = t.program-digit_start; + + return tok; +} + +func skip_single_line_comment(t *Tokenizer) i32 { + if (*t.program == '/') && (*(t.program+1) == '/') { + tokenizer_n_next(t, 2); + while (*t.program != '\n') && (*t.program != '\0') { + tokenizer_next(t); + } + } + return 0; +} + +func string_end(t *Tokenizer, str *u8) *u8 { + while *str != '\"' { + if *str == '\n' || *str == '\0' { + eprintf("\033[1m\033[31m--> %s:%d:%d: error: unclosed string literal\033[0m\n", t.file_name, t.line, t.col); + exit(1); + } + if *str == '\\' { // back slash + str++; + } + str++; + } + return str; +} + +func is_hex_digit(c u8) bool { + return ('0' <= c <= '9') || ('A' <= c <= 'F') || ('a' <= c <= 'f'); +} + +func from_hex(c u8) bool { + if '0' <= c <= '9' { + return c - '0'; + } + if 'a' <= c <= 'f' { + return c - 'a' + 10; + } + return c - 'A' + 10; +} + +func read_escaped_char(t *Tokenizer) i32 { + var c i32; + tokenizer_next(t); + if '0' <= *t.program <= '7' { + c = *t.program - '0'; + if '0' <= *(t.program+1) <= '7' { + tokenizer_next(t); + c = (c << 3) + (*t.program - '0'); + if '0' <= *(t.program+1) <= '7' { + tokenizer_next(t); + c = (c << 3) + (*t.program - '0'); + } + } + return c; + } + + if *t.program == 'x' { + tokenizer_next(t); + if !is_hex_digit(*t.program) { + eprintf("\033[1m\033[31m--> %s:%d:%d: error: invalid hex escape sequence\033[0m\n", t.file_name, t.line, t.col); + exit(1); + } + + while is_hex_digit(*t.program) { + c = (c << 4) + from_hex(*t.program); + tokenizer_next(t); + } + } + + if *t.program == 'a' { + return '\a'; + } + if *t.program == 'b' { + return '\b'; + } + if *t.program == 't' { + return '\t'; + } + if *t.program == 'n' { + return '\n'; + } + if *t.program == 'v' { + return '\v'; + } + if *t.program == 'f' { + return '\f'; + } + if *t.program == 'r' { + return '\r'; + } + + return *t.program; +} + +func tokenize_char(t *Tokenizer) *Token { + var tok *Token = new_token(t, TK_CHAR); + var char_start *u8 = t.program; + tokenizer_next(t); // skip start '\'' + + var c i32; + if *t.program == '\\' { + c = read_escaped_char(t); + } else { + c = *t.program; + } + tokenizer_next(t); + tokenizer_next(t); // skip end '\'' + + tok.lit = strndup(char_start, t.program - char_start); + tok.len = t.program - char_start; + tok.char_val = c; + + return tok; +} + +func tokenize_string(t *Tokenizer) *Token { + var tok *Token = new_token(t, TK_STR); + + var string_start *u8 = t.program; + + tokenizer_next(t); // skip start `"` + + var end *u8 = string_end(t, t.program); + var buf *u8 = alloc(end - t.program + 1); + var len i32 = 0; + + while t.program < end { + if *t.program == '\\' { + buf[len++] = read_escaped_char(t); + } else { + buf[len++] = *t.program; + } + + tokenizer_next(t); + } + buf[len] = 0; // null terminator + + tokenizer_next(t); // skip end `"` + + tok.lit = strndup(string_start, t.program - string_start); + tok.len = t.program - string_start; + + tok.str_val = buf; + + return tok; +} + +func tokenize_ident(t *Tokenizer) *Token { + var tok *Token = new_token(t, TK_IDENT); + + var ident_start *u8 = t.program; + while isalpha(*t.program) || isdigit(*t.program) || *t.program == 95 { + tokenizer_next(t); + } + ident_end: + + tok.lit = strndup(ident_start, t.program-ident_start); + tok.len = t.program-ident_start; + + return tok; +} + +func tokenize(t *Tokenizer) *Token { + var head Token; + var cur *Token = &head; + + while *t.program != nil { + skip_single_line_comment(t); + + if isdigit(*t.program) { + cur = cur.next = tokenize_number(t); + } else if isalpha(*t.program) { + cur = cur.next = tokenize_ident(t); + } else if *t.program == '\'' { + cur = cur.next = tokenize_char(t); + } else if *t.program == '\"' { + cur = cur.next = tokenize_string(t); + } else if is_two_c_punct(t.program) { + cur = cur.next = new_token(t, TK_PUNCT); + cur.lit = strndup(t.program, 2); + cur.len = 2; + tokenizer_n_next(t, 2); + } else if is_three_c_punct(t.program) { // ... + cur = cur.next = new_token(t, TK_PUNCT); + cur.lit = strndup(t.program, 3); + cur.len = 3; + tokenizer_n_next(t, 3); + } else if ispunct(*t.program) { + cur = cur.next = new_token(t, TK_PUNCT); + cur.lit = strndup(t.program, 1); + cur.len = 1; + tokenizer_next(t); + } else if *t.program == ' ' { // Space + tokenizer_next(t); + } else if *t.program == '\n' { // New line + tokenizer_next(t); + } else if *t.program == '\t' { // Tab + tokenizer_next(t); + } else { + var invalid *Token = new_token(t, TK_UNKOWN); + invalid.lit = strndup(t.program, 1); + invalid.len = 1; + print_error(invalid, "unkown character found"); + } + } + + cur = cur.next = new_token(t, TK_EOF); + cur.lit = "EOF"; + cur.len = 1; + + return head.next; +} + +