// File: /workspace/github_c_makefile_star2_O3/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, %r12
xorl %ebp, %ebp
xorl %eax, %eax
callq 0x8738
movq %rax, 0x18(%rsp)
movb (%r12), %r15b
testb %r15b, %r15b
je 0x866d
callq 0x11a0
movq %rax, %r14
leaq 0x1(%r12), %rax
movq %rax, 0x28(%rsp)
movq %r12, %rsi
xorl %r13d, %r13d
movq %r12, (%rsp)
movq %r14, 0x8(%rsp)
movq (%r14), %rbx
movsbq %r15b, %rax
movzwl (%rbx,%rax,2), %eax
btl $0xd, %eax
jb 0x7abc
movzbl %r15b, %r12d
leal -0x21(%r12), %r14d
cmpl $0x1e, %r14d
ja 0x7ac5
leaq 0x2cc0(%rip), %rdx      # 0xa754
movslq (%rdx,%r14,4), %rcx
addq %rdx, %rcx
jmpq *%rcx
movslq %ebp, %r14
movq (%rsp), %rax
movb 0x1(%rax,%r14), %al
incq %r14
cmpb $0x22, %al
jne 0x7fff
xorl %r12d, %r12d
jmp 0x8021
incl %ebp
movl %ebp, %ebx
jmp 0x81a3
leal -0x5b(%r12), %ecx
cmpl $0x22, %ecx
ja 0x7b96
movabsq $0x70000000f, %rdx      # imm = 0x70000000F
btq %rcx, %rdx
jae 0x7b96
movq %rsi, %r15
movl $0x1, %edi
movl $0x18, %esi
callq 0x10c0
movslq %ebp, %rbx
movq (%rsp), %rcx
movb 0x1(%rcx,%rbx), %dl
incq %rbx
movzbl %dl, %ecx
cmpl $0x5a, %r12d
jg 0x7b3e
cmpl $0x1e, %r14d
ja 0x8637
leaq 0x2caf(%rip), %rdi      # 0xa7d0
movslq (%rdi,%r14,4), %rsi
addq %rdi, %rsi
jmpq *%rsi
cmpb $0x3d, %dl
jne 0x8095
movl $0x34, (%rax)
jmp 0x8188
cmpl $0x7a, %r12d
jg 0x7b6d
addl $-0x5b, %r12d
cmpl $0x3, %r12d
ja 0x8637
leaq 0x2cf3(%rip), %rsi      # 0xa84c
movslq (%rsi,%r12,4), %rcx
addq %rsi, %rcx
jmpq *%rcx
movl $0x25, (%rax)
jmp 0x818d
cmpl $0x7b, %r12d
je 0x7f5e
cmpl $0x7c, %r12d
je 0x7f38
cmpl $0x7d, %r12d
jne 0x8637
movl $0x24, (%rax)
jmp 0x818d
cmpb $0x5f, %r15b
movq %rsi, 0x10(%rsp)
je 0x7f69
movl %eax, %ecx
andl $0x400, %ecx            # imm = 0x400
jne 0x7f69
btl $0xb, %eax
jae 0x8650
movl $0x1, %edi
movl $0x18, %esi
callq 0x10c0
movq %rax, %rbp
movq (%rsp), %r12
leaq (%r12,%r13), %rax
xorl %r14d, %r14d
movsbq (%rax,%r14), %rcx
incq %r14
testb $0x8, 0x1(%rbx,%rcx,2)
jne 0x7bda
leal (%r14,%r13), %ebx
decl %ebx
movl $0x20, %edx
leaq 0x30(%rsp), %r15
movq %r15, %rdi
movq 0x10(%rsp), %rsi
callq 0x1050
decl %r14d
movb $0x0, 0x30(%rsp,%r14)
movq %r15, %rdi
callq 0x1160
movl %eax, 0x4(%rbp)
movq 0x18(%rsp), %rdi
movq %rbp, %rsi
jmp 0x8204
movslq %ebp, %rbx
movq (%rsp), %rax
addq %rbx, %rax
incq %rax
incq %rbx
movl %ebx, %r12d
xorl %r15d, %r15d
movzbl (%rax,%r15), %ecx
cmpl $0xa, %ecx
je 0x7c54
cmpl $0x20, %ecx
je 0x7c54
incq %r15
incl %r12d
jmp 0x7c3d
movl $0x1, %edi
movl $0x18, %esi
callq 0x10c0
movq %rax, %r14
movl $0x2f, (%rax)
movl %r15d, 0x10(%rax)
leal 0x1(%r15), %edi
callq 0x1100
movq %rax, %rbp
movq %r14, 0x10(%rsp)
movq %rax, 0x8(%r14)
movq %rbx, %rsi
movq (%rsp), %r14
addq %r14, %rsi
movl %r15d, %r13d
movq %rax, %rdi
movq %r13, %rdx
callq 0x1050
movb $0x0, (%rbp,%r13)
movslq %r12d, %rcx
movq %r14, %r12
leaq (%r14,%rcx), %rax
addq 0x28(%rsp), %rcx
movq $-0x1, %rdx
movq %rdx, %rsi
movq %rcx, %rdi
incq %rdx
incq %rcx
cmpb $0x20, 0x1(%rax,%rsi)
je 0x7cb9
movq 0x8(%rsp), %r14
movq (%r14), %r8
movq %rdi, %rcx
movsbq 0x1(%rax,%rsi), %rdx
incq %rsi
incq %rdi
cmpq $0x5f, %rdx
je 0x7cd4
movzwl (%r8,%rdx,2), %r9d
andl $0xc00, %r9d            # imm = 0xC00
jne 0x7cd4
movl %ebx, %ebx
addq %r15, %rbx
cmpb $0x20, %dl
jne 0x7d08
movb (%rcx), %dl
incq %rcx
jmp 0x7cfc
movzbl %dl, %eax
cmpl $0xa, %eax
movq 0x10(%rsp), %rsi
je 0x7d19
movb $0x1, 0x14(%rsi)
movq 0x18(%rsp), %rdi
jmp 0x819e
movzbl 0x1(%rsi), %eax
cmpl $0x2a, %eax
je 0x80c1
cmpl $0x2f, %eax
movq (%rsp), %r12
movq 0x8(%rsp), %r14
jne 0x80ed
movslq %ebp, %rax
decl %ebp
addq %r12, %rax
movl %ebp, %ebx
incl %ebx
cmpb $0xa, (%rax)
leaq 0x1(%rax), %rax
jne 0x7d4c
jmp 0x81a3
movslq %ebp, %rbx
movq (%rsp), %r12
movb 0x1(%r12,%rbx), %r14b
addq $0x2, %rbx
cmpb $0x5c, %r14b
jne 0x81d0
movzbl (%r12,%rbx), %eax
addl $0x3, %ebp
cmpl $0x27, %eax
je 0x81cb
cmpl $0x6e, %eax
je 0x81c6
movb $0x5c, %r14b
cmpl $0x30, %eax
jne 0x81ce
xorl %r14d, %r14d
jmp 0x81ce
movl $0x1f, (%rax)
jmp 0x818d
cmpl $0x3e, %ecx
je 0x8182
cmpl $0x3d, %ecx
movq 0x8(%rsp), %r14
je 0x8171
cmpl $0x2d, %ecx
movq (%rsp), %r12
jne 0x81be
movl $0x3c, (%rax)
jmp 0x8112
cmpl $0x3d, %ecx
je 0x8121
cmpl $0x3e, %ecx
movq 0x8(%rsp), %r14
jne 0x8139
movl $0x3a, (%rax)
jmp 0x8177
cmpb $0x3d, %dl
jne 0x807f
movl $0x3d, (%rax)
jmp 0x8188
movl $0x30, (%rax)
jmp 0x818d
movq (%rsp), %r12
movq 0x8(%rsp), %r14
jmp 0x8107
cmpb $0x2e, %dl
jne 0x808a
cmpb $0x2e, 0x2(%r15)
jne 0x808a
movl $0x45, (%rax)
addl $0x3, %ebp
jmp 0x818b
cmpl $0x3d, %ecx
je 0x8129
cmpl $0x26, %ecx
movq 0x8(%rsp), %r14
jne 0x8149
movl $0x38, (%rax)
jmp 0x8177
cmpl $0x3d, %ecx
je 0x8131
cmpl $0x2b, %ecx
movq 0x8(%rsp), %r14
jne 0x8151
movl $0x3b, (%rax)
jmp 0x8177
movl $0x21, (%rax)
jmp 0x818d
movl $0x20, (%rax)
jmp 0x818d
cmpb $0x3d, %dl
jne 0x80a0
movl $0x3f, (%rax)
jmp 0x8188
movl $0x22, (%rax)
jmp 0x818d
cmpb $0x3d, %dl
jne 0x80ab
movl $0x33, (%rax)
jmp 0x8188
cmpl $0x3d, %ecx
je 0x8141
cmpl $0x3c, %ecx
movq 0x8(%rsp), %r14
jne 0x8159
movl $0x39, (%rax)
jmp 0x8177
movl $0x2a, (%rax)
jmp 0x818d
movl $0x26, (%rax)
jmp 0x818d
cmpb $0x3d, %dl
movq 0x8(%rsp), %r14
jne 0x80b6
movl $0x43, (%rax)
jmp 0x8177
movl $0x1c, (%rax)
jmp 0x818d
cmpl $0x7c, %ecx
je 0x8161
cmpl $0x3d, %ecx
movq (%rsp), %r12
movq 0x8(%rsp), %r14
jne 0x8169
movl $0x44, (%rax)
jmp 0x8112
movl $0x23, (%rax)
jmp 0x818d
movl $0x1, %edi
movl $0x18, %esi
callq 0x10c0
movq %rax, %r15
movl $0x3, (%rax)
movq (%rsp), %rax
addq %r13, %rax
xorl %ebp, %ebp
movq 0x8(%rsp), %r14
movsbq (%rax,%rbp), %rcx
incq %rbp
cmpq $0x5f, %rcx
je 0x7f8f
movzwl (%rbx,%rcx,2), %ecx
andl $0xc00, %ecx            # imm = 0xC00
jne 0x7f8f
leaq -0x1(%rbp), %rbx
addl $-0x62, %r12d
cmpl $0x15, %r12d
ja 0x8596
leaq 0x289a(%rip), %rcx      # 0xa85c
movslq (%rcx,%r12,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpq $0x6, %rbp
jne 0x8596
movl $0x5, %edx
leaq 0x2c9a(%rip), %rdi      # 0xac7b
movq 0x10(%rsp), %rsi
callq 0x1060
testl %eax, %eax
jne 0x8596
movl $0x14, (%r15)
jmp 0x85ce
movq 0x28(%rsp), %rcx
addq %r14, %rcx
xorl %r12d, %r12d
cmpb $0x5c, %al
sete %dl
movb (%rcx,%r12), %al
incq %r12
cmpb $0x22, %al
setne %sil
orb %dl, %sil
jne 0x800a
movl $0x1, %edi
movl $0x18, %esi
callq 0x10c0
movq %rax, %r13
movl $0x2, (%rax)
movl %r12d, 0x10(%rax)
movl %r12d, %ebx
leaq 0x1(%rbx), %rdi
callq 0x1100
movq %rax, %r15
movq %rax, 0x8(%r13)
addq (%rsp), %r14
movq %rax, %rdi
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1050
movb $0x0, (%r15,%rbx)
leal (%r12,%rbp), %ebx
addl $0x2, %ebx
movq (%rsp), %r12
movq 0x18(%rsp), %rdi
movq %r13, %rsi
jmp 0x8204
movl $0x1a, (%rax)
jmp 0x818d
movl $0x31, (%rax)
jmp 0x818d
movl $0x29, (%rax)
jmp 0x818d
movl $0x1d, (%rax)
jmp 0x818d
movl $0x1e, (%rax)
jmp 0x818d
movl $0x2c, (%rax)
jmp 0x817c
movslq %ebp, %rax
addl $0x2, %ebp
addq 0x28(%rsp), %rax
movl %ebp, %ebx
movq (%rsp), %r12
movq 0x8(%rsp), %r14
cmpb $0x2a, -0x1(%rax)
jne 0x80e6
cmpb $0x2f, (%rax)
je 0x81a3
incl %ebx
incq %rax
jmp 0x80d7
movl $0x1, %edi
movl $0x18, %esi
callq 0x10c0
movslq %ebp, %rbx
movb 0x1(%r12,%rbx), %dl
incq %rbx
cmpb $0x3d, %dl
jne 0x8119
movl $0x3e, (%rax)
addl $0x2, %ebp
movl %ebp, %ebx
jmp 0x8196
movl $0x1b, (%rax)
jmp 0x8196
movl $0x36, (%rax)
jmp 0x8188
movl $0x42, (%rax)
jmp 0x8188
movl $0x40, (%rax)
jmp 0x8188
movl $0x28, (%rax)
jmp 0x817c
movl $0x35, (%rax)
jmp 0x8188
movl $0x2b, (%rax)
jmp 0x817c
movl $0x18, (%rax)
jmp 0x817c
movl $0x27, (%rax)
jmp 0x817c
movl $0x37, (%rax)
jmp 0x8188
movl $0x2e, (%rax)
jmp 0x8196
movl $0x41, (%rax)
addl $0x2, %ebp
movl %ebp, %ebx
movq (%rsp), %r12
jmp 0x8196
movl $0x32, (%rax)
addl $0x2, %ebp
movl %ebp, %ebx
movq (%rsp), %r12
movq 0x8(%rsp), %r14
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x876b
movslq %ebx, %r13
leaq (%r12,%r13), %rsi
movb (%r12,%r13), %r15b
movl %ebx, %ebp
testb %r15b, %r15b
jne 0x7a6d
jmp 0x866d
movl $0x19, (%rax)
jmp 0x8196
movb $0xa, %r14b
jmp 0x81ce
movb $0x27, %r14b
movl %ebp, %ebx
movslq %ebx, %rax
cmpb $0x27, (%r12,%rax)
jne 0x8617
movl $0x1, %edi
movl $0x18, %esi
callq 0x10c0
movl $0x1, (%rax)
movsbl %r14b, %ecx
movl %ecx, 0x4(%rax)
incl %ebx
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x876b
movq 0x8(%rsp), %r14
jmp 0x81a3
cmpq $0x6, %rbp
jne 0x8596
movl $0x5, %edx
leaq 0x2ab8(%rip), %rdi      # 0xacde
movq 0x10(%rsp), %rsi
callq 0x1060
testl %eax, %eax
jne 0x8596
movl $0x10, (%r15)
jmp 0x85ce
cmpq $0x4, %rbp
jne 0x8596
movq 0x10(%rsp), %rcx
movzbl 0x1(%rcx), %eax
subl $0x6f, %eax
jne 0x8536
movzbl 0x2(%rcx), %ecx
movl $0x72, %eax
subl %ecx, %eax
jmp 0x8538
leal -0x5(%rbp), %eax
cmpl $-0x2, %eax
jb 0x8596
movq 0x10(%rsp), %rcx
movzbl 0x1(%rcx), %eax
cmpl $0x66, %eax
jne 0x8548
movl $0xd, (%r15)
jmp 0x85ce
cmpq $0x5, %rbp
jne 0x8596
movq %r15, %r12
movl $0x4, %edx
leaq 0x2494(%rip), %rdi      # 0xa747
movq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
je 0x855a
movl $0x4, %edx
leaq 0x29d5(%rip), %rdi      # 0xaca9
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
movq %r12, %r15
jne 0x8596
movl $0xb, (%r15)
jmp 0x85ce
leal -0x9(%rbp), %eax
cmpl $-0x2, %eax
jb 0x8596
movq %r15, %r12
movl $0x6, %edx
leaq 0x298c(%rip), %rdi      # 0xac9a
movq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
je 0x8567
movl $0x7, %edx
leaq 0x2972(%rip), %rdi      # 0xaca1
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
movq %r12, %r15
jne 0x8596
movl $0x13, (%r15)
jmp 0x85ce
cmpl $0x8, %ebx
ja 0x8596
movl $0x130, %eax            # imm = 0x130
btl %ebx, %eax
jae 0x8596
movq %r15, 0x20(%rsp)
movl $0x4, %edx
leaq 0x290b(%rip), %rdi      # 0xac81
movq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
je 0x8525
movl $0x4, %edx
leaq 0x28ef(%rip), %rdi      # 0xac86
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
movq (%rsp), %r12
je 0x8582
movl $0x5, %edx
leaq 0x28d4(%rip), %rdi      # 0xac8b
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
je 0x85f2
movl $0x8, %edx
leaq 0x28be(%rip), %rdi      # 0xac91
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
movq 0x20(%rsp), %r15
jne 0x8596
movl $0x15, (%r15)
jmp 0x85ce
cmpq $0x7, %rbp
jne 0x8596
movl $0x6, %edx
leaq 0x28a4(%rip), %rdi      # 0xacae
movq 0x10(%rsp), %rsi
callq 0x1060
testl %eax, %eax
jne 0x8596
movl $0x16, (%r15)
jmp 0x85ce
cmpq $0x7, %rbp
jne 0x8596
movq %r15, 0x20(%rsp)
movl $0x6, %edx
leaq 0x2872(%rip), %rdi      # 0xacb5
movq 0x10(%rsp), %r15
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
je 0x8574
movl $0x6, %edx
leaq 0x2858(%rip), %rdi      # 0xacbc
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
movq (%rsp), %r12
je 0x85e4
movl $0x6, %edx
leaq 0x283f(%rip), %rdi      # 0xacc3
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
je 0x8609
movl $0x6, %edx
leaq 0x282a(%rip), %rdi      # 0xacca
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
movq 0x20(%rsp), %r15
jne 0x8596
movl $0x17, (%r15)
jmp 0x85ce
cmpq $0x5, %rbp
jne 0x8596
movl $0x4, %edx
leaq 0x2802(%rip), %rdi      # 0xacd9
movq 0x10(%rsp), %rsi
callq 0x1060
testl %eax, %eax
jne 0x8596
movl $0x6, (%r15)
jmp 0x85ce
cmpq $0x8, %rbp
jne 0x8596
movl $0x7, %edx
leaq 0x27c6(%rip), %rdi      # 0xacd1
movq 0x10(%rsp), %rsi
callq 0x1060
testl %eax, %eax
jne 0x8596
movl $0x5, (%r15)
jmp 0x85ce
movq 0x20(%rsp), %r15
movl $0x7, (%r15)
jmp 0x85ce
negl %eax
testl %eax, %eax
jne 0x8596
movl $0xf, (%r15)
jmp 0x85ce
subl $0x6e, %eax
jne 0x8590
movzbl 0x2(%rcx), %ecx
movl $0x74, %eax
subl %ecx, %eax
jmp 0x8592
movq %r12, %r15
movl $0xe, (%r12)
jmp 0x85ce
movq %r12, %r15
movl $0x9, (%r12)
jmp 0x85ce
movq 0x20(%rsp), %r15
movl $0xa, (%r15)
jmp 0x85ce
movq 0x20(%rsp), %r15
movl $0x12, (%r15)
jmp 0x85d2
negl %eax
testl %eax, %eax
je 0x8600
movl %ebx, %ebx
leaq 0x1(%rbx), %rsi
movl $0x1, %edi
callq 0x10c0
movq %r15, %r12
movq %rax, %r15
movq %rax, 0x8(%r12)
movl %ebp, 0x10(%r12)
movq %rax, %rdi
movq 0x10(%rsp), %rsi
movq %rbx, %rdx
callq 0x1050
movb $0x0, (%r15,%rbx)
movq %r12, %r15
movq (%rsp), %r12
leal -0x1(%r13,%rbp), %ebx
movq 0x18(%rsp), %rdi
movq %r15, %rsi
jmp 0x819e
movq 0x20(%rsp), %r15
movl $0x11, (%r15)
jmp 0x85d2
movq 0x20(%rsp), %r15
movl $0xc, (%r15)
jmp 0x85d2
movl $0x8, (%r15)
jmp 0x85ce
movq 0x20(%rsp), %r15
movl $0x4, (%r15)
jmp 0x85d2
leaq 0x2648(%rip), %rdi      # 0xac66
movq $0x0, 0x18(%rsp)
xorl %eax, %eax
callq 0x86ac
leaq 0x2397(%rip), %rdi      # 0xa9cc
jmp 0x8647
leaq 0x23a9(%rip), %rdi      # 0xa9e7
movq $0x0, 0x18(%rsp)
xorl %eax, %eax
callq 0x86ac
jmp 0x866d
movsbl %r15b, %edx
leaq 0x23a4(%rip), %rdi      # 0xa9ff
movq $0x0, 0x18(%rsp)
movl %ebp, %esi
xorl %eax, %eax
callq 0x86ac
movq 0x18(%rsp), %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq