// File: /workspace/github_cpp_makefile_star2_O3/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, %rbx
leaq -0xa0(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x35cd(%rip), %rsi      # 0x9166
leaq 0x35d3(%rip), %rdx      # 0x9173
leaq -0xb0(%rbp), %rdi
callq 0x799c
leaq -0x430(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x4cce
leaq -0x638(%rbp), %r12
leaq -0x430(%rbp), %rsi
movq %r12, %rdi
movl $0x8, %edx
callq 0x2300
leaq -0x420(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5bef
callq 0x21d0
movq -0xb0(%rbp), %rdi
cmpq %r13, %rdi
je 0x5c00
callq 0x21d0
leaq -0x80(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x35d2(%rip), %rsi      # 0x91e1
leaq 0x35dc(%rip), %rdx      # 0x91f2
leaq -0x90(%rbp), %rdi
callq 0x799c
leaq -0x230(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x4cce
leaq -0x430(%rbp), %rdi
leaq -0x230(%rbp), %rsi
movl $0x10, %edx
callq 0x23d0
leaq -0x220(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5c62
callq 0x21d0
movq %rbx, -0x30(%rbp)
movq -0x90(%rbp), %rdi
cmpq %r13, %rdi
je 0x5c77
callq 0x21d0
leaq -0x40(%rbp), %rbx
movq %rbx, -0x10(%rbx)
xorl %eax, %eax
movq %rax, -0x8(%rbx)
movb %al, (%rbx)
leaq -0x60(%rbp), %r13
movq %r13, -0x10(%r13)
movq %rax, -0x8(%r13)
movb %al, (%r13)
movq -0x638(%rbp), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x21e0
movsbl %al, %edx
leaq -0x638(%rbp), %r12
leaq -0x50(%rbp), %rsi
movq %r12, %rdi
callq 0x23b0
leaq -0x230(%rbp), %rdi
leaq -0x50(%rbp), %rsi
movl $0x8, %edx
callq 0x2330
leaq -0x230(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2290
leaq -0x230(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x2290
leaq -0x230(%rbp), %rdi
movq %r15, %rsi
callq 0x2130
leaq -0x230(%rbp), %rdi
movq %r14, %rsi
callq 0x2130
incl (%r14)
leaq -0x50(%rbp), %r14
leaq -0x430(%rbp), %r15
leaq 0x3450(%rip), %r13      # 0x917d
movq -0x638(%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 0x5d83
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
movq %r15, %rdi
callq 0x2250
movl $0x1, %edx
movq %rax, %rdi
movq %r13, %rsi
callq 0x2250
jmp 0x5d2d
movq -0x30(%rbp), %rax
movq (%rax), %rsi
movq 0x8(%rax), %rdx
leaq -0x430(%rbp), %rdi
callq 0x2250
leaq -0x430(%rbp), %rdi
callq 0x22b0
leaq -0x638(%rbp), %rdi
callq 0x2050
movq 0x720f(%rip), %rsi      # 0xcfc8
leaq -0x230(%rbp), %rdi
callq 0x22c0
leaq -0x1b8(%rbp), %rdi
callq 0x20a0
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x5de3
callq 0x21d0
movq -0x50(%rbp), %rdi
cmpq %rbx, %rdi
je 0x5df1
callq 0x21d0
movq 0x71c8(%rip), %rax      # 0xcfc0
movq (%rax), %rcx
movq 0x18(%rax), %rax
leaq -0x428(%rbp), %rdi
movq %rcx, -0x8(%rdi)
movq -0x18(%rcx), %rcx
movq %rax, -0x430(%rbp,%rcx)
callq 0x2180
leaq -0x338(%rbp), %rdi
callq 0x20a0
leaq -0x638(%rbp), %rdi
callq 0x2060
addq $0x618, %rsp            # imm = 0x618
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x5ebd
movq %rax, %r14
leaq -0x220(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5e64
callq 0x21d0
jmp 0x5e64
movq %rax, %r14
movq -0x90(%rbp), %rdi
cmpq %r13, %rdi
je 0x5f12
callq 0x21d0
jmp 0x5f12
movq %rax, %r14
jmp 0x5f12
movq %rax, %r14
leaq -0x420(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x5ea3
callq 0x21d0
jmp 0x5ea3
movq %rax, %r14
movq -0xb0(%rbp), %rdi
cmpq %r13, %rdi
je 0x5f1e
callq 0x21d0
jmp 0x5f1e
movq %rax, %r14
jmp 0x5f1e
jmp 0x5ec4
movq %rax, %r14
jmp 0x5eea
jmp 0x5ec4
movq %rax, %r14
movq 0x70fa(%rip), %rsi      # 0xcfc8
leaq -0x230(%rbp), %rdi
callq 0x22c0
leaq -0x1b8(%rbp), %rdi
callq 0x20a0
leaq -0x60(%rbp), %r13
movq -0x70(%rbp), %rdi
cmpq %r13, %rdi
je 0x5ef8
callq 0x21d0
movq -0x50(%rbp), %rdi
cmpq %rbx, %rdi
je 0x5f06
callq 0x21d0
leaq -0x430(%rbp), %rdi
callq 0x22e0
leaq -0x638(%rbp), %rdi
callq 0x2060
movq %r14, %rdi
callq 0x2380