// File: /workspace/github_cpp_makefile_star2_O2/vsklad[P]cgen/commands.cpp
// Function: bool process_impl<bal::Cnf, false>(bal::Cnf&, 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>>>&, bool, bal::FormulaProcessingMode)
bool process_impl(FORMULA& formula, CGenVariablesMap& variables_map,
                  const bool b_reindex_variables, const bal::FormulaProcessingMode mode) {
    static_assert(std::is_base_of<bal::Formula, FORMULA>::value, "FORMULA must be a descendant of bal::Formula");
    
    // all variable values will be mapped to a single array
    // conflicts of the constant values if any will be found on the way
    bal::VariablesArray variables(formula.variables_size(), 1);
    
    // a flag to determine the need for the compute route
    if (variables_require_computing(variables_map)) {
        std::cout << "Computing variables" << std::endl;
        variables.assign_sequence();
        variables_merge(variables, formula, variables_map, false, true);
        if (!evaluate(formula, variables)) {
            throw std::invalid_argument(ERROR_COMPUTE_INVALID_ENCODING);
        };
        variables_store_computed(formula, variables, variables_map);
    };
    
    // rebuild the variables with computed values if exist
    // all random values generated and all except options applied
    variables.assign_sequence();
    const bal::variables_size_t changes_count = variables_merge(variables, formula, variables_map,
                                                                true, mode != bal::fpmUnoptimized);
    if (!ONLY_IF_CHANGED || changes_count > 0) {
        if (changes_count > 0) {
            std::cout << "Assigning " << std::dec << changes_count << " variable(s) in the formula" << std::endl;
        };
        return process(formula, variables, b_reindex_variables, mode);
    } else {
        return true;
    };
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %ecx, %ebx
movl %edx, %r15d
movq %rsi, %r12
movq %rdi, %r14
movq (%rdi), %rax
callq *0x58(%rax)
leaq -0x48(%rbp), %rdi
pushq $0x1
popq %rdx
movl %eax, %esi
callq 0xdbc2
movq %r12, %rdi
callq 0x1b1e7
testb %al, %al
je 0x1f178
movq 0x31e91(%rip), %rdi     # 0x50fb0
leaq 0x1cab3(%rip), %rsi     # 0x3bbd9
callq 0xc290
movq %rax, %rdi
callq 0xc120
leaq -0x48(%rbp), %r13
movq %r13, %rdi
xorl %esi, %esi
callq 0xdc16
pushq $0x1
popq %r8
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x1b21a
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0x2b5f2
testb %al, %al
je 0x1f21f
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
movq %r12, %rdx
callq 0x1b439
leaq -0x48(%rbp), %r13
movq %r13, %rdi
xorl %esi, %esi
callq 0xdc16
xorl %r8d, %r8d
testl %ebx, %ebx
setne %r8b
pushq $0x1
popq %rcx
movq %r13, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x1b21a
movl %eax, %r12d
testl %eax, %eax
je 0x1f1f1
movq 0x31e02(%rip), %rdi     # 0x50fb0
leaq 0x1ca5a(%rip), %rsi     # 0x3bc0f
callq 0xc290
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
movl 0x18(%rax,%rcx), %edx
andl $-0x4b, %edx
orl $0x2, %edx
movl %edx, 0x18(%rax,%rcx)
movl %r12d, %esi
movq %rax, %rdi
callq 0xc190
leaq 0x1ca39(%rip), %rsi     # 0x3bc1a
movq %rax, %rdi
callq 0xc290
movq %rax, %rdi
callq 0xc120
movzbl %r15b, %edx
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
movl %ebx, %ecx
callq 0x2b64c
movl %eax, %ebx
leaq -0x48(%rbp), %rdi
callq 0xde58
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0xc130
movq %rax, %r14
leaq 0x1c9bc(%rip), %rsi     # 0x3bbed
movq %rax, %rdi
callq 0xc4e0
movq 0x31d98(%rip), %rsi     # 0x50fd8
movq 0x31d79(%rip), %rdx     # 0x50fc0
movq %r14, %rdi
callq 0xc490
movq %rax, %rbx
movq %r14, %rdi
callq 0xc1d0
jmp 0x1f261
jmp 0x1f25e
movq %rax, %rbx
leaq -0x48(%rbp), %rdi
callq 0xde58
movq %rbx, %rdi
callq 0xc4c0