// File: /workspace/github_c_makefile_star2_O2/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 %ebp, %ebp
xorl %eax, %eax
callq 0x812e
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x6ff5(%rip)      # 0xe168
jne 0x7184
pushq $0x20
popq %rdi
callq 0x82e4
movq %rax, 0x6fe4(%rip)      # 0xe168
andl $0x0, 0xc(%rsp)
xorl %eax, %eax
cmpl 0x8(%r14), %ebp
jge 0x74c1
movq (%r14), %r15
movslq %ebp, %rbx
movq (%r15,%rbx,8), %r12
testl %eax, %eax
je 0x71ec
incl %ebp
movl %ebp, 0xc(%rsp)
movb $0x1, %r13b
cmpl $0x2f, (%r12)
jne 0x7245
movq 0x8(%r12), %r12
leaq 0x3584(%rip), %rdi      # 0xa747
movq %r12, %rsi
pushq $0x4
popq %rdx
callq 0x1060
testl %eax, %eax
je 0x7242
leaq 0x3573(%rip), %rdi      # 0xa74c
movq %r12, %rsi
pushq $0x5
popq %rdx
callq 0x1060
testl %eax, %eax
setne %r13b
jmp 0x7245
movl (%r12), %eax
cmpl $0x2f, %eax
je 0x7252
cmpl $0x3, %eax
jne 0x722f
movq 0x6f67(%rip), %rdi      # 0xe168
movq 0x8(%r12), %rsi
callq 0x83c5
testb %al, %al
je 0x722f
movq 0x6f52(%rip), %rdi      # 0xe168
movq 0x8(%r12), %rsi
callq 0x8412
testq %rax, %rax
je 0x723c
movq 0x10(%rsp), %rdi
movq %rax, %rsi
jmp 0x7237
movq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x8167
incl %ebp
movl %ebp, 0xc(%rsp)
xorl %r13d, %r13d
movl %ebp, %ebx
movzbl %r13b, %eax
movl %ebx, %ebp
jmp 0x718b
movq 0x8(%r12), %r13
leaq 0x34b2(%rip), %rdi      # 0xa710
movq %r13, %rsi
pushq $0x6
popq %rdx
callq 0x1060
testl %eax, %eax
je 0x72de
leaq 0x34a3(%rip), %rdi      # 0xa717
movq %r13, %rsi
pushq $0x7
popq %rdx
callq 0x1060
testl %eax, %eax
je 0x7311
leaq 0x34ac(%rip), %rdi      # 0xa73a
movq %r13, %rsi
pushq $0x5
popq %rdx
callq 0x1060
testl %eax, %eax
je 0x7377
leaq 0x3498(%rip), %rdi      # 0xa740
movq %r13, %rsi
pushq $0x6
popq %rdx
callq 0x1060
testl %eax, %eax
je 0x741e
leaq 0x3485(%rip), %rdi      # 0xa747
movq %r13, %rsi
pushq $0x4
popq %rdx
callq 0x1060
testl %eax, %eax
sete %r13b
incl %ebp
movl %ebp, 0xc(%rsp)
jmp 0x7245
movq 0x8(%r15,%rbx,8), %rax
leal 0x2(%rbp), %ebx
movl %ebx, 0xc(%rsp)
cmpb $0x1, 0x14(%r12)
jne 0x735d
movslq %ebx, %rcx
movq (%r15,%rcx,8), %rdx
movq 0x6e68(%rip), %rdi      # 0xe168
movq 0x8(%rax), %rsi
callq 0x8315
addl $0x3, %ebp
jmp 0x723e
leal 0x1(%rbp), %eax
movl %eax, 0xc(%rsp)
movq 0x8(%r15,%rbx,8), %r13
movl (%r13), %edi
cmpl $0x2, %edi
je 0x73b1
cmpl $0x27, %edi
jne 0x7450
addl $0x2, %ebp
leaq (%r15,%rbx,8), %rax
addq $0x10, %rax
movl %ebp, %ebx
pushq $0x27
popq %rcx
cmpl $0x28, %ecx
je 0x740a
movl %ebx, 0xc(%rsp)
movq (%rax), %rcx
movl (%rcx), %ecx
incl %ebx
addq $0x8, %rax
jmp 0x7343
movq 0x6e04(%rip), %rdi      # 0xe168
movq 0x8(%rax), %rsi
xorl %r13d, %r13d
xorl %edx, %edx
callq 0x8315
jmp 0x7247
leal 0x1(%rbp), %eax
movl %eax, 0xc(%rsp)
movq 0x8(%r15,%rbx,8), %rax
movl (%rax), %edi
cmpl $0x3, %edi
jne 0x7450
addl $0x2, %ebp
movl %ebp, 0xc(%rsp)
movq 0x6dcc(%rip), %rdi      # 0xe168
movq 0x8(%rax), %rsi
callq 0x83c5
movl %eax, %r13d
xorb $0x1, %r13b
jmp 0x7245
movq 0x8(%r13), %rdi
callq 0x80b9
testq %rax, %rax
je 0x746d
movq %rax, %rdi
callq 0x74d8
testq %rax, %rax
je 0x7481
movq %rax, %rdi
callq 0x714c
testq %rax, %rax
je 0x748a
movq %rax, %r13
xorl %ebx, %ebx
movslq 0x8(%r13), %rax
cmpq %rax, %rbx
jge 0x7416
movq (%r13), %rax
movq (%rax,%rbx,8), %rsi
movq 0x10(%rsp), %rdi
callq 0x8167
incq %rbx
jmp 0x73ea
movl %ebx, 0xc(%rsp)
xorl %r13d, %r13d
jmp 0x7247
addl $0x2, %ebp
jmp 0x723e
leal 0x1(%rbp), %eax
movl %eax, 0xc(%rsp)
movq 0x8(%r15,%rbx,8), %rax
movl (%rax), %edi
cmpl $0x3, %edi
jne 0x7450
addl $0x2, %ebp
movl %ebp, 0xc(%rsp)
movq 0x6d29(%rip), %rdi      # 0xe168
movq 0x8(%rax), %rsi
callq 0x83c5
movl %eax, %r13d
jmp 0x7245
callq 0x807a
leaq 0x2994(%rip), %rdi      # 0x9df0
leaq 0xc(%rsp), %rsi
movq %rax, %rdx
xorl %eax, %eax
callq 0x80a8
jmp 0x7498
movq 0x8(%r13), %rsi
leaq 0x32a7(%rip), %rdi      # 0xa71f
xorl %eax, %eax
callq 0x80a8
jmp 0x7498
leaq 0x24fc(%rip), %rdi      # 0x9984
jmp 0x7491
leaq 0x2508(%rip), %rdi      # 0x9999
xorl %eax, %eax
callq 0x80a8
movl 0xc(%rsp), %ebp
movl (%r12), %edi
callq 0x807a
leaq 0x2944(%rip), %rdi      # 0x9df0
movq $0x0, 0x10(%rsp)
movl %ebp, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x80a8
movq 0x10(%rsp), %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopl (%rax)