// File: 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
subq $0x120, %rsp            # imm = 0x120
movl %r9d, %eax
movl %ecx, -0x114(%rbp)
movq %rdx, %rcx
movl -0x114(%rbp), %edx
movq %rcx, -0x110(%rbp)
movq %rsi, %rcx
movq -0x110(%rbp), %rsi
movq %rcx, -0x108(%rbp)
movq %rdi, %r9
movq -0x108(%rbp), %rdi
movb %al, %cl
movl 0x18(%rbp), %eax
movb 0x10(%rbp), %al
movq %r9, -0x8(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
andb $0x1, %cl
movb %cl, -0x21(%rbp)
andb $0x1, %al
movb %al, -0x22(%rbp)
leaq -0xe8(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0x2e5b0
movq -0x100(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x33960
jmp 0x2d09a
movq -0x8(%rbp), %rsi
leaq -0xe8(%rbp), %rdi
callq 0x2a7d0
jmp 0x2d0ac
movb $0x1, -0xf5(%rbp)
movq -0x8(%rbp), %rsi
movl 0x18(%rbp), %ecx
movzbl -0x21(%rbp), %edx
andl $0x1, %edx
leaq -0xe8(%rbp), %rdi
callq 0x33c70
movb %al, -0x115(%rbp)
jmp 0x2d0d5
movb -0x115(%rbp), %al
andb $0x1, %al
movb %al, -0xf5(%rbp)
testb $0x1, -0xf5(%rbp)
je 0x2d134
testb $0x1, -0x22(%rbp)
je 0x2d134
movzbl -0x21(%rbp), %esi
andl $0x1, %esi
leaq -0xe8(%rbp), %rdi
callq 0x33ec0
movb %al, -0x116(%rbp)
jmp 0x2d10d
movb -0x116(%rbp), %al
andb $0x1, %al
movb %al, -0xf5(%rbp)
jmp 0x2d134
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf0(%rbp)
movl %eax, -0xf4(%rbp)
jmp 0x2d1db
testb $0x1, -0xf5(%rbp)
je 0x2d165
movq -0x18(%rbp), %rdi
callq 0xd140
cmpq $0x0, %rax
je 0x2d163
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
leaq -0xe8(%rbp), %rdi
callq 0x29f90
jmp 0x2d161
jmp 0x2d163
jmp 0x2d1c6
movl $0x10, %edi
callq 0xd150
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x120(%rbp)
leaq 0x359b2(%rip), %rsi     # 0x62b35
callq 0xd5f0
jmp 0x2d18a
movq -0x120(%rbp), %rdi
movq 0x55e40(%rip), %rsi     # 0x82fd8
movq 0x55e21(%rip), %rdx     # 0x82fc0
callq 0xd570
jmp 0x2d1f3
movq -0x120(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xf0(%rbp)
movl %eax, -0xf4(%rbp)
callq 0xd210
jmp 0x2d1db
leaq -0xe8(%rbp), %rdi
callq 0x30e30
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
leaq -0xe8(%rbp), %rdi
callq 0x30e30
movq -0xf0(%rbp), %rdi
callq 0xd5a0
nopw %cs:(%rax,%rax)