// File: vsklad[P]cgen/commands.cpp
// Function: void encode_impl<acl::SHA1<bal::Literal<bal::Anf>>>(acl::SHA1<bal::Literal<bal::Anf>>::Bit::Formula&, 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, bool, bool, bool, bal::FormulaProcessingMode)
void encode_impl(typename SHA::Bit::Formula& formula, 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 bool b_reindex_variables, const bool b_normalize_variables,
                 const bool b_assign_after_encoding, const bal::FormulaProcessingMode mode) {

    if (rounds == 0 || rounds > SHA::ROUNDS_NUMBER) {
        throw std::invalid_argument(ERROR_ROUNDS_RANGE);
    };
    
    if (add_max_args > 0) {
        formula.set_add_max_args(add_max_args);
    };
    if (xor_max_args > 0) {
        formula.set_xor_max_args(xor_max_args);
    };
    formula.add_parameter("encoder", "add_max_args", formula.get_add_max_args());
    formula.add_parameter("encoder", "xor_max_args", formula.get_xor_max_args());
    
    formula.add_parameter("encoder", "xor_args_structure", "chain"); // "pyramid"
#if defined(XOR_ARGS_ORDER_ASCENDING)
    formula.add_parameter("encoder", "xor_args_order", "ascending");
#elif defined(XOR_ARGS_ORDER_DESCENDING)
    formula.add_parameter("encoder", "xor_args_order", "descending");
#else
    formula.add_parameter("encoder", "xor_args_order", "none");
#endif
    
    formula.add_parameter("encoder", "algorithm", SHA::NAME);
    formula.add_parameter("encoder", "rounds", rounds);
 
    // assume 1 block but expand if necessary
    bal::VariablesArray M_array(SHA::MESSAGE_BLOCK_SIZE, SHA::WORD_SIZE);
    M_array.assign_unassigned();
    
    // handling of message M is special because it is used to optimise the encoding itself
    auto M_it = variables_map.find("M");
    if (!b_assign_after_encoding && M_it != variables_map.end()) {
        if (M_it->second.mode == vmCompute) {
            throw std::invalid_argument(ERROR_COMPUTE_MESSAGE_NOT_SUPPORTED);
        } else if (M_it->second.mode == vmRandom) {
            variable_define_random(M_it->second, M_array);
        } else {
            _assert_level_0(M_it->second.mode == vmValue);
            // check that the message size is a multiple of the block size
            constexpr auto MESSAGE_BLOCK_SIZE_BITS = SHA::MESSAGE_BLOCK_SIZE * SHA::WORD_SIZE;
            if ((M_it->second.data.size() % MESSAGE_BLOCK_SIZE_BITS) != 0) {
                std::stringstream error_message;
                error_message << "Message (M) size must be a multiple of the block size ";
                error_message << std::dec << "(" << MESSAGE_BLOCK_SIZE_BITS << ")";
                throw std::invalid_argument(error_message.str());
            } else if (M_it->second.data.size() > MESSAGE_BLOCK_SIZE_BITS) {
                // expand the message template
                M_array = bal::VariablesArray(M_it->second.data.size() / SHA::WORD_SIZE, SHA::WORD_SIZE);
                M_array.assign_unassigned();
            };
        };
        M_array = variable_generate_value(formula, "M", M_it->second, M_array, true, true);
    };
    
    SHA sha;
    
    const std::size_t M_size = M_array.size() / SHA::WORD_SIZE;
    formula.add_parameter("encoder", "message_blocks", M_size / SHA::MESSAGE_BLOCK_SIZE);
    
    bal::Ref<typename SHA::Word> M[M_size];
    bal::Ref<typename SHA::Word> H[SHA::HASH_SIZE];
    
    formula.generate_unassigned_variable_literals(M_array.data(), M_array.size());

    assign(M, M_size, formula, M_array);
    
    bal::FormulaTracer<SHA::WORD_SIZE, typename SHA::Bit> tracer(formula);
    sha.execute(M, M_size, H, tracer, rounds);
    
    bool is_valid = true;
    
    if (variables_map.size() > 0) {
        // take the same route as process function
        print_statistics(formula);
        variables_define(formula, variables_map);
        is_valid = process_impl<typename SHA::Bit::Formula, true>(formula, variables_map, b_reindex_variables, mode);
    };
    
    if (is_valid && b_normalize_variables) {
        normalize_variables(formula, b_reindex_variables);
    };
    
    if (is_valid) {
        save(formula, output_file_name, output_format);
    } else {
        throw std::invalid_argument("Encoding failed");
    };
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0x7e8, %rsp            # imm = 0x7E8
movl %ecx, -0x5d4(%rbp)
movq %rdx, -0x5d0(%rbp)
movl %esi, %r10d
movl -0x5d4(%rbp), %esi
movq %rdi, %r11
movq -0x5d0(%rbp), %rdi
movl 0x30(%rbp), %eax
movb 0x28(%rbp), %al
movb 0x20(%rbp), %cl
movb 0x18(%rbp), %dl
movl 0x10(%rbp), %ebx
movq %r11, -0x10(%rbp)
movl %r10d, -0x14(%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)
cmpl $0x0, -0x14(%rbp)
je 0x2e67f
cmpl $0x50, -0x14(%rbp)
jbe 0x2e6db
movl $0x10, %edi
callq 0xd150
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x5e0(%rbp)
leaq 0x366b0(%rip), %rsi     # 0x64d4d
callq 0xd5f0
jmp 0x2e6a4
movq -0x5e0(%rbp), %rdi
movq 0x54926(%rip), %rsi     # 0x82fd8
movq 0x54907(%rip), %rdx     # 0x82fc0
callq 0xd570
movq -0x5e0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0xd210
jmp 0x2fa17
cmpl $0x0, -0x24(%rbp)
jbe 0x2e6ed
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x40580
cmpl $0x0, -0x28(%rbp)
jbe 0x2e6ff
movq -0x10(%rbp), %rdi
movl -0x28(%rbp), %esi
callq 0x40800
movq -0x10(%rbp), %rax
movq %rax, -0x5f0(%rbp)
leaq -0x69(%rbp), %rdi
movq %rdi, -0x5e8(%rbp)
callq 0xd5b0
movq -0x5e8(%rbp), %rdx
leaq 0x342e7(%rip), %rsi     # 0x62a0f
leaq -0x68(%rbp), %rdi
callq 0xd440
jmp 0x2e733
leaq -0x91(%rbp), %rdi
movq %rdi, -0x5f8(%rbp)
callq 0xd5b0
movq -0x5f8(%rbp), %rdx
leaq 0x33914(%rip), %rsi     # 0x62068
leaq -0x90(%rbp), %rdi
callq 0xd440
jmp 0x2e762
movq -0x10(%rbp), %rdi
callq 0x40a80
movl %eax, -0x5fc(%rbp)
jmp 0x2e773
movl -0x5fc(%rbp), %ecx
movq -0x5f0(%rbp), %rdi
leaq -0x68(%rbp), %rsi
leaq -0x90(%rbp), %rdx
callq 0x55940
jmp 0x2e792
leaq -0x90(%rbp), %rdi
callq 0xd1b0
leaq -0x91(%rbp), %rdi
callq 0xd370
leaq -0x68(%rbp), %rdi
callq 0xd1b0
leaq -0x69(%rbp), %rdi
callq 0xd370
movq -0x10(%rbp), %rax
movq %rax, -0x610(%rbp)
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x608(%rbp)
callq 0xd5b0
movq -0x608(%rbp), %rdx
leaq 0x34227(%rip), %rsi     # 0x62a0f
leaq -0xb8(%rbp), %rdi
callq 0xd440
jmp 0x2e7f6
leaq -0xe1(%rbp), %rdi
movq %rdi, -0x618(%rbp)
callq 0xd5b0
movq -0x618(%rbp), %rdx
leaq 0x3385e(%rip), %rsi     # 0x62075
leaq -0xe0(%rbp), %rdi
callq 0xd440
jmp 0x2e825
movq -0x10(%rbp), %rdi
callq 0x40ac0
movl %eax, -0x61c(%rbp)
jmp 0x2e836
movl -0x61c(%rbp), %ecx
movq -0x610(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
leaq -0xe0(%rbp), %rdx
callq 0x55940
jmp 0x2e858
leaq -0xe0(%rbp), %rdi
callq 0xd1b0
leaq -0xe1(%rbp), %rdi
callq 0xd370
leaq -0xb8(%rbp), %rdi
callq 0xd1b0
leaq -0xb9(%rbp), %rdi
callq 0xd370
movq -0x10(%rbp), %rax
movq %rax, -0x630(%rbp)
leaq -0x109(%rbp), %rdi
movq %rdi, -0x628(%rbp)
callq 0xd5b0
movq -0x628(%rbp), %rdx
leaq 0x3415b(%rip), %rsi     # 0x62a0f
leaq -0x108(%rbp), %rdi
callq 0xd440
jmp 0x2e8c2
leaq -0x131(%rbp), %rdi
movq %rdi, -0x638(%rbp)
callq 0xd5b0
movq -0x638(%rbp), %rdx
leaq 0x36488(%rip), %rsi     # 0x64d6b
leaq -0x130(%rbp), %rdi
callq 0xd440
jmp 0x2e8f1
leaq -0x159(%rbp), %rdi
movq %rdi, -0x640(%rbp)
callq 0xd5b0
movq -0x640(%rbp), %rdx
leaq 0x34118(%rip), %rsi     # 0x62a2a
leaq -0x158(%rbp), %rdi
callq 0xd440
jmp 0x2e920
movq -0x630(%rbp), %rdi
leaq -0x108(%rbp), %rsi
leaq -0x130(%rbp), %rdx
leaq -0x158(%rbp), %rcx
movl $0x1, %r8d
callq 0x55620
jmp 0x2e949
leaq -0x158(%rbp), %rdi
callq 0xd1b0
leaq -0x159(%rbp), %rdi
callq 0xd370
leaq -0x130(%rbp), %rdi
callq 0xd1b0
leaq -0x131(%rbp), %rdi
callq 0xd370
leaq -0x108(%rbp), %rdi
callq 0xd1b0
leaq -0x109(%rbp), %rdi
callq 0xd370
movq -0x10(%rbp), %rax
movq %rax, -0x650(%rbp)
leaq -0x181(%rbp), %rdi
movq %rdi, -0x648(%rbp)
callq 0xd5b0
movq -0x648(%rbp), %rdx
leaq 0x34052(%rip), %rsi     # 0x62a0f
leaq -0x180(%rbp), %rdi
callq 0xd440
jmp 0x2e9cb
leaq -0x1a9(%rbp), %rdi
movq %rdi, -0x658(%rbp)
callq 0xd5b0
movq -0x658(%rbp), %rdx
leaq 0x36392(%rip), %rsi     # 0x64d7e
leaq -0x1a8(%rbp), %rdi
callq 0xd440
jmp 0x2e9fa
leaq -0x1d1(%rbp), %rdi
movq %rdi, -0x660(%rbp)
callq 0xd5b0
movq -0x660(%rbp), %rdx
leaq 0x36372(%rip), %rsi     # 0x64d8d
leaq -0x1d0(%rbp), %rdi
callq 0xd440
jmp 0x2ea29
movq -0x650(%rbp), %rdi
leaq -0x180(%rbp), %rsi
leaq -0x1a8(%rbp), %rdx
leaq -0x1d0(%rbp), %rcx
movl $0x1, %r8d
callq 0x55620
jmp 0x2ea52
leaq -0x1d0(%rbp), %rdi
callq 0xd1b0
leaq -0x1d1(%rbp), %rdi
callq 0xd370
leaq -0x1a8(%rbp), %rdi
callq 0xd1b0
leaq -0x1a9(%rbp), %rdi
callq 0xd370
leaq -0x180(%rbp), %rdi
callq 0xd1b0
leaq -0x181(%rbp), %rdi
callq 0xd370
movq -0x10(%rbp), %rax
movq %rax, -0x670(%rbp)
leaq -0x1f9(%rbp), %rdi
movq %rdi, -0x668(%rbp)
callq 0xd5b0
movq -0x668(%rbp), %rdx
leaq 0x33f49(%rip), %rsi     # 0x62a0f
leaq -0x1f8(%rbp), %rdi
callq 0xd440
jmp 0x2ead4
leaq -0x221(%rbp), %rdi
movq %rdi, -0x678(%rbp)
callq 0xd5b0
movq -0x678(%rbp), %rdx
leaq 0x362a2(%rip), %rsi     # 0x64d97
leaq -0x220(%rbp), %rdi
callq 0xd440
jmp 0x2eb03
leaq -0x249(%rbp), %rdi
movq %rdi, -0x680(%rbp)
callq 0xd5b0
movq -0x680(%rbp), %rdx
leaq 0x3627d(%rip), %rsi     # 0x64da1
leaq -0x248(%rbp), %rdi
callq 0xd440
jmp 0x2eb32
movq -0x670(%rbp), %rdi
leaq -0x1f8(%rbp), %rsi
leaq -0x220(%rbp), %rdx
leaq -0x248(%rbp), %rcx
movl $0x1, %r8d
callq 0x55620
jmp 0x2eb5b
leaq -0x248(%rbp), %rdi
callq 0xd1b0
leaq -0x249(%rbp), %rdi
callq 0xd370
leaq -0x220(%rbp), %rdi
callq 0xd1b0
leaq -0x221(%rbp), %rdi
callq 0xd370
leaq -0x1f8(%rbp), %rdi
callq 0xd1b0
leaq -0x1f9(%rbp), %rdi
callq 0xd370
movq -0x10(%rbp), %rax
movq %rax, -0x690(%rbp)
leaq -0x271(%rbp), %rdi
movq %rdi, -0x688(%rbp)
callq 0xd5b0
movq -0x688(%rbp), %rdx
leaq 0x33e40(%rip), %rsi     # 0x62a0f
leaq -0x270(%rbp), %rdi
callq 0xd440
jmp 0x2ebdd
leaq -0x299(%rbp), %rdi
movq %rdi, -0x698(%rbp)
callq 0xd5b0
movq -0x698(%rbp), %rdx
leaq 0x361a9(%rip), %rsi     # 0x64da7
leaq -0x298(%rbp), %rdi
callq 0xd440
jmp 0x2ec0c
movq -0x690(%rbp), %rdi
movl -0x14(%rbp), %ecx
leaq -0x270(%rbp), %rsi
leaq -0x298(%rbp), %rdx
callq 0x55940
jmp 0x2ec2b
leaq -0x298(%rbp), %rdi
callq 0xd1b0
leaq -0x299(%rbp), %rdi
callq 0xd370
leaq -0x270(%rbp), %rdi
callq 0xd1b0
leaq -0x271(%rbp), %rdi
callq 0xd370
leaq -0x2c0(%rbp), %rdi
movq %rdi, -0x6b0(%rbp)
movl $0x10, %esi
movl $0x20, %edx
callq 0x10330
movq -0x6b0(%rbp), %rdi
callq 0x2e1c0
movq -0x20(%rbp), %rax
movq %rax, -0x6a8(%rbp)
leaq -0x2e9(%rbp), %rdi
movq %rdi, -0x6a0(%rbp)
callq 0xd5b0
movq -0x6a0(%rbp), %rdx
leaq 0x360fe(%rip), %rsi     # 0x64dae
leaq -0x2e8(%rbp), %rdi
callq 0xd440
jmp 0x2ecbe
movq -0x6a8(%rbp), %rdi
leaq -0x2e8(%rbp), %rsi
callq 0x26cc0
movq %rax, -0x6b8(%rbp)
jmp 0x2ecda
movq -0x6b8(%rbp), %rax
movq %rax, -0x2c8(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0xd1b0
leaq -0x2e9(%rbp), %rdi
callq 0xd370
xorl %eax, %eax
testb $0x1, -0x33(%rbp)
movb %al, -0x6b9(%rbp)
jne 0x2ed37
movq -0x20(%rbp), %rdi
callq 0x2e110
movq %rax, -0x2f8(%rbp)
leaq -0x2c8(%rbp), %rdi
leaq -0x2f8(%rbp), %rsi
callq 0x2e0e0
movb %al, -0x6b9(%rbp)
movb -0x6b9(%rbp), %al
testb $0x1, %al
jne 0x2ed46
jmp 0x2f411
leaq -0x2c8(%rbp), %rdi
callq 0x26cf0
cmpl $0x2, 0x20(%rax)
jne 0x2f09f
movl $0x10, %edi
callq 0xd150
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x6c8(%rbp)
leaq 0x36036(%rip), %rsi     # 0x64db0
callq 0xd5f0
jmp 0x2ed81
movq -0x6c8(%rbp), %rdi
movq 0x54249(%rip), %rsi     # 0x82fd8
movq 0x5422a(%rip), %rdx     # 0x82fc0
callq 0xd570
jmp 0x2fa20
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2ede9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2edd4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x90(%rbp), %rdi
callq 0xd1b0
leaq -0x91(%rbp), %rdi
callq 0xd370
leaq -0x68(%rbp), %rdi
callq 0xd1b0
leaq -0x69(%rbp), %rdi
callq 0xd370
jmp 0x2fa17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2ee43
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2ee2b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0xe0(%rbp), %rdi
callq 0xd1b0
leaq -0xe1(%rbp), %rdi
callq 0xd370
leaq -0xb8(%rbp), %rdi
callq 0xd1b0
leaq -0xb9(%rbp), %rdi
callq 0xd370
jmp 0x2fa17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2eec6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2eeae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2ee96
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x158(%rbp), %rdi
callq 0xd1b0
leaq -0x159(%rbp), %rdi
callq 0xd370
leaq -0x130(%rbp), %rdi
callq 0xd1b0
leaq -0x131(%rbp), %rdi
callq 0xd370
leaq -0x108(%rbp), %rdi
callq 0xd1b0
leaq -0x109(%rbp), %rdi
callq 0xd370
jmp 0x2fa17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2ef49
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2ef31
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2ef19
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1d0(%rbp), %rdi
callq 0xd1b0
leaq -0x1d1(%rbp), %rdi
callq 0xd370
leaq -0x1a8(%rbp), %rdi
callq 0xd1b0
leaq -0x1a9(%rbp), %rdi
callq 0xd370
leaq -0x180(%rbp), %rdi
callq 0xd1b0
leaq -0x181(%rbp), %rdi
callq 0xd370
jmp 0x2fa17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2efcc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2efb4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2ef9c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x248(%rbp), %rdi
callq 0xd1b0
leaq -0x249(%rbp), %rdi
callq 0xd370
leaq -0x220(%rbp), %rdi
callq 0xd1b0
leaq -0x221(%rbp), %rdi
callq 0xd370
leaq -0x1f8(%rbp), %rdi
callq 0xd1b0
leaq -0x1f9(%rbp), %rdi
callq 0xd370
jmp 0x2fa17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2f029
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2f011
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x298(%rbp), %rdi
callq 0xd1b0
leaq -0x299(%rbp), %rdi
callq 0xd370
leaq -0x270(%rbp), %rdi
callq 0xd1b0
leaq -0x271(%rbp), %rdi
callq 0xd370
jmp 0x2fa17
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2f060
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x2e8(%rbp), %rdi
callq 0xd1b0
leaq -0x2e9(%rbp), %rdi
callq 0xd370
jmp 0x2fa0b
movq -0x6c8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0xd210
jmp 0x2fa0b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2fa0b
leaq -0x2c8(%rbp), %rdi
callq 0x26cf0
cmpl $0x1, 0x20(%rax)
jne 0x2f0d7
leaq -0x2c8(%rbp), %rdi
callq 0x26cf0
movq %rax, %rdi
addq $0x20, %rdi
leaq -0x2c0(%rbp), %rsi
callq 0x2a2e0
jmp 0x2f0d2
jmp 0x2f318
leaq -0x2c8(%rbp), %rdi
callq 0x26cf0
cmpl $0x0, 0x20(%rax)
jne 0x2f0eb
jmp 0x2f10a
leaq 0x35cea(%rip), %rdi     # 0x64ddc
leaq 0x33398(%rip), %rsi     # 0x62491
movl $0x1f2, %edx            # imm = 0x1F2
leaq 0x35cf4(%rip), %rcx     # 0x64df9
callq 0xd1c0
movq $0x200, -0x300(%rbp) # imm = 0x200
leaq -0x2c8(%rbp), %rdi
callq 0x26cf0
movq %rax, %rdi
addq $0x20, %rdi
addq $0x18, %rdi
callq 0x102f0
movl %eax, %eax
andq $0x1ff, %rax            # imm = 0x1FF
cmpq $0x0, %rax
je 0x2f293
leaq -0x488(%rbp), %rdi
callq 0xd200
jmp 0x2f151
leaq -0x478(%rbp), %rdi
leaq 0x35da8(%rip), %rsi     # 0x64f07
callq 0xd320
jmp 0x2f166
leaq -0x478(%rbp), %rdi
leaq -0x1eeb4(%rip), %rsi    # 0x102c0
callq 0xd0f0
movq %rax, -0x6d0(%rbp)
jmp 0x2f182
movq -0x6d0(%rbp), %rdi
leaq 0x2edde(%rip), %rsi     # 0x5df6e
callq 0xd320
movq %rax, -0x6d8(%rbp)
jmp 0x2f19e
movq -0x6d8(%rbp), %rdi
movl $0x200, %esi            # imm = 0x200
callq 0xd0a0
movq %rax, -0x6e0(%rbp)
jmp 0x2f1b8
movq -0x6e0(%rbp), %rdi
leaq 0x3951d(%rip), %rsi     # 0x686e3
callq 0xd320
jmp 0x2f1cd
movb $0x1, -0x4a9(%rbp)
movl $0x10, %edi
callq 0xd150
movq %rax, -0x6e8(%rbp)
leaq -0x4a8(%rbp), %rdi
leaq -0x488(%rbp), %rsi
callq 0xd310
jmp 0x2f1fa
movq -0x6e8(%rbp), %rdi
leaq -0x4a8(%rbp), %rsi
callq 0xd590
jmp 0x2f20f
movq -0x6e8(%rbp), %rdi
movb $0x0, -0x4a9(%rbp)
movq 0x53db4(%rip), %rsi     # 0x82fd8
movq 0x53d95(%rip), %rdx     # 0x82fc0
callq 0xd570
jmp 0x2fa20
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2f282
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2f269
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x4a8(%rbp), %rdi
callq 0xd1b0
testb $0x1, -0x4a9(%rbp)
jne 0x2f274
jmp 0x2f280
movq -0x6e8(%rbp), %rdi
callq 0xd210
jmp 0x2f282
leaq -0x488(%rbp), %rdi
callq 0xd230
jmp 0x2fa0b
leaq -0x2c8(%rbp), %rdi
callq 0x26cf0
movq %rax, %rdi
addq $0x20, %rdi
addq $0x18, %rdi
callq 0x102f0
movl %eax, %eax
cmpq $0x200, %rax            # imm = 0x200
jbe 0x2f314
leaq -0x2c8(%rbp), %rdi
callq 0x26cf0
movq %rax, %rdi
addq $0x38, %rdi
callq 0x102f0
movl %eax, %esi
shrl $0x5, %esi
leaq -0x4d0(%rbp), %rdi
movl $0x20, %edx
callq 0x10330
jmp 0x2f2e9
leaq -0x2c0(%rbp), %rdi
leaq -0x4d0(%rbp), %rsi
callq 0x26b30
leaq -0x4d0(%rbp), %rdi
callq 0x10850
leaq -0x2c0(%rbp), %rdi
callq 0x2e1c0
jmp 0x2f316
jmp 0x2f318
jmp 0x2f31a
movq -0x10(%rbp), %rax
movq %rax, -0x6f8(%rbp)
leaq -0x511(%rbp), %rdi
movq %rdi, -0x6f0(%rbp)
callq 0xd5b0
movq -0x6f0(%rbp), %rdx
leaq 0x35a68(%rip), %rsi     # 0x64dae
leaq -0x510(%rbp), %rdi
callq 0xd440
jmp 0x2f354
leaq -0x2c8(%rbp), %rdi
callq 0x26cf0
movq -0x6f8(%rbp), %rsi
movq %rax, %rcx
addq $0x20, %rcx
subq $0x10, %rsp
movq %rsp, %rax
movl $0x1, (%rax)
leaq -0x4f0(%rbp), %rdi
leaq -0x510(%rbp), %rdx
leaq -0x2c0(%rbp), %r8
movl $0x1, %r9d
callq 0x2afe0
addq $0x10, %rsp
jmp 0x2f3a1
leaq -0x2c0(%rbp), %rdi
leaq -0x4f0(%rbp), %rsi
callq 0x26b30
leaq -0x4f0(%rbp), %rdi
callq 0x10850
leaq -0x510(%rbp), %rdi
callq 0xd1b0
leaq -0x511(%rbp), %rdi
callq 0xd370
jmp 0x2f411
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2f400
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x510(%rbp), %rdi
callq 0xd1b0
leaq -0x511(%rbp), %rdi
callq 0xd370
jmp 0x2fa0b
leaq -0x2c0(%rbp), %rdi
callq 0x102f0
shrl $0x5, %eax
movq %rax, -0x520(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x708(%rbp)
leaq -0x541(%rbp), %rdi
movq %rdi, -0x700(%rbp)
callq 0xd5b0
movq -0x700(%rbp), %rdx
leaq 0x335bc(%rip), %rsi     # 0x62a0f
leaq -0x540(%rbp), %rdi
callq 0xd440
jmp 0x2f461
leaq -0x569(%rbp), %rdi
movq %rdi, -0x710(%rbp)
callq 0xd5b0
movq -0x710(%rbp), %rdx
leaq 0x35abc(%rip), %rsi     # 0x64f3e
leaq -0x568(%rbp), %rdi
callq 0xd440
jmp 0x2f490
movq -0x708(%rbp), %rdi
movq -0x520(%rbp), %rax
shrq $0x4, %rax
movl %eax, %ecx
leaq -0x540(%rbp), %rsi
leaq -0x568(%rbp), %rdx
callq 0x55940
jmp 0x2f4b9
leaq -0x568(%rbp), %rdi
callq 0xd1b0
leaq -0x569(%rbp), %rdi
callq 0xd370
leaq -0x540(%rbp), %rdi
callq 0xd1b0
leaq -0x541(%rbp), %rdi
callq 0xd370
movq -0x520(%rbp), %rax
movq %rax, -0x720(%rbp)
movq %rsp, %rcx
movq %rcx, -0x578(%rbp)
leaq 0xf(,%rax,8), %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x718(%rbp)
movq %rcx, %rsp
movq %rax, -0x580(%rbp)
cmpq $0x0, %rax
je 0x2f583
movq -0x718(%rbp), %rax
movq -0x720(%rbp), %rdx
shlq $0x3, %rdx
movq %rax, %rcx
addq %rdx, %rcx
movq %rcx, -0x730(%rbp)
movq %rax, -0x728(%rbp)
movq -0x728(%rbp), %rdi
movq %rdi, -0x738(%rbp)
callq 0x40b00
jmp 0x2f565
movq -0x730(%rbp), %rcx
movq -0x738(%rbp), %rax
addq $0x8, %rax
cmpq %rcx, %rax
movq %rax, -0x728(%rbp)
jne 0x2f550
leaq -0x5b0(%rbp), %rax
movq %rax, -0x750(%rbp)
movq %rax, %rcx
addq $0x28, %rcx
movq %rcx, -0x748(%rbp)
movq %rax, -0x740(%rbp)
movq -0x740(%rbp), %rdi
movq %rdi, -0x758(%rbp)
callq 0x40b00
jmp 0x2f5bb
movq -0x748(%rbp), %rcx
movq -0x758(%rbp), %rax
addq $0x8, %rax
cmpq %rcx, %rax
movq %rax, -0x740(%rbp)
jne 0x2f5a6
movq -0x10(%rbp), %rax
movq %rax, -0x768(%rbp)
leaq -0x2c0(%rbp), %rdi
movq %rdi, -0x770(%rbp)
callq 0x10310
movq -0x770(%rbp), %rdi
movq %rax, -0x760(%rbp)
callq 0x102f0
movq -0x768(%rbp), %rdi
movq -0x760(%rbp), %rsi
movl %eax, %eax
movl %eax, %edx
callq 0x40b50
jmp 0x2f623
movq -0x718(%rbp), %rdi
movq -0x520(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq -0x2c0(%rbp), %rcx
callq 0x40bc0
jmp 0x2f643
movq -0x10(%rbp), %rsi
leaq -0x5c0(%rbp), %rdi
callq 0x40d70
jmp 0x2f655
movq -0x718(%rbp), %rsi
movq -0x520(%rbp), %rdx
movl -0x14(%rbp), %r9d
leaq -0x512(%rbp), %rdi
leaq -0x5b0(%rbp), %rcx
leaq -0x5c0(%rbp), %r8
callq 0x40db0
jmp 0x2f683
movb $0x1, -0x5c1(%rbp)
movq -0x20(%rbp), %rdi
callq 0x272a0
cmpq $0x0, %rax
jbe 0x2f80b
movq -0x10(%rbp), %rdi
callq 0x298a0
jmp 0x2f6a8
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x2a7d0
jmp 0x2f6b7
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl 0x30(%rbp), %ecx
movzbl -0x31(%rbp), %edx
andl $0x1, %edx
callq 0x41c70
movb %al, -0x771(%rbp)
jmp 0x2f6d6
movb -0x771(%rbp), %al
andb $0x1, %al
movb %al, -0x5c1(%rbp)
jmp 0x2f80b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2f735
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2f71d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x568(%rbp), %rdi
callq 0xd1b0
leaq -0x569(%rbp), %rdi
callq 0xd370
leaq -0x540(%rbp), %rdi
callq 0xd1b0
leaq -0x541(%rbp), %rdi
callq 0xd370
jmp 0x2fa0b
movq -0x718(%rbp), %rcx
movq %rax, %rsi
movq -0x738(%rbp), %rax
movq %rsi, -0x40(%rbp)
movl %edx, -0x44(%rbp)
cmpq %rax, %rcx
movq %rax, -0x780(%rbp)
je 0x2f79b
movq -0x780(%rbp), %rdi
addq $-0x8, %rdi
movq %rdi, -0x788(%rbp)
callq 0x40b20
movq -0x718(%rbp), %rcx
movq -0x788(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x780(%rbp)
jne 0x2f76a
jmp 0x2fa0b
movq -0x750(%rbp), %rcx
movq %rax, %rsi
movq -0x758(%rbp), %rax
movq %rsi, -0x40(%rbp)
movl %edx, -0x44(%rbp)
cmpq %rax, %rcx
movq %rax, -0x790(%rbp)
je 0x2f7f5
movq -0x790(%rbp), %rdi
addq $-0x8, %rdi
movq %rdi, -0x798(%rbp)
callq 0x40b20
movq -0x750(%rbp), %rcx
movq -0x798(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x790(%rbp)
jne 0x2f7c4
jmp 0x2f9b4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x2f968
testb $0x1, -0x5c1(%rbp)
je 0x2f82e
testb $0x1, -0x32(%rbp)
je 0x2f82e
movq -0x10(%rbp), %rdi
movzbl -0x31(%rbp), %esi
andl $0x1, %esi
callq 0x33ec0
jmp 0x2f82c
jmp 0x2f82e
testb $0x1, -0x5c1(%rbp)
je 0x2f84b
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl 0x10(%rbp), %edx
callq 0x29f90
jmp 0x2f849
jmp 0x2f8ac
movl $0x10, %edi
callq 0xd150
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x7a0(%rbp)
leaq 0x356e4(%rip), %rsi     # 0x64f4d
callq 0xd5f0
jmp 0x2f870
movq -0x7a0(%rbp), %rdi
movq 0x5375a(%rip), %rsi     # 0x82fd8
movq 0x5373b(%rip), %rdx     # 0x82fc0
callq 0xd570
jmp 0x2fa20
movq -0x7a0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
callq 0xd210
jmp 0x2f968
leaq -0x5b0(%rbp), %rax
movq %rax, -0x7b0(%rbp)
addq $0x28, %rax
movq %rax, -0x7a8(%rbp)
movq -0x7a8(%rbp), %rdi
addq $-0x8, %rdi
movq %rdi, -0x7b8(%rbp)
callq 0x40b20
movq -0x7b0(%rbp), %rcx
movq -0x7b8(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x7a8(%rbp)
jne 0x2f8c5
movq -0x718(%rbp), %rcx
movq -0x720(%rbp), %rdx
shlq $0x3, %rdx
movq %rcx, %rax
addq %rdx, %rax
cmpq %rax, %rcx
movq %rax, -0x7c0(%rbp)
je 0x2f94b
movq -0x7c0(%rbp), %rdi
addq $-0x8, %rdi
movq %rdi, -0x7c8(%rbp)
callq 0x40b20
movq -0x718(%rbp), %rcx
movq -0x7c8(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x7c0(%rbp)
jne 0x2f91a
movq -0x578(%rbp), %rax
movq %rax, %rsp
leaq -0x2c0(%rbp), %rdi
callq 0x10850
leaq -0x8(%rbp), %rsp
popq %rbx
popq %rbp
retq
leaq -0x5b0(%rbp), %rax
movq %rax, -0x7d8(%rbp)
addq $0x28, %rax
movq %rax, -0x7d0(%rbp)
movq -0x7d0(%rbp), %rdi
addq $-0x8, %rdi
movq %rdi, -0x7e0(%rbp)
callq 0x40b20
movq -0x7d8(%rbp), %rcx
movq -0x7e0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x7d0(%rbp)
jne 0x2f981
jmp 0x2f9b4
movq -0x718(%rbp), %rcx
movq -0x720(%rbp), %rdx
shlq $0x3, %rdx
movq %rcx, %rax
addq %rdx, %rax
cmpq %rax, %rcx
movq %rax, -0x7e8(%rbp)
je 0x2fa09
movq -0x7e8(%rbp), %rdi
addq $-0x8, %rdi
movq %rdi, -0x7f0(%rbp)
callq 0x40b20
movq -0x718(%rbp), %rcx
movq -0x7f0(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x7e8(%rbp)
jne 0x2f9d8
jmp 0x2fa0b
leaq -0x2c0(%rbp), %rdi
callq 0x10850
movq -0x40(%rbp), %rdi
callq 0xd5a0