// File: /workspace/github_cpp_makefile_star2_O2/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, %r14
movq %rsi, %r15
movq %rdi, %r12
movq 0x4939(%rip), %rdi      # 0x6fc0
leaq 0x1992(%rip), %rsi      # 0x4020
callq 0x2160
movq %rax, %rdi
callq 0x20a0
cmpq $0x0, 0x8(%r14)
je 0x26c8
movq 0x4917(%rip), %rdi      # 0x6fc0
leaq 0x199d(%rip), %rsi      # 0x404d
callq 0x2160
movq %rax, %rdi
movq %r14, %rsi
callq 0x2140
movq %rax, %rdi
callq 0x20a0
movq 0x48f1(%rip), %r14      # 0x6fc0
leaq 0x1987(%rip), %rsi      # 0x405d
movq %r14, %rdi
callq 0x2160
movzbl %bl, %ebx
movq %rax, %rdi
movl %ebx, %esi
callq 0x2220
movq %rax, %rdi
callq 0x20a0
leaq 0x1953(%rip), %rsi      # 0x404d
movq %r14, %rdi
callq 0x2160
movq %rax, %rdi
callq 0x20a0
testb %bl, %bl
movq %r12, -0x30(%rbp)
je 0x2828
movq 0x8(%r15), %rbx
subq (%r15), %rbx
sarq $0x2, %rbx
incq %rbx
movq 0x4895(%rip), %rdi      # 0x6fc0
leaq 0x194e(%rip), %rsi      # 0x4080
callq 0x2160
movl (%r12), %esi
movq %rax, %rdi
callq 0x2240
leaq 0x1934(%rip), %r14      # 0x407e
movq %rax, %rdi
movq %r14, %rsi
callq 0x2160
movq 0x10(%r12), %rcx
subq 0x8(%r12), %rcx
movq %rax, %rdi
pushq $0x18
popq %rsi
movq %rcx, %rax
cqto
idivq %rsi
movq 0x8(%r15), %rsi
subq (%r15), %rsi
sarq $0x2, %rsi
addq %rax, %rsi
callq 0x20e0
movq %rax, %rdi
movq %r14, %rsi
callq 0x2160
movq %rax, %rdi
movq %rbx, -0x38(%rbp)
movq %rbx, %rsi
callq 0x20e0
movq %rax, %rdi
callq 0x20a0
movq (%r15), %r13
movq 0x8(%r15), %r14
leaq -0x1e0(%rbp), %r12
leaq -0x58(%rbp), %r15
leaq 0x189c(%rip), %rbx      # 0x4057
cmpq %r14, %r13
je 0x28ae
movq %r12, %rdi
callq 0x2100
leaq -0x1d0(%rbp), %rdi
pushq $0x1
popq %rsi
callq 0x2240
movq %rax, %rdi
leaq 0x1899(%rip), %rsi      # 0x407e
callq 0x2160
movq %rax, %rdi
movq %r13, %rsi
callq 0x348b
movq %r15, %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x21f0
movq -0x58(%rbp), %rsi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2030
movq %r15, %rdi
callq 0x2090
movq %r12, %rdi
callq 0x2110
addq $0x4, %r13
jmp 0x27bb
movq (%r15), %r14
movq 0x8(%r15), %r15
leaq -0x1e0(%rbp), %rbx
leaq -0x58(%rbp), %r12
leaq 0x1816(%rip), %r13      # 0x4057
cmpq %r15, %r14
je 0x293a
movq %rbx, %rdi
callq 0x2100
leaq -0x1d0(%rbp), %rdi
pushq $0x1
popq %rsi
callq 0x2240
movq %rax, %rdi
leaq 0x1813(%rip), %rsi      # 0x407e
callq 0x2160
movq %rax, %rdi
movq %r14, %rsi
callq 0x348b
movq %r12, %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x21f0
movq -0x58(%rbp), %rsi
movq %r13, %rdi
xorl %eax, %eax
callq 0x2030
movq %r12, %rdi
callq 0x2090
movq %rbx, %rdi
callq 0x2110
addq $0x4, %r14
jmp 0x2841
movq -0x30(%rbp), %rax
movq 0x8(%rax), %r15
movq 0x10(%rax), %r14
leaq -0x1e0(%rbp), %r13
leaq -0x58(%rbp), %rbx
leaq 0x178b(%rip), %r12      # 0x4057
cmpq %r14, %r15
je 0x29b6
movq %r13, %rdi
callq 0x2100
leaq -0x1d0(%rbp), %rdi
movq -0x38(%rbp), %rsi
callq 0x20e0
movq %rax, %rdi
leaq 0x1787(%rip), %rsi      # 0x407e
callq 0x2160
movq %rax, %rdi
movq %r15, %rsi
callq 0x3426
movq %rbx, %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x21f0
movq -0x58(%rbp), %rsi
movq %r12, %rdi
xorl %eax, %eax
callq 0x2030
movq %rbx, %rdi
callq 0x2090
movq %r13, %rdi
callq 0x2110
addq $0x18, %r15
jmp 0x28cc
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rbx
movq 0x10(%rax), %r13
leaq -0x1e0(%rbp), %r12
leaq -0x58(%rbp), %r14
leaq 0x16ff(%rip), %r15      # 0x4057
cmpq %r13, %rbx
je 0x29b6
movq %r12, %rdi
callq 0x2100
leaq -0x1d0(%rbp), %rdi
leaq 0x195c(%rip), %rsi      # 0x42cf
callq 0x2160
movq %rax, %rdi
movq %rbx, %rsi
callq 0x3426
movq %r14, %rdi
leaq -0x1c8(%rbp), %rsi
callq 0x21f0
movq -0x58(%rbp), %rsi
movq %r15, %rdi
xorl %eax, %eax
callq 0x2030
movq %r14, %rdi
callq 0x2090
movq %r12, %rdi
callq 0x2110
addq $0x18, %rbx
jmp 0x2958
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x29d6
jmp 0x29d6
jmp 0x29d6
jmp 0x29d6
jmp 0x29d6
jmp 0x29d6
jmp 0x29d6
movq %rax, %rbx
leaq -0x1e0(%rbp), %rdi
callq 0x2110
movq %rbx, %rdi
callq 0x2250