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

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movl %r9d, %eax
movl %ecx, -0x134(%rbp)
movq %rdx, %rcx
movl -0x134(%rbp), %edx
movq %rcx, -0x130(%rbp)
movq %rsi, %rcx
movq -0x130(%rbp), %rsi
movq %rcx, -0x128(%rbp)
movq %rdi, %r9
movq -0x128(%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 -0x100(%rbp), %rdi
movq %rdi, -0x120(%rbp)
callq 0x310a0
movq -0x120(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x33f80
jmp 0x2d28a
movq -0x8(%rbp), %rsi
leaq -0x100(%rbp), %rdi
callq 0x2a7d0
jmp 0x2d29c
movb $0x1, -0x10d(%rbp)
movl -0x20(%rbp), %edi
movq -0x18(%rbp), %rsi
callq 0x2c640
jmp 0x2d2b1
movq -0x8(%rbp), %rsi
movl 0x18(%rbp), %ecx
movzbl -0x21(%rbp), %edx
andl $0x1, %edx
leaq -0x100(%rbp), %rdi
callq 0x34290
movb %al, -0x135(%rbp)
jmp 0x2d2d3
movb -0x135(%rbp), %al
andb $0x1, %al
movb %al, -0x10d(%rbp)
xorl %eax, %eax
movl %eax, %esi
leaq -0x118(%rbp), %rdi
callq 0x30e90
jmp 0x2d2f3
leaq -0x118(%rbp), %rdi
callq 0x15b80
jmp 0x2d301
leaq -0x118(%rbp), %rdi
callq 0x161e0
testb $0x1, -0x10d(%rbp)
je 0x2d381
testb $0x1, -0x22(%rbp)
je 0x2d381
movzbl -0x21(%rbp), %esi
andl $0x1, %esi
leaq -0x100(%rbp), %rdi
callq 0x344e0
movb %al, -0x136(%rbp)
jmp 0x2d337
movb -0x136(%rbp), %al
andb $0x1, %al
movb %al, -0x10d(%rbp)
jmp 0x2d381
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
jmp 0x2d428
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
leaq -0x118(%rbp), %rdi
callq 0x161e0
jmp 0x2d428
testb $0x1, -0x10d(%rbp)
je 0x2d3b2
movq -0x18(%rbp), %rdi
callq 0xd140
cmpq $0x0, %rax
je 0x2d3b0
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
leaq -0x100(%rbp), %rdi
callq 0x29eb0
jmp 0x2d3ae
jmp 0x2d3b0
jmp 0x2d413
movl $0x10, %edi
callq 0xd150
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0x140(%rbp)
leaq 0x35765(%rip), %rsi     # 0x62b35
callq 0xd5f0
jmp 0x2d3d7
movq -0x140(%rbp), %rdi
movq 0x55bf3(%rip), %rsi     # 0x82fd8
movq 0x55bd4(%rip), %rdx     # 0x82fc0
callq 0xd570
jmp 0x2d440
movq -0x140(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x108(%rbp)
movl %eax, -0x10c(%rbp)
callq 0xd210
jmp 0x2d428
leaq -0x100(%rbp), %rdi
callq 0x33930
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
leaq -0x100(%rbp), %rdi
callq 0x33930
movq -0x108(%rbp), %rdi
callq 0xd5a0