// File: /workspace/github_cpp_makefile_star2_O1/vsklad[P]cgen/commands.cpp
// Function: encode_anf(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_anf(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::Anf anf;
    
    switch(algorithm) {
        case algSHA1:
            encode_impl<acl::SHA1<bal::Literal<bal::Anf>>>(anf, 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::Anf>>>(anf, 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);
    };
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %r9, -0x38(%rbp)
movl %r8d, -0x30(%rbp)
movl %ecx, -0x2c(%rbp)
movq %rdx, %r13
movl %esi, %r12d
movl %edi, %ebx
leaq -0xf8(%rbp), %r14
movq %r14, %rdi
callq 0x27a94
leaq 0x39bf1(%rip), %r15     # 0x5b100
addq $0x10, %r15
movq %r15, (%r14)
xorps %xmm0, %xmm0
movups %xmm0, 0x78(%r14)
movups %xmm0, 0x88(%r14)
movups %xmm0, 0x98(%r14)
movups %xmm0, 0xa8(%r14)
movq $0x0, 0xb8(%r14)
cmpl $0x2, %ebx
je 0x2159d
movb 0x30(%rbp), %al
movb 0x28(%rbp), %r10b
movb 0x20(%rbp), %dil
movl %r12d, %esi
movl -0x2c(%rbp), %ecx
movl -0x30(%rbp), %r8d
movl 0x38(%rbp), %r14d
movq -0x38(%rbp), %r9
movl 0x10(%rbp), %r12d
cmpl $0x1, %ebx
jne 0x21647
subq $0x8, %rsp
movzbl %al, %eax
movzbl %r10b, %r10d
movzbl %dil, %r11d
leaq -0xf8(%rbp), %rdi
movq %r13, %rdx
pushq %r14
pushq %rax
pushq %r10
pushq %r11
pushq %r12
callq 0x232b9
addq $0x30, %rsp
jmp 0x215dd
subq $0x8, %rsp
movzbl 0x30(%rbp), %eax
movzbl 0x28(%rbp), %r10d
movzbl 0x20(%rbp), %r11d
leaq -0xf8(%rbp), %rdi
movl %r12d, %esi
movq %r13, %rdx
movl -0x2c(%rbp), %ecx
movl -0x30(%rbp), %r8d
movq -0x38(%rbp), %r9
movl 0x38(%rbp), %ebx
pushq %rbx
pushq %rax
pushq %r10
pushq %r11
movl 0x10(%rbp), %eax
pushq %rax
callq 0x240f6
addq $0x30, %rsp
movq %r15, -0xf8(%rbp)
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x215f2
callq 0xc280
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x21600
callq 0xc280
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x2160e
callq 0xc280
leaq 0x3d513(%rip), %rax     # 0x5eb28
addq $0x10, %rax
leaq -0xb8(%rbp), %rdi
movq %rax, -0x40(%rdi)
callq 0x27b0a
leaq -0xe8(%rbp), %rdi
callq 0x27bbc
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x28644(%rip), %rdi     # 0x49c92
leaq 0x26e40(%rip), %rsi     # 0x48495
leaq 0x2728e(%rip), %rcx     # 0x488ea
movl $0x23d, %edx            # imm = 0x23D
callq 0xc180
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x24f36
movq %rbx, %rdi
callq 0xc4e0