// File: /workspace/github_cpp_makefile_star2_O3/philpoore[P]Math/main.cpp
// Function: main
int main(int argc, char** argv) {
    bool repl = argc == 1;

    if (repl) {
        runRepl();
    }

    string input;
    string firstArg = string(argv[1]);

    if (firstArg == "-f") {
        // Use a file as input.
        // E.g "./math -f examples/example-1.math"
        if (argc < 3) {
            cerr << "Runtime Error: Too few arguments\n";
            cerr << "-f flag missing filename" << endl;
            exit(1);
        }
        string filename = string(argv[2]);
        // Read file for input
        input = readFile(filename);
    } else {
        // Default to running from firstArg.
        // E.g "./math 10+10"
        input = string(firstArg);
    }

    run(input);
    exit(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0xc8, %rsp
cmpl $0x1, %edi
jne 0xa66c
callq 0xa463
movq %rsi, %rbx
movl %edi, %r14d
leaq -0x68(%rbp), %r15
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
movq 0x8(%rsi), %rsi
leaq -0xb8(%rbp), %rdi
leaq -0x38(%rbp), %rdx
callq 0xaad4
leaq 0x2de8(%rip), %rsi      # 0xd489
leaq -0xb8(%rbp), %rdi
callq 0x30c0
testl %eax, %eax
jne 0xa723
cmpl $0x2, %r14d
jg 0xa7aa
movq 0x792e(%rip), %rdi      # 0x11ff0
leaq 0x2dc3(%rip), %rsi      # 0xd48c
movl $0x21, %edx
callq 0x3270
movq 0x7916(%rip), %rbx      # 0x11ff0
leaq 0x2dcd(%rip), %rsi      # 0xd4ae
movl $0x18, %edx
movq %rbx, %rdi
callq 0x3270
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x3210
movsbl %al, %esi
movq 0x78e4(%rip), %rdi      # 0x11ff0
callq 0x3030
movq %rax, %rdi
callq 0x3180
movl $0x1, %edi
callq 0x3290
leaq -0x28(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0xb8(%rbp), %rsi
movq -0xb0(%rbp), %rdx
addq %rsi, %rdx
leaq -0x38(%rbp), %rdi
callq 0xb26a
leaq -0x78(%rbp), %rdi
leaq -0x38(%rbp), %rbx
movq %rbx, %rsi
callq 0x32a0
movq (%rbx), %rdi
cmpq %r14, %rdi
je 0xa769
movq -0x28(%rbp), %rsi
incq %rsi
callq 0x3240
leaq -0x88(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x78(%rbp), %rsi
movq -0x70(%rbp), %rdx
addq %rsi, %rdx
leaq -0x98(%rbp), %rdi
callq 0xb26a
leaq -0x98(%rbp), %rdi
callq 0xa00b
leaq -0x98(%rbp), %rdi
callq 0x3120
xorl %edi, %edi
callq 0x3290
movq 0x10(%rbx), %rsi
leaq -0x38(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0xaad4
leaq -0x48(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
addq %rsi, %rdx
leaq -0x58(%rbp), %rdi
callq 0xb26a
leaq -0xd8(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0xa564
leaq -0x78(%rbp), %rdi
leaq -0xd8(%rbp), %rbx
movq %rbx, %rsi
callq 0x32a0
movq (%rbx), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xa81b
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x3240
movq -0x58(%rbp), %rdi
cmpq %r14, %rdi
je 0xa830
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3240
leaq -0x28(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0xa75d
jmp 0xa769
movq %rax, %rbx
movq -0x58(%rbp), %rdi
cmpq %r14, %rdi
je 0xa863
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3240
jmp 0xa863
movq %rax, %rbx
leaq -0x28(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa89d
movq -0x28(%rbp), %rsi
jmp 0xa88c
movq %rax, %rbx
movq -0x98(%rbp), %rdi
cmpq %r14, %rdi
je 0xa89d
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x3240
jmp 0xa89d
jmp 0xa89a
jmp 0xa89a
movq %rax, %rbx
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa8c1
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x3240
jmp 0xa8c1
movq %rax, %rbx
movq -0x78(%rbp), %rdi
cmpq %r15, %rdi
je 0xa8d6
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x3240
movq %rbx, %rdi
callq 0x3370