// File: /workspace/github_cpp_makefile_star2_O3/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 0x2c5f
cmpl $0x2, %edi
je 0x2a8a
cmpl $0x1, %edi
jne 0x2e35
leaq 0x6614(%rip), %rsi      # 0x9045
leaq -0x4f8(%rbp), %rdi
movl $0x8, %edx
callq 0x23a0
leaq 0x6606(%rip), %rsi      # 0x904f
leaq -0x2f0(%rbp), %rdi
movl $0x10, %edx
callq 0x2220
leaq -0x4f8(%rbp), %rdi
leaq -0x2f0(%rbp), %rsi
callq 0x2921
leaq -0x4f8(%rbp), %rdi
callq 0x2050
leaq -0x2f0(%rbp), %rdi
callq 0x22b0
jmp 0x2df3
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 0x3808
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 0x6662
leaq -0x70(%rbp), %rdi
movq %rax, %rsi
callq 0x3086
movq -0xf0(%rbp), %rdi
testq %rdi, %rdi
je 0x2b42
callq 0x21d0
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x2b50
callq 0x21d0
movq -0x70(%rbp), %rax
cmpq %rax, -0x68(%rbp)
je 0x2bb0
movq (%rax), %r15
movq 0x8(%rax), %r12
cmpq %r12, %r15
je 0x2b98
movq 0xa463(%rip), %rbx      # 0xcfd0
leaq 0x666b(%rip), %r14      # 0x91df
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 0x2b74
movq 0xa431(%rip), %rdi      # 0xcfd0
leaq 0x65d7(%rip), %rsi      # 0x917d
movl $0x1, %edx
callq 0x2250
leaq -0x70(%rbp), %rdi
callq 0x3122
movq -0x260(%rbp), %rdi
testq %rdi, %rdi
je 0x2bca
callq 0x21d0
leaq -0x278(%rbp), %rbx
movq %rbx, %rdi
callq 0x3122
movq -0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x2c0a
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 0x3122
movq -0x18(%rbx), %rdi
testq %rdi, %rdi
je 0x2c27
callq 0x21d0
movq -0x2e8(%rbp), %rdi
testq %rdi, %rdi
je 0x2c38
callq 0x21d0
leaq -0x4f8(%rbp), %rdi
callq 0x2060
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2e35
callq 0x21d0
jmp 0x2e35
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 0x3216
leaq -0x50(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x4cce
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 0x2cfb
callq 0x21d0
movq -0xd0(%rbp), %rdi
cmpq %r14, %rdi
je 0x2d0c
callq 0x21d0
movq -0x4f8(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x4d8(%rbp,%rax)
jne 0x2e47
leaq -0xa0(%rbp), %r14
movq %r14, -0x10(%r14)
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
addq %rsi, %rdx
leaq -0xb0(%rbp), %rdi
callq 0x3216
leaq -0x50(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x4cce
leaq -0x2f0(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x10, %edx
callq 0x20f0
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x2d7a
callq 0x21d0
movq -0xb0(%rbp), %rdi
cmpq %r14, %rdi
je 0x2d8b
callq 0x21d0
movq -0x2f0(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x2d0(%rbp,%rax)
jne 0x2e80
leaq -0x4f8(%rbp), %rdi
leaq -0x2f0(%rbp), %rsi
callq 0x2921
leaq -0x4f8(%rbp), %rdi
callq 0x2050
leaq -0x2f0(%rbp), %rdi
callq 0x22b0
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2de1
callq 0x21d0
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2df3
callq 0x21d0
movq 0xa1c6(%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 0xa1a2(%rip), %rdi      # 0xcff0
leaq 0x6207(%rip), %rsi      # 0x905c
movl $0x1a, %edx
callq 0x2250
movq 0x8(%rbx), %rsi
movq 0xa186(%rip), %rdi      # 0xcff0
callq 0x21f0
leaq 0x6307(%rip), %rsi      # 0x917d
movq %rax, %rdi
callq 0x21f0
jmp 0x2eb7
movq 0xa169(%rip), %rdi      # 0xcff0
leaq 0x61e9(%rip), %rsi      # 0x9077
movl $0x1b, %edx
callq 0x2250
movq 0x10(%rbx), %rsi
movq 0xa14d(%rip), %rdi      # 0xcff0
callq 0x21f0
leaq 0x62ce(%rip), %rsi      # 0x917d
movq %rax, %rdi
callq 0x21f0
movl $0x1, %edi
callq 0x2270
jmp 0x2fae
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r15, %rdi
je 0x2edc
callq 0x21d0
jmp 0x2edc
movq %rax, %rbx
movq -0xb0(%rbp), %rdi
jmp 0x2f0b
jmp 0x2f6d
movq %rax, %rbx
leaq -0x40(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f04
callq 0x21d0
jmp 0x2f04
movq %rax, %rbx
movq -0xd0(%rbp), %rdi
cmpq %r14, %rdi
je 0x2f70
callq 0x21d0
jmp 0x2f70
jmp 0x2f6d
movq %rax, %rbx
jmp 0x2f82
movq %rax, %rbx
jmp 0x2fc6
jmp 0x2f68
movq %rax, %rbx
jmp 0x2fd2
jmp 0x2f32
movq %rax, %rbx
jmp 0x2fa0
movq %rax, %rbx
jmp 0x2fe4
movq %rax, %rbx
movq -0xf0(%rbp), %rdi
testq %rdi, %rdi
je 0x2f53
callq 0x21d0
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x2fba
callq 0x21d0
jmp 0x2fba
movq %rax, %rbx
jmp 0x2fba
movq %rax, %rbx
jmp 0x2f94
movq %rax, %rbx
leaq -0x60(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f82
callq 0x21d0
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2f94
callq 0x21d0
leaq -0x2f0(%rbp), %rdi
callq 0x22e0
leaq -0x4f8(%rbp), %rdi
callq 0x2060
jmp 0x2fe4
movq %rax, %rbx
leaq -0x70(%rbp), %rdi
callq 0x3122
leaq -0x2f0(%rbp), %rdi
callq 0x3176
leaq -0x4f8(%rbp), %rdi
callq 0x2060
leaq -0x80(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2fe4
callq 0x21d0
movq %rbx, %rdi
callq 0x2380