// File: joncampbell123[P]haxcc/haxpp.cpp
// Function: main
int main(int argc,char **argv) {
    if (parse_argv(argc,argv))
        return 1;

    in_src_stk.alloc();
    in_src_stk.push();
    if (in_file == "-")
        in_src_stk.top().set(stdin);
    else
        in_src_stk.top().set(in_file);

    in_src_stk.top().open();
    if (!in_src_stk.top().is_open()) {
        fprintf(stderr,"Unable to open source\n");
        return 1;
    }

    if (out_file == "-")
        out_dst.set(stdout);
    else
        out_dst.set(out_file);

    out_dst.open();
    if (!out_dst.is_open()) {
        fprintf(stderr,"Unable to open dest\n");
        return 1;
    }

    string line;
    bool emit_line = false;
    int32_t lineno_expect = -1;
    token_string tokens;

    while (!in_src_stk.empty()) {
        const int32_t lineno = in_src_stk.top().current_line();
        const string &source = in_src_stk.top().get_path();

        if (read_line(/*&*/line,in_src_stk.top())) {
            if (ppp_only) {
                if (lineno_expect != lineno)
                    emit_line = true;

                if (emit_line) {
                    out_dst.puts(string("#line ") + to_string(lineno) + " " + source + "\n");
                    emit_line = false;
                }

                out_dst.puts(line);
                out_dst.putc('\n');
                lineno_expect = lineno + int32_t(1);
            }
            else {
                tokens.clear();
                parse_tokens(tokens,line.begin(),line.end(),lineno,source);
                if (accept_tokens(tokens.begin(),tokens.end())) {
                    if (ppt_only) {
                        if (lineno_expect != lineno)
                            emit_line = true;

                        if (emit_line) {
                            out_dst.puts(string("#line ") + to_string(lineno) + " " + source + "\n");
                            emit_line = false;
                        }

                        for (const auto &t : tokens)
                            out_dst.puts(to_string(t));

                        out_dst.putc('\n');
                        lineno_expect = lineno + int32_t(1);
                    }
                    else if (pp_only) {
                        if (pp_allow_token_display(tokens)) {
                            if (lineno_expect != lineno)
                                emit_line = true;

                            if (emit_line) {
                                out_dst.puts(string("#line ") + to_string(lineno) + " " + source + "\n");
                                emit_line = false;
                            }

                            for (const auto &t : tokens)
                                out_dst.puts(to_string_pp(t));

                            out_dst.putc('\n');
                            lineno_expect = lineno + int32_t(1);
                        }
                    }
                }
            }
        }
        else if (in_src_stk.top().eof()) {
            emit_line = true;
            in_src_stk.pop();
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x3d0, %rsp            # imm = 0x3D0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x15040
cmpl $0x0, %eax
je 0x144d6
movl $0x1, -0x4(%rbp)
jmp 0x1502b
leaq 0x1ee9b(%rip), %rdi     # 0x33378
callq 0x16e70
leaq 0x1ee8f(%rip), %rdi     # 0x33378
callq 0x16e90
leaq 0x1eed3(%rip), %rdi     # 0x333c8
leaq 0x10598(%rip), %rsi     # 0x24a94
callq 0x15ab0
testb $0x1, %al
jne 0x14507
jmp 0x14527
leaq 0x1ee6a(%rip), %rdi     # 0x33378
callq 0x16f40
movq %rax, %rdi
movq 0x1ea7b(%rip), %rax     # 0x32f98
movq (%rax), %rsi
callq 0x41f0
jmp 0x14542
leaq 0x1ee4a(%rip), %rdi     # 0x33378
callq 0x16f40
movq %rax, %rdi
leaq 0x1ee8b(%rip), %rsi     # 0x333c8
callq 0x4280
leaq 0x1ee2f(%rip), %rdi     # 0x33378
callq 0x16f40
movq %rax, %rdi
callq 0x42c0
leaq 0x1ee1b(%rip), %rdi     # 0x33378
callq 0x16f40
movq %rax, %rdi
callq 0x4320
testb $0x1, %al
jne 0x14592
movq 0x1ea43(%rip), %rax     # 0x32fb8
movq (%rax), %rdi
leaq 0x11399(%rip), %rsi     # 0x25918
movb $0x0, %al
callq 0x33f0
movl $0x1, -0x4(%rbp)
jmp 0x1502b
leaq 0x1ee4f(%rip), %rdi     # 0x333e8
leaq 0x104f4(%rip), %rsi     # 0x24a94
callq 0x15ab0
testb $0x1, %al
jne 0x145ab
jmp 0x145c3
movq 0x1e9b6(%rip), %rax     # 0x32f68
movq (%rax), %rsi
leaq 0x1eddc(%rip), %rdi     # 0x33398
callq 0x4490
jmp 0x145d6
leaq 0x1edce(%rip), %rdi     # 0x33398
leaq 0x1ee17(%rip), %rsi     # 0x333e8
callq 0x4520
leaq 0x1edbb(%rip), %rdi     # 0x33398
callq 0x4560
leaq 0x1edaf(%rip), %rdi     # 0x33398
callq 0x45c0
testb $0x1, %al
jne 0x14616
movq 0x1e9bf(%rip), %rax     # 0x32fb8
movq (%rax), %rdi
leaq 0x1132c(%rip), %rsi     # 0x2592f
movb $0x0, %al
callq 0x33f0
movl $0x1, -0x4(%rbp)
jmp 0x1502b
leaq -0x30(%rbp), %rdi
callq 0x33d0
movb $0x0, -0x31(%rbp)
movl $0xffffffff, -0x38(%rbp) # imm = 0xFFFFFFFF
leaq -0x50(%rbp), %rdi
callq 0x16ff0
leaq 0x1ed3e(%rip), %rdi     # 0x33378
callq 0x17010
movb %al, -0x361(%rbp)
jmp 0x14647
movb -0x361(%rbp), %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x14658
jmp 0x14ffc
leaq 0x1ed19(%rip), %rdi     # 0x33378
callq 0x16f40
movq %rax, -0x370(%rbp)
jmp 0x1466d
movq -0x370(%rbp), %rdi
callq 0x17030
movl %eax, -0x374(%rbp)
jmp 0x14681
movl -0x374(%rbp), %eax
movl %eax, -0x60(%rbp)
leaq 0x1ece7(%rip), %rdi     # 0x33378
callq 0x16f40
movq %rax, -0x380(%rbp)
jmp 0x1469f
movq -0x380(%rbp), %rdi
callq 0x4390
movq %rax, -0x68(%rbp)
leaq 0x1ecc2(%rip), %rdi     # 0x33378
callq 0x16f40
movq %rax, -0x388(%rbp)
jmp 0x146c4
movq -0x388(%rbp), %rsi
leaq -0x30(%rbp), %rdi
callq 0x4a80
movb %al, -0x389(%rbp)
jmp 0x146dc
movb -0x389(%rbp), %al
testb $0x1, %al
jne 0x146eb
jmp 0x14fba
testb $0x1, 0x1ed67(%rip)     # 0x33459
je 0x14932
movl -0x38(%rbp), %eax
cmpl -0x60(%rbp), %eax
je 0x14717
movb $0x1, -0x31(%rbp)
jmp 0x14717
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x15017
testb $0x1, -0x31(%rbp)
je 0x148ff
leaq -0x109(%rbp), %rdi
movq %rdi, -0x398(%rbp)
callq 0x34f0
movq -0x398(%rbp), %rdx
leaq 0x11202(%rip), %rsi     # 0x25944
leaq -0x108(%rbp), %rdi
callq 0x15960
jmp 0x14750
movl -0x60(%rbp), %esi
leaq -0x130(%rbp), %rdi
callq 0x17050
jmp 0x14761
leaq -0xe8(%rbp), %rdi
leaq -0x108(%rbp), %rsi
leaq -0x130(%rbp), %rdx
callq 0x15d50
jmp 0x1477d
leaq 0x1077b(%rip), %rdx     # 0x24eff
leaq -0xc8(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
callq 0x15cb0
jmp 0x14799
movq -0x68(%rbp), %rdx
leaq -0xa8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x15d00
jmp 0x147b2
leaq 0x10db6(%rip), %rdx     # 0x2556f
leaq -0x88(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
callq 0x15cb0
jmp 0x147ce
leaq 0x1ebc3(%rip), %rdi     # 0x33398
leaq -0x88(%rbp), %rsi
callq 0x4760
jmp 0x147e3
leaq -0x88(%rbp), %rdi
callq 0x3598
leaq -0xa8(%rbp), %rdi
callq 0x3598
leaq -0xc8(%rbp), %rdi
callq 0x3598
leaq -0xe8(%rbp), %rdi
callq 0x3598
leaq -0x130(%rbp), %rdi
callq 0x3598
leaq -0x108(%rbp), %rdi
callq 0x3598
leaq -0x109(%rbp), %rdi
callq 0x32f0
movb $0x0, -0x31(%rbp)
jmp 0x148ff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x148ee
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x148e2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x148d6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x148ca
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x148be
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x148b2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x88(%rbp), %rdi
callq 0x3598
leaq -0xa8(%rbp), %rdi
callq 0x3598
leaq -0xc8(%rbp), %rdi
callq 0x3598
leaq -0xe8(%rbp), %rdi
callq 0x3598
leaq -0x130(%rbp), %rdi
callq 0x3598
leaq -0x108(%rbp), %rdi
callq 0x3598
leaq -0x109(%rbp), %rdi
callq 0x32f0
jmp 0x15017
leaq 0x1ea92(%rip), %rdi     # 0x33398
leaq -0x30(%rbp), %rsi
callq 0x4760
jmp 0x14911
leaq 0x1ea80(%rip), %rdi     # 0x33398
movl $0xa, %esi
callq 0x4600
jmp 0x14924
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x14fb8
leaq -0x50(%rbp), %rdi
movq %rdi, -0x3a0(%rbp)
callq 0x17170
leaq -0x30(%rbp), %rdi
movq %rdi, -0x3a8(%rbp)
callq 0x3240
movq -0x3a8(%rbp), %rdi
movq %rax, -0x138(%rbp)
callq 0x3160
movq -0x3a0(%rbp), %rdi
movq %rax, -0x140(%rbp)
movl -0x60(%rbp), %ecx
movq -0x68(%rbp), %r8
movq -0x138(%rbp), %rsi
movq -0x140(%rbp), %rdx
callq 0xcc80
jmp 0x1498f
leaq -0x50(%rbp), %rdi
movq %rdi, -0x3b8(%rbp)
callq 0x17190
movq -0x3b8(%rbp), %rdi
movq %rax, -0x148(%rbp)
callq 0x171c0
movq %rax, -0x150(%rbp)
leaq -0x148(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x13290
movb %al, -0x3a9(%rbp)
jmp 0x149d4
movb -0x3a9(%rbp), %al
testb $0x1, %al
jne 0x149e3
jmp 0x14fb6
testb $0x1, 0x1ea6e(%rip)     # 0x33458
je 0x14cc3
movl -0x38(%rbp), %eax
cmpl -0x60(%rbp), %eax
je 0x149fc
movb $0x1, -0x31(%rbp)
testb $0x1, -0x31(%rbp)
je 0x14be4
leaq -0x1f1(%rbp), %rdi
movq %rdi, -0x3c0(%rbp)
callq 0x34f0
movq -0x3c0(%rbp), %rdx
leaq 0x10f1d(%rip), %rsi     # 0x25944
leaq -0x1f0(%rbp), %rdi
callq 0x15960
jmp 0x14a35
movl -0x60(%rbp), %esi
leaq -0x218(%rbp), %rdi
callq 0x17050
jmp 0x14a46
leaq -0x1d0(%rbp), %rdi
leaq -0x1f0(%rbp), %rsi
leaq -0x218(%rbp), %rdx
callq 0x15d50
jmp 0x14a62
leaq 0x10496(%rip), %rdx     # 0x24eff
leaq -0x1b0(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x15cb0
jmp 0x14a7e
movq -0x68(%rbp), %rdx
leaq -0x190(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x15d00
jmp 0x14a97
leaq 0x10ad1(%rip), %rdx     # 0x2556f
leaq -0x170(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x15cb0
jmp 0x14ab3
leaq 0x1e8de(%rip), %rdi     # 0x33398
leaq -0x170(%rbp), %rsi
callq 0x4760
jmp 0x14ac8
leaq -0x170(%rbp), %rdi
callq 0x3598
leaq -0x190(%rbp), %rdi
callq 0x3598
leaq -0x1b0(%rbp), %rdi
callq 0x3598
leaq -0x1d0(%rbp), %rdi
callq 0x3598
leaq -0x218(%rbp), %rdi
callq 0x3598
leaq -0x1f0(%rbp), %rdi
callq 0x3598
leaq -0x1f1(%rbp), %rdi
callq 0x32f0
movb $0x0, -0x31(%rbp)
jmp 0x14be4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x14bd3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x14bc7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x14bbb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x14baf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x14ba3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x14b97
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x170(%rbp), %rdi
callq 0x3598
leaq -0x190(%rbp), %rdi
callq 0x3598
leaq -0x1b0(%rbp), %rdi
callq 0x3598
leaq -0x1d0(%rbp), %rdi
callq 0x3598
leaq -0x218(%rbp), %rdi
callq 0x3598
leaq -0x1f0(%rbp), %rdi
callq 0x3598
leaq -0x1f1(%rbp), %rdi
callq 0x32f0
jmp 0x15017
leaq -0x50(%rbp), %rax
movq %rax, -0x220(%rbp)
movq -0x220(%rbp), %rdi
callq 0x17190
movq %rax, -0x228(%rbp)
movq -0x220(%rbp), %rdi
callq 0x171c0
movq %rax, -0x230(%rbp)
leaq -0x228(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x16580
testb $0x1, %al
jne 0x14c2e
jmp 0x14ca2
leaq -0x228(%rbp), %rdi
callq 0x16600
movq %rax, -0x238(%rbp)
movq -0x238(%rbp), %rsi
leaq -0x258(%rbp), %rdi
callq 0x7d10
jmp 0x14c56
leaq 0x1e73b(%rip), %rdi     # 0x33398
leaq -0x258(%rbp), %rsi
callq 0x4760
jmp 0x14c6b
leaq -0x258(%rbp), %rdi
callq 0x3598
leaq -0x228(%rbp), %rdi
callq 0x171f0
jmp 0x14c15
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x258(%rbp), %rdi
callq 0x3598
jmp 0x15017
leaq 0x1e6ef(%rip), %rdi     # 0x33398
movl $0xa, %esi
callq 0x4600
jmp 0x14cb5
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x14fb4
testb $0x1, 0x1e790(%rip)     # 0x3345a
je 0x14fb2
leaq -0x50(%rbp), %rdi
callq 0x14420
testb $0x1, %al
jne 0x14ce2
jmp 0x14fb0
movl -0x38(%rbp), %eax
cmpl -0x60(%rbp), %eax
je 0x14cee
movb $0x1, -0x31(%rbp)
testb $0x1, -0x31(%rbp)
je 0x14ed6
leaq -0x2f9(%rbp), %rdi
movq %rdi, -0x3c8(%rbp)
callq 0x34f0
movq -0x3c8(%rbp), %rdx
leaq 0x10c2b(%rip), %rsi     # 0x25944
leaq -0x2f8(%rbp), %rdi
callq 0x15960
jmp 0x14d27
movl -0x60(%rbp), %esi
leaq -0x320(%rbp), %rdi
callq 0x17050
jmp 0x14d38
leaq -0x2d8(%rbp), %rdi
leaq -0x2f8(%rbp), %rsi
leaq -0x320(%rbp), %rdx
callq 0x15d50
jmp 0x14d54
leaq 0x101a4(%rip), %rdx     # 0x24eff
leaq -0x2b8(%rbp), %rdi
leaq -0x2d8(%rbp), %rsi
callq 0x15cb0
jmp 0x14d70
movq -0x68(%rbp), %rdx
leaq -0x298(%rbp), %rdi
leaq -0x2b8(%rbp), %rsi
callq 0x15d00
jmp 0x14d89
leaq 0x107df(%rip), %rdx     # 0x2556f
leaq -0x278(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x15cb0
jmp 0x14da5
leaq 0x1e5ec(%rip), %rdi     # 0x33398
leaq -0x278(%rbp), %rsi
callq 0x4760
jmp 0x14dba
leaq -0x278(%rbp), %rdi
callq 0x3598
leaq -0x298(%rbp), %rdi
callq 0x3598
leaq -0x2b8(%rbp), %rdi
callq 0x3598
leaq -0x2d8(%rbp), %rdi
callq 0x3598
leaq -0x320(%rbp), %rdi
callq 0x3598
leaq -0x2f8(%rbp), %rdi
callq 0x3598
leaq -0x2f9(%rbp), %rdi
callq 0x32f0
movb $0x0, -0x31(%rbp)
jmp 0x14ed6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x14ec5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x14eb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x14ead
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x14ea1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x14e95
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x14e89
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x278(%rbp), %rdi
callq 0x3598
leaq -0x298(%rbp), %rdi
callq 0x3598
leaq -0x2b8(%rbp), %rdi
callq 0x3598
leaq -0x2d8(%rbp), %rdi
callq 0x3598
leaq -0x320(%rbp), %rdi
callq 0x3598
leaq -0x2f8(%rbp), %rdi
callq 0x3598
leaq -0x2f9(%rbp), %rdi
callq 0x32f0
jmp 0x15017
leaq -0x50(%rbp), %rax
movq %rax, -0x328(%rbp)
movq -0x328(%rbp), %rdi
callq 0x17190
movq %rax, -0x330(%rbp)
movq -0x328(%rbp), %rdi
callq 0x171c0
movq %rax, -0x338(%rbp)
leaq -0x330(%rbp), %rdi
leaq -0x338(%rbp), %rsi
callq 0x16580
testb $0x1, %al
jne 0x14f20
jmp 0x14f94
leaq -0x330(%rbp), %rdi
callq 0x16600
movq %rax, -0x340(%rbp)
movq -0x340(%rbp), %rsi
leaq -0x360(%rbp), %rdi
callq 0xb110
jmp 0x14f48
leaq 0x1e449(%rip), %rdi     # 0x33398
leaq -0x360(%rbp), %rsi
callq 0x4760
jmp 0x14f5d
leaq -0x360(%rbp), %rdi
callq 0x3598
leaq -0x330(%rbp), %rdi
callq 0x171f0
jmp 0x14f07
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x360(%rbp), %rdi
callq 0x3598
jmp 0x15017
leaq 0x1e3fd(%rip), %rdi     # 0x33398
movl $0xa, %esi
callq 0x4600
jmp 0x14fa7
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x38(%rbp)
jmp 0x14fb2
jmp 0x14fb4
jmp 0x14fb6
jmp 0x14fb8
jmp 0x14ff7
leaq 0x1e3b7(%rip), %rdi     # 0x33378
callq 0x16f40
movq %rax, -0x3d0(%rbp)
jmp 0x14fcf
movq -0x3d0(%rbp), %rdi
callq 0x4340
testb $0x1, %al
jne 0x14fe1
jmp 0x14ff5
movb $0x1, -0x31(%rbp)
leaq 0x1e38c(%rip), %rdi     # 0x33378
callq 0x17210
jmp 0x14ff3
jmp 0x14ff5
jmp 0x14ff7
jmp 0x14633
movl $0x0, -0x4(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x172c0
leaq -0x30(%rbp), %rdi
callq 0x3598
jmp 0x1502b
leaq -0x50(%rbp), %rdi
callq 0x172c0
leaq -0x30(%rbp), %rdi
callq 0x3598
jmp 0x15037
movl -0x4(%rbp), %eax
addq $0x3d0, %rsp            # imm = 0x3D0
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0x34e0