// File: /workspace/github_c_makefile_star2_O1/chgzm[P]minic/tokenizer.c
// Function: tokenize
Vector* tokenize(char* addr) {
    Vector* vec = create_vector();

    int pos = 0;
    const char* p = addr;
    Token* token = NULL;
    while (p[pos]) {
        if (isspace(p[pos])) {
            ++pos;
        }
        else if (is_line_comment(p, pos)) {
            while (p[pos] != '\n') {
                ++pos;
            } 
        }
        else if (is_block_comment_begin(p, pos)) {
            while (!is_block_comment_end(p, pos)) {
                ++pos;
            }
            pos += 2;
        }
        else if (p[pos] == '#') {
            token = read_directive(p, &pos);
            if (token == NULL) {
                error("Failed to read directive.\n");
                return NULL;
            }
            vector_push_back(vec, token);
        }
        else if (p[pos] == '\'') {
            token = read_character(p, &pos);
            if (token == NULL) {
                error("Failed to read character.\n");
                return NULL;
            }
            vector_push_back(vec, token);
        }
        else if (p[pos] == '"') {
            token = read_string(p, &pos);
            if (token == NULL) {
                error("Failed to read string.\n");
                return NULL;
            }
            vector_push_back(vec, token);
        }
        else if (is_symbol(p[pos])) {
            token = read_symbol(p, &pos);
            if (token == NULL) {
                error("Failed to read symbol.\n");
                return NULL;
            }
            vector_push_back(vec, token);
        }
        else if (isalpha(p[pos]) || p[pos] == '_') {
            token = read_identifier(p, &pos);
            if (token == NULL) {
                error("Failed to read identifier.\n");
                return NULL;
            }
            vector_push_back(vec, token);
        }
        else if (isdigit(p[pos])) {
            token = read_number(p, &pos);
            if (token == NULL) {
                error("Failed to read number.\n");
                return NULL;
            }
            vector_push_back(vec, token);
        }
        else {
            error("Invalid character[%d]='%c'\n", pos, p[pos]);
            return NULL;
        }
    }

    return vec;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbp
xorl %eax, %eax
callq 0x8b08
movq %rax, 0x20(%rsp)
movb (%rbp), %r15b
testb %r15b, %r15b
je 0x8a14
callq 0x11a0
movq %rax, 0x28(%rsp)
movq %rbp, %r12
xorl %ecx, %ecx
xorl %r13d, %r13d
movq %rbp, 0x8(%rsp)
movq 0x28(%rsp), %rax
movq (%rax), %rbx
movsbq %r15b, %rax
movzwl (%rbx,%rax,2), %r14d
btl $0xd, %r14d
jb 0x7f01
movq %rcx, 0x10(%rsp)
movl $0x2, %edx
movq %r12, %rdi
leaq 0x3e29(%rip), %rsi      # 0xbcb2
callq 0x1060
testl %eax, %eax
je 0x7f09
movl $0x2, %edx
movq %r12, 0x18(%rsp)
movq %r12, %rdi
leaq 0x3e0f(%rip), %rsi      # 0xbcb5
callq 0x1060
testl %eax, %eax
je 0x7f23
movzbl %r15b, %ebp
leal -0x21(%rbp), %r12d
cmpl $0x1e, %r12d
ja 0x7f52
leaq 0x38d8(%rip), %rcx      # 0xb7a0
movslq (%rcx,%r12,4), %rax
addq %rcx, %rax
jmpq *%rax
leal 0x1(%r13), %eax
movslq %eax, %r14
movq 0x8(%rsp), %rbp
addq %rbp, %r14
xorl %r15d, %r15d
xorl %eax, %eax
testb $0x1, %al
jne 0x7ef4
cmpb $0x22, (%r14,%r15)
je 0x80c1
cmpb $0x5c, (%r14,%r15)
sete %al
incq %r15
jmp 0x7ee5
incl %r13d
jmp 0x8603
movslq %r13d, %rax
decl %r13d
addq %rbp, %rax
incl %r13d
cmpb $0xa, (%rax)
leaq 0x1(%rax), %rax
jne 0x7f12
jmp 0x8603
movslq %r13d, %rbx
incl %r13d
addq %rbp, %rbx
leaq 0x3d85(%rip), %r14      # 0xbcb8
movl $0x2, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1060
incl %r13d
incq %rbx
testl %eax, %eax
jne 0x7f33
jmp 0x8603
leal -0x5b(%rbp), %eax
cmpl $0x22, %eax
ja 0x802b
movabsq $0x70000000f, %rcx      # imm = 0x70000000F
btq %rax, %rcx
jae 0x802b
movl $0x1, %edi
movl $0x18, %esi
callq 0x10c0
movslq %r13d, %rbx
movq 0x8(%rsp), %rcx
movzbl 0x1(%rcx,%rbx), %ecx
incq %rbx
cmpl $0x5a, %ebp
jg 0x7fc9
cmpl $0x1e, %r12d
ja 0x857c
leaq 0x3875(%rip), %rsi      # 0xb81c
movslq (%rsi,%r12,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
cmpl $0x3d, %ecx
movq 0x8(%rsp), %rbp
jne 0x8552
movl $0x34, (%rax)
jmp 0x85e3
cmpl $0x7a, %ebp
jg 0x7ffd
addl $-0x5b, %ebp
cmpl $0x3, %ebp
movq %rbp, %rdi
movq 0x8(%rsp), %rbp
ja 0x8578
leaq 0x38af(%rip), %rsi      # 0xb898
movslq (%rsi,%rdi,4), %rdx
addq %rsi, %rdx
jmpq *%rdx
movl $0x25, (%rax)
jmp 0x85ea
cmpl $0x7b, %ebp
movq %rbp, %rdx
movq 0x8(%rsp), %rbp
je 0x83f6
cmpl $0x7c, %edx
je 0x8420
cmpl $0x7d, %edx
jne 0x8578
movl $0x24, (%rax)
jmp 0x85ea
cmpb $0x5f, %r15b
je 0x843d
movl %r14d, %eax
andl $0x400, %eax            # imm = 0x400
jne 0x843d
btl $0xb, %r14d
movq 0x8(%rsp), %r14
jae 0x8a31
movl $0x1, %edi
movl $0x18, %esi
callq 0x10c0
movq %rax, %r15
movl $0x0, (%rax)
movq %r14, %rbp
movq 0x10(%rsp), %rdx
leaq (%r14,%rdx), %rax
xorl %r14d, %r14d
movsbq (%rax,%r14), %rcx
incq %r14
testb $0x8, 0x1(%rbx,%rcx,2)
jne 0x807a
leal (%r14,%rdx), %r13d
decl %r13d
movl $0x20, %edx
leaq 0x30(%rsp), %rbx
movq %rbx, %rdi
movq 0x18(%rsp), %rsi
callq 0x1050
decl %r14d
movb $0x0, 0x30(%rsp,%r14)
movq %rbx, %rdi
callq 0x1160
movl %eax, 0x4(%r15)
jmp 0x89eb
movl $0x1, %edi
movl $0x18, %esi
callq 0x10c0
movq %rax, %r12
movl $0x2, (%rax)
movl %r15d, 0x10(%rax)
movl %r15d, %eax
movq %rax, 0x10(%rsp)
leaq 0x1(%rax), %rdi
callq 0x1100
movq %rax, %rbx
movq %rax, 0x8(%r12)
movq %rax, %rdi
movq %r14, %rsi
movq 0x10(%rsp), %r14
movq %r14, %rdx
callq 0x1050
movb $0x0, (%rbx,%r14)
addl %r15d, %r13d
addl $0x2, %r13d
movq 0x20(%rsp), %rdi
movq %r12, %rsi
jmp 0x89f3
movslq %r13d, %rax
movq 0x8(%rsp), %rbp
movb 0x1(%rbp,%rax), %bl
addq $0x2, %rax
cmpb $0x5c, %bl
jne 0x84de
movzbl (%rbp,%rax), %eax
addl $0x3, %r13d
cmpl $0x27, %eax
je 0x862c
cmpl $0x6e, %eax
je 0x8625
cmpl $0x30, %eax
jne 0x84e1
xorl %ebx, %ebx
jmp 0x84e1
movslq %r13d, %r15
movq 0x8(%rsp), %rax
addq %r15, %rax
incq %rax
incq %r15
movl %r15d, %ebp
xorl %r12d, %r12d
movzbl (%rax,%r12), %ecx
cmpl $0xa, %ecx
je 0x8193
cmpl $0x20, %ecx
je 0x8193
incq %r12
incl %ebp
jmp 0x817d
movl $0x1, %edi
movl $0x18, %esi
callq 0x10c0
movq %rax, %r14
movl $0x2f, (%rax)
movl %r12d, 0x10(%rax)
leal 0x1(%r12), %edi
callq 0x1100
movq %rax, %rbx
movq %r14, 0x10(%rsp)
movq %rax, 0x8(%r14)
movq %r15, %rsi
movq 0x8(%rsp), %r14
addq %r14, %rsi
movl %r12d, %r13d
movq %rax, %rdi
movq %r13, %rdx
callq 0x1050
movb $0x0, (%rbx,%r13)
movslq %ebp, %rax
leaq (%r14,%rax), %rdx
movq $-0x1, %rdi
movq %rdx, %r8
movq %rdi, %rcx
movq %r8, %rsi
incq %rdi
incq %r8
cmpb $0x20, 0x1(%rdx,%rcx)
je 0x81f4
movq 0x28(%rsp), %rdx
movq (%rdx), %rdi
addq 0x8(%rsp), %rax
movq %rsi, %rdx
movsbq 0x1(%rax,%rcx), %r8
incq %rcx
incq %rsi
cmpq $0x5f, %r8
je 0x8214
movzwl (%rdi,%r8,2), %r8d
andl $0xc00, %r8d            # imm = 0xC00
jne 0x8214
movl %r15d, %r13d
addq %r12, %r13
movq 0x8(%rsp), %rbp
movzbl (%rdx), %eax
cmpl $0x20, %eax
jne 0x824f
incq %rdx
jmp 0x8242
cmpl $0xa, %eax
movq 0x10(%rsp), %rsi
je 0x8527
movb $0x1, 0x14(%rsi)
jmp 0x8527
cmpl $0x3d, %ecx
movq 0x8(%rsp), %rbp
je 0x8585
cmpl $0x3e, %ecx
jne 0x858d
movl $0x3a, (%rax)
jmp 0x85e3
cmpl $0x2e, %ecx
movq 0x8(%rsp), %rbp
jne 0x8531
movq 0x18(%rsp), %rcx
cmpb $0x2e, 0x2(%rcx)
jne 0x8531
movl $0x45, (%rax)
addl $0x3, %r13d
jmp 0x85e7
movl $0x21, (%rax)
jmp 0x857e
cmpl $0x3e, %ecx
movq 0x8(%rsp), %rbp
je 0x85dd
cmpl $0x3d, %ecx
je 0x85d5
cmpl $0x2d, %ecx
jne 0x861d
movl $0x3c, (%rax)
jmp 0x85e3
cmpl $0x3d, %ecx
movq 0x8(%rsp), %rbp
jne 0x853c
movl $0x3d, (%rax)
jmp 0x85e3
cmpl $0x3d, %ecx
movq 0x8(%rsp), %rbp
jne 0x8547
movl $0x3f, (%rax)
jmp 0x85e3
movl $0x22, (%rax)
jmp 0x857e
cmpl $0x3d, %ecx
movq 0x8(%rsp), %rbp
je 0x8595
cmpl $0x26, %ecx
jne 0x85ad
movl $0x38, (%rax)
jmp 0x85e3
cmpl $0x3d, %ecx
movq 0x8(%rsp), %rbp
je 0x859d
cmpl $0x3c, %ecx
jne 0x85b5
movl $0x39, (%rax)
jmp 0x85e3
cmpl $0x3d, %ecx
movq 0x8(%rsp), %rbp
jne 0x855d
movl $0x33, (%rax)
jmp 0x85e3
cmpl $0x3d, %ecx
movq 0x8(%rsp), %rbp
jne 0x8568
movl $0x3e, (%rax)
jmp 0x85e3
cmpl $0x3d, %ecx
movq 0x8(%rsp), %rbp
je 0x85a5
cmpl $0x2b, %ecx
jne 0x85bd
movl $0x3b, (%rax)
jmp 0x85e3
movl $0x30, (%rax)
jmp 0x857e
movl $0x2a, (%rax)
jmp 0x857e
movl $0x20, (%rax)
jmp 0x857e
movl $0x1f, (%rax)
jmp 0x857e
movl $0x26, (%rax)
jmp 0x85ea
movl $0x23, (%rax)
jmp 0x85ea
cmpl $0x3d, %ecx
jne 0x8570
movl $0x43, (%rax)
jmp 0x85e3
movl $0x1c, (%rax)
jmp 0x85ea
cmpl $0x7c, %ecx
je 0x85c5
cmpl $0x3d, %ecx
jne 0x85cd
movl $0x44, (%rax)
jmp 0x85e3
movq %rbp, %r14
movl $0x1, %edi
movl $0x18, %esi
callq 0x10c0
movq %rax, %r15
movl $0x3, (%rax)
movq 0x8(%rsp), %rax
movq %rax, %rbp
movq 0x10(%rsp), %rdx
addq %rdx, %rax
xorl %r13d, %r13d
movsbq (%rax,%r13), %rcx
incq %r13
cmpq $0x5f, %rcx
je 0x846b
movzwl (%rbx,%rcx,2), %ecx
andl $0xc00, %ecx            # imm = 0xC00
jne 0x846b
leaq -0x1(%r13), %rbx
addl $-0x62, %r14d
cmpl $0x15, %r14d
ja 0x89aa
leaq 0x340a(%rip), %rcx      # 0xb8a8
movslq (%rcx,%r14,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpq $0x6, %r13
jne 0x89aa
movl $0x5, %edx
leaq 0x3813(%rip), %rdi      # 0xbcd0
movq 0x18(%rsp), %rsi
callq 0x1060
movq 0x10(%rsp), %rdx
testl %eax, %eax
jne 0x89aa
movl $0x14, %eax
jmp 0x89a7
movl %eax, %r13d
movslq %r13d, %rax
cmpb $0x27, (%rbp,%rax)
jne 0x850e
incl %r13d
movl $0x1, %edi
movl $0x18, %esi
callq 0x10c0
movq %rax, %rsi
movl $0x1, (%rax)
movsbl %bl, %eax
movl %eax, 0x4(%rsi)
jmp 0x851e
leaq 0x37a6(%rip), %rdi      # 0xbcbb
xorl %eax, %eax
callq 0x8a7c
xorl %esi, %esi
testq %rsi, %rsi
je 0x8a28
movq 0x20(%rsp), %rdi
jmp 0x89f3
movl $0x31, (%rax)
jmp 0x85ea
movl $0x1a, (%rax)
jmp 0x85ea
movl $0x1d, (%rax)
jmp 0x85ea
movl $0x29, (%rax)
jmp 0x85ea
movl $0x1e, (%rax)
jmp 0x85ea
movl $0x1b, (%rax)
jmp 0x85ea
movl $0x2c, (%rax)
jmp 0x85ea
xorl %eax, %eax
jmp 0x85ea
xorl %eax, %eax
movq 0x8(%rsp), %rbp
jmp 0x85ea
movl $0x36, (%rax)
jmp 0x85e3
movl $0x28, (%rax)
jmp 0x85ea
movl $0x42, (%rax)
jmp 0x85e3
movl $0x35, (%rax)
jmp 0x85e3
movl $0x40, (%rax)
jmp 0x85e3
movl $0x2b, (%rax)
jmp 0x85ea
movl $0x27, (%rax)
jmp 0x85ea
movl $0x18, (%rax)
jmp 0x85ea
movl $0x37, (%rax)
jmp 0x85e3
movl $0x2e, (%rax)
jmp 0x85ea
movl $0x41, (%rax)
jmp 0x85e3
movl $0x32, (%rax)
addl $0x2, %r13d
movl %r13d, %ebx
testq %rax, %rax
je 0x89fd
movq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x8b3b
movl %ebx, %r13d
movslq %r13d, %rcx
leaq (%rcx,%rbp), %r12
movb (%rbp,%rcx), %r15b
testb %r15b, %r15b
jne 0x7e59
jmp 0x8a14
movl $0x19, (%rax)
jmp 0x85ea
movb $0xa, %bl
jmp 0x84e1
movb $0x27, %bl
jmp 0x84e1
cmpq $0x6, %r13
jne 0x89aa
movl $0x5, %edx
leaq 0x36f2(%rip), %rdi      # 0xbd3b
movq 0x18(%rsp), %rsi
callq 0x1060
movq 0x10(%rsp), %rdx
testl %eax, %eax
jne 0x89aa
movl $0x10, %eax
jmp 0x89a7
cmpq $0x4, %r13
jne 0x89aa
movl $0x3, %edx
leaq 0x3683(%rip), %rdi      # 0xbd03
movq 0x18(%rsp), %rsi
callq 0x1060
movq 0x10(%rsp), %rdx
testl %eax, %eax
jne 0x89aa
movl $0xf, %eax
jmp 0x89a7
leal -0x5(%r13), %eax
cmpl $-0x2, %eax
jb 0x89aa
movl $0x2, %edx
leaq 0x30e0(%rip), %rdi      # 0xb79a
movq 0x18(%rsp), %r14
movq %r14, %rsi
callq 0x1060
testl %eax, %eax
je 0x896c
movl $0x3, %edx
leaq 0x362c(%rip), %rdi      # 0xbd07
movq %r14, %rsi
callq 0x1060
testl %eax, %eax
movq 0x10(%rsp), %rdx
jne 0x89aa
movl $0x8, %eax
jmp 0x89a7
cmpq $0x5, %r13
jne 0x89aa
movl $0x4, %edx
leaq 0x3082(%rip), %rdi      # 0xb792
movq 0x18(%rsp), %r14
movq %r14, %rsi
callq 0x1060
testl %eax, %eax
je 0x8973
movl $0x4, %edx
leaq 0x35cd(%rip), %rdi      # 0xbcfe
movq %r14, %rsi
callq 0x1060
testl %eax, %eax
movq 0x10(%rsp), %rdx
jne 0x89aa
movl $0xb, %eax
jmp 0x89a7
leal -0x9(%r13), %eax
cmpl $-0x2, %eax
jb 0x89aa
movl $0x6, %edx
leaq 0x3586(%rip), %rdi      # 0xbcef
movq 0x18(%rsp), %r14
movq %r14, %rsi
callq 0x1060
testl %eax, %eax
je 0x897a
movl $0x7, %edx
leaq 0x356c(%rip), %rdi      # 0xbcf6
movq %r14, %rsi
callq 0x1060
testl %eax, %eax
movq 0x10(%rsp), %rdx
jne 0x89aa
movl $0x13, %eax
jmp 0x89a7
cmpl $0x8, %ebx
ja 0x89aa
movl $0x130, %eax            # imm = 0x130
btl %ebx, %eax
jae 0x89aa
movl $0x4, %edx
leaq 0x350a(%rip), %rdi      # 0xbcd6
movq 0x18(%rsp), %r14
movq %r14, %rsi
callq 0x1060
testl %eax, %eax
je 0x8965
movl $0x4, %edx
leaq 0x34ee(%rip), %rdi      # 0xbcdb
movq %r14, %rsi
callq 0x1060
testl %eax, %eax
je 0x8988
movl $0x5, %edx
leaq 0x34d7(%rip), %rdi      # 0xbce0
movq %r14, %rsi
callq 0x1060
testl %eax, %eax
je 0x8996
movl $0x8, %edx
leaq 0x34c1(%rip), %rdi      # 0xbce6
movq %r14, %rsi
callq 0x1060
testl %eax, %eax
movq 0x10(%rsp), %rdx
jne 0x89aa
movl $0x15, %eax
jmp 0x89a7
cmpq $0x7, %r13
jne 0x89aa
movl $0x6, %edx
leaq 0x34b1(%rip), %rdi      # 0xbd0b
movq 0x18(%rsp), %rsi
callq 0x1060
movq 0x10(%rsp), %rdx
testl %eax, %eax
jne 0x89aa
movl $0x16, %eax
jmp 0x89a7
cmpq $0x7, %r13
jne 0x89aa
movl $0x6, %edx
leaq 0x3481(%rip), %rdi      # 0xbd12
movq 0x18(%rsp), %r14
movq %r14, %rsi
callq 0x1060
testl %eax, %eax
je 0x8981
movl $0x6, %edx
leaq 0x3467(%rip), %rdi      # 0xbd19
movq %r14, %rsi
callq 0x1060
testl %eax, %eax
je 0x898f
movl $0x6, %edx
leaq 0x3452(%rip), %rdi      # 0xbd20
movq %r14, %rsi
callq 0x1060
testl %eax, %eax
je 0x899d
movl $0x6, %edx
leaq 0x343d(%rip), %rdi      # 0xbd27
movq %r14, %rsi
callq 0x1060
testl %eax, %eax
movq 0x10(%rsp), %rdx
jne 0x89aa
movl $0x17, %eax
jmp 0x89a7
cmpq $0x5, %r13
jne 0x89aa
movl $0x4, %edx
leaq 0x3417(%rip), %rdi      # 0xbd36
movq 0x18(%rsp), %rsi
callq 0x1060
movq 0x10(%rsp), %rdx
testl %eax, %eax
jne 0x89aa
movl $0x6, %eax
jmp 0x89a7
cmpq $0x8, %r13
jne 0x89aa
movl $0x7, %edx
leaq 0x33e3(%rip), %rdi      # 0xbd2e
movq 0x18(%rsp), %rsi
callq 0x1060
movq 0x10(%rsp), %rdx
testl %eax, %eax
jne 0x89aa
movl $0x5, %eax
jmp 0x89a7
movl $0x7, %eax
jmp 0x89a2
movl $0xd, %eax
jmp 0x89a2
movl $0xe, %eax
jmp 0x89a2
movl $0x9, %eax
jmp 0x89a2
movl $0xa, %eax
jmp 0x89a2
movl $0x12, %eax
jmp 0x89a2
movl $0x11, %eax
jmp 0x89a2
movl $0xc, %eax
jmp 0x89a2
movl $0x4, %eax
movq 0x10(%rsp), %rdx
movl %eax, (%r15)
cmpl $0x3, (%r15)
jne 0x89e5
movl %ebx, %ebx
leaq 0x1(%rbx), %rsi
movl $0x1, %edi
callq 0x10c0
movq %rax, %r14
movq %rax, 0x8(%r15)
movl %r13d, 0x10(%r15)
movq %rax, %rdi
movq 0x18(%rsp), %rsi
movq %rbx, %rdx
callq 0x1050
movq 0x10(%rsp), %rdx
movb $0x0, (%r14,%rbx)
addl %edx, %r13d
decl %r13d
movq 0x20(%rsp), %rdi
movq %r15, %rsi
callq 0x8b3b
jmp 0x8603
leaq 0x302f(%rip), %rdi      # 0xba33
movq $0x0, 0x20(%rsp)
xorl %eax, %eax
callq 0x8a7c
movq 0x20(%rsp), %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x2fe9(%rip), %rdi      # 0xba18
jmp 0x8a04
movsbl %r15b, %edx
leaq 0x300f(%rip), %rdi      # 0xba4b
movq $0x0, 0x20(%rsp)
movl %r13d, %esi
xorl %eax, %eax
callq 0x8a7c
jmp 0x8a14