// File: /workspace/github_cpp_makefile_star2_O3/vsklad[P]cgen/commands.cpp
// Function: process_anf(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>>>&, char const*, char const*, CGenOutputFormat, CGenTraceFormat, bool, bool, bal::FormulaProcessingMode)
void process_anf(CGenVariablesMap& variables_map,
             const char* const input_file_name, 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 bal::FormulaProcessingMode mode) {
    bal::Anf anf;
    load_impl<bal::Anf, bal::PolyBoRiStreamReader>(anf, input_file_name);
    variables_define(anf, variables_map);
    
    bool is_valid = true;
    
    is_valid = process_impl(anf, variables_map, b_reindex_variables, mode);
    
    if (is_valid && b_normalize_variables) {
        is_valid = normalize_variables(anf, b_reindex_variables);
    };
    
    if (is_valid) {
        if (std::strlen(output_file_name) != 0) {
            save(anf, output_file_name, output_format);
        };
    } else {
        throw std::invalid_argument("Processing failed");
    };
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movl %r9d, %r15d
movl %ecx, -0x2c(%rbp)
movq %rdx, -0x38(%rbp)
movq %rsi, %r13
movq %rdi, %r12
leaq -0xf8(%rbp), %rbx
movq %rbx, %rdi
callq 0x2622c
leaq 0x385cc(%rip), %r14     # 0x58dc0
addq $0x10, %r14
movq %r14, (%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x78(%rbx)
movups %xmm0, 0x88(%rbx)
movups %xmm0, 0x98(%rbx)
movups %xmm0, 0xa8(%rbx)
movq $0x0, 0xb8(%rbx)
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2555b
leaq -0xf8(%rbp), %rdi
movq %r12, %rsi
callq 0x1ecb2
movl 0x18(%rbp), %ecx
movzbl %r15b, %edx
leaq -0xf8(%rbp), %rdi
movq %r12, %rsi
callq 0x25844
movq -0x38(%rbp), %r13
movb 0x10(%rbp), %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x2089e
testb %r15b, %r15b
je 0x20929
leaq -0xb0(%rbp), %rbx
movq 0x10(%rbx), %r15
cmpq %rbx, %r15
je 0x208a6
leaq -0xf8(%rbp), %r12
leaq 0x40(%r15), %rsi
movq %r12, %rdi
callq 0xe1b4
movq %r15, %rdi
callq 0xb1b0
movq %rax, %r15
cmpq %rbx, %rax
jne 0x20880
jmp 0x208a6
testb %al, %al
je 0x20948
cmpb $0x0, (%r13)
je 0x208bf
leaq -0xf8(%rbp), %rdi
movq %r13, %rsi
movl -0x2c(%rbp), %edx
callq 0x1e78f
movq %r14, -0xf8(%rbp)
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x208d4
callq 0xb280
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x208e2
callq 0xb280
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x208f0
callq 0xb280
leaq 0x3b2d9(%rip), %rax     # 0x5bbd0
addq $0x10, %rax
leaq -0xb8(%rbp), %rdi
movq %rax, -0x40(%rdi)
callq 0x262a2
leaq -0xe8(%rbp), %rdi
callq 0x26354
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x26d21(%rip), %rdi     # 0x47651
leaq 0x26d2e(%rip), %rsi     # 0x47665
leaq 0x26d39(%rip), %rcx     # 0x47677
movl $0x81, %edx
callq 0xb180
movl $0x10, %edi
callq 0xb130
movq %rax, %r14
leaq 0x261ed(%rip), %rsi     # 0x46b49
movq %rax, %rdi
callq 0xb520
movq 0x3b66d(%rip), %rsi     # 0x5bfd8
movq 0x3b64e(%rip), %rdx     # 0x5bfc0
movq %r14, %rdi
callq 0xb4b0
movq %rax, %rbx
movq %r14, %rdi
callq 0xb1e0
jmp 0x2098e
jmp 0x2098b
jmp 0x2098b
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x237ec
movq %rbx, %rdi
callq 0xb4e0