// File: /workspace/github_cpp_makefile_star2_O2/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, %r12d
movl %ecx, -0x30(%rbp)
movq %rdx, -0x38(%rbp)
movl %esi, %r13d
movl %edi, %r14d
leaq -0x178(%rbp), %rdi
callq 0x1d906
leaq 0x1d09c(%rip), %rsi     # 0x38963
leaq -0xa0(%rbp), %rdi
leaq -0x2b(%rbp), %rdx
callq 0xc0e0
leaq 0x1d08d(%rip), %rsi     # 0x3896b
leaq -0x80(%rbp), %rdi
leaq -0x2a(%rbp), %rdx
callq 0xc0e0
leaq 0x1d08c(%rip), %rsi     # 0x3897e
leaq -0x60(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0xc0e0
leaq -0x178(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0x80(%rbp), %rdx
leaq -0x60(%rbp), %rcx
pushq $0x1
popq %r8
callq 0x2e47c
leaq -0x60(%rbp), %rdi
callq 0xc110
leaq -0x80(%rbp), %rdi
callq 0xc110
leaq -0xa0(%rbp), %rdi
callq 0xc110
leaq 0x1d020(%rip), %rsi     # 0x38963
leaq -0xa0(%rbp), %rdi
leaq -0x2b(%rbp), %rdx
callq 0xc0e0
leaq 0x1d02a(%rip), %rsi     # 0x38984
leaq -0x80(%rbp), %rdi
leaq -0x2a(%rbp), %rdx
callq 0xc0e0
leaq 0x1d025(%rip), %rsi     # 0x38993
leaq -0x60(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0xc0e0
leaq -0x178(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0x80(%rbp), %rdx
leaq -0x60(%rbp), %rcx
pushq $0x1
popq %r8
callq 0x2e47c
movl 0x18(%rbp), %r15d
leaq -0x60(%rbp), %rdi
callq 0xc110
leaq -0x80(%rbp), %rdi
callq 0xc110
leaq -0xa0(%rbp), %rdi
callq 0xc110
movl %r15d, %edi
movq %rbx, %rsi
callq 0x1b66b
movl 0x38(%rbp), %r10d
movb 0x30(%rbp), %sil
movb 0x28(%rbp), %dl
movb 0x20(%rbp), %cl
movl 0x10(%rbp), %eax
cmpl $0x1, %r14d
je 0x1ba23
cmpl $0x2, %r14d
jne 0x1ba90
subq $0x8, %rsp
movzbl %sil, %r11d
movzbl %dl, %r14d
movzbl %cl, %r15d
leaq -0x178(%rbp), %rdi
movl %r13d, %esi
movq -0x38(%rbp), %rdx
movl -0x30(%rbp), %ecx
movl %r12d, %r8d
movq %rbx, %r9
pushq %r10
pushq %r11
pushq %r14
pushq %r15
pushq %rax
callq 0x1e214
addq $0x30, %rsp
jmp 0x1ba5c
subq $0x8, %rsp
movzbl %sil, %r11d
movzbl %dl, %r14d
movzbl %cl, %r15d
leaq -0x178(%rbp), %rdi
movl %r13d, %esi
movq -0x38(%rbp), %rdx
movl -0x30(%rbp), %ecx
movl %r12d, %r8d
movq %rbx, %r9
pushq %r10
pushq %r11
pushq %r14
pushq %r15
pushq %rax
callq 0x1d94b
addq $0x30, %rsp
leaq -0x40(%rbp), %rdi
andq $0x0, (%rdi)
callq 0x10250
leaq -0x40(%rbp), %rdi
callq 0x10620
leaq -0x178(%rbp), %rdi
callq 0x1eae4
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1e324(%rip), %rdi     # 0x39dbb
leaq 0x1c947(%rip), %rsi     # 0x383e5
leaq 0x1cef3(%rip), %rcx     # 0x38998
movl $0x27d, %edx            # imm = 0x27D
callq 0xc180
movq %rax, %rbx
leaq -0x40(%rbp), %rdi
callq 0x10620
jmp 0x1bb12
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0xc110
jmp 0x1bace
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0xc110
jmp 0x1baff
movq %rax, %rbx
jmp 0x1baff
jmp 0x1bb0f
movq %rax, %rbx
leaq -0x60(%rbp), %rdi
callq 0xc110
jmp 0x1baf1
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0xc110
jmp 0x1baff
movq %rax, %rbx
leaq -0xa0(%rbp), %rdi
callq 0xc110
jmp 0x1bb12
jmp 0x1bb0f
movq %rax, %rbx
leaq -0x178(%rbp), %rdi
callq 0x1eae4
movq %rbx, %rdi
callq 0xc4c0