// File: /workspace/github_cpp_makefile_star2_O1/cauimsouza[P]rikudo-solver/src/rikudo_solver/graph.cpp
// Function: Graph::extend_sat(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int&, int&)
void Graph::extend_sat(std::string s, int &n_vars, int &n_clauses){
    std::ifstream ifile(get_path(sat_input));
    std::ofstream ofile(get_path(sat_aux_input));
    
    std::string line;
    std::string token;

    getline(ifile, line);
    std::istringstream iss(line);
    
    for(int i = 0; i < 2; i++){
        iss >> token;
    }
    iss >> n_vars;
    iss >> n_clauses;
    n_clauses++;
    
    while(getline(ifile, line)){
        ofile << line << "\n";
    }

    ofile << s;

    ofile.close();
    ifile.close();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x618, %rsp            # imm = 0x618
movq %rcx, %r14
movq %rdx, -0x58(%rbp)
movq %rsi, %rbx
leaq -0xa8(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x3506(%rip), %rsi      # 0x914e
leaq 0x350c(%rip), %rdx      # 0x915b
leaq -0xb8(%rbp), %rdi
callq 0x7a46
leaq -0x438(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x4d76
leaq -0x640(%rbp), %r12
leaq -0x438(%rbp), %rsi
movq %r12, %rdi
movl $0x8, %edx
callq 0x2300
leaq -0x428(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5c9e
callq 0x21d0
movq -0xb8(%rbp), %rdi
cmpq %r15, %rdi
je 0x5caf
callq 0x21d0
leaq -0x88(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x3508(%rip), %rsi      # 0x91c9
leaq 0x3512(%rip), %rdx      # 0x91da
leaq -0x98(%rbp), %rdi
callq 0x7a46
leaq -0x238(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0x4d76
leaq -0x438(%rbp), %rdi
leaq -0x238(%rbp), %rsi
movl $0x10, %edx
callq 0x23d0
leaq -0x228(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5d14
callq 0x21d0
movq -0x98(%rbp), %rdi
cmpq %r15, %rdi
je 0x5d25
callq 0x21d0
leaq -0x38(%rbp), %r15
movq %r15, -0x10(%r15)
xorl %eax, %eax
movq %rax, -0x8(%r15)
movb %al, (%r15)
leaq -0x68(%rbp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
movq -0x640(%rbp), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %edx
leaq -0x640(%rbp), %r12
leaq -0x48(%rbp), %rsi
movq %r12, %rdi
callq 0x23b0
movq %rbx, -0x50(%rbp)
leaq -0x238(%rbp), %rdi
leaq -0x48(%rbp), %rsi
movl $0x8, %edx
callq 0x2330
movl $0x1, %ebx
leaq -0x238(%rbp), %r13
leaq -0x78(%rbp), %r15
movq %r13, %rdi
movq %r15, %rsi
callq 0x2290
decl %ebx
je 0x5d9b
leaq -0x238(%rbp), %rdi
movq -0x58(%rbp), %rsi
callq 0x2130
leaq -0x238(%rbp), %rdi
movq %r14, %rsi
callq 0x2130
incl (%r14)
leaq -0x48(%rbp), %r14
leaq -0x438(%rbp), %r15
leaq 0x3387(%rip), %r13      # 0x9165
movq -0x640(%rbp), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %edx
movq %r12, %rdi
movq %r14, %rsi
callq 0x23b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x5e34
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq %r15, %rdi
callq 0x2250
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2250
jmp 0x5dde
movq -0x50(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
leaq -0x438(%rbp), %rdi
callq 0x2250
leaq -0x438(%rbp), %rdi
callq 0x22b0
leaq -0x640(%rbp), %rdi
callq 0x2050
movq 0x715e(%rip), %rsi      # 0xcfc8
leaq -0x238(%rbp), %rdi
callq 0x22c0
leaq -0x1c0(%rbp), %rdi
callq 0x20a0
movq -0x78(%rbp), %rdi
leaq -0x68(%rbp), %rax
cmpq %rax, %rdi
je 0x5e94
callq 0x21d0
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x5ea6
callq 0x21d0
movq 0x7113(%rip), %rax      # 0xcfc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x430(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x438(%rbp,%rcx)
callq 0x2180
leaq -0x340(%rbp), %rdi
callq 0x20a0
leaq -0x640(%rbp), %rdi
callq 0x2060
addq $0x618, %rsp            # imm = 0x618
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
jmp 0x5fa1
movq %rax, %rbx
leaq -0x228(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5f1f
callq 0x21d0
jmp 0x5f1f
movq %rax, %rbx
movq -0x98(%rbp), %rdi
cmpq %r15, %rdi
je 0x5fd1
callq 0x21d0
jmp 0x5fd1
movq %rax, %rbx
jmp 0x5fd1
movq %rax, %rbx
leaq -0x428(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5f5e
callq 0x21d0
jmp 0x5f5e
movq %rax, %rbx
movq -0xb8(%rbp), %rdi
cmpq %r15, %rdi
je 0x5fdd
callq 0x21d0
jmp 0x5fdd
movq %rax, %rbx
jmp 0x5fdd
movq %rax, %rbx
jmp 0x5fa5
jmp 0x5f7f
jmp 0x5f7f
movq %rax, %rbx
movq 0x703f(%rip), %rsi      # 0xcfc8
leaq -0x238(%rbp), %rdi
callq 0x22c0
leaq -0x1c0(%rbp), %rdi
callq 0x20a0
leaq -0x38(%rbp), %r15
leaq -0x68(%rbp), %rax
movq -0x78(%rbp), %rdi
cmpq %rax, %rdi
je 0x5fb7
callq 0x21d0
movq -0x48(%rbp), %rdi
cmpq %r15, %rdi
je 0x5fc5
callq 0x21d0
leaq -0x438(%rbp), %rdi
callq 0x22e0
leaq -0x640(%rbp), %rdi
callq 0x2060
movq %rbx, %rdi
callq 0x2380
nop