// File: devaigergely81[P]flex-bison-example/while.cc
// Function: main
int main(int argc, char *argv[]) {
    if(argc != 3) {
        std::cerr << "Usage: " << argv[0] << " (-c|-i) inputfile" << std::endl;
        exit(1);
    }
    
    if(std::string(argv[1]) == "-c") {
        current_mode = compiler;
    } else if(std::string(argv[1]) == "-i") {
        current_mode = interpreter;
    } else {
        std::cerr << "Usage: " << argv[0] << "(-c|-i) inputfile" << std::endl;
        exit(1);
    }
    
    std::ifstream input(argv[2]);
    if(!input) {
        std::cerr << "Cannot open input file: " << argv[2] << std::endl;
        exit(1);
    }
    
    lexer = new yyFlexLexer(&input);
    yy::parser parser;
    parser.parse();
    delete lexer;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2f0, %rsp            # imm = 0x2F0
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x3, -0x8(%rbp)
je 0x7019
movq 0x1901a(%rip), %rdi     # 0x1fff0
leaq 0xf968(%rip), %rsi      # 0x16945
callq 0x4290
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x4290
movq %rax, %rdi
leaq 0xf952(%rip), %rsi      # 0x1694d
callq 0x4290
movq %rax, %rdi
movq 0x18fae(%rip), %rsi     # 0x1ffb8
callq 0x42d0
movl $0x1, %edi
callq 0x4340
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x2a8(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x4480
movq -0x2a8(%rbp), %rsi
movq -0x2a0(%rbp), %rdx
leaq -0x30(%rbp), %rdi
callq 0x7390
jmp 0x7051
leaq 0xf908(%rip), %rsi      # 0x16960
leaq -0x30(%rbp), %rdi
callq 0x7440
movb %al, -0x2a9(%rbp)
jmp 0x7069
leaq -0x30(%rbp), %rdi
callq 0x41c0
leaq -0x31(%rbp), %rdi
callq 0x42f0
movb -0x2a9(%rbp), %al
testb $0x1, %al
jne 0x7087
jmp 0x70ca
leaq 0x1924e(%rip), %rax     # 0x202dc
movl $0x0, (%rax)
jmp 0x71c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x70bc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x41c0
leaq -0x31(%rbp), %rdi
callq 0x42f0
jmp 0x7357
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x2c0(%rbp)
leaq -0x69(%rbp), %rdi
movq %rdi, -0x2b8(%rbp)
callq 0x4480
movq -0x2c0(%rbp), %rsi
movq -0x2b8(%rbp), %rdx
leaq -0x68(%rbp), %rdi
callq 0x7390
jmp 0x7102
leaq 0xf85a(%rip), %rsi      # 0x16963
leaq -0x68(%rbp), %rdi
callq 0x7440
movb %al, -0x2c1(%rbp)
jmp 0x711a
leaq -0x68(%rbp), %rdi
callq 0x41c0
leaq -0x69(%rbp), %rdi
callq 0x42f0
movb -0x2c1(%rbp), %al
testb $0x1, %al
jne 0x7138
jmp 0x7178
leaq 0x1919d(%rip), %rax     # 0x202dc
movl $0x1, (%rax)
jmp 0x71c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x716a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x41c0
leaq -0x69(%rbp), %rdi
callq 0x42f0
jmp 0x7357
movq 0x18e71(%rip), %rdi     # 0x1fff0
leaq 0xf7bf(%rip), %rsi      # 0x16945
callq 0x4290
movq %rax, %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x4290
movq %rax, %rdi
leaq 0xf7aa(%rip), %rsi      # 0x1694e
callq 0x4290
movq %rax, %rdi
movq 0x18e05(%rip), %rsi     # 0x1ffb8
callq 0x42d0
movl $0x1, %edi
callq 0x4340
jmp 0x71c4
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
leaq -0x278(%rbp), %rdi
movl $0x8, %edx
callq 0x44c0
movq -0x278(%rbp), %rax
movq -0x18(%rax), %rax
leaq -0x278(%rbp,%rax), %rdi
callq 0x4170
movb %al, -0x2c2(%rbp)
jmp 0x71fd
movb -0x2c2(%rbp), %al
testb $0x1, %al
jne 0x7209
jmp 0x7272
movq 0x18de0(%rip), %rdi     # 0x1fff0
leaq 0xf74f(%rip), %rsi      # 0x16966
callq 0x4290
movq %rax, -0x2d0(%rbp)
jmp 0x7225
movq -0x2d0(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
callq 0x4290
movq %rax, -0x2d8(%rbp)
jmp 0x7242
movq -0x2d8(%rbp), %rdi
movq 0x18d68(%rip), %rsi     # 0x1ffb8
callq 0x42d0
jmp 0x7257
movl $0x1, %edi
callq 0x4340
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x734b
movl $0x2e0, %edi            # imm = 0x2E0
callq 0x42a0
movq %rax, -0x2e0(%rbp)
jmp 0x7285
movq -0x2e0(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
leaq -0x278(%rbp), %rsi
callq 0x59c0
jmp 0x729e
movq -0x2e0(%rbp), %rax
movq %rax, 0x1901c(%rip)     # 0x202c8
leaq -0x298(%rbp), %rdi
callq 0x7760
jmp 0x72ba
leaq -0x298(%rbp), %rdi
callq 0x7eb0
jmp 0x72c8
movq 0x18ff9(%rip), %rax     # 0x202c8
movq %rax, -0x2e8(%rbp)
cmpq $0x0, %rax
je 0x72e9
movq -0x2e8(%rbp), %rdi
movq (%rdi), %rax
callq *0x8(%rax)
movl $0x0, -0x4(%rbp)
leaq -0x298(%rbp), %rdi
callq 0x77a0
leaq -0x278(%rbp), %rdi
callq 0x40d0
movl -0x4(%rbp), %eax
addq $0x2f0, %rsp            # imm = 0x2F0
popq %rbp
retq
movq -0x2e0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
movl $0x2e0, %esi            # imm = 0x2E0
callq 0x42b0
jmp 0x734b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x298(%rbp), %rdi
callq 0x77a0
leaq -0x278(%rbp), %rdi
callq 0x40d0
movq -0x40(%rbp), %rdi
callq 0x4470