// File: /workspace/github_cpp_makefile_star2_O1/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 0x27a94
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 0x26774(%rip), %xmm0    # 0x48290
movups %xmm0, 0x8(%rdx)
leaq 0x3b091(%rip), %rcx     # 0x5cbb8
movq %rcx, -0x80(%rax)
leaq 0x3b0fe(%rip), %rax     # 0x5cc30
movq %rax, -0x48(%rdx)
leaq -0x98(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x26eca(%rip), %rsi     # 0x48a13
leaq 0x26eca(%rip), %rdx     # 0x48a1a
leaq -0xa8(%rbp), %rdi
callq 0x1f29e
leaq -0x78(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x26eb0(%rip), %rsi     # 0x48a1b
leaq 0x26ebb(%rip), %rdx     # 0x48a2d
leaq -0x88(%rbp), %rdi
callq 0x1f29e
leaq -0x58(%rbp), %r13
movq %r13, -0x10(%r13)
leaq 0x26ea1(%rip), %rsi     # 0x48a2e
leaq 0x26e9f(%rip), %rdx     # 0x48a33
leaq -0x68(%rbp), %rdi
callq 0x1f29e
leaq -0x180(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
leaq -0x88(%rbp), %rdx
leaq -0x68(%rbp), %rcx
movl $0x1, %r8d
callq 0x3d45c
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x21bcf
callq 0xc280
movq -0x88(%rbp), %rdi
cmpq %r15, %rdi
je 0x21be0
callq 0xc280
movq -0xa8(%rbp), %rdi
cmpq %r12, %rdi
je 0x21bf1
callq 0xc280
leaq -0xa8(%rbp), %rdi
movq %r12, (%rdi)
leaq 0x26e11(%rip), %rsi     # 0x48a13
leaq 0x26e11(%rip), %rdx     # 0x48a1a
callq 0x1f29e
leaq -0x88(%rbp), %rdi
movq %r15, (%rdi)
leaq 0x26e15(%rip), %rsi     # 0x48a34
leaq 0x26e1c(%rip), %rdx     # 0x48a42
callq 0x1f29e
leaq -0x68(%rbp), %rdi
movq %r13, (%rdi)
leaq 0x26e0a(%rip), %rsi     # 0x48a43
leaq 0x26e07(%rip), %rdx     # 0x48a47
callq 0x1f29e
leaq -0x180(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
leaq -0x88(%rbp), %rdx
leaq -0x68(%rbp), %rcx
movl $0x1, %r8d
callq 0x3d45c
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x21c77
callq 0xc280
movq -0x88(%rbp), %rdi
cmpq %r15, %rdi
je 0x21c88
callq 0xc280
movl 0x18(%rbp), %r15d
movq -0xa8(%rbp), %rdi
cmpq %r12, %rdi
je 0x21c9d
callq 0xc280
movl %r15d, %edi
movq %rbx, %rsi
callq 0x2167d
movl 0x38(%rbp), %r10d
movb 0x30(%rbp), %sil
movb 0x28(%rbp), %dl
movb 0x20(%rbp), %cl
movl 0x10(%rbp), %eax
cmpl $0x1, %r14d
je 0x21d05
cmpl $0x2, %r14d
jne 0x21e33
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 0x25e98
addq $0x30, %rsp
jmp 0x21d3f
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 0x25092
addq $0x30, %rsp
leaq -0x40(%rbp), %rdi
movq $0x0, (%rdi)
callq 0x12190
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x21d75
movl 0x8(%rdi), %eax
cmpl $0x1, %eax
ja 0x21d68
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x21d6d
decl %eax
movl %eax, 0x8(%rdi)
movq $0x0, -0x40(%rbp)
leaq 0x3affc(%rip), %rax     # 0x5cd78
movq %rax, -0x108(%rbp)
cmpl $0x0, -0xc0(%rbp)
je 0x21db6
movq -0xd8(%rbp), %rdi
testq %rdi, %rdi
je 0x21da8
callq 0xc350
movq $0x0, -0xd8(%rbp)
xorl %eax, %eax
movl %eax, -0xd0(%rbp)
movl %eax, -0xc0(%rbp)
movl $0x0, -0xd0(%rbp)
cmpl $0x0, -0xe8(%rbp)
je 0x21df3
movq -0x100(%rbp), %rdi
testq %rdi, %rdi
je 0x21de5
callq 0xc350
movq $0x0, -0x100(%rbp)
xorl %eax, %eax
movl %eax, -0xf8(%rbp)
movl %eax, -0xe8(%rbp)
leaq -0x140(%rbp), %rdi
movl $0x0, 0x48(%rdi)
leaq 0x3cd20(%rip), %rax     # 0x5eb28
addq $0x10, %rax
movq %rax, -0x40(%rdi)
callq 0x27b0a
leaq -0x170(%rbp), %rdi
callq 0x27bbc
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x27e58(%rip), %rdi     # 0x49c92
leaq 0x26654(%rip), %rsi     # 0x48495
leaq 0x26c00(%rip), %rcx     # 0x48a48
movl $0x27d, %edx            # imm = 0x27D
callq 0xc180
movq %rax, %rbx
movq -0x40(%rbp), %rdi
testq %rdi, %rdi
je 0x21ef0
leaq -0x40(%rbp), %rsi
callq 0xc7fe
jmp 0x21ef0
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x21e86
callq 0xc280
jmp 0x21e86
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r15, %rdi
je 0x21e9c
callq 0xc280
jmp 0x21e9c
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
cmpq %r12, %rdi
je 0x21ef0
jmp 0x21ee4
jmp 0x21eed
movq %rax, %rbx
movq -0x68(%rbp), %rdi
cmpq %r13, %rdi
je 0x21ec2
callq 0xc280
jmp 0x21ec2
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r15, %rdi
je 0x21ed8
callq 0xc280
jmp 0x21ed8
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
cmpq %r12, %rdi
je 0x21ef0
callq 0xc280
jmp 0x21ef0
jmp 0x21eed
movq %rax, %rbx
leaq -0x180(%rbp), %rdi
callq 0x26ca2
movq %rbx, %rdi
callq 0xc4e0