// File: /workspace/github_cpp_makefile_star2_O1/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 0xa76e
callq 0xa565
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 0xabdc
leaq 0x2ce6(%rip), %rsi      # 0xd489
leaq -0xb8(%rbp), %rdi
callq 0x30c0
testl %eax, %eax
jne 0xa825
cmpl $0x2, %r14d
jg 0xa8ac
movq 0x782c(%rip), %rdi      # 0x11ff0
leaq 0x2cc1(%rip), %rsi      # 0xd48c
movl $0x21, %edx
callq 0x3270
movq 0x7814(%rip), %rbx      # 0x11ff0
leaq 0x2ccb(%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 0x77e2(%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 0xb374
leaq -0x78(%rbp), %rdi
leaq -0x38(%rbp), %rbx
movq %rbx, %rsi
callq 0x32a0
movq (%rbx), %rdi
cmpq %r14, %rdi
je 0xa86b
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 0xb374
leaq -0x98(%rbp), %rdi
callq 0xa10d
leaq -0x98(%rbp), %rdi
callq 0x3120
xorl %edi, %edi
callq 0x3290
movq 0x10(%rbx), %rsi
leaq -0x38(%rbp), %rdi
leaq -0xd8(%rbp), %rdx
callq 0xabdc
leaq -0x48(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x38(%rbp), %rsi
movq -0x30(%rbp), %rdx
addq %rsi, %rdx
leaq -0x58(%rbp), %rdi
callq 0xb374
leaq -0xd8(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0xa666
leaq -0x78(%rbp), %rdi
leaq -0xd8(%rbp), %rbx
movq %rbx, %rsi
callq 0x32a0
movq (%rbx), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0xa91d
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x3240
movq -0x58(%rbp), %rdi
cmpq %r14, %rdi
je 0xa932
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3240
leaq -0x28(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0xa85f
jmp 0xa86b
movq %rax, %rbx
movq -0x58(%rbp), %rdi
cmpq %r14, %rdi
je 0xa965
movq -0x48(%rbp), %rsi
incq %rsi
callq 0x3240
jmp 0xa965
movq %rax, %rbx
leaq -0x28(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa99f
movq -0x28(%rbp), %rsi
jmp 0xa98e
movq %rax, %rbx
movq -0x98(%rbp), %rdi
cmpq %r14, %rdi
je 0xa99f
movq -0x88(%rbp), %rsi
incq %rsi
callq 0x3240
jmp 0xa99f
jmp 0xa99c
jmp 0xa99c
movq %rax, %rbx
leaq -0xa8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0xa9c3
movq -0xa8(%rbp), %rsi
incq %rsi
callq 0x3240
jmp 0xa9c3
movq %rax, %rbx
movq -0x78(%rbp), %rdi
cmpq %r15, %rdi
je 0xa9d8
movq -0x68(%rbp), %rsi
incq %rsi
callq 0x3240
movq %rbx, %rdi
callq 0x3370