// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
movl %r9d, -0x38(%rbp)
movl %r8d, %r13d
movl %ecx, -0x34(%rbp)
movq %rdx, %r15
movq %rsi, %rbx
movq %rdi, %r12
leaq -0x110(%rbp), %r14
movq %r14, %rdi
callq 0x27a94
leaq -0x90(%rbp), %rax
xorl %ecx, %ecx
movq %rcx, (%rax)
movl %ecx, 0x8(%rax)
leaq -0x78(%rbp), %rdx
movq %rdx, -0x8(%rdx)
movl %ecx, (%rdx)
movq %rax, 0x8(%rdx)
movq %rcx, 0x10(%rdx)
movl %ecx, 0x18(%rdx)
leaq -0x50(%rbp), %rdx
movq %rdx, -0x8(%rdx)
movl %ecx, (%rdx)
movaps 0x26139(%rip), %xmm0    # 0x48290
movups %xmm0, 0x8(%rdx)
leaq 0x3aa56(%rip), %rcx     # 0x5cbb8
movq %rcx, -0x80(%rax)
leaq 0x3aac3(%rip), %rax     # 0x5cc30
movq %rax, -0x48(%rdx)
movq %r14, %rdi
movq %rbx, %rsi
callq 0x27304
leaq -0x110(%rbp), %rdi
movq %r12, %rsi
callq 0x204b6
movl %r13d, %edi
movq %r15, %r14
movq %r15, %rsi
callq 0x2167d
movl 0x18(%rbp), %ecx
movzbl -0x38(%rbp), %r15d
leaq -0x110(%rbp), %rdi
movq %r12, %rsi
movl %r15d, %edx
callq 0x275ed
movl %eax, %r12d
leaq -0x30(%rbp), %rdi
movq $0x0, (%rdi)
callq 0x12190
movb 0x10(%rbp), %bl
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x221ef
movl 0x8(%rdi), %eax
cmpl $0x1, %eax
ja 0x221e2
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x221e7
decl %eax
movl %eax, 0x8(%rdi)
movq $0x0, -0x30(%rbp)
andb %r12b, %bl
cmpb $0x1, %bl
jne 0x22209
leaq -0x110(%rbp), %rdi
movl %r15d, %esi
callq 0x27857
movl %eax, %r12d
testb %r12b, %r12b
je 0x222d0
cmpb $0x0, (%r14)
je 0x2222a
leaq -0x110(%rbp), %rdi
movq %r14, %rsi
movl -0x34(%rbp), %edx
callq 0x1feb9
leaq 0x3ab47(%rip), %rax     # 0x5cd78
movq %rax, -0x98(%rbp)
cmpl $0x0, -0x50(%rbp)
je 0x2225c
movq -0x68(%rbp), %rdi
testq %rdi, %rdi
je 0x22254
callq 0xc350
movq $0x0, -0x68(%rbp)
xorl %eax, %eax
movl %eax, -0x60(%rbp)
movl %eax, -0x50(%rbp)
movl $0x0, -0x60(%rbp)
cmpl $0x0, -0x78(%rbp)
je 0x22290
movq -0x90(%rbp), %rdi
testq %rdi, %rdi
je 0x22285
callq 0xc350
movq $0x0, -0x90(%rbp)
xorl %eax, %eax
movl %eax, -0x88(%rbp)
movl %eax, -0x78(%rbp)
leaq -0xd0(%rbp), %rdi
movl $0x0, 0x48(%rdi)
leaq 0x3c883(%rip), %rax     # 0x5eb28
addq $0x10, %rax
movq %rax, -0x40(%rdi)
callq 0x27b0a
leaq -0x100(%rbp), %rdi
callq 0x27bbc
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0xc130
movq %rax, %r14
leaq 0x26855(%rip), %rsi     # 0x48b39
movq %rax, %rdi
callq 0xc520
movq 0x3ccdd(%rip), %rsi     # 0x5efd0
movq 0x3ccbe(%rip), %rdx     # 0x5efb8
movq %r14, %rdi
callq 0xc4b0
movq %rax, %rbx
movq %r14, %rdi
callq 0xc1e0
jmp 0x2232b
movq %rax, %rbx
movq -0x30(%rbp), %rdi
testq %rdi, %rdi
je 0x2232b
leaq -0x30(%rbp), %rsi
callq 0xc8c0
jmp 0x2232b
jmp 0x22328
movq %rax, %rbx
leaq -0x110(%rbp), %rdi
callq 0x26ca2
movq %rbx, %rdi
callq 0xc4e0
nop