// File: /workspace/github_cpp_makefile_star2_O2/joncampbell123[P]haxcc/haxpp.cpp
// Function: accept_tokens(__gnu_cxx::__normal_iterator<token*, std::vector<token, std::allocator<token>>> const&, __gnu_cxx::__normal_iterator<token*, std::vector<token, std::allocator<token>>> const&)
bool accept_tokens(const token_string::iterator &tib,const token_string::iterator &tie) {
    bool pass = pp_pass();
    auto ti = tib;

    /* we're only looking for #preprocessor directives here that control conditional inclusion */
    if (ti != tie && tokenit_next_match_inc(ti,tie,token::PREPROC)) {
        if (tokenit_next_match_inc(ti,tie,token::IF)) {
            pp_cond_t pc; pc.on_if(pp_if_eval(ti,tie),pass);
            pp_cond_stack.push(move(pc));
        }
        else if (tokenit_next_match_inc(ti,tie,token::ELIF)) {
            if (!pp_cond_stack.empty()) {
                pp_cond_stack.top().on_elif(pp_if_eval(ti,tie));
            }
            else {
                throw invalid_argument("#else not allowed here");
            }
        }
        else if (tokenit_next_match_inc(ti,tie,token::IFDEF)) {
            const string &ident = tokenit_next_identifier(ti,tie); /* will throw exception if not! */
            pp_cond_t pc; pc.on_ifdef(is_macro(ident),pass);
            pp_cond_stack.push(move(pc));
        }
        else if (tokenit_next_match_inc(ti,tie,token::IFNDEF)) {
            const string &ident = tokenit_next_identifier(ti,tie); /* will throw exception if not! */
            pp_cond_t pc; pc.on_ifdef(!is_macro(ident),pass);
            pp_cond_stack.push(move(pc));
        }
        else if (tokenit_next_match_inc(ti,tie,token::DEFINE)) { /* some preprocessing done by the parse token code */
            const string &ident = tokenit_next_identifier(ti,tie); /* will throw exception if not! */
            macro_t macro;

            if (tokenit_next_match_inc(ti,tie,token::OPEN_PARENS)) {
                macro.parens = true;
                /* parameter list, IDENTIFIER. Final one may be __VA_ARGS__ */
                do {
                    if (ti == tie) throw invalid_argument("#define macro param list expected close parens");
                    if ((*ti).tval == token::IDENTIFIER) {
                        if (find(macro.param.begin(),macro.param.end(),(*ti).sval) == macro.param.end()) {
                            macro.param.push_back((*ti).sval);
                            ti++;
                        }
                        else {
                            throw invalid_argument(string("parameter specified more than once ") + (*ti).sval);
                        }

                        if (ti == tie) throw invalid_argument("#define macro param cut off suddenly");

                        /* allow older style param... */
                        if (tokenit_next_match_inc(ti,tie,token::DOTDOTDOT)) {
                            macro.last_param_variadic = true;
                            macro.last_param_optional = false;

                            /* this must be the last param! */
                            if (!tokenit_next_match_inc(ti,tie,token::CLOSE_PARENS))
                                throw invalid_argument("#define macro param list expected close parens after ...");

                            break;
                        }
                        else if (tokenit_next_match_inc(ti,tie,token::CLOSE_PARENS)) {
                            break;
                        }
                        else if (tokenit_next_match_inc(ti,tie,token::COMMA)) {
                            /* OK */
                        }
                    }
                    else if (tokenit_next_match_inc(ti,tie,token::DOTDOTDOT)) {
                        macro.param.push_back("__VA_ARGS__");
                        macro.last_param_variadic = true;
                        macro.last_param_optional = true;

                        /* this must be the last param! */
                        if (!tokenit_next_match_inc(ti,tie,token::CLOSE_PARENS))
                            throw invalid_argument("#define macro param list expected close parens after ...");

                        break;
                    }
                    else if (tokenit_next_match_inc(ti,tie,token::CLOSE_PARENS)) {
                        break;
                    }
                    else {
                        throw invalid_argument(string("unexpected token in macro parameter list ") + to_string(*ti));
                    }
                } while (1);
            }

            /* the tokens from here are MACROSUBST, MACROPARAM, __VA_ARGS__, __VA_OPT__ ( MACROSUBST ), STRINGIFY, AND TOKEN_PASTE.
             * There will never be an IDENTIFIER because the parameter matching has already been done. */
            while (ti != tie) {
                if ((*ti).tval == token::MACROSUBST ||
                    (*ti).tval == token::VA_ARGS ||
                    (*ti).tval == token::VA_OPT ||
                    (*ti).tval == token::COMMA ||
                    (*ti).tval == token::STRINGIFY ||
                    (*ti).tval == token::TOKEN_PASTE ||
                    (*ti).tval == token::OPEN_PARENS ||
                    (*ti).tval == token::CLOSE_PARENS) {
                    macro.subst.push_back(*ti);
                    ti++;
                }
                else if ((*ti).tval == token::MACROPARAM) {
                    if ((*ti).i.u >= (unsigned long long)macro.param.size()) throw runtime_error("macro param out of range");
                    macro.subst.push_back(*ti);
                    ti++;
                }
                else {
                    throw invalid_argument(string("unexpected token in the body of a macro ") + to_string(*ti));
                }
            }

            {
                auto mi = macro_store.find(ident);
                if (mi != macro_store.end()) {
                    if (mi->second == macro)
                        macro_store[ident] = macro;
                    else
                        fprintf(stderr,"WARNING: Macro '%s' redefinition\n",ident.c_str());
                }
                else {
                    macro_store[ident] = macro;
                }
            }
        }
        else if (tokenit_next_match_inc(ti,tie,token::UNDEF)) {
            const string &ident = tokenit_next_identifier(ti,tie); /* will throw exception if not! */

            {
                auto mi = macro_store.find(ident);
                if (mi != macro_store.end())
                    macro_store.erase(mi);
            }
        }
        else if (tokenit_next_match_inc(ti,tie,token::ELSE)) {
            if (!pp_cond_stack.empty()) {
                pp_cond_stack.top().on_else();
            }
            else {
                throw invalid_argument("#else not allowed here");
            }
        }
        else if (tokenit_next_match_inc(ti,tie,token::ENDIF)) {
            if (!pp_cond_stack.empty()) {
                pp_cond_stack.pop();
                pass = pp_pass();
            }
            else {
                throw invalid_argument("too many #endif");
            }
        }
    }

    return pass;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movq %rsi, %r14
movq %rdi, %r15
callq 0x873c
movl %eax, %ebx
movq (%r15), %rax
movq (%r14), %rsi
cmpq %rax, %rsi
je 0xa027
cmpl $0x2, (%rax)
jne 0xa027
leaq 0x70(%rax), %rcx
cmpq %rsi, %rcx
je 0xa027
cmpl $0x60, (%rcx)
jne 0x9f59
addq $0xe0, %rax
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
leaq 0x30(%rsp), %r15
movl $0x1010000, (%r15)      # imm = 0x1010000
movq %r14, %rsi
callq 0x9da3
movb %bl, 0x1(%r15)
movb %al, (%r15)
leaq 0xe3ef(%rip), %rdi      # 0x18340
movq %r15, %rsi
jmp 0xa022
cmpl $0x61, (%rcx)
jne 0x9fb5
addq $0xe0, %rax
movq %rax, 0x8(%rsp)
movq 0xe400(%rip), %r15      # 0x18370
cmpq 0xe3d9(%rip), %r15      # 0x18350
je 0xa35a
cmpq 0xe3f4(%rip), %r15      # 0x18378
jne 0x9f97
movq 0xe3fb(%rip), %rax      # 0x18388
movl $0x200, %r15d           # imm = 0x200
addq -0x8(%rax), %r15
addq $-0x4, %r15
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x9da3
movzbl %al, %esi
movq %r15, %rdi
callq 0x2d10
jmp 0xa027
cmpl $0x64, (%rcx)
jne 0x9fe3
addq $0xe0, %rax
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
callq 0x86d5
leaq 0x30(%rsp), %r14
movl $0x10000, (%r14)        # imm = 0x10000
movq %rax, %rdi
callq 0x3639
jmp 0xa011
cmpl $0x65, (%rcx)
jne 0xa03b
addq $0xe0, %rax
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
callq 0x86d5
leaq 0x30(%rsp), %r14
movl $0x10000, (%r14)        # imm = 0x10000
movq %rax, %rdi
callq 0x3639
xorb $0x1, %al
movb %bl, 0x1(%r14)
movb %al, (%r14)
leaq 0xe321(%rip), %rdi      # 0x18340
movq %r14, %rsi
callq 0xddb4
movl %ebx, %eax
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x66, (%rcx)
jne 0xa118
addq $0xe0, %rax
leaq 0x8(%rsp), %r15
movq %rax, (%r15)
movq %r15, %rdi
callq 0x86d5
movq %rax, %r12
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movaps %xmm0, 0x40(%rsp)
andl $0x0, 0x5f(%rsp)
movaps %xmm0, 0x30(%rsp)
movq (%r14), %rax
movq (%r15), %r15
cmpq %rax, %r15
je 0xa27f
cmpl $0x20, (%r15)
jne 0xa27f
addq $0x70, %r15
movq %r15, 0x8(%rsp)
leaq 0x48(%rsp), %r13
movb $0x1, 0x1a(%r13)
cmpq %rax, %r15
je 0xa431
movl (%r15), %ecx
cmpl $0x5, %ecx
jne 0xa1e2
movq 0x48(%rsp), %rdi
movq 0x50(%rsp), %rsi
leaq 0x48(%r15), %rbp
movq %rbp, %rdx
callq 0xd51b
cmpq 0x50(%rsp), %rax
jne 0xa450
movq %r13, %rdi
movq %rbp, %rsi
callq 0xb3fc
leaq 0x70(%r15), %rcx
movq (%r14), %rax
cmpq %rax, %rcx
je 0xa4b8
movl (%rcx), %edx
cmpl $0x21, %edx
je 0xa236
cmpl $0x19, %edx
je 0xa253
cmpl $0x17, %edx
je 0xa10f
movq %rcx, %r15
jmp 0xa0a0
addq $0xe0, %r15
jmp 0xa0a0
cmpl $0x67, (%rcx)
jne 0xa163
addq $0xe0, %rax
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
callq 0x86d5
leaq 0xe0e9(%rip), %rdi      # 0x18220
movq %rax, %rsi
callq 0xd03c
leaq 0xe0e2(%rip), %rcx      # 0x18228
cmpq %rcx, %rax
je 0xa027
leaq 0xe0ca(%rip), %rdi      # 0x18220
movq %rax, %rsi
callq 0xe4cc
jmp 0xa027
cmpl $0x5a, (%rcx)
jne 0xa1a3
movq 0xe201(%rip), %rdi      # 0x18370
cmpq 0xe1da(%rip), %rdi      # 0x18350
je 0xa4e8
cmpq 0xe1f5(%rip), %rdi      # 0x18378
jne 0xa195
movq 0xe1fc(%rip), %rax      # 0x18388
movl $0x200, %edi            # imm = 0x200
addq -0x8(%rax), %rdi
addq $-0x4, %rdi
callq 0x2d84
jmp 0xa027
cmpl $0x62, (%rcx)
jne 0xa027
movq 0xe1bd(%rip), %rax      # 0x18370
cmpq 0xe196(%rip), %rax      # 0x18350
je 0xa53f
leaq 0xe179(%rip), %rdi      # 0x18340
callq 0xe51a
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x873c
cmpl $0x19, %ecx
jne 0xa23f
leaq 0x5730(%rip), %rsi      # 0xf91e
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0xb1b8
leaq 0x10(%rsp), %rsi
movq %r13, %rdi
callq 0xd0c6
leaq 0x70(%r15), %r13
leaq 0x10(%rsp), %rdi
callq 0x2408
movw $0x101, 0x60(%rsp)      # imm = 0x101
movq (%r14), %rax
cmpq %rax, %r13
je 0xa507
cmpl $0x21, (%r13)
jne 0xa507
addq $0xe0, %r15
jmp 0xa27a
movq %r15, 0x8(%rsp)
cmpl $0x21, %ecx
jne 0xa55e
addq $0x70, %r15
jmp 0xa27a
leaq 0xe0(%r15), %rcx
movw $0x1, 0x60(%rsp)
cmpq %rax, %rcx
je 0xa523
cmpl $0x21, (%rcx)
jne 0xa523
addq $0x150, %r15            # imm = 0x150
movq %r15, 0x8(%rsp)
leaq 0x30(%rsp), %r13
movabsq $0x300800008, %rbp      # imm = 0x300800008
cmpq %rax, %r15
je 0xa2e1
movl (%r15), %eax
cmpq $0x21, %rax
ja 0xa2c1
btq %rax, %rbp
jb 0xa2cd
cmpq $0x4, %rax
jne 0xa2c1
movq 0x50(%rsp), %rax
subq 0x48(%rsp), %rax
sarq $0x5, %rax
cmpq %rax, 0x8(%r15)
jb 0xa2cd
jmp 0xa38a
addl $-0x7a, %eax
cmpl $0x4, %eax
jae 0xa3b7
movq %r13, %rdi
movq %r15, %rsi
callq 0xb5ea
addq $0x70, %r15
movq (%r14), %rax
jmp 0xa28e
leaq 0xdf38(%rip), %rdi      # 0x18220
movq %r12, %rsi
callq 0xd03c
leaq 0xdf31(%rip), %rcx      # 0x18228
cmpq %rcx, %rax
je 0xa311
addq $0x40, %rax
leaq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0x2df6
testb %al, %al
je 0xa33c
leaq 0xdf08(%rip), %rdi      # 0x18220
movq %r12, %rsi
callq 0xb616
leaq 0x30(%rsp), %rsi
movq %rax, %rdi
callq 0xb67c
leaq 0x30(%rsp), %rdi
callq 0xb6b4
jmp 0xa027
movq 0xdc75(%rip), %rax      # 0x17fb8
movq (%rax), %rdi
movq (%r12), %rdx
leaq 0x62c5(%rip), %rsi      # 0x10616
xorl %eax, %eax
callq 0x2290
jmp 0xa32d
pushq $0x10
popq %rdi
callq 0x20e0
movq %rax, %r14
leaq 0x5441(%rip), %rsi      # 0xf7ad
movq %rax, %rdi
callq 0x23a0
movq 0xdc5d(%rip), %rsi      # 0x17fd8
movq 0xdc3e(%rip), %rdx      # 0x17fc0
movq %r14, %rdi
callq 0x2340
pushq $0x10
popq %rdi
callq 0x20e0
movq %rax, %r14
leaq 0x6238(%rip), %rsi      # 0x105d4
movq %rax, %rdi
callq 0x20a0
movq 0xdc05(%rip), %rdx      # 0x17fb0
movq 0xdc46(%rip), %rsi      # 0x17ff8
jmp 0xa4e0
movq %r15, 0x8(%rsp)
pushq $0x10
popq %rdi
callq 0x20e0
movq %rax, %r14
leaq 0x621f(%rip), %rsi      # 0x105ed
leaq 0x68(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0xb1b8
leaq 0x88(%rsp), %rdi
movq %r15, %rsi
callq 0x47a7
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0xb282
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x2360
xorl %ebp, %ebp
movq 0xdbbb(%rip), %rsi      # 0x17fd8
movq 0xdb9c(%rip), %rdx      # 0x17fc0
movq %r14, %rdi
callq 0x2340
jmp 0xa5ce
pushq $0x10
popq %rdi
callq 0x20e0
movq %rax, %r14
leaq 0x60b6(%rip), %rsi      # 0x104f9
movq %rax, %rdi
callq 0x23a0
jmp 0xa4d2
movq %r15, 0x8(%rsp)
pushq $0x10
popq %rdi
callq 0x20e0
movq %rax, %r14
leaq 0x60c1(%rip), %rsi      # 0x10528
leaq 0x68(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0xb1b8
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
movq %rbp, %rdx
callq 0xb263
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x2360
xorl %ebp, %ebp
movq 0xdb34(%rip), %rsi      # 0x17fd8
movq 0xdb15(%rip), %rdx      # 0x17fc0
movq %r14, %rdi
callq 0x2340
jmp 0xa5ce
pushq $0x10
popq %rdi
callq 0x20e0
movq %rax, %r14
leaq 0x6082(%rip), %rsi      # 0x1054c
movq %rax, %rdi
callq 0x23a0
movq 0xdae7(%rip), %rdx      # 0x17fc0
movq 0xdaf8(%rip), %rsi      # 0x17fd8
movq %r14, %rdi
callq 0x2340
pushq $0x10
popq %rdi
callq 0x20e0
movq %rax, %r14
leaq 0x52b3(%rip), %rsi      # 0xf7ad
movq %rax, %rdi
callq 0x23a0
jmp 0xa374
pushq $0x10
popq %rdi
callq 0x20e0
movq %rax, %r14
leaq 0x6058(%rip), %rsi      # 0x10571
movq %rax, %rdi
callq 0x23a0
jmp 0xa4d2
pushq $0x10
popq %rdi
callq 0x20e0
movq %rax, %r14
leaq 0x603c(%rip), %rsi      # 0x10571
movq %rax, %rdi
callq 0x23a0
jmp 0xa4d2
pushq $0x10
popq %rdi
callq 0x20e0
movq %rax, %r14
leaq 0x60e7(%rip), %rsi      # 0x10638
movq %rax, %rdi
callq 0x23a0
jmp 0xa374
pushq $0x10
popq %rdi
callq 0x20e0
movq %rax, %r14
leaq 0x603a(%rip), %rsi      # 0x105aa
leaq 0x68(%rsp), %rdi
leaq 0x7(%rsp), %rdx
callq 0xb1b8
leaq 0x88(%rsp), %rdi
movq %r15, %rsi
callq 0x47a7
leaq 0x10(%rsp), %rdi
leaq 0x68(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0xb282
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x2360
xorl %ebp, %ebp
movq 0xda19(%rip), %rsi      # 0x17fd8
movq 0xd9fa(%rip), %rdx      # 0x17fc0
movq %r14, %rdi
callq 0x2340
jmp 0xa5ef
jmp 0xa5fe
jmp 0xa61f
jmp 0xa63e
jmp 0xa651
jmp 0xa63e
jmp 0xa63e
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2408
jmp 0xa663
jmp 0xa660
jmp 0xa651
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2408
jmp 0xa604
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x88(%rsp), %rdi
jmp 0xa616
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x2408
jmp 0xa625
jmp 0xa61f
movq %rax, %rbx
movb $0x1, %bpl
leaq 0x68(%rsp), %rdi
callq 0x2408
testb %bpl, %bpl
jne 0xa641
jmp 0xa663
jmp 0xa63e
jmp 0xa63e
jmp 0xa63e
jmp 0xa63e
movq %rax, %rbx
movq %r14, %rdi
callq 0x2160
jmp 0xa663
jmp 0xa660
jmp 0xa660
jmp 0xa660
movq %rax, %rbx
movq %r14, %rdi
callq 0x2160
jmp 0xa66d
jmp 0xa660
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xb6b4
movq %rbx, %rdi
callq 0x2370