// File: /workspace/github_cpp_makefile_star2_O1/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 0x2c72
cmpl $0x2, %edi
je 0x2a9d
cmpl $0x1, %edi
jne 0x2e48
leaq 0x6601(%rip), %rsi      # 0x9045
leaq -0x4f8(%rbp), %rdi
movl $0x8, %edx
callq 0x23a0
leaq 0x65f3(%rip), %rsi      # 0x904f
leaq -0x2f0(%rbp), %rdi
movl $0x10, %edx
callq 0x2220
leaq -0x4f8(%rbp), %rdi
leaq -0x2f0(%rbp), %rsi
callq 0x2934
leaq -0x4f8(%rbp), %rdi
callq 0x2050
leaq -0x2f0(%rbp), %rdi
callq 0x22b0
jmp 0x2e06
movq 0x8(%rbx), %rsi
leaq -0x90(%rbp), %rdi
leaq -0x4f8(%rbp), %rdx
callq 0x20c0
leaq -0x4f8(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movl $0x8, %edx
callq 0x2300
leaq -0x2f0(%rbp), %rdi
leaq -0x4f8(%rbp), %rsi
callq 0x3876
leaq -0x4f8(%rbp), %rdi
leaq -0x28(%rbp), %rsi
callq 0x2130
leaq -0x24(%rbp), %rsi
movq %rax, %rdi
callq 0x2130
movl -0x28(%rbp), %esi
movl -0x24(%rbp), %edx
xorl %eax, %eax
leaq -0x50(%rbp), %r9
movq %rax, 0x10(%r9)
xorps %xmm0, %xmm0
movaps %xmm0, (%r9)
leaq -0xf0(%rbp), %rcx
movq %rax, 0x10(%rcx)
movaps %xmm0, (%rcx)
movq %rcx, (%rsp)
leaq -0x2f0(%rbp), %rdi
movl $0x1, %ecx
xorl %r8d, %r8d
callq 0x6730
leaq -0x70(%rbp), %rdi
movq %rax, %rsi
callq 0x309a
movq -0xf0(%rbp), %rdi
testq %rdi, %rdi
je 0x2b55
callq 0x21d0
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x2b63
callq 0x21d0
movq -0x70(%rbp), %rax
cmpq %rax, -0x68(%rbp)
je 0x2bc3
movq (%rax), %r15
movq 0x8(%rax), %r12
cmpq %r12, %r15
je 0x2bab
movq 0xa450(%rip), %rbx      # 0xcfd0
leaq 0x6640(%rip), %r14      # 0x91c7
movl (%r15), %esi
movq %rbx, %rdi
callq 0x2370
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2250
addq $0x4, %r15
cmpq %r12, %r15
jne 0x2b87
movq 0xa41e(%rip), %rdi      # 0xcfd0
leaq 0x65ac(%rip), %rsi      # 0x9165
movl $0x1, %edx
callq 0x2250
leaq -0x70(%rbp), %rdi
callq 0x3136
movq -0x260(%rbp), %rdi
testq %rdi, %rdi
je 0x2bdd
callq 0x21d0
leaq -0x278(%rbp), %rbx
movq %rbx, %rdi
callq 0x3136
movq -0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x2c1d
callq 0x21d0
xorl %eax, %eax
movq %rax, -0x2a0(%rbp)
movl %eax, -0x298(%rbp)
movq %rax, -0x290(%rbp)
movl %eax, -0x288(%rbp)
movq %rax, -0x280(%rbp)
leaq -0x2b8(%rbp), %rbx
movq %rbx, %rdi
callq 0x3136
movq -0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x2c3a
callq 0x21d0
movq -0x2e8(%rbp), %rdi
testq %rdi, %rdi
je 0x2c4b
callq 0x21d0
leaq -0x4f8(%rbp), %rdi
callq 0x2060
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2e48
callq 0x21d0
jmp 0x2e48
leaq -0x4f8(%rbp), %rdi
callq 0x2240
leaq -0x2f0(%rbp), %rdi
callq 0x2350
movq 0x8(%rbx), %rsi
leaq -0x90(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x20c0
movq 0x10(%rbx), %rsi
leaq -0x70(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x20c0
leaq -0xc0(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x90(%rbp), %rsi
movq -0x88(%rbp), %rdx
addq %rsi, %rdx
leaq -0xd0(%rbp), %rdi
callq 0x3220
leaq -0x50(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x4d76
leaq -0x4f8(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x8, %edx
callq 0x21a0
leaq -0x40(%rbp), %r15
movq -0x10(%r15), %rdi
cmpq %r15, %rdi
je 0x2d0e
callq 0x21d0
movq -0xd0(%rbp), %rdi
cmpq %r14, %rdi
je 0x2d1f
callq 0x21d0
movq -0x4f8(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x4d8(%rbp,%rax)
jne 0x2e5a
leaq -0xa0(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq %rsi, %rdx
leaq -0xb0(%rbp), %rdi
callq 0x3220
leaq -0x50(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x4d76
leaq -0x2f0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x10, %edx
callq 0x20f0
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x2d8d
callq 0x21d0
movq -0xb0(%rbp), %rdi
cmpq %r14, %rdi
je 0x2d9e
callq 0x21d0
movq -0x2f0(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x2d0(%rbp,%rax)
jne 0x2e93
leaq -0x4f8(%rbp), %rdi
leaq -0x2f0(%rbp), %rsi
callq 0x2934
leaq -0x4f8(%rbp), %rdi
callq 0x2050
leaq -0x2f0(%rbp), %rdi
callq 0x22b0
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2df4
callq 0x21d0
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2e06
callq 0x21d0
movq 0xa1b3(%rip), %rax      # 0xcfc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x2e8(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x2f0(%rbp,%rcx)
callq 0x2180
leaq -0x1f8(%rbp), %rdi
callq 0x20a0
leaq -0x4f8(%rbp), %rdi
callq 0x2060
xorl %eax, %eax
addq $0x4e0, %rsp            # imm = 0x4E0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0xa18f(%rip), %rdi      # 0xcff0
leaq 0x61f4(%rip), %rsi      # 0x905c
movl $0x1a, %edx
callq 0x2250
movq 0x8(%rbx), %rsi
movq 0xa173(%rip), %rdi      # 0xcff0
callq 0x21f0
leaq 0x62dc(%rip), %rsi      # 0x9165
movq %rax, %rdi
callq 0x21f0
jmp 0x2eca
movq 0xa156(%rip), %rdi      # 0xcff0
leaq 0x61d6(%rip), %rsi      # 0x9077
movl $0x1b, %edx
callq 0x2250
movq 0x10(%rbx), %rsi
movq 0xa13a(%rip), %rdi      # 0xcff0
callq 0x21f0
leaq 0x62a3(%rip), %rsi      # 0x9165
movq %rax, %rdi
callq 0x21f0
movl $0x1, %edi
callq 0x2270
jmp 0x2fc1
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x2eef
callq 0x21d0
jmp 0x2eef
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
jmp 0x2f1e
jmp 0x2f80
movq %rax, %rbx
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f17
callq 0x21d0
jmp 0x2f17
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
cmpq %r14, %rdi
je 0x2f83
callq 0x21d0
jmp 0x2f83
jmp 0x2f80
movq %rax, %rbx
jmp 0x2f95
movq %rax, %rbx
jmp 0x2fd9
jmp 0x2f7b
movq %rax, %rbx
jmp 0x2fe5
jmp 0x2f45
movq %rax, %rbx
jmp 0x2fb3
movq %rax, %rbx
jmp 0x2ff7
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
testq %rdi, %rdi
je 0x2f66
callq 0x21d0
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x2fcd
callq 0x21d0
jmp 0x2fcd
movq %rax, %rbx
jmp 0x2fcd
movq %rax, %rbx
jmp 0x2fa7
movq %rax, %rbx
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f95
callq 0x21d0
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2fa7
callq 0x21d0
leaq -0x2f0(%rbp), %rdi
callq 0x22e0
leaq -0x4f8(%rbp), %rdi
callq 0x2060
jmp 0x2ff7
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x3136
leaq -0x2f0(%rbp), %rdi
callq 0x3180
leaq -0x4f8(%rbp), %rdi
callq 0x2060
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2ff7
callq 0x21d0
movq %rbx, %rdi
callq 0x2380
nop