// File: /workspace/github_cpp_makefile_star2_O3/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 0x7f12
leaq -0x420(%rbp), %rdi
callq 0x2240
leaq -0x88(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x4339(%rip), %rsi      # 0x9194
leaq 0x4340(%rip), %rdx      # 0x91a2
leaq -0x98(%rbp), %rdi
callq 0x799c
leaq -0x218(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x4cce
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 0x4eae
callq 0x21d0
movq -0x98(%rbp), %rdi
cmpq %r15, %rdi
je 0x4ebf
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 0x4fd0
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 0x4248(%rip), %rsi      # 0x91a3
callq 0x2080
testl %eax, %eax
jne 0x4fa2
jmp 0x4f89
movl -0x34(%rbp), %eax
testl %eax, %eax
jle 0x4f89
movq -0x30(%rbp), %rcx
movl (%rcx), %ecx
movl %ecx, %edx
imull %ecx, %edx
cmpl %edx, %eax
jg 0x4f89
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 0x4f66
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
je 0x4fb0
callq 0x21d0
movq %r12, %rdi
movq 0x800e(%rip), %rsi      # 0xcfc8
callq 0x22c0
leaq -0x1a0(%rbp), %rdi
callq 0x20a0
jmp 0x4edd
leaq -0x420(%rbp), %rdi
callq 0x2050
movq 0x7fed(%rip), %rdi      # 0xcfd0
leaq 0x41bb(%rip), %rsi      # 0x91a5
movl $0xe, %edx
callq 0x2250
movq -0x30(%rbp), %rax
movslq (%rax), %rcx
testq %rcx, %rcx
jle 0x502d
movq (%r14), %rax
xorl %edx, %edx
cmpl $-0x1, (%rax,%rdx,4)
je 0x5015
incq %rdx
cmpq %rdx, %rcx
jne 0x5005
jmp 0x502d
movq -0x30(%rbp), %rcx
cmpq %rax, 0x98(%rcx)
je 0x502d
movq -0x30(%rbp), %rcx
movq %rax, 0x98(%rcx)
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x503f
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 0x507d
callq 0x21d0
jmp 0x507d
movq %rax, %rbx
movq -0x98(%rbp), %rdi
cmpq %r15, %rdi
jne 0x50d8
jmp 0x50dd
movq %rax, %rbx
jmp 0x50dd
jmp 0x5096
jmp 0x5096
jmp 0x509b
movq %rax, %rbx
jmp 0x50cb
movq %rax, %rbx
movq -0x58(%rbp), %rdi
cmpq %r15, %rdi
je 0x50ac
callq 0x21d0
movq 0x7f15(%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 0x50dd
callq 0x21d0
leaq -0x420(%rbp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x2380
nop