// File: /workspace/github_cpp_makefile_star2_O1/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, %r13
movq %rdi, %r15
movq 0x4700(%rip), %r14      # 0x6fc0
leaq 0x2759(%rip), %rsi      # 0x5020
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 0x295a
movq 0x46b6(%rip), %rdi      # 0x6fc0
leaq 0x273c(%rip), %rsi      # 0x504d
movl $0x2, %edx
callq 0x2190
movq (%r12), %rsi
movq 0x8(%r12), %rdx
movq 0x4695(%rip), %rdi      # 0x6fc0
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 0x26fc(%rip), %rsi      # 0x505d
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 0x26a1(%rip), %rsi      # 0x504d
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
movq %r15, -0x30(%rbp)
je 0x2c92
movq 0x8(%r13), %r12
subq (%r13), %r12
sarq $0x2, %r12
incq %r12
movq 0x45be(%rip), %rbx      # 0x6fc0
leaq 0x2677(%rip), %rsi      # 0x5080
movl $0x7, %edx
movq %rbx, %rdi
callq 0x2190
movl (%r15), %esi
movq %rbx, %rdi
callq 0x2260
movq %rax, %r14
leaq 0x2653(%rip), %rbx      # 0x507e
movl $0x1, %edx
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2190
movq 0x10(%r15), %rax
subq 0x8(%r15), %rax
sarq $0x3, %rax
movabsq $-0x5555555555555555, %rcx # imm = 0xAAAAAAAAAAAAAAAB
imulq %rax, %rcx
movq 0x8(%r13), %rsi
subq (%r13), %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 %r12, -0x38(%rbp)
movq %r12, %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 (%r13), %r15
movq 0x8(%r13), %r12
cmpq %r12, %r15
je 0x2b80
leaq -0x1e0(%rbp), %rbx
movq 0x44c1(%rip), %r13      # 0x6f98
movq %rbx, %rdi
callq 0x2110
leaq -0x1d0(%rbp), %rdi
movl $0x1, %esi
callq 0x2260
movq %rax, %r14
movl $0x1, %edx
movq %rax, %rdi
leaq 0x257c(%rip), %rsi      # 0x507e
callq 0x2190
movl (%r15), %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
leaq -0x58(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x2210
movq -0x58(%rbp), %rsi
leaq 0x2514(%rip), %rdi      # 0x5057
xorl %eax, %eax
callq 0x2040
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x2b5c
callq 0x2150
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2120
leaq -0x160(%rbp), %rdi
callq 0x2070
addq $0x4, %r15
cmpq %r12, %r15
jne 0x2ad7
movq -0x30(%rbp), %rax
movq 0x8(%rax), %r12
movq 0x10(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq %rax, %r12
je 0x2e5b
leaq -0x1e0(%rbp), %r14
leaq 0x24d7(%rip), %rbx      # 0x507e
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 0x2c2d
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 0x2be3
leaq -0x58(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x2210
movq -0x58(%rbp), %rsi
leaq 0x240f(%rip), %rdi      # 0x5057
xorl %eax, %eax
callq 0x2040
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
movq %r15, %r14
je 0x2c64
callq 0x2150
movq %r14, %rdi
movq 0x432a(%rip), %rsi      # 0x6f98
callq 0x2120
leaq -0x160(%rbp), %rdi
callq 0x2070
addq $0x18, %r12
cmpq -0x30(%rbp), %r12
jne 0x2ba7
jmp 0x2e5b
movq (%r13), %r14
movq 0x8(%r13), %r15
cmpq %r15, %r14
je 0x2d5a
leaq -0x1e0(%rbp), %r13
movq 0x42e7(%rip), %r12      # 0x6f98
movq %r13, %rdi
callq 0x2110
leaq -0x1d0(%rbp), %rdi
movl $0x1, %esi
callq 0x2260
movq %rax, %rbx
movl $0x1, %edx
movq %rax, %rdi
leaq 0x23a2(%rip), %rsi      # 0x507e
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 0x233a(%rip), %rdi      # 0x5057
xorl %eax, %eax
callq 0x2040
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
je 0x2d36
callq 0x2150
movq %r13, %rdi
movq %r12, %rsi
callq 0x2120
leaq -0x160(%rbp), %rdi
callq 0x2070
addq $0x4, %r14
cmpq %r15, %r14
jne 0x2cb1
movq -0x30(%rbp), %rax
movq 0x8(%rax), %r15
movq 0x10(%rax), %rax
movq %rax, -0x38(%rbp)
cmpq %rax, %r15
je 0x2e5b
leaq -0x1d0(%rbp), %rbx
leaq -0x1e0(%rbp), %r12
leaq 0x22f6(%rip), %r14      # 0x507e
movq %r12, %r13
movq %r12, %rdi
callq 0x2110
movl $0x2, %edx
movq %rbx, %rdi
leaq 0x252d(%rip), %rsi      # 0x52cf
callq 0x2190
movq (%r15), %rax
cmpq %rax, 0x8(%r15)
je 0x2dfb
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 %rbx, %rdi
callq 0x2260
movq %rax, %rdi
callq 0x2100
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2190
incq %r12
movq (%r15), %rax
movq 0x8(%r15), %rcx
subq %rax, %rcx
sarq $0x2, %rcx
cmpq %r12, %rcx
ja 0x2db3
leaq -0x58(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x2210
movq -0x58(%rbp), %rsi
leaq 0x2241(%rip), %rdi      # 0x5057
xorl %eax, %eax
callq 0x2040
movq -0x58(%rbp), %rdi
leaq -0x48(%rbp), %rax
cmpq %rax, %rdi
movq %r13, %r12
je 0x2e32
callq 0x2150
movq %r12, %rdi
movq 0x415c(%rip), %rsi      # 0x6f98
callq 0x2120
leaq -0x160(%rbp), %rdi
callq 0x2070
addq $0x18, %r15
cmpq -0x38(%rbp), %r15
jne 0x2d88
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2e7f
jmp 0x2e7f
jmp 0x2e7f
jmp 0x2e7f
jmp 0x2e7f
jmp 0x2e7f
jmp 0x2e7f
jmp 0x2e7f
jmp 0x2e7f
movq %rax, %rbx
movq 0x410f(%rip), %rsi      # 0x6f98
leaq -0x1e0(%rbp), %rdi
callq 0x2120
leaq -0x160(%rbp), %rdi
callq 0x2070
movq %rbx, %rdi
callq 0x2270