// File: /workspace/github_cpp_makefile_star2_O3/conp-solutions[P]cnfmiter/AtLeastTwoSolutions.cc
// Function: print_maxsat_formula(CNFMITER::Formula&, std::vector<CNFMITER::Lit, std::allocator<CNFMITER::Lit>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, bool)
void print_maxsat_formula(Formula &hardclauses, std::vector <Lit> penalty_literals, std::string s, bool pre2021format = true)
{
    std::cout << "c AtLeastTwoSolutions, Norbert Manthey, 2021" << std::endl;
    if (!s.empty()) std::cout << "c " << s << std::endl;
    std::cout << "c print in pre2021 MaxSat format: " << pre2021format << std::endl;
    std::cout << "c " << std::endl;
    if(pre2021format)
    {
        size_t top = penalty_literals.size() + 1;
        std::cout << "p wcnf " << hardclauses.nVars() << " " << hardclauses.clauses.size() + penalty_literals.size() << " " << top << std::endl;
        /* print the soft unit clauses */
        for (const auto &unit : penalty_literals) {
            std::stringstream s;
            s << 1 << " " << unit;
            printf("%s 0\n", s.str().c_str());
        }
        /* print the hard clauses */
        for (const auto &c : hardclauses.clauses) {
            std::stringstream s;
            s << top << " " << c;
            printf("%s 0\n", s.str().c_str());
        }
    } else {
        /* print the soft unit clauses */
        for (const auto &unit : penalty_literals) {
            std::stringstream s;
            s << 1 << " " << unit;
            printf("%s 0\n", s.str().c_str());
        }
        /* print the hard clauses */
        for (const auto &c : hardclauses.clauses) {
            std::stringstream s;
            s << "h " << c;
            printf("%s 0\n", s.str().c_str());
        }
    }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movl %ecx, %ebx
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, -0x30(%rbp)
movq 0x3714(%rip), %r14      # 0x5fc0
leaq 0x176d(%rip), %rsi      # 0x4020
movl $0x2c, %edx
movq %r14, %rdi
callq 0x2190
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
cmpq $0x0, 0x8(%r12)
je 0x2945
movq 0x36ca(%rip), %r13      # 0x5fc0
leaq 0x1750(%rip), %rsi      # 0x404d
movl $0x2, %edx
movq %r13, %rdi
callq 0x2190
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq %r13, %rdi
callq 0x2190
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
leaq 0x1711(%rip), %rsi      # 0x405d
movl $0x22, %edx
movq %r14, %rdi
callq 0x2190
movzbl %bl, %ebx
movq %r14, %rdi
movl %ebx, %esi
callq 0x2240
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r12, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
leaq 0x16b6(%rip), %rsi      # 0x404d
movl $0x2, %edx
movq %r14, %rdi
callq 0x2190
movq (%r14), %rax
movq -0x18(%rax), %rdi
addq %r14, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %r14, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
testb %bl, %bl
je 0x2c7d
movq 0x8(%r15), %r13
subq (%r15), %r13
sarq $0x2, %r13
incq %r13
movq 0x35d8(%rip), %rbx      # 0x5fc0
leaq 0x1691(%rip), %rsi      # 0x4080
movl $0x7, %edx
movq %rbx, %rdi
callq 0x2190
movq -0x30(%rbp), %r12
movl (%r12), %esi
movq %rbx, %rdi
callq 0x2260
movq %rax, %r14
leaq 0x1668(%rip), %rbx      # 0x407e
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2190
movq 0x10(%r12), %rax
subq 0x8(%r12), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rcx
movq 0x8(%r15), %rsi
subq (%r15), %rsi
sarq $0x2, %rsi
addq %rcx, %rsi
movq %r14, %rdi
callq 0x20f0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2190
movq %r14, %rdi
movq %r13, -0x38(%rbp)
movq %r13, %rsi
callq 0x20f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2160
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2100
movq (%r15), %r14
movq 0x8(%r15), %r12
cmpq %r12, %r14
je 0x2b6b
leaq -0x1e0(%rbp), %rbx
movq 0x34d6(%rip), %r13      # 0x5f98
movq %rbx, %rdi
callq 0x2110
leaq -0x1d0(%rbp), %rdi
movl $0x1, %esi
callq 0x2260
movq %rax, %r15
movl $0x1, %edx
movq %rax, %rdi
leaq 0x1591(%rip), %rsi      # 0x407e
callq 0x2190
movl (%r14), %eax
movl %eax, %esi
sarl %esi
leal 0x1(%rsi), %ecx
testb $0x1, %al
notl %esi
cmovel %ecx, %esi
movq %r15, %rdi
callq 0x2260
movq %rax, %rdi
callq 0x2100
leaq -0x58(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x2210
movq -0x58(%rbp), %rsi
leaq 0x1529(%rip), %rdi      # 0x4057
xorl %eax, %eax
callq 0x2040
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x2b47
callq 0x2150
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2120
leaq -0x160(%rbp), %rdi
callq 0x2070
addq $0x4, %r14
cmpq %r12, %r14
jne 0x2ac2
movq -0x30(%rbp), %rax
movq 0x8(%rax), %r12
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq %rax, %r12
je 0x2e45
leaq -0x1e0(%rbp), %r14
leaq 0x14ec(%rip), %rbx      # 0x407e
movq %r14, %r15
movq %r14, %rdi
callq 0x2110
leaq -0x1d0(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x20f0
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2190
movq (%r12), %rax
cmpq %rax, 0x8(%r12)
je 0x2c18
xorl %r13d, %r13d
movl (%rax,%r13,4), %eax
movl %eax, %esi
sarl %esi
leal 0x1(%rsi), %ecx
testb $0x1, %al
notl %esi
cmovel %ecx, %esi
movq %r14, %rdi
callq 0x2260
movq %rax, %rdi
callq 0x2100
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2190
incq %r13
movq (%r12), %rax
movq 0x8(%r12), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r13, %rcx
ja 0x2bce
leaq -0x58(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x2210
movq -0x58(%rbp), %rsi
leaq 0x1424(%rip), %rdi      # 0x4057
xorl %eax, %eax
callq 0x2040
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
movq %r15, %r14
je 0x2c4f
callq 0x2150
movq %r14, %rdi
movq 0x333f(%rip), %rsi      # 0x5f98
callq 0x2120
leaq -0x160(%rbp), %rdi
callq 0x2070
addq $0x18, %r12
cmpq -0x30(%rbp), %r12
jne 0x2b92
jmp 0x2e45
movq (%r15), %r14
movq 0x8(%r15), %r15
cmpq %r15, %r14
je 0x2d44
leaq -0x1e0(%rbp), %r13
movq 0x32fd(%rip), %r12      # 0x5f98
movq %r13, %rdi
callq 0x2110
leaq -0x1d0(%rbp), %rdi
movl $0x1, %esi
callq 0x2260
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x13b8(%rip), %rsi      # 0x407e
callq 0x2190
movl (%r14), %eax
movl %eax, %esi
sarl %esi
leal 0x1(%rsi), %ecx
testb $0x1, %al
notl %esi
cmovel %ecx, %esi
movq %rbx, %rdi
callq 0x2260
movq %rax, %rdi
callq 0x2100
leaq -0x58(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x2210
movq -0x58(%rbp), %rsi
leaq 0x1350(%rip), %rdi      # 0x4057
xorl %eax, %eax
callq 0x2040
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x2d20
callq 0x2150
movq %r13, %rdi
movq %r12, %rsi
callq 0x2120
leaq -0x160(%rbp), %rdi
callq 0x2070
addq $0x4, %r14
cmpq %r15, %r14
jne 0x2c9b
movq -0x30(%rbp), %rax
movq 0x8(%rax), %r15
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq %rax, %r15
je 0x2e45
leaq -0x1d0(%rbp), %r14
leaq -0x1e0(%rbp), %r12
leaq 0x130c(%rip), %rbx      # 0x407e
movq %r12, %r13
movq %r12, %rdi
callq 0x2110
movl $0x2, %edx
movq %r14, %rdi
leaq 0x1543(%rip), %rsi      # 0x42cf
callq 0x2190
movq (%r15), %rax
cmpq %rax, 0x8(%r15)
je 0x2de5
xorl %r12d, %r12d
movl (%rax,%r12,4), %eax
movl %eax, %esi
sarl %esi
leal 0x1(%rsi), %ecx
testb $0x1, %al
notl %esi
cmovel %ecx, %esi
movq %r14, %rdi
callq 0x2260
movq %rax, %rdi
callq 0x2100
movl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2190
incq %r12
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r12, %rcx
ja 0x2d9d
leaq -0x58(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x2210
movq -0x58(%rbp), %rsi
leaq 0x1257(%rip), %rdi      # 0x4057
xorl %eax, %eax
callq 0x2040
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
movq %r13, %r12
je 0x2e1c
callq 0x2150
movq %r12, %rdi
movq 0x3172(%rip), %rsi      # 0x5f98
callq 0x2120
leaq -0x160(%rbp), %rdi
callq 0x2070
addq $0x18, %r15
cmpq -0x38(%rbp), %r15
jne 0x2d72
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2e69
jmp 0x2e69
jmp 0x2e69
jmp 0x2e69
jmp 0x2e69
jmp 0x2e69
jmp 0x2e69
jmp 0x2e69
jmp 0x2e69
movq %rax, %rbx
movq 0x3125(%rip), %rsi      # 0x5f98
leaq -0x1e0(%rbp), %rdi
callq 0x2120
leaq -0x160(%rbp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2270