// File: cauimsouza[P]rikudo-solver/src/rikudo_solver/graph.cpp
// Function: Graph::solve_sat()
void Graph::solve_sat(){
    char buffer[1024];  
    int buffer_size = 1024;
    
    readlink("/proc/self/exe", buffer, buffer_size);
    char *path_s = dirname(buffer);
    char *parpath_s = dirname(path_s);
    std::string path(path_s);
    std::string sat_path(std::string(parpath_s) + "/lib/" + sat_solver);
    std::string inp_path(path + "/bin/" + std::string(sat_input));
    std::string out_path(path + "/bin/" + std::string(sat_output));
    std::cout << inp_path << "\n" << out_path << "\n";

    std::string cmd = sat_path + " " + inp_path + " > " + out_path; 
    std::system(cmd.data());
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x670, %rsp            # imm = 0x670
movq %rdi, -0x8(%rbp)
movl $0x400, -0x414(%rbp)    # imm = 0x400
movslq -0x414(%rbp), %rdx
leaq 0xa83b(%rip), %rdi      # 0x13172
leaq -0x410(%rbp), %rsi
movq %rsi, -0x630(%rbp)
callq 0x3260
movq -0x630(%rbp), %rdi
callq 0x30d0
movq %rax, -0x420(%rbp)
movq -0x420(%rbp), %rdi
callq 0x30d0
movq %rax, -0x428(%rbp)
movq -0x420(%rbp), %rax
movq %rax, -0x628(%rbp)
leaq -0x449(%rbp), %rdi
movq %rdi, -0x620(%rbp)
callq 0x3410
movq -0x628(%rbp), %rsi
movq -0x620(%rbp), %rdx
leaq -0x448(%rbp), %rdi
callq 0x3300
jmp 0x89ad
leaq -0x449(%rbp), %rdi
callq 0x3270
movq -0x428(%rbp), %rax
movq %rax, -0x640(%rbp)
leaq -0x4c1(%rbp), %rdi
movq %rdi, -0x638(%rbp)
callq 0x3410
movq -0x640(%rbp), %rsi
movq -0x638(%rbp), %rdx
leaq -0x4c0(%rbp), %rdi
callq 0x3300
jmp 0x89f6
leaq 0xa784(%rip), %rdx      # 0x13181
leaq -0x4a0(%rbp), %rdi
leaq -0x4c0(%rbp), %rsi
callq 0xb850
jmp 0x8a12
leaq 0xa76e(%rip), %rdx      # 0x13187
leaq -0x480(%rbp), %rdi
leaq -0x4a0(%rbp), %rsi
callq 0xb850
jmp 0x8a2e
leaq -0x4a0(%rbp), %rdi
callq 0x3170
leaq -0x4c0(%rbp), %rdi
callq 0x3170
leaq -0x4c1(%rbp), %rdi
callq 0x3270
leaq 0xa73c(%rip), %rdx      # 0x13195
leaq -0x508(%rbp), %rdi
leaq -0x448(%rbp), %rsi
callq 0xb970
jmp 0x8a6e
leaq -0x529(%rbp), %rdi
movq %rdi, -0x648(%rbp)
callq 0x3410
movq -0x648(%rbp), %rdx
leaq 0xa695(%rip), %rsi      # 0x13124
leaq -0x528(%rbp), %rdi
callq 0x3300
jmp 0x8a9d
leaq -0x4e8(%rbp), %rdi
leaq -0x508(%rbp), %rsi
leaq -0x528(%rbp), %rdx
callq 0xb8a0
jmp 0x8ab9
leaq -0x528(%rbp), %rdi
callq 0x3170
leaq -0x529(%rbp), %rdi
callq 0x3270
leaq -0x508(%rbp), %rdi
callq 0x3170
leaq 0xa6b1(%rip), %rdx      # 0x13195
leaq -0x570(%rbp), %rdi
leaq -0x448(%rbp), %rsi
callq 0xb970
jmp 0x8af9
leaq -0x591(%rbp), %rdi
movq %rdi, -0x650(%rbp)
callq 0x3410
movq -0x650(%rbp), %rdx
leaq 0xa638(%rip), %rsi      # 0x13152
leaq -0x590(%rbp), %rdi
callq 0x3300
jmp 0x8b28
leaq -0x550(%rbp), %rdi
leaq -0x570(%rbp), %rsi
leaq -0x590(%rbp), %rdx
callq 0xb8a0
jmp 0x8b44
leaq -0x590(%rbp), %rdi
callq 0x3170
leaq -0x591(%rbp), %rdi
callq 0x3270
leaq -0x570(%rbp), %rdi
callq 0x3170
movq 0x11461(%rip), %rdi     # 0x19fd0
leaq -0x4e8(%rbp), %rsi
callq 0x31f0
movq %rax, -0x658(%rbp)
jmp 0x8b84
movq -0x658(%rbp), %rdi
leaq 0xa5a9(%rip), %rsi      # 0x1313b
callq 0x3230
movq %rax, -0x660(%rbp)
jmp 0x8ba0
movq -0x660(%rbp), %rdi
leaq -0x550(%rbp), %rsi
callq 0x31f0
movq %rax, -0x668(%rbp)
jmp 0x8bbc
movq -0x668(%rbp), %rdi
leaq 0xa571(%rip), %rsi      # 0x1313b
callq 0x3230
jmp 0x8bd1
leaq 0xa5c5(%rip), %rdx      # 0x1319d
leaq -0x618(%rbp), %rdi
leaq -0x480(%rbp), %rsi
callq 0xb970
jmp 0x8bed
leaq -0x5f8(%rbp), %rdi
leaq -0x618(%rbp), %rsi
leaq -0x4e8(%rbp), %rdx
callq 0xb9f0
jmp 0x8c09
leaq 0xa58b(%rip), %rdx      # 0x1319b
leaq -0x5d8(%rbp), %rdi
leaq -0x5f8(%rbp), %rsi
callq 0xb850
jmp 0x8c25
leaq -0x5b8(%rbp), %rdi
leaq -0x5d8(%rbp), %rsi
leaq -0x550(%rbp), %rdx
callq 0xb9f0
jmp 0x8c41
leaq -0x5d8(%rbp), %rdi
callq 0x3170
leaq -0x5f8(%rbp), %rdi
callq 0x3170
leaq -0x618(%rbp), %rdi
callq 0x3170
leaq -0x5b8(%rbp), %rdi
callq 0x32f0
movq %rax, %rdi
callq 0x31c0
jmp 0x8c7b
leaq -0x5b8(%rbp), %rdi
callq 0x3170
leaq -0x550(%rbp), %rdi
callq 0x3170
leaq -0x4e8(%rbp), %rdi
callq 0x3170
leaq -0x480(%rbp), %rdi
callq 0x3170
leaq -0x448(%rbp), %rdi
callq 0x3170
addq $0x670, %rsp            # imm = 0x670
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x458(%rbp)
movl %eax, -0x45c(%rbp)
leaq -0x449(%rbp), %rdi
callq 0x3270
jmp 0x8ed4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x458(%rbp)
movl %eax, -0x45c(%rbp)
jmp 0x8d35
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x458(%rbp)
movl %eax, -0x45c(%rbp)
jmp 0x8d29
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x458(%rbp)
movl %eax, -0x45c(%rbp)
leaq -0x4a0(%rbp), %rdi
callq 0x3170
leaq -0x4c0(%rbp), %rdi
callq 0x3170
leaq -0x4c1(%rbp), %rdi
callq 0x3270
jmp 0x8ec8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x458(%rbp)
movl %eax, -0x45c(%rbp)
jmp 0x8ebc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x458(%rbp)
movl %eax, -0x45c(%rbp)
jmp 0x8d8f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x458(%rbp)
movl %eax, -0x45c(%rbp)
leaq -0x528(%rbp), %rdi
callq 0x3170
leaq -0x529(%rbp), %rdi
callq 0x3270
leaq -0x508(%rbp), %rdi
callq 0x3170
jmp 0x8ebc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x458(%rbp)
movl %eax, -0x45c(%rbp)
jmp 0x8eb0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x458(%rbp)
movl %eax, -0x45c(%rbp)
jmp 0x8df5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x458(%rbp)
movl %eax, -0x45c(%rbp)
leaq -0x590(%rbp), %rdi
callq 0x3170
leaq -0x591(%rbp), %rdi
callq 0x3270
leaq -0x570(%rbp), %rdi
callq 0x3170
jmp 0x8eb0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x458(%rbp)
movl %eax, -0x45c(%rbp)
jmp 0x8ea4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x458(%rbp)
movl %eax, -0x45c(%rbp)
jmp 0x8e78
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x458(%rbp)
movl %eax, -0x45c(%rbp)
jmp 0x8e6c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x458(%rbp)
movl %eax, -0x45c(%rbp)
leaq -0x5d8(%rbp), %rdi
callq 0x3170
leaq -0x5f8(%rbp), %rdi
callq 0x3170
leaq -0x618(%rbp), %rdi
callq 0x3170
jmp 0x8ea4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x458(%rbp)
movl %eax, -0x45c(%rbp)
leaq -0x5b8(%rbp), %rdi
callq 0x3170
leaq -0x550(%rbp), %rdi
callq 0x3170
leaq -0x4e8(%rbp), %rdi
callq 0x3170
leaq -0x480(%rbp), %rdi
callq 0x3170
leaq -0x448(%rbp), %rdi
callq 0x3170
movq -0x458(%rbp), %rdi
callq 0x3400