// File: /workspace/github_cpp_makefile_star2_O3/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, %r12
movq %rdi, %rbx
leaq -0x30(%rbp), %rdx
callq 0x2673
movq 0x4843(%rip), %r15      # 0x6ff0
leaq 0x2850(%rip), %rsi      # 0x5004
movl $0x2b, %edx
movq %r15, %rdi
callq 0x21d0
movl (%rbx), %esi
movq %r15, %rdi
callq 0x22a0
movq %rax, %r14
leaq 0x285b(%rip), %r13      # 0x5030
movl $0xa, %edx
movq %rax, %rdi
movq %r13, %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
leaq -0x2c(%rbp), %rdx
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2673
leaq 0x2819(%rip), %rsi      # 0x503b
movl $0x2b, %edx
movq %r15, %rdi
callq 0x21d0
movl (%rbx), %esi
movq %r15, %rdi
callq 0x22a0
movq %rax, %r14
movl $0xa, %edx
movq %rax, %rdi
movq %r13, %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
leaq -0x50(%rbp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
xorl %esi, %esi
leaq -0x30(%rbp), %rdx
callq 0x4124
movq -0x48(%rbp), %rsi
cmpq -0x40(%rbp), %rsi
je 0x28a9
movl -0x2c(%rbp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, -0x48(%rbp)
jmp 0x28b6
leaq -0x50(%rbp), %rdi
leaq -0x2c(%rbp), %rdx
callq 0x4124
leaq 0x8(%rbx), %r14
leaq -0x50(%rbp), %rsi
movq %r14, %rdi
callq 0x3ce4
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 0x3ce4
movq 0x4703(%rip), %rdi      # 0x6ff0
leaq 0x2773(%rip), %rsi      # 0x5067
movl $0xc, %edx
callq 0x21d0
movl (%rbx), %esi
movq 0x46e9(%rip), %rdi      # 0x6ff0
callq 0x22a0
movq %rax, %r14
leaq 0x275e(%rip), %rsi      # 0x5074
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 0x2735(%rip), %rsi      # 0x5084
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 0x2991
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 0x29b1
callq 0x2180
movq %rbx, %rdi
callq 0x22b0