// File: /workspace/github_cpp_makefile_star2_O2/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, %r15
movq %rsi, -0x30(%rbp)
leaq 0x3439(%rip), %rsi      # 0x8124
leaq -0xb0(%rbp), %rdi
leaq -0x230(%rbp), %rdx
callq 0x20b0
leaq -0x430(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x4491
leaq -0x638(%rbp), %rdi
leaq -0x430(%rbp), %rsi
pushq $0x8
popq %rdx
callq 0x22e0
leaq -0x430(%rbp), %rdi
callq 0x20e0
leaq -0xb0(%rbp), %rdi
callq 0x20e0
leaq 0x3459(%rip), %rsi      # 0x819f
leaq -0x90(%rbp), %rdi
leaq -0x50(%rbp), %rdx
callq 0x20b0
leaq -0x230(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x4491
leaq -0x430(%rbp), %rdi
leaq -0x230(%rbp), %rsi
pushq $0x10
popq %rdx
callq 0x2390
leaq -0x230(%rbp), %rdi
callq 0x20e0
leaq -0x90(%rbp), %rdi
callq 0x20e0
leaq -0x40(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq -0x60(%rbp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq -0x638(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0x2040
leaq -0x230(%rbp), %rdi
leaq -0x50(%rbp), %rsi
pushq $0x8
popq %rdx
callq 0x2310
pushq $0x2
popq %rbx
leaq -0x230(%rbp), %r12
leaq -0x70(%rbp), %r13
subl $0x1, %ebx
jb 0x4dfa
movq %r12, %rdi
movq %r13, %rsi
callq 0x2250
jmp 0x4de8
leaq -0x230(%rbp), %rdi
movq %r15, %rsi
callq 0x2150
leaq -0x230(%rbp), %rdi
movq %r14, %rsi
callq 0x2150
incl (%r14)
leaq -0x638(%rbp), %r14
leaq -0x50(%rbp), %r15
leaq -0x430(%rbp), %r12
leaq 0x3307(%rip), %r13      # 0x813b
movq %r14, %rdi
movq %r15, %rsi
callq 0x2040
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4e65
movq %r12, %rdi
movq %r15, %rsi
callq 0x21a0
movq %rax, %rdi
movq %r13, %rsi
callq 0x21d0
jmp 0x4e34
leaq -0x430(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x21a0
leaq -0x430(%rbp), %rdi
callq 0x2290
leaq -0x638(%rbp), %rdi
callq 0x2050
leaq -0x230(%rbp), %rdi
callq 0x20f0
leaq -0x70(%rbp), %rdi
callq 0x20e0
leaq -0x50(%rbp), %rdi
callq 0x20e0
leaq -0x430(%rbp), %rdi
callq 0x22b0
leaq -0x638(%rbp), %rdi
callq 0x2070
addq $0x618, %rsp            # imm = 0x618
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4ed7
movq %rax, %rbx
jmp 0x4f3d
movq %rax, %rbx
leaq -0x230(%rbp), %rdi
callq 0x20e0
jmp 0x4ef0
movq %rax, %rbx
leaq -0x90(%rbp), %rdi
callq 0x20e0
jmp 0x4f5b
movq %rax, %rbx
jmp 0x4f5b
movq %rax, %rbx
leaq -0x430(%rbp), %rdi
callq 0x20e0
jmp 0x4f17
movq %rax, %rbx
leaq -0xb0(%rbp), %rdi
callq 0x20e0
jmp 0x4f67
movq %rax, %rbx
jmp 0x4f67
jmp 0x4f2e
jmp 0x4f2e
movq %rax, %rbx
leaq -0x230(%rbp), %rdi
callq 0x20f0
leaq -0x70(%rbp), %rdi
callq 0x20e0
leaq -0x50(%rbp), %rdi
callq 0x20e0
leaq -0x430(%rbp), %rdi
callq 0x22b0
leaq -0x638(%rbp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2360
nop