// File: /workspace/github_cpp_makefile_star2_O3/vsklad[P]cgen/commands.cpp
// Function: void load_impl<bal::Cnf, bal::DimacsStreamReader>(bal::Cnf&, char const*)
void load_impl(Formula& formula, const char* const file_name) {
    std::cout << "Input file: " << file_name << std::endl;
    
    if (std::strlen(file_name) == 0) {
        throw std::invalid_argument(ERROR_MISSING_INPUT_FILE_NAME);
    };
    
    std::ifstream file(file_name);
    if (file.is_open()) {
        try {
            Reader reader(file);
            reader.read(formula);
            file.close();
        }
        catch (TextReaderException e) {
            std::cout << "Parse error: " << e << std::endl;
            throw std::invalid_argument("Failed to load the input file");
        }
    }
    else {
        throw std::invalid_argument("Failed to open the input file");
    };
    print_statistics(formula);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x270, %rsp            # imm = 0x270
movq %rsi, %r14
movq %rdi, %rbx
movq 0x364a1(%rip), %r15     # 0x5bfb0
leaq 0x24dcd(%rip), %rsi     # 0x4a8e3
movl $0xc, %edx
movq %r15, %rdi
callq 0xb320
testq %r14, %r14
je 0x25b44
movq %r14, %rdi
callq 0xb110
movq 0x36479(%rip), %rdi     # 0x5bfb0
movq %r14, %rsi
movq %rax, %rdx
callq 0xb320
jmp 0x25b5c
movq (%r15), %rax
movq -0x18(%rax), %rax
leaq (%r15,%rax), %rdi
movl 0x20(%r15,%rax), %esi
orl $0x1, %esi
callq 0xb4a0
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0xa, %esi
callq 0xb2a0
movsbl %al, %esi
movq %r15, %rdi
callq 0xb030
movq %rax, %rdi
callq 0xb1a0
cmpb $0x0, (%r14)
je 0x25c67
leaq -0x288(%rbp), %r15
movq %r15, %rdi
movq %r14, %rsi
movl $0x8, %edx
callq 0xb500
leaq -0x210(%rbp), %rdi
callq 0xb080
testb %al, %al
je 0x25c99
leaq -0x40(%rbp), %r12
movq $-0x1, -0x20(%r12)
xorl %eax, %eax
movq %rax, -0x18(%r12)
movq %r12, -0x10(%r12)
movq %rax, -0x8(%r12)
movb $0x0, (%r12)
movq %rax, 0x10(%r12)
movl $0x0, 0x18(%r12)
movq %r15, -0x30(%r12)
leaq 0x35f0b(%rip), %rax     # 0x5bb00
movq %rax, -0x38(%r12)
leaq 0x35f3f(%rip), %rax     # 0x5bb40
movq %rax, -0x28(%r12)
leaq 0x35eb3(%rip), %rax     # 0x5bac0
movq %rax, -0x40(%r12)
leaq -0x80(%rbp), %rdi
movq %rbx, %rsi
callq 0x395de
leaq -0x288(%rbp), %rdi
callq 0xb070
leaq 0x35e57(%rip), %rax     # 0x5ba88
movq %rax, -0x68(%rbp)
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x25c43
callq 0xb280
movq %rbx, %rdi
callq 0x1e11e
leaq -0x288(%rbp), %rdi
callq 0xb090
addq $0x270, %rsp            # imm = 0x270
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0xb130
movq %rax, %r14
leaq 0x1ff03(%rip), %rsi     # 0x45b7e
movq %rax, %rdi
callq 0xb520
movq 0x3634e(%rip), %rsi     # 0x5bfd8
movq 0x3632f(%rip), %rdx     # 0x5bfc0
movq %r14, %rdi
callq 0xb4b0
movl $0x10, %edi
callq 0xb130
movq %rax, %r14
leaq 0x24c6f(%rip), %rsi     # 0x4a91c
movq %rax, %rdi
callq 0xb520
movq 0x3631c(%rip), %rsi     # 0x5bfd8
movq 0x362fd(%rip), %rdx     # 0x5bfc0
movq %r14, %rdi
callq 0xb4b0
jmp 0x25d9f
movq %rax, %rbx
movq %r14, %rdi
callq 0xb1e0
jmp 0x25dbd
movq %rax, %rbx
movq %r14, %rdi
callq 0xb1e0
jmp 0x25dc9
movq %rax, %rbx
jmp 0x25dbd
movq %rdx, %r14
movq %rax, %rbx
leaq 0x35d83(%rip), %rax     # 0x5ba88
movq %rax, -0x68(%rbp)
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x25d17
callq 0xb280
cmpl $0x1, %r14d
jne 0x25dbd
movq %rbx, %rdi
callq 0xb370
leaq -0x80(%rbp), %rdi
movq %rax, %rsi
callq 0x38926
movq %rbx, %rdi
callq 0xb100
movq 0x3626c(%rip), %rdi     # 0x5bfb0
leaq 0x24ba5(%rip), %rsi     # 0x4a8f0
movl $0xd, %edx
callq 0xb320
movq 0x36254(%rip), %rdi     # 0x5bfb0
leaq -0x80(%rbp), %rsi
callq 0x38999
movq %rax, %rdi
callq 0xb120
movl $0x10, %edi
callq 0xb130
movq %rax, %r14
leaq 0x24b7d(%rip), %rsi     # 0x4a8fe
movq %rax, %rdi
callq 0xb520
movq 0x36248(%rip), %rsi     # 0x5bfd8
movq 0x36229(%rip), %rdx     # 0x5bfc0
movq %r14, %rdi
callq 0xb4b0
movq %rax, %rbx
movq %r14, %rdi
callq 0xb1e0
jmp 0x25daf
movq %rax, %rbx
leaq -0x80(%rbp), %rdi
callq 0x1d9de
callq 0xb460
leaq -0x288(%rbp), %rdi
callq 0xb090
movq %rbx, %rdi
callq 0xb4e0
movq %rax, %rdi
callq 0x1d8eb