// File: /workspace/github_cpp_makefile_star2_O1/conp-solutions[P]cnfmiter/Main.cc
// Function: generate_formula_miter(CNFMITER::Formula&, CNFMITER::Formula const&, CNFMITER::Formula const&)
void generate_formula_miter(Formula &formula, const Formula &input1, const Formula &input2)
{
    Lit e1, e2;
    generate_clause_sat(formula, input1, e1);
    std::cerr << "c after 1st equivalence formula, miter has " << formula.nVars() << " variables" << std::endl;
    generate_clause_sat(formula, input2, e2);
    std::cerr << "c after 2nd equivalence formula, miter has " << formula.nVars() << " variables" << std::endl;

    std::vector<Lit> clause;

    // !e1 -> e2
    clause.push_back(e1);
    clause.push_back(e2);
    formula.addClause_(clause);

    // e1 -> !e2
    clause[0] = ~e1;
    clause[1] = ~e2;
    formula.addClause_(clause);
    std::cerr << "c miter has " << formula.nVars() << " variables and " << formula.clauses.size() << " clauses" << std::endl;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdx, %r15
movq %rdi, %rbx
leaq -0x30(%rbp), %rdx
callq 0x267c
movq 0x484e(%rip), %r14      # 0x6ff0
leaq 0x2877(%rip), %rsi      # 0x5020
movl $0x2b, %edx
movq %r14, %rdi
callq 0x21d0
movl (%rbx), %esi
movq %r14, %rdi
callq 0x22a0
movq %rax, %r13
leaq 0x2882(%rip), %r12      # 0x504c
movl $0xa, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x21d0
movq (%r13), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
leaq -0x2c(%rbp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x267c
leaq 0x283f(%rip), %rsi      # 0x5057
movl $0x2b, %edx
movq %r14, %rdi
callq 0x21d0
movl (%rbx), %esi
movq %r14, %rdi
callq 0x22a0
movq %rax, %r14
movl $0xa, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x21d0
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
xorps %xmm0, %xmm0
movaps %xmm0, -0x50(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x48(%rbp), %rsi
testq %rsi, %rsi
je 0x2890
movl -0x30(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x48(%rbp)
jmp 0x289d
leaq -0x50(%rbp), %rdi
leaq -0x30(%rbp), %rdx
callq 0x4178
movq -0x48(%rbp), %rsi
cmpq -0x40(%rbp), %rsi
je 0x28b6
movl -0x2c(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x48(%rbp)
jmp 0x28c3
leaq -0x50(%rbp), %rdi
leaq -0x2c(%rbp), %rdx
callq 0x4178
leaq 0x8(%rbx), %r14
leaq -0x50(%rbp), %rsi
movq %r14, %rdi
callq 0x3d34
movl -0x30(%rbp), %eax
xorl $0x1, %eax
leaq -0x50(%rbp), %rsi
movq (%rsi), %rcx
movl %eax, (%rcx)
movl -0x2c(%rbp), %eax
xorl $0x1, %eax
movl %eax, 0x4(%rcx)
movq %r14, %rdi
callq 0x3d34
movq 0x46f6(%rip), %rdi      # 0x6ff0
leaq 0x2782(%rip), %rsi      # 0x5083
movl $0xc, %edx
callq 0x21d0
movl (%rbx), %esi
movq 0x46dc(%rip), %rdi      # 0x6ff0
callq 0x22a0
movq %rax, %r14
leaq 0x276d(%rip), %rsi      # 0x5090
movl $0xf, %edx
movq %rax, %rdi
callq 0x21d0
movq 0x10(%rbx), %rax
subq 0x8(%rbx), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rsi # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rsi
movq %r14, %rdi
callq 0x2120
movq %rax, %rbx
leaq 0x2744(%rip), %rsi      # 0x50a0
movl $0x8, %edx
movq %rax, %rdi
callq 0x21d0
movq (%rbx), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x21a0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2130
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x299e
callq 0x2180
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x29be
callq 0x2180
movq %rbx, %rdi
callq 0x22b0