// File: /workspace/github_c_makefile_star2_O1/chgzm[P]minic/preprocessor.c
// Function: preprocess
Vector* preprocess(const Vector* in_vec) {
    Vector* out_vec = create_vector();
    if (define_map == NULL) {
        define_map = create_strptrmap(32);
    }

    int state = STATE_ENABLED;
    int index = 0;
    while (index < in_vec->size) {   
        Token* token = in_vec->elements[index];
        switch (state) {
        case STATE_ENABLED: {
            state = enabled_read(in_vec, &index, out_vec);
            if (state == STATE_INVALID) {
                error("Invalid token[%d]=\"%s\".\n", index, decode_token_type(token->type));
                return NULL;
            }
            break;
        }
        case STATE_DISABLED: {
            state = disabled_read(in_vec, &index, out_vec);
            if (state == STATE_INVALID) {
                error("Invalid token[%d]=\"%s\".\n", index, decode_token_type(token->type));
                return NULL;
            }
            break;
        }
        default: {
            error("Invalid state=%d\n", state);
            return NULL;
        }
        }
    }

    return out_vec;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %eax, %eax
callq 0x8b08
movq %rax, %r14
cmpq $0x0, 0x773c(%rip)      # 0xf168
jne 0x7a3f
movl $0x20, %edi
callq 0x8c93
movq %rax, 0x7729(%rip)      # 0xf168
leaq 0x4(%rsp), %rax
movl $0x0, (%rax)
xorl %r12d, %r12d
movslq 0x4(%rsp), %r15
cmpl 0x8(%rbx), %r15d
jge 0x7e03
movq (%rbx), %r13
movq (%r13,%r15,8), %rbp
cmpl $0x1, %r12d
je 0x7ac1
testl %r12d, %r12d
jne 0x7b1e
movl (%rbp), %eax
cmpl $0x2f, %eax
je 0x7b85
cmpl $0x3, %eax
jne 0x7b37
movq 0x76d9(%rip), %rdi      # 0xf168
movq 0x8(%rbp), %rsi
callq 0x8d8c
testb %al, %al
je 0x7b37
movq 0x76c1(%rip), %rdi      # 0xf168
movq 0x8(%rbp), %rsi
callq 0x8def
testq %rax, %rax
je 0x7b42
movq %r14, %rdi
movq %rax, %rsi
jmp 0x7b3d
leal 0x1(%r15), %eax
movl %eax, 0x4(%rsp)
movb $0x1, %r13b
movl $0x1, %r12d
cmpl $0x2f, (%rbp)
jne 0x7c26
movq 0x8(%rbp), %r15
movl $0x4, %edx
leaq 0x3ca6(%rip), %rdi      # 0xb792
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
je 0x7c23
movl $0x5, %edx
leaq 0x3c8f(%rip), %rdi      # 0xb797
movq %r15, %rsi
callq 0x1060
xorl %r12d, %r12d
testl %eax, %eax
setne %r12b
jmp 0x7c26
xorl %r13d, %r13d
leaq 0x3c21(%rip), %rdi      # 0xb749
movl %r12d, %esi
xorl %eax, %eax
callq 0x8a7c
jmp 0x7c26
movq %r14, %rdi
movq %rbp, %rsi
callq 0x8b3b
incl 0x4(%rsp)
xorl %r12d, %r12d
movb $0x1, %r13b
cmpl $0x2, %r12d
jne 0x7c26
movl 0x4(%rsp), %r15d
movl (%rbp), %edi
callq 0x8a51
xorl %r13d, %r13d
leaq 0x3283(%rip), %rdi      # 0xadf0
movl %r15d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8a7c
movl $0x2, %r12d
jmp 0x7c26
movq 0x8(%rbp), %r12
movl $0x6, %edx
leaq 0x3bc6(%rip), %rdi      # 0xb75b
movq %r12, %rsi
callq 0x1060
testl %eax, %eax
je 0x7c34
movl $0x7, %edx
leaq 0x3bb1(%rip), %rdi      # 0xb762
movq %r12, %rsi
callq 0x1060
testl %eax, %eax
je 0x7c6b
movl $0x5, %edx
leaq 0x3bb8(%rip), %rdi      # 0xb785
movq %r12, %rsi
callq 0x1060
testl %eax, %eax
je 0x7cdc
movl $0x6, %edx
leaq 0x3ba2(%rip), %rdi      # 0xb78b
movq %r12, %rsi
callq 0x1060
testl %eax, %eax
je 0x7d0d
movl $0x4, %edx
leaq 0x3b8d(%rip), %rdi      # 0xb792
movq %r12, %rsi
callq 0x1060
xorl %r12d, %r12d
testl %eax, %eax
sete %r12b
leal 0x1(%r15), %eax
movl %eax, 0x4(%rsp)
jmp 0x7b49
xorl %r12d, %r12d
testb %r13b, %r13b
jne 0x7a4d
jmp 0x7e00
movq %r15, %rax
incq %rax
movl %eax, 0x4(%rsp)
movq 0x8(%r13,%r15,8), %rax
leal 0x2(%r15), %ecx
movl %ecx, 0x4(%rsp)
cmpb $0x1, 0x14(%rbp)
jne 0x7cc2
movq 0x10(%r13,%r15,8), %rdx
movq 0x750b(%rip), %rdi      # 0xf168
movq 0x8(%rax), %rsi
callq 0x8ccb
jmp 0x7b42
movq %r15, %rax
incq %rax
movl %eax, 0x4(%rsp)
movq 0x8(%r13,%r15,8), %r15
movl (%r15), %edi
cmpl $0x2, %edi
je 0x7d68
cmpl $0x27, %edi
jne 0x7d42
cmpl $0x28, (%r15)
je 0x7b42
movslq 0x4(%rsp), %rcx
leaq 0x8(,%rcx,8), %rax
addq %r13, %rax
incl %ecx
movl %ecx, 0x4(%rsp)
movq (%rax), %rdx
addq $0x8, %rax
incl %ecx
cmpl $0x28, (%rdx)
jne 0x7cab
jmp 0x7b42
movq 0x749f(%rip), %rdi      # 0xf168
movq 0x8(%rax), %rsi
xorl %r12d, %r12d
xorl %edx, %edx
callq 0x8ccb
jmp 0x7b49
leaq 0x1(%r15), %rax
movl %eax, 0x4(%rsp)
movq 0x8(%r13,%r15,8), %rax
movl (%rax), %edi
cmpl $0x3, %edi
jne 0x7d42
addl $0x2, %r15d
movl %r15d, 0x4(%rsp)
movq 0x7468(%rip), %rdi      # 0xf168
movq 0x8(%rax), %rsi
callq 0x8d8c
xorb $0x1, %al
jmp 0x7d39
leal 0x1(%r15), %eax
movl %eax, 0x4(%rsp)
movq 0x8(%r13,%r15,8), %rax
movl (%rax), %edi
cmpl $0x3, %edi
jne 0x7d42
leal 0x2(%r15), %ecx
movl %ecx, 0x4(%rsp)
movq 0x7438(%rip), %rdi      # 0xf168
movq 0x8(%rax), %rsi
callq 0x8d8c
movzbl %al, %r12d
jmp 0x7b49
callq 0x8a51
leaq 0x30a2(%rip), %rdi      # 0xadf0
leaq 0x4(%rsp), %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x8a7c
movl $0x2, %r12d
jmp 0x7b49
movq 0x8(%r15), %rdi
callq 0x8a8d
testq %rax, %rax
je 0x7dcd
movq %rax, %rdi
callq 0x7e18
testq %rax, %rax
je 0x7de4
movq %rax, %rdi
callq 0x7a0c
testq %rax, %rax
je 0x7ded
movq %rax, %r15
cmpl $0x0, 0x8(%rax)
jle 0x7db7
xorl %r12d, %r12d
movq (%r15), %rax
movq (%rax,%r12,8), %rsi
movq %r14, %rdi
callq 0x8b3b
incq %r12
movslq 0x8(%r15), %rax
cmpq %rax, %r12
jl 0x7d9c
xorl %r12d, %r12d
testq %r15, %r15
sete %r12b
incl 0x4(%rsp)
addl %r12d, %r12d
jmp 0x7b49
movq 0x8(%r15), %rsi
leaq 0x3992(%rip), %rdi      # 0xb76a
xorl %eax, %eax
callq 0x8a7c
jmp 0x7d5d
leaq 0x2b9c(%rip), %rdi      # 0xa987
jmp 0x7df4
leaq 0x2ba8(%rip), %rdi      # 0xa99c
xorl %eax, %eax
callq 0x8a7c
jmp 0x7d5d
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)