// File: /workspace/github_cpp_makefile_star2_O1/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 0x27a94
leaq 0x391c2(%rip), %r14     # 0x5b100
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 0x26d59
leaq -0xf8(%rbp), %rdi
movq %r12, %rsi
callq 0x204b6
movl 0x18(%rbp), %ecx
movzbl %r15b, %edx
leaq -0xf8(%rbp), %rdi
movq %r12, %rsi
callq 0x27042
movq -0x38(%rbp), %r13
movb 0x10(%rbp), %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x21fe8
testb %r15b, %r15b
je 0x22073
leaq -0xb0(%rbp), %rbx
movq 0x10(%rbx), %r15
cmpq %rbx, %r15
je 0x21ff0
leaq -0xf8(%rbp), %r12
leaq 0x40(%r15), %rsi
movq %r12, %rdi
callq 0xf2b2
movq %r15, %rdi
callq 0xc1b0
movq %rax, %r15
cmpq %rbx, %rax
jne 0x21fca
jmp 0x21ff0
testb %al, %al
je 0x22092
cmpb $0x0, (%r13)
je 0x22009
leaq -0xf8(%rbp), %rdi
movq %r13, %rsi
movl -0x2c(%rbp), %edx
callq 0x1ff83
movq %r14, -0xf8(%rbp)
movq -0x50(%rbp), %rdi
testq %rdi, %rdi
je 0x2201e
callq 0xc280
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x2202c
callq 0xc280
movq -0x80(%rbp), %rdi
testq %rdi, %rdi
je 0x2203a
callq 0xc280
leaq 0x3cae7(%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 0x275c7(%rip), %rdi     # 0x49641
leaq 0x275d4(%rip), %rsi     # 0x49655
leaq 0x275df(%rip), %rcx     # 0x49667
movl $0x81, %edx
callq 0xc180
movl $0x10, %edi
callq 0xc130
movq %rax, %r14
leaq 0x26a93(%rip), %rsi     # 0x48b39
movq %rax, %rdi
callq 0xc520
movq 0x3cf1b(%rip), %rsi     # 0x5efd0
movq 0x3cefc(%rip), %rdx     # 0x5efb8
movq %r14, %rdi
callq 0xc4b0
movq %rax, %rbx
movq %r14, %rdi
callq 0xc1e0
jmp 0x220d8
jmp 0x220d5
jmp 0x220d5
movq %rax, %rbx
leaq -0xf8(%rbp), %rdi
callq 0x24f36
movq %rbx, %rdi
callq 0xc4e0