// File: /workspace/github_c_makefile_star2_O2/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 %r12d, %r12d
xorl %eax, %eax
callq 0x812e
movq %rax, 0x20(%rsp)
leaq 0x1(%rbp), %rax
movq %rax, 0x28(%rsp)
movq %rbp, 0x18(%rsp)
movslq %r12d, %r13
movsbq (%rbp,%r13), %rbx
testq %rbx, %rbx
je 0x8066
callq 0x11a0
movq (%rax), %r14
movzwl (%r14,%rbx,2), %ecx
btl $0xd, %ecx
jb 0x7590
movq %rax, %r15
movq %r12, 0x10(%rsp)
movq %rbp, %rdi
addq %r13, %rdi
movzbl %bl, %r12d
movq %rbp, %rax
leal -0x21(%r12), %ebp
cmpl $0x1e, %ebp
ja 0x7598
leaq 0x3203(%rip), %rsi      # 0xa754
movslq (%rsi,%rbp,4), %rdx
addq %rsi, %rdx
addq %r13, %rax
incq %rax
jmpq *%rdx
incq %r13
xorl %r14d, %r14d
xorl %ecx, %ecx
movq 0x18(%rsp), %rbp
movb (%rax,%r14), %dl
cmpb $0x22, %dl
setne %sil
orb %cl, %sil
testb $0x1, %sil
je 0x76e6
cmpb $0x5c, %dl
sete %cl
incq %r14
jmp 0x756d
incl %r12d
jmp 0x7506
leal -0x5b(%r12), %eax
cmpl $0x22, %eax
ja 0x7663
movabsq $0x70000000f, %rdx      # imm = 0x70000000F
btq %rax, %rdx
jae 0x7663
movq %rdi, %r14
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x10c0
movq 0x18(%rsp), %rcx
movb 0x1(%rcx,%r13), %bl
incq %r13
movzbl %bl, %ecx
cmpl $0x1e, %ebp
ja 0x760b
leaq 0x31ec(%rip), %rsi      # 0xa7d0
movslq (%rsi,%rbp,4), %rdx
addq %rsi, %rdx
movq 0x18(%rsp), %rbp
movq 0x10(%rsp), %r12
jmpq *%rdx
cmpb $0x3d, %bl
jne 0x7af3
movl $0x34, (%rax)
jmp 0x7bd4
leal -0x5b(%r12), %edx
cmpl $0x3, %edx
ja 0x7635
leaq 0x3230(%rip), %rsi      # 0xa84c
movslq (%rsi,%rdx,4), %rcx
addq %rsi, %rcx
movq 0x18(%rsp), %rbp
jmpq *%rcx
movl $0x25, (%rax)
jmp 0x7bdb
cmpl $0x7b, %r12d
movq 0x18(%rsp), %rbp
je 0x7a44
cmpl $0x7c, %r12d
je 0x79fd
cmpl $0x7d, %r12d
jne 0x8011
movl $0x24, (%rax)
jmp 0x7bdb
cmpl $0x5f, %r12d
movq %rdi, 0x8(%rsp)
je 0x7a4f
movl %ecx, %eax
andl $0x400, %eax            # imm = 0x400
jne 0x7a4f
btl $0xb, %ecx
movq 0x18(%rsp), %rbp
movq 0x10(%rsp), %r12
jae 0x804a
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x10c0
movq %rax, %rbx
addq %rbp, %r13
pushq $-0x1
popq %r15
movsbq 0x1(%r13,%r15), %rax
incq %r15
testb $0x8, 0x1(%r14,%rax,2)
jne 0x76a8
addl %r15d, %r12d
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq 0x8(%rsp), %rsi
pushq $0x20
popq %rdx
callq 0x1050
movl %r15d, %eax
movb $0x0, 0x30(%rsp,%rax)
movq %r14, %rdi
callq 0x1160
movl %eax, 0x4(%rbx)
jmp 0x7733
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x10c0
movq %rax, %rbx
movl $0x2, (%rax)
movl %r14d, 0x10(%rax)
movl %r14d, %r15d
leaq 0x1(%r15), %rdi
callq 0x1100
movq %rax, %r12
movq %rax, 0x8(%rbx)
addq %rbp, %r13
movq %rax, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x1050
movb $0x0, (%r12,%r15)
movq 0x10(%rsp), %r12
addl %r14d, %r12d
addl $0x2, %r12d
movq 0x20(%rsp), %rdi
movq %rbx, %rsi
callq 0x8167
jmp 0x7506
incq %r13
movl %r13d, %r14d
xorl %ebx, %ebx
movzbl (%rax,%rbx), %ecx
cmpl $0xa, %ecx
je 0x7763
cmpl $0x20, %ecx
je 0x7763
incq %rbx
incl %r14d
jmp 0x774d
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x10c0
movq %rax, %rbp
movl $0x2f, (%rax)
movl %ebx, 0x10(%rax)
leal 0x1(%rbx), %edi
callq 0x1100
movq %rax, %r12
movq %rbp, 0x10(%rsp)
movq %rax, 0x8(%rbp)
movq %r13, %rsi
addq 0x18(%rsp), %rsi
movl %ebx, %ebp
movq %rax, %rdi
movq %rbp, %rdx
callq 0x1050
movb $0x0, (%r12,%rbp)
movq 0x18(%rsp), %rbp
movslq %r14d, %rcx
leaq (%rcx,%rbp), %rax
addq 0x28(%rsp), %rcx
pushq $-0x1
popq %rdx
movq %rdx, %rsi
movq %rcx, %rdi
incq %rdx
incq %rcx
cmpb $0x20, 0x1(%rax,%rsi)
je 0x77bc
movq (%r15), %r8
movq %rdi, %rcx
movsbq 0x1(%rax,%rsi), %rdx
incq %rsi
incq %rdi
cmpq $0x5f, %rdx
je 0x77d2
movzwl (%r8,%rdx,2), %r9d
andl $0xc00, %r9d            # imm = 0xC00
jne 0x77d2
movl %r13d, %r12d
addq %rbx, %r12
cmpb $0x20, %dl
jne 0x7807
movb (%rcx), %dl
incq %rcx
jmp 0x77fb
movzbl %dl, %eax
cmpl $0xa, %eax
movq 0x10(%rsp), %rsi
je 0x7818
movb $0x1, 0x14(%rsi)
movq 0x20(%rsp), %rdi
callq 0x8167
jmp 0x7506
movzbl 0x1(%rdi), %ebx
cmpl $0x2f, %ebx
je 0x7b2a
cmpl $0x2a, %ebx
movq 0x18(%rsp), %rbp
movq 0x10(%rsp), %r12
jne 0x7b48
addl $0x2, %r12d
addq 0x28(%rsp), %r13
movb $0x2f, %al
cmpb $0x2a, %al
jne 0x7861
cmpb $0x2f, (%r13)
je 0x7506
movb (%r13), %al
incl %r12d
incq %r13
jmp 0x7852
movq 0x18(%rsp), %rbp
movb 0x1(%rbp,%r13), %bl
addq $0x2, %r13
cmpb $0x5c, %bl
jne 0x7bfe
movzbl (%rbp,%r13), %eax
movq 0x10(%rsp), %r13
addl $0x3, %r13d
cmpl $0x27, %eax
je 0x7bfc
cmpl $0x6e, %eax
je 0x7bf8
movb $0x5c, %bl
cmpl $0x30, %eax
jne 0x7bfe
xorl %ebx, %ebx
jmp 0x7bfe
movl $0x20, (%rax)
jmp 0x7bdb
cmpl $0x3d, %ecx
je 0x7b6d
cmpl $0x2b, %ecx
jne 0x7b85
movl $0x3b, (%rax)
jmp 0x7bd4
cmpl $0x3d, %ecx
je 0x7b75
cmpl $0x3e, %ecx
jne 0x7b8d
movl $0x3a, (%rax)
jmp 0x7bd4
movl $0x22, (%rax)
jmp 0x7bdb
movl $0x21, (%rax)
jmp 0x7bdb
movl $0x30, (%rax)
jmp 0x7bdb
cmpb $0x3d, %bl
jne 0x7ae8
movl $0x3f, (%rax)
jmp 0x7bd4
cmpl $0x3d, %ecx
je 0x7b7d
cmpl $0x26, %ecx
jne 0x7b95
movl $0x38, (%rax)
jmp 0x7bd4
cmpl $0x3e, %ecx
je 0x7bce
cmpl $0x3d, %ecx
je 0x7bc6
cmpl $0x2d, %ecx
jne 0x7bf0
movl $0x3c, (%rax)
jmp 0x7bd4
movl $0x1f, (%rax)
jmp 0x7bdb
cmpb $0x2e, %bl
jne 0x7afe
cmpb $0x2e, 0x2(%r14)
jne 0x7afe
movl $0x45, (%rax)
addl $0x3, %r12d
jmp 0x7bd8
cmpb $0x3d, %bl
jne 0x7b09
movl $0x3d, (%rax)
jmp 0x7bd4
cmpl $0x3d, %ecx
je 0x7b9d
cmpl $0x3c, %ecx
jne 0x7ba5
movl $0x39, (%rax)
jmp 0x7bd4
cmpb $0x3d, %bl
jne 0x7b14
movl $0x33, (%rax)
jmp 0x7bd4
movl $0x2a, (%rax)
jmp 0x7bdb
movl $0x26, (%rax)
jmp 0x7bdb
cmpl $0x7c, %ecx
je 0x7bad
cmpl $0x3d, %ecx
movq 0x10(%rsp), %rcx
jne 0x7bbe
movl $0x44, (%rax)
addl $0x2, %ecx
movl %ecx, %r13d
jmp 0x7bdb
cmpb $0x3d, %bl
jne 0x7b1f
movl $0x43, (%rax)
jmp 0x7bb3
movl $0x1c, (%rax)
jmp 0x7bdb
movl $0x23, (%rax)
jmp 0x7bdb
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x10c0
movq %rax, (%rsp)
movl $0x3, (%rax)
movq 0x18(%rsp), %rbp
addq %rbp, %r13
xorl %r15d, %r15d
movq 0x10(%rsp), %r12
movsbq (%r13,%r15), %rax
incq %r15
cmpq $0x5f, %rax
je 0x7a74
movzwl (%r14,%rax,2), %eax
andl $0xc00, %eax            # imm = 0xC00
jne 0x7a74
leaq -0x1(%r15), %r13
movzbl %bl, %eax
addl $-0x62, %eax
cmpl $0x15, %eax
ja 0x7f91
leaq 0x2db3(%rip), %rcx      # 0xa85c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpq $0x6, %r15
jne 0x7f91
leaq 0x31b8(%rip), %rdi      # 0xac7b
movq 0x8(%rsp), %rsi
pushq $0x5
popq %rdx
callq 0x1060
testl %eax, %eax
jne 0x7f91
movq (%rsp), %r14
movl $0x14, (%r14)
jmp 0x7fc5
movl $0x1d, (%rax)
jmp 0x7bdb
movl $0x29, (%rax)
jmp 0x7bdb
movl $0x31, (%rax)
jmp 0x7bdb
movl $0x1a, (%rax)
jmp 0x7bdb
movl $0x1e, (%rax)
jmp 0x7bdb
movl $0x2c, (%rax)
jmp 0x7bdb
movq 0x10(%rsp), %r12
decl %r12d
movq 0x18(%rsp), %rbp
incl %r12d
cmpb $0xa, (%rdi)
leaq 0x1(%rdi), %rdi
jne 0x7b37
jmp 0x7506
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x10c0
leal 0x1(%r12), %r13d
cmpb $0x3d, %bl
jne 0x7b65
movl $0x3e, (%rax)
jmp 0x7bd4
movl $0x1b, (%rax)
jmp 0x7bdb
movl $0x40, (%rax)
jmp 0x7bd4
movl $0x36, (%rax)
jmp 0x7bd4
movl $0x42, (%rax)
jmp 0x7bd4
movl $0x18, (%rax)
jmp 0x7bdb
movl $0x28, (%rax)
jmp 0x7bdb
movl $0x2b, (%rax)
jmp 0x7bdb
movl $0x35, (%rax)
jmp 0x7bd4
movl $0x27, (%rax)
jmp 0x7bdb
movl $0x37, (%rax)
movq 0x10(%rsp), %r13
addl $0x2, %r13d
jmp 0x7bdb
movl $0x2e, (%rax)
jmp 0x7bdb
movl $0x41, (%rax)
jmp 0x7bd4
movl $0x32, (%rax)
addl $0x2, %r12d
movl %r12d, %r13d
movq 0x20(%rsp), %rdi
movq %rax, %rsi
callq 0x8167
movl %r13d, %r12d
jmp 0x7506
movl $0x19, (%rax)
jmp 0x7bdb
movb $0xa, %bl
jmp 0x7bfe
movb $0x27, %bl
movslq %r13d, %rax
cmpb $0x27, (%rbp,%rax)
jne 0x8023
pushq $0x1
popq %rdi
pushq $0x18
popq %rsi
callq 0x10c0
movl $0x1, (%rax)
movsbl %bl, %ecx
movl %ecx, 0x4(%rax)
incl %r13d
jmp 0x7bdb
cmpq $0x6, %r15
jne 0x7f91
leaq 0x30a5(%rip), %rdi      # 0xacde
movq 0x8(%rsp), %rsi
pushq $0x5
popq %rdx
callq 0x1060
testl %eax, %eax
jne 0x7f91
movq (%rsp), %r14
movl $0x10, (%r14)
jmp 0x7fc5
cmpq $0x4, %r15
jne 0x7f91
movq 0x8(%rsp), %rcx
movzbl 0x1(%rcx), %eax
subl $0x6f, %eax
jne 0x7f34
movzbl 0x2(%rcx), %ecx
pushq $0x72
popq %rax
subl %ecx, %eax
jmp 0x7f36
leal -0x5(%r15), %eax
cmpl $-0x2, %eax
jb 0x7f91
movq 0x8(%rsp), %rcx
movzbl 0x1(%rcx), %eax
cmpl $0x66, %eax
jne 0x7f47
movq (%rsp), %r14
movl $0xd, (%r14)
jmp 0x7fc5
cmpq $0x5, %r15
jne 0x7f91
leaq 0x2a7f(%rip), %rdi      # 0xa747
movq 0x8(%rsp), %r14
movq %r14, %rsi
pushq $0x4
popq %rbx
movq %rbx, %rdx
callq 0x1060
testl %eax, %eax
je 0x7f57
leaq 0x2fbf(%rip), %rdi      # 0xaca9
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1060
testl %eax, %eax
jne 0x7f91
movq (%rsp), %r14
movl $0xb, (%r14)
jmp 0x7fc5
leal -0x9(%r15), %eax
cmpl $-0x2, %eax
jb 0x7f91
leaq 0x2f79(%rip), %rdi      # 0xac9a
movq 0x8(%rsp), %rbx
movq %rbx, %rsi
pushq $0x6
popq %rdx
callq 0x1060
testl %eax, %eax
je 0x7f64
leaq 0x2f61(%rip), %rdi      # 0xaca1
movq %rbx, %rsi
pushq $0x7
popq %rdx
callq 0x1060
testl %eax, %eax
jne 0x7f91
movq (%rsp), %r14
movl $0x13, (%r14)
jmp 0x7fc5
cmpl $0x8, %r13d
ja 0x7f91
movl $0x130, %eax            # imm = 0x130
btl %r13d, %eax
jae 0x7f91
leaq 0x2efe(%rip), %rdi      # 0xac81
movq 0x8(%rsp), %r14
movq %r14, %rsi
pushq $0x4
popq %rbx
movq %rbx, %rdx
callq 0x1060
testl %eax, %eax
je 0x7f24
leaq 0x2ee1(%rip), %rdi      # 0xac86
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1060
testl %eax, %eax
je 0x7f7e
leaq 0x2ecc(%rip), %rdi      # 0xac8b
movq %r14, %rsi
pushq $0x5
popq %rdx
callq 0x1060
testl %eax, %eax
je 0x7fea
leaq 0x2eb8(%rip), %rdi      # 0xac91
movq %r14, %rsi
pushq $0x8
popq %rdx
callq 0x1060
testl %eax, %eax
jne 0x7f91
movq (%rsp), %r14
movl $0x15, (%r14)
jmp 0x7fc5
cmpq $0x7, %r15
jne 0x7f91
leaq 0x2ea1(%rip), %rdi      # 0xacae
movq 0x8(%rsp), %rsi
pushq $0x6
popq %rdx
callq 0x1060
testl %eax, %eax
jne 0x7f91
movq (%rsp), %r14
movl $0x16, (%r14)
jmp 0x7fc5
cmpq $0x7, %r15
jne 0x7f91
leaq 0x2e72(%rip), %rdi      # 0xacb5
movq 0x8(%rsp), %r14
movq %r14, %rsi
pushq $0x6
popq %rbx
movq %rbx, %rdx
callq 0x1060
testl %eax, %eax
je 0x7f71
leaq 0x2e57(%rip), %rdi      # 0xacbc
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1060
testl %eax, %eax
je 0x7fdd
leaq 0x2e44(%rip), %rdi      # 0xacc3
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1060
testl %eax, %eax
je 0x8004
leaq 0x2e31(%rip), %rdi      # 0xacca
movq %r14, %rsi
movq %rbx, %rdx
callq 0x1060
testl %eax, %eax
jne 0x7f91
movq (%rsp), %r14
movl $0x17, (%r14)
jmp 0x7fc5
cmpq $0x5, %r15
jne 0x7f91
leaq 0x2e0c(%rip), %rdi      # 0xacd9
movq 0x8(%rsp), %rsi
pushq $0x4
popq %rdx
callq 0x1060
testl %eax, %eax
jne 0x7f91
movq (%rsp), %r14
movl $0x6, (%r14)
jmp 0x7fc5
cmpq $0x8, %r15
jne 0x7f91
leaq 0x2dce(%rip), %rdi      # 0xacd1
movq 0x8(%rsp), %rsi
pushq $0x7
popq %rdx
callq 0x1060
testl %eax, %eax
jne 0x7f91
movq (%rsp), %r14
movl $0x5, (%r14)
jmp 0x7fc5
movq (%rsp), %r14
movl $0x7, (%r14)
jmp 0x7fc5
negl %eax
testl %eax, %eax
jne 0x7f91
movq (%rsp), %r14
movl $0xf, (%r14)
jmp 0x7fc5
subl $0x6e, %eax
jne 0x7f8b
movzbl 0x2(%rcx), %ecx
pushq $0x74
popq %rax
subl %ecx, %eax
jmp 0x7f8d
movq (%rsp), %r14
movl $0xe, (%r14)
jmp 0x7fc5
movq (%rsp), %r14
movl $0x9, (%r14)
jmp 0x7fc5
movq (%rsp), %r14
movl $0xa, (%r14)
jmp 0x7fc5
movq (%rsp), %r14
movl $0x12, (%r14)
jmp 0x7fc5
negl %eax
testl %eax, %eax
je 0x7ff7
movl %r13d, %ebx
leaq 0x1(%rbx), %rsi
pushq $0x1
popq %rdi
callq 0x10c0
movq %rax, %r13
movq (%rsp), %r14
movq %rax, 0x8(%r14)
movl %r15d, 0x10(%r14)
movq %rax, %rdi
movq 0x8(%rsp), %rsi
movq %rbx, %rdx
callq 0x1050
movb $0x0, (%r13,%rbx)
addl %r15d, %r12d
decl %r12d
movq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x8167
jmp 0x7506
movq (%rsp), %r14
movl $0x11, (%r14)
jmp 0x7fc5
movq (%rsp), %r14
movl $0xc, (%r14)
jmp 0x7fc5
movq (%rsp), %r14
movl $0x8, (%r14)
jmp 0x7fc5
movq (%rsp), %r14
movl $0x4, (%r14)
jmp 0x7fc5
leaq 0x29cf(%rip), %rdi      # 0xa9e7
movq $0x0, 0x20(%rsp)
jmp 0x8041
leaq 0x2c3c(%rip), %rdi      # 0xac66
movq $0x0, 0x20(%rsp)
xorl %eax, %eax
callq 0x80a8
leaq 0x298b(%rip), %rdi      # 0xa9cc
xorl %eax, %eax
callq 0x80a8
jmp 0x8066
leaq 0x29ae(%rip), %rdi      # 0xa9ff
movq $0x0, 0x20(%rsp)
movl %r12d, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x80a8
movq 0x20(%rsp), %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq