// File: /workspace/github_cpp_makefile_star2_O1/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
leaq 0x90(%rdi), %r14
movq %rdi, -0x30(%rbp)
movslq (%rdi), %rsi
leaq -0x420(%rbp), %rdx
movl $0xffffffff, (%rdx)     # imm = 0xFFFFFFFF
movq %r14, %rdi
callq 0x7fbc
leaq -0x420(%rbp), %rdi
callq 0x2240
leaq -0x88(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x4279(%rip), %rsi      # 0x917c
leaq 0x4280(%rip), %rdx      # 0x918a
leaq -0x98(%rbp), %rdi
callq 0x7a46
leaq -0x218(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x4d76
leaq -0x420(%rbp), %rdi
leaq -0x218(%rbp), %rsi
movl $0x8, %edx
callq 0x21a0
leaq -0x208(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x4f56
callq 0x21d0
movq -0x98(%rbp), %rdi
cmpq %r15, %rdi
je 0x4f67
callq 0x21d0
leaq -0x68(%rbp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
leaq -0x218(%rbp), %r12
leaq -0x34(%rbp), %r13
movq -0x420(%rbp), %rax
movq -0x18(%rax), %rdi
leaq -0x420(%rbp), %r15
addq %r15, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %edx
movq %r15, %rdi
leaq -0x78(%rbp), %rsi
callq 0x23b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x5078
movq %r12, %rdi
leaq -0x78(%rbp), %rsi
movl $0x8, %edx
callq 0x2330
leaq -0x48(%rbp), %r15
movq %r15, -0x58(%rbp)
movq $0x0, -0x50(%rbp)
movb $0x0, -0x48(%rbp)
movq %r12, %rdi
leaq -0x58(%rbp), %rbx
movq %rbx, %rsi
callq 0x2290
movq %rbx, %rdi
leaq 0x4188(%rip), %rsi      # 0x918b
callq 0x2080
testl %eax, %eax
jne 0x504a
jmp 0x5031
movl -0x34(%rbp), %eax
testl %eax, %eax
jle 0x5031
movq -0x30(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, %edx
imull %ecx, %edx
cmpl %edx, %eax
jg 0x5031
decl %eax
cltd
idivl %ecx
cltq
movq (%r14), %rcx
movl %edx, (%rcx,%rax,4)
movq %r12, %rdi
movq %r13, %rsi
callq 0x2130
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
je 0x500e
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
je 0x5058
callq 0x21d0
movq %r12, %rdi
movq 0x7f66(%rip), %rsi      # 0xcfc8
callq 0x22c0
leaq -0x1a0(%rbp), %rdi
callq 0x20a0
jmp 0x4f85
leaq -0x420(%rbp), %rdi
callq 0x2050
movq 0x7f45(%rip), %rdi      # 0xcfd0
leaq 0x40fb(%rip), %rsi      # 0x918d
movl $0xe, %edx
callq 0x2250
movq -0x30(%rbp), %rax
movslq (%rax), %rcx
testq %rcx, %rcx
jle 0x50d5
movq (%r14), %rax
xorl %edx, %edx
cmpl $-0x1, (%rax,%rdx,4)
je 0x50bd
incq %rdx
cmpq %rdx, %rcx
jne 0x50ad
jmp 0x50d5
movq -0x30(%rbp), %rcx
cmpq %rax, 0x98(%rcx)
je 0x50d5
movq -0x30(%rbp), %rcx
movq %rax, 0x98(%rcx)
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x50e7
callq 0x21d0
leaq -0x420(%rbp), %rdi
callq 0x2060
movq %r14, %rax
addq $0x3f8, %rsp            # imm = 0x3F8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x208(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5125
callq 0x21d0
jmp 0x5125
movq %rax, %rbx
movq -0x98(%rbp), %rdi
cmpq %r15, %rdi
jne 0x5180
jmp 0x5185
movq %rax, %rbx
jmp 0x5185
jmp 0x513e
jmp 0x513e
jmp 0x5143
movq %rax, %rbx
jmp 0x5173
movq %rax, %rbx
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
je 0x5154
callq 0x21d0
movq 0x7e6d(%rip), %rsi      # 0xcfc8
leaq -0x218(%rbp), %rdi
callq 0x22c0
leaq -0x1a0(%rbp), %rdi
callq 0x20a0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x5185
callq 0x21d0
leaq -0x420(%rbp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x2380
nop