// File: /workspace/github_cpp_makefile_star2_O1/cauimsouza[P]rikudo-solver/src/rikudo_solver/graph.cpp
// Function: Graph::add_cons(std::vector<int, std::allocator<int>>&, std::vector<int, std::allocator<int>>&, int)
void Graph::add_cons(std::vector<int>& orig_path, std::vector<int>& cons, int pos){
    std::ofstream ofile;
    ofile.open(get_path(sat_input), std::ofstream::app);

    int n_vertices = orig_path.size();
    for(int i = 0; i <= pos; i++){
        int con = cons[i];
        if(con >= 0){
            int u = orig_path[con];
            int v = orig_path[con+1];
            std::string diam = diam_s(u, v, n_vertices);
            ofile << diam;
        }
        else{
            con = -con;
            int var = encode(con, orig_path[con]);
            ofile << std::to_string(var) << " 0\n";
        }
    }

    ofile.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x268, %rsp            # imm = 0x268
movl %ecx, %ebx
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, -0x50(%rbp)
leaq -0x288(%rbp), %rdi
callq 0x2350
leaq -0x78(%rbp), %r14
movq %r14, -0x10(%r14)
leaq 0x2315(%rip), %rsi      # 0x914e
leaq 0x231b(%rip), %rdx      # 0x915b
leaq -0x88(%rbp), %rdi
callq 0x7a46
leaq -0x48(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x4d76
leaq -0x288(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movl $0x1, %edx
callq 0x20f0
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x6e83
callq 0x21d0
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0x6e94
callq 0x21d0
testl %ebx, %ebx
movq -0x50(%rbp), %r14
js 0x700c
movq 0x8(%r13), %rax
subq (%r13), %rax
shrq $0x2, %rax
movq %rax, -0x68(%rbp)
incl %ebx
xorl %r12d, %r12d
movq %rbx, -0x60(%rbp)
movq %r15, -0x58(%rbp)
movq (%r15), %rax
movslq (%rax,%r12,4), %rax
testq %rax, %rax
js 0x6f13
movq (%r13), %rcx
movl (%rcx,%rax,4), %edx
movl 0x4(%rcx,%rax,4), %ecx
leaq -0x48(%rbp), %rdi
movq %r14, %rsi
movq -0x68(%rbp), %r8
callq 0x70be
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq -0x288(%rbp), %rdi
callq 0x2250
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x7000
callq 0x21d0
jmp 0x7000
negl %eax
movq %r13, %rbx
movq (%r13), %rcx
movl (%rcx,%rax,4), %ecx
imull (%r14), %eax
leal (%rcx,%rax), %r15d
incl %r15d
movl %r15d, %r13d
negl %r13d
cmovsl %r15d, %r13d
movl $0x1, %r14d
cmpl $0xa, %r13d
jb 0x6f87
movl $0x4, %r14d
movl %r13d, %eax
cmpl $0x63, %eax
jbe 0x6f7e
cmpl $0x3e7, %eax            # imm = 0x3E7
jbe 0x6f84
cmpl $0x2710, %eax           # imm = 0x2710
jb 0x6f87
movl %eax, %ecx
movl $0xd1b71759, %edx       # imm = 0xD1B71759
imulq %rdx, %rcx
shrq $0x2d, %rcx
addl $0x4, %r14d
cmpl $0x1869f, %eax          # imm = 0x1869F
movl %ecx, %eax
ja 0x6f49
addl $-0x3, %r14d
jmp 0x6f87
addl $-0x2, %r14d
jmp 0x6f87
decl %r14d
shrl $0x1f, %r15d
leal (%r14,%r15), %esi
leaq -0x38(%rbp), %rax
movq %rax, -0x48(%rbp)
leaq -0x48(%rbp), %rdi
movl $0x2d, %edx
callq 0x2260
movl %r15d, %edi
addq -0x48(%rbp), %rdi
movl %r14d, %esi
movl %r13d, %edx
callq 0x79d3
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq -0x288(%rbp), %rdi
callq 0x2250
movl $0x3, %edx
movq %rax, %rdi
leaq 0x2189(%rip), %rsi      # 0x9163
callq 0x2250
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
movq -0x58(%rbp), %r15
movq %rbx, %r13
movq -0x50(%rbp), %r14
je 0x6ffc
callq 0x21d0
movq -0x60(%rbp), %rbx
incq %r12
cmpq %rbx, %r12
jne 0x6ebd
leaq -0x288(%rbp), %rdi
callq 0x22b0
movq 0x5fa1(%rip), %rax      # 0xcfc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x280(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x288(%rbp,%rcx)
callq 0x2180
leaq -0x190(%rbp), %rdi
callq 0x20a0
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x7090
movq %rax, %rbx
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x707c
callq 0x21d0
jmp 0x707c
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
jne 0x70a5
jmp 0x70aa
jmp 0x7090
jmp 0x7090
jmp 0x7095
movq %rax, %rbx
jmp 0x70aa
movq %rax, %rbx
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x70aa
callq 0x21d0
leaq -0x288(%rbp), %rdi
callq 0x22e0
movq %rbx, %rdi
callq 0x2380