// File: /workspace/github_cpp_makefile_star2_O3/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 $0x78, %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 -0x80(%rbp), %rdi
movq %rbx, %rsi
callq 0x2a41
leaq -0x80(%rbp), %r12
movq (%r12), %rax
movq %rax, -0x60(%rbp)
movups 0x8(%r12), %xmm0
movups %xmm0, -0x58(%rbp)
leaq -0xa0(%rbp), %rdi
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
xorl %eax, %eax
movq %rax, 0x10(%rdi)
movaps %xmm0, (%r12)
movq %rax, 0x10(%r12)
callq 0x3d20
movq %r12, %rdi
callq 0x3d20
movq 0x44a0(%rip), %rdi      # 0x6ff0
leaq 0x2536(%rip), %rsi      # 0x508d
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 0x446e(%rip), %rdi      # 0x6ff0
callq 0x2120
movq %rax, %r12
leaq 0x2509(%rip), %rsi      # 0x509a
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 -0x80(%rbp), %rdi
movq %r14, %rsi
movl %r15d, %edx
callq 0x2a41
movaps -0x40(%rbp), %xmm0
movq -0x30(%rbp), %rax
leaq -0x80(%rbp), %r15
movaps (%r15), %xmm1
movaps %xmm1, -0x40(%rbp)
movq 0x10(%r15), %rcx
movq %rcx, -0x30(%rbp)
leaq -0xa0(%rbp), %rdi
movups %xmm0, (%rdi)
movq %rax, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%r15)
movq $0x0, 0x10(%r15)
callq 0x3d20
movq %r15, %rdi
callq 0x3d20
movq 0x43ce(%rip), %rdi      # 0x6ff0
leaq 0x2464(%rip), %rsi      # 0x508d
movl $0xc, %edx
callq 0x21d0
movq -0x38(%rbp), %rsi
subq -0x40(%rbp), %rsi
sarq $0x3, %rsi
imulq %r13, %rsi
movq 0x43a6(%rip), %rdi      # 0x6ff0
callq 0x2120
movq %rax, %r15
leaq 0x2452(%rip), %rsi      # 0x50ab
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 0x2cb2
addq $0x8, %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x3ce4
addq $0x18, %r15
cmpq %r12, %r15
jne 0x2c9e
movq -0x40(%rbp), %r14
movq -0x38(%rbp), %r15
cmpq %r15, %r14
je 0x2cd7
addq $0x8, %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3ce4
addq $0x18, %r14
cmpq %r15, %r14
jne 0x2cc3
leaq -0x40(%rbp), %rdi
callq 0x3d20
leaq -0x60(%rbp), %rdi
callq 0x3d20
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2d00
jmp 0x2d00
jmp 0x2d00
jmp 0x2d00
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x3d20
leaq -0x60(%rbp), %rdi
callq 0x3d20
movq %rbx, %rdi
callq 0x22b0