// File: /workspace/github_cpp_makefile_star2_O1/calgagi[P]cp_gen/main.cpp
// Function: main
int main(int argc, char** argv) {
    ios_base::sync_with_stdio(false);  
    cin.tie(NULL);

    char cwdBuf[10000];
    string cwd = "";
    if (getcwd(cwdBuf, sizeof(cwdBuf)) == NULL) {
        error("Could not get current working directory");
    } 
    else {
        cwd = cwdBuf;
    }

    // Parse CLI arguments
    vector<string> cliArgs;
    string filename = "";
    for (int i = 1; i < argc; i++) {
        cliArgs.push_back(argv[i]);
        if (cliArgs.back()[0] != '-') {
            // we've found our filename
            filename = cliArgs.back();
            cliArgs.pop_back();
        }
        else {
            // remove leading '-'
            cliArgs.back().erase(cliArgs.back().begin());
        }
    }

    if (filename == "") {
        error("Could not find filename");
    }

    string path = cwd + "/" + filename;
    fstream new_file;
    new_file.open(path, ios_base::out);
    if (!new_file.is_open()) {
        error("Could not open file for output");
    }

    output(new_file, filename, cliArgs);

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2a08, %rsp           # imm = 0x2A08
movq %rsi, %rbx
movl %edi, %r13d
xorl %edi, %edi
callq 0x20f0
movq 0x5066(%rip), %rax      # 0x7fe0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movq $0x0, 0xd8(%rax,%rcx)
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x21ed(%rip), %rdx      # 0x518a
leaq 0x40(%rsp), %rdi
movq %rdx, %rsi
callq 0x3c66
leaq 0x2f0(%rsp), %rdi
movl $0x2710, %esi           # imm = 0x2710
callq 0x2120
testq %rax, %rax
je 0x3275
leaq 0x40(%rsp), %r14
movq 0x8(%r14), %r15
leaq 0x2f0(%rsp), %r12
movq %r12, %rdi
callq 0x2100
movq %r14, %rdi
xorl %esi, %esi
movq %r15, %rdx
movq %r12, %rcx
movq %rax, %r8
callq 0x22c0
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movq $0x0, 0x30(%rsp)
leaq 0x10(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x2178(%rip), %rdx      # 0x518a
movq %rsp, %rdi
movq %rdx, %rsi
callq 0x3c66
cmpl $0x2, %r13d
jl 0x30dd
movl %r13d, %r13d
movl $0x1, %ebp
leaq 0xe0(%rsp), %r14
leaq 0x60(%rsp), %r15
leaq 0x20(%rsp), %r12
movq (%rbx,%rbp,8), %rsi
movq %r14, %rdi
movq %r15, %rdx
callq 0x3434
movq %r12, %rdi
movq %r14, %rsi
callq 0x4bbe
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x3080
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x2200
movq 0x28(%rsp), %rsi
movq -0x20(%rsi), %rax
addq $-0x20, %rsi
cmpb $0x2d, (%rax)
jne 0x30a3
movl $0x1, %edx
movq %rsi, %rdi
xorl %esi, %esi
callq 0x2250
jmp 0x30d1
movq %rsp, %rdi
callq 0x2140
movq 0x28(%rsp), %rax
leaq -0x20(%rax), %rcx
movq %rcx, 0x28(%rsp)
movq -0x20(%rax), %rdi
addq $-0x10, %rax
cmpq %rax, %rdi
je 0x30d1
movq (%rax), %rsi
incq %rsi
callq 0x2200
incq %rbp
cmpq %rbp, %r13
jne 0x3041
leaq 0x20a6(%rip), %rsi      # 0x518a
movq %rsp, %rdi
callq 0x20a0
testl %eax, %eax
je 0x32a9
leaq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
movq %rax, (%rdi)
movq 0x40(%rsp), %rsi
movq 0x48(%rsp), %rdx
addq %rsi, %rdx
callq 0x3bd6
leaq 0x1f88(%rip), %rsi      # 0x50a8
leaq 0xe0(%rsp), %rdi
callq 0x2350
movq (%rsp), %rsi
movq 0x8(%rsp), %rdx
leaq 0xe0(%rsp), %rdi
callq 0x20b0
leaq 0x70(%rsp), %r14
movq %r14, -0x10(%r14)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x316a
movq %rdx, 0x60(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x70(%rsp)
jmp 0x3171
movups (%rcx), %xmm0
movups %xmm0, (%r14)
movq 0x8(%rax), %rdx
movq %rdx, 0x68(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x31ae
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0xe0(%rsp), %rdi
callq 0x2260
leaq 0xe0(%rsp), %rdi
leaq 0x60(%rsp), %rsi
movl $0x10, %edx
callq 0x2290
leaq 0x160(%rsp), %rdi
callq 0x2080
testb %al, %al
je 0x32dd
leaq 0xe0(%rsp), %rdi
movq %rsp, %rsi
leaq 0x20(%rsp), %rdx
callq 0x2dc0
leaq 0xe0(%rsp), %rdi
callq 0x2070
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x3220
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x2200
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x323b
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x20(%rsp), %rdi
callq 0x35c8
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x3261
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2200
xorl %eax, %eax
addq $0x2a08, %rsp           # imm = 0x2A08
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1f03(%rip), %rsi      # 0x518b
leaq 0x1f23(%rip), %rdx      # 0x51b2
leaq 0xc0(%rsp), %rdi
callq 0x3c66
leaq 0xc0(%rsp), %rdi
callq 0x266c
leaq 0xb0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x1ef7(%rip), %rsi      # 0x51b3
leaq 0x1f07(%rip), %rdx      # 0x51ca
leaq 0xa0(%rsp), %rdi
callq 0x3c66
leaq 0xa0(%rsp), %rdi
callq 0x266c
leaq 0x90(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1edb(%rip), %rsi      # 0x51cb
leaq 0x1ef2(%rip), %rdx      # 0x51e9
leaq 0x80(%rsp), %rdi
callq 0x3c66
leaq 0x80(%rsp), %rdi
callq 0x266c
movq %rax, %rbx
movq 0x80(%rsp), %rdi
cmpq %r15, %rdi
je 0x339b
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x339b
jmp 0x3398
movq %rax, %rbx
movq 0xa0(%rsp), %rdi
cmpq %r14, %rdi
je 0x33ea
movq 0xb0(%rsp), %rsi
jmp 0x33e2
jmp 0x33bd
movq %rax, %rbx
movq 0xc0(%rsp), %rdi
cmpq %r14, %rdi
je 0x340f
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x2200
jmp 0x340f
jmp 0x3393
movq %rax, %rbx
jmp 0x33a8
jmp 0x33c2
jmp 0x33c2
jmp 0x33bd
movq %rax, %rbx
jmp 0x3405
movq %rax, %rbx
jmp 0x340f
movq %rax, %rbx
leaq 0xe0(%rsp), %rdi
callq 0x2070
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x33ea
movq 0x70(%rsp), %rsi
jmp 0x33e2
jmp 0x33bd
jmp 0x33bd
movq %rax, %rbx
jmp 0x33ea
movq %rax, %rbx
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x33ea
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x2200
movq (%rsp), %rdi
leaq 0x10(%rsp), %rax
cmpq %rax, %rdi
je 0x3405
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x2200
leaq 0x20(%rsp), %rdi
callq 0x35c8
movq 0x40(%rsp), %rdi
leaq 0x50(%rsp), %rax
cmpq %rax, %rdi
je 0x342b
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x2200
movq %rbx, %rdi
callq 0x2320
nop