// File: /workspace/github_cpp_makefile_star2_O2/cauimsouza[P]rikudo-solver/src/rikudo_solver/main.cpp
// Function: main
int main(int argc, char const *argv[])
{
    if(argc == 1){
        std::ifstream ifile("graph.txt");
        std::ofstream ofile("solution.txt");

        solves_rikudo(ifile, ofile);

        ifile.close();
        ofile.close();
    }
    else if(argc == 2){
        std::string ifile_name(argv[1]);
        std::ifstream ifile(ifile_name);
        Graph graph(ifile);
        int source, target;
        ifile >> source >> target;
        auto paths = graph.ham_path(source, target);
        if(paths.size() > 0){
            for(int i : paths[0])
                std::cout << i << " ";
            std::cout << "\n";
        }
    }
    else if(argc == 3){
        std::ifstream ifile;
        std::ofstream ofile;

        std::string inp_file(argv[1]);
        std::string out_file(argv[2]);
        ifile.open(get_path(inp_file));
        if(!ifile){
            std::cerr << "Unable to open input file " << argv[1] << "\n";
            exit(1);
        }

        ofile.open(get_path(out_file));
        if(!ofile){
            std::cerr << "Unable to open output file " << argv[2] << "\n";
            exit(1);
        }

        solves_rikudo(ifile, ofile);

        ifile.close();
        ofile.close();
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x4e0, %rsp            # imm = 0x4E0
movq %rsi, %rbx
cmpl $0x3, %edi
je 0x2971
cmpl $0x2, %edi
je 0x2871
cmpl $0x1, %edi
jne 0x2b0d
leaq 0x5829(%rip), %rsi      # 0x8045
leaq -0x2f8(%rbp), %rdi
pushq $0x8
popq %rdx
callq 0x2370
leaq 0x581d(%rip), %rsi      # 0x804f
leaq -0x4f8(%rbp), %rdi
pushq $0x10
popq %rdx
callq 0x2200
leaq -0x2f8(%rbp), %rdi
leaq -0x4f8(%rbp), %rsi
callq 0x276a
leaq -0x2f8(%rbp), %rdi
callq 0x2050
leaq -0x4f8(%rbp), %rdi
callq 0x2290
jmp 0x2ab3
movq 0x8(%rbx), %rsi
leaq -0x90(%rbp), %rdi
leaq -0x2f8(%rbp), %rdx
callq 0x20b0
leaq -0x2f8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
pushq $0x8
popq %rdx
callq 0x22e0
leaq -0x4f8(%rbp), %rdi
leaq -0x2f8(%rbp), %rsi
callq 0x33b2
leaq -0x2f8(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x2150
leaq -0x24(%rbp), %rsi
movq %rax, %rdi
callq 0x2150
movl -0x28(%rbp), %esi
movl -0x24(%rbp), %edx
xorps %xmm0, %xmm0
leaq -0x50(%rbp), %r9
movaps %xmm0, (%r9)
andq $0x0, 0x10(%r9)
leaq -0xb0(%rbp), %rax
movaps %xmm0, (%rax)
andq $0x0, 0x10(%rax)
movq %rax, (%rsp)
leaq -0x4f8(%rbp), %rdi
pushq $0x1
popq %rcx
xorl %r8d, %r8d
callq 0x5570
leaq -0x70(%rbp), %rdi
movq %rax, %rsi
callq 0x2cdc
leaq -0xb0(%rbp), %rdi
callq 0x3172
leaq -0x50(%rbp), %rdi
callq 0x3172
movq -0x70(%rbp), %rax
cmpq %rax, -0x68(%rbp)
je 0x2ae0
movq (%rax), %r15
movq 0x8(%rax), %r12
movq 0x968b(%rip), %rbx      # 0xbfd0
leaq 0x5851(%rip), %r14      # 0x819d
cmpq %r12, %r15
je 0x2acd
movl (%r15), %esi
movq %rbx, %rdi
callq 0x2350
movq %rax, %rdi
movq %r14, %rsi
callq 0x21d0
addq $0x4, %r15
jmp 0x294c
leaq -0x2f8(%rbp), %rdi
callq 0x2210
leaq -0x4f8(%rbp), %rdi
callq 0x2330
movq 0x8(%rbx), %rsi
leaq -0x90(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x20b0
movq 0x10(%rbx), %rsi
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x20b0
leaq -0xf0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x2270
leaq -0x50(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
callq 0x4491
leaq -0x2f8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
pushq $0x8
popq %rdx
callq 0x2180
leaq -0x50(%rbp), %rdi
callq 0x20e0
leaq -0xf0(%rbp), %rdi
callq 0x20e0
movq -0x2f8(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x2d8(%rbp,%rax)
jne 0x2b1f
leaq -0xd0(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2270
leaq -0x50(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x4491
leaq -0x4f8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
pushq $0x10
popq %rdx
callq 0x2100
leaq -0x50(%rbp), %rdi
callq 0x20e0
leaq -0xd0(%rbp), %rdi
callq 0x20e0
movq -0x4f8(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x4d8(%rbp,%rax)
jne 0x2b4f
leaq -0x2f8(%rbp), %rdi
leaq -0x4f8(%rbp), %rsi
callq 0x276a
leaq -0x2f8(%rbp), %rdi
callq 0x2050
leaq -0x4f8(%rbp), %rdi
callq 0x2290
leaq -0x70(%rbp), %rdi
callq 0x20e0
leaq -0x90(%rbp), %rdi
callq 0x20e0
leaq -0x4f8(%rbp), %rdi
callq 0x22b0
leaq -0x2f8(%rbp), %rdi
callq 0x2070
jmp 0x2b0d
movq 0x94fc(%rip), %rdi      # 0xbfd0
leaq 0x5660(%rip), %rsi      # 0x813b
callq 0x21d0
leaq -0x70(%rbp), %rdi
callq 0x2d36
leaq -0x4f8(%rbp), %rdi
callq 0x2d62
leaq -0x2f8(%rbp), %rdi
callq 0x2070
leaq -0x90(%rbp), %rdi
callq 0x20e0
xorl %eax, %eax
addq $0x4e0, %rsp            # imm = 0x4E0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x94ca(%rip), %rdi      # 0xbff0
leaq 0x552f(%rip), %rsi      # 0x805c
callq 0x21d0
movq 0x8(%rbx), %rsi
movq %rax, %rdi
callq 0x21d0
leaq 0x55f6(%rip), %rsi      # 0x813b
movq %rax, %rdi
callq 0x21d0
jmp 0x2b7d
movq 0x949a(%rip), %rdi      # 0xbff0
leaq 0x551a(%rip), %rsi      # 0x8077
callq 0x21d0
movq 0x10(%rbx), %rsi
movq %rax, %rdi
callq 0x21d0
leaq 0x55c6(%rip), %rsi      # 0x813b
movq %rax, %rdi
callq 0x21d0
pushq $0x1
popq %rdi
callq 0x2230
jmp 0x2c43
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x20e0
jmp 0x2b9b
movq %rax, %rbx
leaq -0xd0(%rbp), %rdi
jmp 0x2bbe
jmp 0x2c11
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x20e0
jmp 0x2bb7
movq %rax, %rbx
leaq -0xf0(%rbp), %rdi
callq 0x20e0
jmp 0x2c14
jmp 0x2c11
movq %rax, %rbx
jmp 0x2c1d
movq %rax, %rbx
jmp 0x2c5b
jmp 0x2c0c
movq %rax, %rbx
jmp 0x2c67
jmp 0x2be0
movq %rax, %rbx
jmp 0x2c35
movq %rax, %rbx
jmp 0x2c73
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x3172
leaq -0x50(%rbp), %rdi
callq 0x3172
jmp 0x2c4f
movq %rax, %rbx
jmp 0x2c4f
movq %rax, %rbx
jmp 0x2c29
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x20e0
leaq -0x90(%rbp), %rdi
callq 0x20e0
leaq -0x4f8(%rbp), %rdi
callq 0x22b0
leaq -0x2f8(%rbp), %rdi
callq 0x2070
jmp 0x2c73
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x2d36
leaq -0x4f8(%rbp), %rdi
callq 0x2d62
leaq -0x2f8(%rbp), %rdi
callq 0x2070
leaq -0x90(%rbp), %rdi
callq 0x20e0
movq %rbx, %rdi
callq 0x2360
nop