// File: 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 %r14
pushq %rbx
subq $0x280, %rsp            # imm = 0x280
movl %ecx, -0x22c(%rbp)
movq %rdx, -0x228(%rbp)
movl %esi, %r10d
movl -0x22c(%rbp), %esi
movl %edi, %r11d
movq -0x228(%rbp), %rdi
movl 0x38(%rbp), %eax
movb 0x30(%rbp), %al
movb 0x28(%rbp), %cl
movb 0x20(%rbp), %dl
movl 0x18(%rbp), %ebx
movl 0x10(%rbp), %ebx
movl %r11d, -0x14(%rbp)
movl %r10d, -0x18(%rbp)
movq %rdi, -0x20(%rbp)
movl %esi, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movq %r9, -0x30(%rbp)
andb $0x1, %dl
movb %dl, -0x31(%rbp)
andb $0x1, %cl
movb %cl, -0x32(%rbp)
andb $0x1, %al
movb %al, -0x33(%rbp)
leaq -0x110(%rbp), %rdi
callq 0x310a0
leaq -0x131(%rbp), %rdi
movq %rdi, -0x220(%rbp)
callq 0xd5b0
movq -0x220(%rbp), %rdx
leaq 0x35eaa(%rip), %rsi     # 0x62a0f
leaq -0x130(%rbp), %rdi
callq 0xd440
jmp 0x2cb73
leaq -0x169(%rbp), %rdi
movq %rdi, -0x238(%rbp)
callq 0xd5b0
movq -0x238(%rbp), %rdx
leaq 0x35e83(%rip), %rsi     # 0x62a17
leaq -0x168(%rbp), %rdi
callq 0xd440
jmp 0x2cba2
leaq -0x191(%rbp), %rdi
movq %rdi, -0x240(%rbp)
callq 0xd5b0
movq -0x240(%rbp), %rdx
leaq 0x35e67(%rip), %rsi     # 0x62a2a
leaq -0x190(%rbp), %rdi
callq 0xd440
jmp 0x2cbd1
leaq -0x110(%rbp), %rdi
leaq -0x130(%rbp), %rsi
leaq -0x168(%rbp), %rdx
leaq -0x190(%rbp), %rcx
movl $0x1, %r8d
callq 0x55620
jmp 0x2cbfa
leaq -0x190(%rbp), %rdi
callq 0xd1b0
leaq -0x191(%rbp), %rdi
callq 0xd370
leaq -0x168(%rbp), %rdi
callq 0xd1b0
leaq -0x169(%rbp), %rdi
callq 0xd370
leaq -0x130(%rbp), %rdi
callq 0xd1b0
leaq -0x131(%rbp), %rdi
callq 0xd370
leaq -0x1b9(%rbp), %rdi
movq %rdi, -0x248(%rbp)
callq 0xd5b0
movq -0x248(%rbp), %rdx
leaq 0x35dac(%rip), %rsi     # 0x62a0f
leaq -0x1b8(%rbp), %rdi
callq 0xd440
jmp 0x2cc71
leaq -0x1e1(%rbp), %rdi
movq %rdi, -0x250(%rbp)
callq 0xd5b0
movq -0x250(%rbp), %rdx
leaq 0x35d9e(%rip), %rsi     # 0x62a30
leaq -0x1e0(%rbp), %rdi
callq 0xd440
jmp 0x2cca0
leaq -0x209(%rbp), %rdi
movq %rdi, -0x258(%rbp)
callq 0xd5b0
movq -0x258(%rbp), %rdx
leaq 0x35d7e(%rip), %rsi     # 0x62a3f
leaq -0x208(%rbp), %rdi
callq 0xd440
jmp 0x2cccf
leaq -0x110(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
leaq -0x1e0(%rbp), %rdx
leaq -0x208(%rbp), %rcx
movl $0x1, %r8d
callq 0x55620
jmp 0x2ccf8
leaq -0x208(%rbp), %rdi
callq 0xd1b0
leaq -0x209(%rbp), %rdi
callq 0xd370
leaq -0x1e0(%rbp), %rdi
callq 0xd1b0
leaq -0x1e1(%rbp), %rdi
callq 0xd370
leaq -0x1b8(%rbp), %rdi
callq 0xd1b0
leaq -0x1b9(%rbp), %rdi
callq 0xd370
movl 0x18(%rbp), %edi
movq -0x30(%rbp), %rsi
callq 0x2c640
jmp 0x2cd4e
movl -0x14(%rbp), %eax
movl %eax, -0x25c(%rbp)
subl $0x1, %eax
je 0x2cec3
jmp 0x2cd62
movl -0x25c(%rbp), %eax
subl $0x2, %eax
je 0x2cf19
jmp 0x2cf6f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
jmp 0x2ce00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
jmp 0x2cde8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
jmp 0x2cdd0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
leaq -0x190(%rbp), %rdi
callq 0xd1b0
leaq -0x191(%rbp), %rdi
callq 0xd370
leaq -0x168(%rbp), %rdi
callq 0xd1b0
leaq -0x169(%rbp), %rdi
callq 0xd370
leaq -0x130(%rbp), %rdi
callq 0xd1b0
leaq -0x131(%rbp), %rdi
callq 0xd370
jmp 0x2cff0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
jmp 0x2ce9b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
jmp 0x2ce83
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
jmp 0x2ce6b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
leaq -0x208(%rbp), %rdi
callq 0xd1b0
leaq -0x209(%rbp), %rdi
callq 0xd370
leaq -0x1e0(%rbp), %rdi
callq 0xd1b0
leaq -0x1e1(%rbp), %rdi
callq 0xd370
leaq -0x1b8(%rbp), %rdi
callq 0xd1b0
leaq -0x1b9(%rbp), %rdi
callq 0xd370
jmp 0x2cff0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
jmp 0x2cff0
movl -0x18(%rbp), %esi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
movl -0x28(%rbp), %r8d
movq -0x30(%rbp), %r9
movl 0x10(%rbp), %edi
movl 0x38(%rbp), %r14d
movzbl -0x31(%rbp), %r10d
movzbl -0x32(%rbp), %r11d
movzbl -0x33(%rbp), %ebx
movq %rsp, %rax
movl %r14d, 0x20(%rax)
andl $0x1, %ebx
movl %ebx, 0x18(%rax)
andl $0x1, %r11d
movl %r11d, 0x10(%rax)
andl $0x1, %r10d
movl %r10d, 0x8(%rax)
movl %edi, (%rax)
leaq -0x110(%rbp), %rdi
callq 0x31110
jmp 0x2cf17
jmp 0x2cf8e
movl -0x18(%rbp), %esi
movq -0x20(%rbp), %rdx
movl -0x24(%rbp), %ecx
movl -0x28(%rbp), %r8d
movq -0x30(%rbp), %r9
movl 0x10(%rbp), %edi
movl 0x38(%rbp), %r14d
movzbl -0x31(%rbp), %r10d
movzbl -0x32(%rbp), %r11d
movzbl -0x33(%rbp), %ebx
movq %rsp, %rax
movl %r14d, 0x20(%rax)
andl $0x1, %ebx
movl %ebx, 0x18(%rax)
andl $0x1, %r11d
movl %r11d, 0x10(%rax)
andl $0x1, %r10d
movl %r10d, 0x8(%rax)
movl %edi, (%rax)
leaq -0x110(%rbp), %rdi
callq 0x32520
jmp 0x2cf6d
jmp 0x2cf8e
leaq 0x36ef1(%rip), %rdi     # 0x63e67
leaq 0x35514(%rip), %rsi     # 0x62491
movl $0x27d, %edx            # imm = 0x27D
leaq 0x35abb(%rip), %rcx     # 0x62a44
callq 0xd1c0
xorl %eax, %eax
movl %eax, %esi
leaq -0x218(%rbp), %rdi
callq 0x30e90
jmp 0x2cfa0
leaq -0x218(%rbp), %rdi
callq 0x15b80
jmp 0x2cfae
leaq -0x218(%rbp), %rdi
callq 0x161e0
leaq -0x110(%rbp), %rdi
callq 0x33930
addq $0x280, %rsp            # imm = 0x280
popq %rbx
popq %r14
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x140(%rbp)
movl %eax, -0x144(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x161e0
leaq -0x110(%rbp), %rdi
callq 0x33930
movq -0x140(%rbp), %rdi
callq 0xd5a0
nopl (%rax,%rax)