// File: /workspace/github_c_makefile_star2_O3/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
subq $0x18, %rsp
movq %rdi, %r14
xorl %eax, %eax
callq 0x8738
movq %rax, %rbx
cmpq $0x0, 0x6ae5(%rip)      # 0xe168
jne 0x7696
movl $0x20, %edi
callq 0x88c7
movq %rax, 0x6ad2(%rip)      # 0xe168
movl $0x0, 0xc(%rsp)
cmpl $0x0, 0x8(%r14)
jle 0x79a1
movq %rbx, 0x10(%rsp)
xorl %eax, %eax
xorl %r13d, %r13d
movq (%r14), %rbp
movslq %r13d, %rbx
movq (%rbp,%rbx,8), %r12
testl %eax, %eax
je 0x7711
incl %r13d
movl %r13d, 0xc(%rsp)
movb $0x1, %r15b
cmpl $0x2f, (%r12)
jne 0x776c
movq 0x8(%r12), %r15
movl $0x4, %edx
leaq 0x305e(%rip), %rdi      # 0xa747
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
je 0x7769
movl $0x5, %edx
leaq 0x304b(%rip), %rdi      # 0xa74c
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
setne %r15b
jmp 0x776c
movl (%r12), %eax
cmpl $0x2f, %eax
je 0x7785
cmpl $0x3, %eax
jne 0x7754
movq 0x6a42(%rip), %rdi      # 0xe168
movq 0x8(%r12), %rsi
callq 0x89bf
testb %al, %al
je 0x7754
movq 0x6a2d(%rip), %rdi      # 0xe168
movq 0x8(%r12), %rsi
callq 0x8a1e
testq %rax, %rax
je 0x7761
movq 0x10(%rsp), %rdi
movq %rax, %rsi
jmp 0x775c
movq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x876b
incl %r13d
movl %r13d, 0xc(%rsp)
xorl %r15d, %r15d
movl %r13d, %ebx
movzbl %r15b, %eax
movl %ebx, %r13d
cmpl 0x8(%r14), %ebx
jl 0x76b3
jmp 0x799c
movq 0x8(%r12), %r15
movl $0x6, %edx
leaq 0x2f7a(%rip), %rdi      # 0xa710
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
je 0x781d
movl $0x7, %edx
leaq 0x2f69(%rip), %rdi      # 0xa717
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
je 0x7853
movl $0x5, %edx
leaq 0x2f70(%rip), %rdi      # 0xa73a
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
je 0x78c2
movl $0x6, %edx
leaq 0x2f5a(%rip), %rdi      # 0xa740
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
je 0x7967
movl $0x4, %edx
leaq 0x2f45(%rip), %rdi      # 0xa747
movq %r15, %rsi
callq 0x1060
testl %eax, %eax
sete %r15b
incl %r13d
movl %r13d, 0xc(%rsp)
jmp 0x776c
movq 0x8(%rbp,%rbx,8), %rax
leal 0x2(%r13), %ebx
movl %ebx, 0xc(%rsp)
cmpb $0x1, 0x14(%r12)
jne 0x78a8
movslq %ebx, %rcx
movq (%rbp,%rcx,8), %rdx
movq 0x6927(%rip), %rdi      # 0xe168
movq 0x8(%rax), %rsi
callq 0x88ff
addl $0x3, %r13d
jmp 0x7764
leal 0x1(%r13), %eax
movl %eax, 0xc(%rsp)
movq 0x8(%rbp,%rbx,8), %r15
movl (%r15), %edi
cmpl $0x2, %edi
je 0x78ff
cmpl $0x27, %edi
jne 0x79b3
incq %rbx
addl $0x2, %r13d
leaq 0x8(,%rbx,8), %rax
addq %rbp, %rax
movl %r13d, %ebx
movl %ebx, 0xc(%rsp)
movq (%rax), %rcx
incl %ebx
addq $0x8, %rax
cmpl $0x28, (%rcx)
jne 0x788a
movl %ebx, 0xc(%rsp)
xorl %r15d, %r15d
jmp 0x776f
movq 0x68b9(%rip), %rdi      # 0xe168
movq 0x8(%rax), %rsi
xorl %r15d, %r15d
xorl %edx, %edx
callq 0x88ff
jmp 0x776f
leal 0x1(%r13), %eax
movl %eax, 0xc(%rsp)
movq 0x8(%rbp,%rbx,8), %rax
movl (%rax), %edi
cmpl $0x3, %edi
jne 0x79b3
addl $0x2, %r13d
movl %r13d, 0xc(%rsp)
movq 0x687e(%rip), %rdi      # 0xe168
movq 0x8(%rax), %rsi
callq 0x89bf
movl %eax, %r15d
xorb $0x1, %r15b
jmp 0x776c
movq 0x8(%r15), %rdi
callq 0x86bd
testq %rax, %rax
je 0x79d0
movq %rax, %rdi
callq 0x7a20
testq %rax, %rax
je 0x79e4
movq %rax, %rdi
callq 0x7660
testq %rax, %rax
je 0x79ed
movq %rax, %r15
cmpl $0x0, 0x8(%rax)
movq 0x10(%rsp), %r12
jle 0x795e
xorl %ebx, %ebx
movq (%r15), %rax
movq (%rax,%rbx,8), %rsi
movq %r12, %rdi
callq 0x876b
incq %rbx
movslq 0x8(%r15), %rax
cmpq %rax, %rbx
jl 0x7943
addl $0x2, %r13d
jmp 0x7764
leal 0x1(%r13), %eax
movl %eax, 0xc(%rsp)
movq 0x8(%rbp,%rbx,8), %rax
movl (%rax), %edi
cmpl $0x3, %edi
jne 0x79b3
addl $0x2, %r13d
movl %r13d, 0xc(%rsp)
movq 0x67dd(%rip), %rdi      # 0xe168
movq 0x8(%rax), %rsi
callq 0x89bf
movl %eax, %r15d
jmp 0x776c
movq 0x10(%rsp), %rbx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x8681
leaq 0x2431(%rip), %rdi      # 0x9df0
leaq 0xc(%rsp), %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x86ac
jmp 0x79fb
movq 0x8(%r15), %rsi
leaq 0x2d44(%rip), %rdi      # 0xa71f
xorl %eax, %eax
callq 0x86ac
jmp 0x79fb
leaq 0x1f99(%rip), %rdi      # 0x9984
jmp 0x79f4
leaq 0x1fa5(%rip), %rdi      # 0x9999
xorl %eax, %eax
callq 0x86ac
movl 0xc(%rsp), %ebp
movl (%r12), %edi
callq 0x8681
leaq 0x23e1(%rip), %rdi      # 0x9df0
xorl %ebx, %ebx
movl %ebp, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x86ac
jmp 0x79a1
nop