// File: /workspace/github_cpp_makefile_star2_O2/cauimsouza[P]rikudo-solver/src/rikudo_solver/graph.cpp
// Function: Graph::read_sol()
std::vector<int>& Graph::read_sol()
{
    path.assign(n_vertices, -1);

    std::ifstream myfile;
    myfile.open(get_path(sat_output));

    std::string line;

    while(getline(myfile, line)){
        std::istringstream iss(line);

        std::string type;
        iss >> type;

        if(type == "v"){
            int val;
            while(iss >> val){
                if(val > 0 && val <= n_vertices * n_vertices){
                    int i, j;
                    decode(val, i, j);
                    path[i] = j;
                }
            }
        }
    }


    myfile.close();

    std::cout << "sat file read\n";
    
    for(int i = 0; i < n_vertices; i++){
        if(path[i] == -1) {
            path.clear();
            return path;
        }
    }

    return path;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3f8, %rsp            # imm = 0x3F8
movq %rdi, %r14
leaq 0x90(%rdi), %rbx
movslq (%rdi), %rsi
leaq -0x298(%rbp), %rdx
orl $-0x1, (%rdx)
movq %rbx, %rdi
callq 0x6ab8
leaq -0x298(%rbp), %rdi
callq 0x2210
leaq 0x3bbe(%rip), %rsi      # 0x8152
leaq -0x90(%rbp), %rdi
leaq -0x70(%rbp), %rdx
callq 0x20b0
leaq -0x418(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x4491
leaq -0x298(%rbp), %rdi
leaq -0x418(%rbp), %rsi
pushq $0x8
popq %rdx
callq 0x2180
leaq -0x418(%rbp), %r15
movq %r15, %rdi
callq 0x20e0
leaq -0x90(%rbp), %rdi
callq 0x20e0
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x50(%rbp), %r12
leaq -0x2c(%rbp), %r13
leaq -0x298(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2040
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x46b0
movq %r15, %rdi
leaq -0x70(%rbp), %rsi
pushq $0x8
popq %rdx
callq 0x2310
leaq -0x40(%rbp), %rax
movq %rax, -0x50(%rbp)
andq $0x0, -0x48(%rbp)
movb $0x0, -0x40(%rbp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x2250
movq %r12, %rdi
leaq 0x3b0a(%rip), %rsi      # 0x8161
callq 0x5f79
testb %al, %al
je 0x469b
movq %r15, %rdi
movq %r13, %rsi
callq 0x2150
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x469b
movl -0x2c(%rbp), %eax
testl %eax, %eax
jle 0x4660
movl (%r14), %ecx
movl %ecx, %edx
imull %ecx, %edx
cmpl %edx, %eax
jg 0x4660
decl %eax
cltd
idivl %ecx
cltq
movq (%rbx), %rcx
movl %edx, (%rcx,%rax,4)
jmp 0x4660
movq %r12, %rdi
callq 0x20e0
movq %r15, %rdi
callq 0x20f0
jmp 0x4600
leaq -0x298(%rbp), %rdi
callq 0x2050
movq 0x790d(%rip), %rdi      # 0xbfd0
leaq 0x3a99(%rip), %rsi      # 0x8163
callq 0x21d0
movl (%r14), %ecx
movq 0x90(%r14), %rax
xorl %edx, %edx
testl %ecx, %ecx
cmovlel %edx, %ecx
cmpq %rdx, %rcx
je 0x46ff
cmpl $-0x1, (%rax,%rdx,4)
leaq 0x1(%rdx), %rdx
jne 0x46e0
cmpq %rax, 0x98(%r14)
je 0x46ff
movq %rax, 0x98(%r14)
leaq -0x70(%rbp), %rdi
callq 0x20e0
leaq -0x298(%rbp), %rdi
callq 0x2070
movq %rbx, %rax
addq $0x3f8, %rsp            # imm = 0x3F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x418(%rbp), %rdi
callq 0x20e0
jmp 0x473d
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
jmp 0x4772
movq %rax, %rbx
jmp 0x4777
jmp 0x4751
jmp 0x4756
jmp 0x4751
movq %rax, %rbx
jmp 0x476e
movq %rax, %rbx
leaq -0x50(%rbp), %rdi
callq 0x20e0
leaq -0x418(%rbp), %rdi
callq 0x20f0
leaq -0x70(%rbp), %rdi
callq 0x20e0
leaq -0x298(%rbp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2360
nop