// File: /workspace/github_cpp_makefile_star2_O3/vsklad[P]cgen/commands.cpp
// Function: encode_cnf(CGenAlgorithm, unsigned int, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, CGenVariableInfo, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, CGenVariableInfo>>>&, unsigned int, unsigned int, char const*, CGenOutputFormat, CGenTraceFormat, bool, bool, bool, bal::FormulaProcessingMode)
void encode_cnf(const CGenAlgorithm algorithm, const uint32_t rounds,
                CGenVariablesMap& variables_map,
                const uint32_t add_max_args, const uint32_t xor_max_args,
                const char* const output_file_name,
                const CGenOutputFormat output_format, const CGenTraceFormat trace_format,
                const bool b_reindex_variables, const bool b_normalize_variables,
                const bool b_assign_after_encoding, const bal::FormulaProcessingMode mode) {
    bal::Cnf cnf;
    
    cnf.add_parameter("encoder", "add_args_structure", "chain");
    cnf.add_parameter("encoder", "add_args_order", "none");
    
    __CNF_TRACE_INITIALIZE(trace_format, output_file_name);
    switch(algorithm) {
        case algSHA1:
            encode_impl<acl::SHA1<bal::Literal<bal::Cnf>>>(cnf, rounds, variables_map, add_max_args, xor_max_args,
                                                       output_file_name, output_format,
                                                       b_reindex_variables, b_normalize_variables,
                                                       b_assign_after_encoding, mode);
            break;
        case algSHA256:
            encode_impl<acl::SHA256<bal::Literal<bal::Cnf>>>(cnf, rounds, variables_map, add_max_args, xor_max_args,
                                                         output_file_name, output_format,
                                                         b_reindex_variables, b_normalize_variables,
                                                         b_assign_after_encoding, mode);
            break;
        default:
            assert(false);
    };
    __CNF_TRACE_FINIALIZE;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %r9, %rbx
movl %r8d, -0x34(%rbp)
movl %ecx, -0x30(%rbp)
movq %rdx, -0x48(%rbp)
movl %esi, -0x2c(%rbp)
movl %edi, %r14d
leaq -0x180(%rbp), %rdi
callq 0x2622c
leaq -0x100(%rbp), %rax
xorl %ecx, %ecx
movq %rcx, (%rax)
movl %ecx, 0x8(%rax)
leaq -0xe8(%rbp), %rdx
movq %rdx, -0x8(%rdx)
movl %ecx, (%rdx)
movq %rax, 0x8(%rdx)
movq %rcx, 0x10(%rdx)
movl %ecx, 0x18(%rdx)
leaq -0xc0(%rbp), %rdx
movq %rdx, -0x8(%rdx)
movl %ecx, (%rdx)
movaps 0x25ec6(%rip), %xmm0    # 0x462a0
movups %xmm0, 0x8(%rdx)
leaq 0x3a3c3(%rip), %rcx     # 0x5a7a8
movq %rcx, -0x80(%rax)
leaq 0x3a430(%rip), %rax     # 0x5a820
movq %rax, -0x48(%rdx)
leaq -0x98(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x2661c(%rip), %rsi     # 0x46a23
leaq 0x2661c(%rip), %rdx     # 0x46a2a
leaq -0xa8(%rbp), %rdi
callq 0x1dab2
leaq -0x78(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x26602(%rip), %rsi     # 0x46a2b
leaq 0x2660d(%rip), %rdx     # 0x46a3d
leaq -0x88(%rbp), %rdi
callq 0x1dab2
leaq -0x58(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x265f3(%rip), %rsi     # 0x46a3e
leaq 0x265f1(%rip), %rdx     # 0x46a43
leaq -0x68(%rbp), %rdi
callq 0x1dab2
leaq -0x180(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
leaq -0x88(%rbp), %rdx
leaq -0x68(%rbp), %rcx
movl $0x1, %r8d
callq 0x3b4f2
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x2048d
callq 0xb280
movq -0x88(%rbp), %rdi
cmpq %r15, %rdi
je 0x2049e
callq 0xb280
movq -0xa8(%rbp), %rdi
cmpq %r12, %rdi
je 0x204af
callq 0xb280
leaq -0xa8(%rbp), %rdi
movq %r12, (%rdi)
leaq 0x26563(%rip), %rsi     # 0x46a23
leaq 0x26563(%rip), %rdx     # 0x46a2a
callq 0x1dab2
leaq -0x88(%rbp), %rdi
movq %r15, (%rdi)
leaq 0x26567(%rip), %rsi     # 0x46a44
leaq 0x2656e(%rip), %rdx     # 0x46a52
callq 0x1dab2
leaq -0x68(%rbp), %rdi
movq %r13, (%rdi)
leaq 0x2655c(%rip), %rsi     # 0x46a53
leaq 0x26559(%rip), %rdx     # 0x46a57
callq 0x1dab2
leaq -0x180(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
leaq -0x88(%rbp), %rdx
leaq -0x68(%rbp), %rcx
movl $0x1, %r8d
callq 0x3b4f2
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x20535
callq 0xb280
movq -0x88(%rbp), %rdi
cmpq %r15, %rdi
je 0x20546
callq 0xb280
movl 0x18(%rbp), %r15d
movq -0xa8(%rbp), %rdi
cmpq %r12, %rdi
je 0x2055b
callq 0xb280
movl %r15d, %edi
movq %rbx, %rsi
callq 0x1ff77
movl 0x38(%rbp), %r10d
movb 0x30(%rbp), %sil
movb 0x28(%rbp), %dl
movb 0x20(%rbp), %cl
movl 0x10(%rbp), %eax
cmpl $0x1, %r14d
je 0x205c3
cmpl $0x2, %r14d
jne 0x206e9
subq $0x8, %rsp
movzbl %sil, %r11d
movzbl %dl, %r14d
movzbl %cl, %r15d
leaq -0x180(%rbp), %rdi
movl -0x2c(%rbp), %esi
movq -0x48(%rbp), %rdx
movl -0x30(%rbp), %ecx
movl -0x34(%rbp), %r8d
movq %rbx, %r9
pushq %r10
pushq %r11
pushq %r14
pushq %r15
pushq %rax
callq 0x246f8
addq $0x30, %rsp
jmp 0x205fd
subq $0x8, %rsp
movzbl %sil, %r11d
movzbl %dl, %r14d
movzbl %cl, %r15d
leaq -0x180(%rbp), %rdi
movl -0x2c(%rbp), %esi
movq -0x48(%rbp), %rdx
movl -0x30(%rbp), %ecx
movl -0x34(%rbp), %r8d
movq %rbx, %r9
pushq %r10
pushq %r11
pushq %r14
pushq %r15
pushq %rax
callq 0x23948
addq $0x30, %rsp
leaq -0x40(%rbp), %rdi
movq $0x0, (%rdi)
callq 0x10e00
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x20633
movl 0x8(%rdi), %eax
cmpl $0x1, %eax
ja 0x20626
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x2062b
decl %eax
movl %eax, 0x8(%rdi)
movq $0x0, -0x40(%rbp)
leaq 0x3a2ce(%rip), %rax     # 0x5a908
movq %rax, -0x108(%rbp)
cmpl $0x0, -0xc0(%rbp)
je 0x20670
movq -0xd8(%rbp), %rdi
testq %rdi, %rdi
je 0x20666
callq 0xb350
movq $0x0, -0xd8(%rbp)
movl $0x0, -0xc0(%rbp)
movl $0x0, -0xd0(%rbp)
cmpl $0x0, -0xe8(%rbp)
je 0x206a9
movq -0x100(%rbp), %rdi
testq %rdi, %rdi
je 0x2069f
callq 0xb350
movq $0x0, -0x100(%rbp)
movl $0x0, -0xe8(%rbp)
leaq -0x140(%rbp), %rdi
movl $0x0, 0x48(%rdi)
leaq 0x3b512(%rip), %rax     # 0x5bbd0
addq $0x10, %rax
movq %rax, -0x40(%rdi)
callq 0x262a2
leaq -0x170(%rbp), %rdi
callq 0x26354
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x275b2(%rip), %rdi     # 0x47ca2
leaq 0x25dae(%rip), %rsi     # 0x464a5
leaq 0x2635a(%rip), %rcx     # 0x46a58
movl $0x27d, %edx            # imm = 0x27D
callq 0xb180
movq %rax, %rbx
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x207a6
leaq -0x40(%rbp), %rsi
callq 0xb658
jmp 0x207a6
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x2073c
callq 0xb280
jmp 0x2073c
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r15, %rdi
je 0x20752
callq 0xb280
jmp 0x20752
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
cmpq %r12, %rdi
je 0x207a6
jmp 0x2079a
jmp 0x207a3
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x20778
callq 0xb280
jmp 0x20778
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r15, %rdi
je 0x2078e
callq 0xb280
jmp 0x2078e
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
cmpq %r12, %rdi
je 0x207a6
callq 0xb280
jmp 0x207a6
jmp 0x207a3
movq %rax, %rbx
leaq -0x180(%rbp), %rdi
callq 0x254ac
movq %rbx, %rdi
callq 0xb4e0