// File: /workspace/github_cpp_makefile_star2_O1/conp-solutions[P]cnfmiter/Main.cc
// Function: exchange_definition_clauses(CNFMITER::Formula&, CNFMITER::Formula&, int)
void exchange_definition_clauses(Formula &f1, Formula &f2, int largest_input_variable)
{
    std::vector<std::vector<Lit>> l2r, r2l;

    // get all clauses in f1 and f2 that have variable beyond largest variable
    l2r = get_definition_clauses(f1, largest_input_variable);
    std::cerr << "c extracted " << l2r.size() << " clauses from f1" << std::endl;
    r2l = get_definition_clauses(f2, largest_input_variable);
    std::cerr << "c extracted " << r2l.size() << " clauses from f2" << std::endl;

    // add the clauses mutually to each formula
    for (const auto &c : l2r) f2.addClause_(c);
    for (const auto &c : r2l) f1.addClause_(c);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edx, %r15d
movq %rsi, %r14
movq %rdi, %rbx
xorps %xmm0, %xmm0
movaps %xmm0, -0x60(%rbp)
xorl %eax, %eax
movq %rax, -0x50(%rbp)
movq %rax, -0x30(%rbp)
movaps %xmm0, -0x40(%rbp)
leaq -0x78(%rbp), %rdi
movq %rbx, %rsi
callq 0x2a3b
leaq -0x90(%rbp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
movaps -0x60(%rbp), %xmm0
movq -0x50(%rbp), %rax
leaq -0x78(%rbp), %r12
movups (%r12), %xmm1
movaps %xmm1, -0x60(%rbp)
movq 0x10(%r12), %rcx
movq %rcx, -0x50(%rbp)
movaps (%rdi), %xmm1
movaps %xmm0, (%rdi)
movq %rax, 0x10(%rdi)
movups %xmm1, (%r12)
movq $0x0, 0x10(%r12)
callq 0x3d70
movq %r12, %rdi
callq 0x3d70
movq 0x4496(%rip), %rdi      # 0x6ff0
leaq 0x2548(%rip), %rsi      # 0x50a9
movl $0xc, %edx
callq 0x21d0
movq -0x58(%rbp), %rsi
subq -0x60(%rbp), %rsi
sarq $0x3, %rsi
movabsq $-0x5555555555555555, %r13 # imm = 0xAAAAAAAAAAAAAAAB
imulq %r13, %rsi
movq 0x4464(%rip), %rdi      # 0x6ff0
callq 0x2120
movq %rax, %r12
leaq 0x251b(%rip), %rsi      # 0x50b6
movl $0x10, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r12), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
leaq -0x78(%rbp), %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x2a3b
xorps %xmm0, %xmm0
leaq -0x90(%rbp), %rdi
movaps %xmm0, (%rdi)
movaps -0x40(%rbp), %xmm0
movq -0x30(%rbp), %rax
leaq -0x78(%rbp), %r15
movups (%r15), %xmm1
movaps %xmm1, -0x40(%rbp)
movq 0x10(%r15), %rcx
movq %rcx, -0x30(%rbp)
movaps (%rdi), %xmm1
movaps %xmm0, (%rdi)
movq %rax, 0x10(%rdi)
movups %xmm1, (%r15)
movq $0x0, 0x10(%r15)
callq 0x3d70
movq %r15, %rdi
callq 0x3d70
movq 0x43be(%rip), %rdi      # 0x6ff0
leaq 0x2470(%rip), %rsi      # 0x50a9
movl $0xc, %edx
callq 0x21d0
movq -0x38(%rbp), %rsi
subq -0x40(%rbp), %rsi
sarq $0x3, %rsi
imulq %r13, %rsi
movq 0x4396(%rip), %rdi      # 0x6ff0
callq 0x2120
movq %rax, %r15
leaq 0x245e(%rip), %rsi      # 0x50c7
movl $0x10, %edx
movq %rax, %rdi
callq 0x21d0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r15, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq -0x60(%rbp), %r15
movq -0x58(%rbp), %r12
cmpq %r12, %r15
je 0x2cc2
addq $0x8, %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x3d34
addq $0x18, %r15
cmpq %r12, %r15
jne 0x2cae
movq -0x40(%rbp), %r14
movq -0x38(%rbp), %r15
cmpq %r15, %r14
je 0x2ce7
addq $0x8, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3d34
addq $0x18, %r14
cmpq %r15, %r14
jne 0x2cd3
leaq -0x40(%rbp), %rdi
callq 0x3d70
leaq -0x60(%rbp), %rdi
callq 0x3d70
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2d10
jmp 0x2d10
jmp 0x2d10
jmp 0x2d10
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x3d70
leaq -0x60(%rbp), %rdi
callq 0x3d70
movq %rbx, %rdi
callq 0x22b0