// File: vsklad[P]cgen/main.cpp
// Function: generate_output_file_name(CGenCommandInfo&)
void generate_output_file_name(CGenCommandInfo& info) {
    if ((info.command == cmdEncode || info.command == cmdProcess) && info.output_file_name.empty()) {
        std::string output_file_name;
        if (info.command == cmdEncode) {
            switch(info.algorithm) {
                case algSHA1:
                    output_file_name = "sha1";
                    break;
                case algSHA256:
                    output_file_name = "sha256";
                    break;
                default:
                    assert(false);
            };
        
            output_file_name += "r" + std::to_string(info.rounds);
        
            generate_output_file_name_var(info, "M", output_file_name);
            generate_output_file_name_var(info, "H", output_file_name);

            if (info.mode == bal::fpmUnoptimized) {
                output_file_name += "_u";
            };
        } else if (info.command == cmdProcess) {
            // generate only if there is a conversion
            if (info.formula_type == ftCnf && (info.output_format == ofCnfVIGGraphML ||
                                               info.output_format == ofCnfWeightedVIGGraphML ||
                                               info.output_format == ofCnfVIGGEXF)) {
                output_file_name = info.input_file_name;
            };
        };
        if (!output_file_name.empty()) {
            switch(info.output_format) {
                case ofAnfPolybori:
                    output_file_name += ".anf";
                    break;
                case ofCnfDimacs:
                    output_file_name += ".cnf";
                    break;
                case ofCnfVIGGraphML:
                    output_file_name += ".graphml";
                    break;
                case ofCnfWeightedVIGGraphML:
                    output_file_name += "_w.graphml";
                    break;
                case ofCnfVIGGEXF:
                    output_file_name += ".gexf";
                    break;
                default:
                    assert(false);
            };
            info.output_file_name = output_file_name;
        };
    };
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x1, (%rax)
je 0x57975
movq -0x8(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x57d36
movq -0x8(%rbp), %rdi
addq $0x78, %rdi
callq 0xd540
testb $0x1, %al
jne 0x5798b
jmp 0x57d36
leaq -0x28(%rbp), %rdi
callq 0xd450
movq -0x8(%rbp), %rax
cmpl $0x1, (%rax)
jne 0x57c02
movq -0x8(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0xc8(%rbp)
subl $0x1, %eax
je 0x579c2
jmp 0x579b5
movl -0xc8(%rbp), %eax
subl $0x2, %eax
je 0x579e7
jmp 0x579fb
leaq 0x9e2d(%rip), %rsi      # 0x617f6
leaq -0x28(%rbp), %rdi
callq 0xd430
jmp 0x579d4
jmp 0x57a1a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x57d2b
leaq 0x9e12(%rip), %rsi      # 0x61800
leaq -0x28(%rbp), %rdi
callq 0xd430
jmp 0x579f9
jmp 0x57a1a
leaq 0xc465(%rip), %rdi      # 0x63e67
leaq 0x109b6(%rip), %rsi     # 0x683bf
movl $0x37, %edx
leaq 0x109b3(%rip), %rcx     # 0x683c8
callq 0xd1c0
movq -0x8(%rbp), %rax
movl 0x48(%rax), %esi
leaq -0x78(%rbp), %rdi
callq 0x260b0
jmp 0x57a2c
leaq 0xa96b(%rip), %rsi      # 0x6239e
leaq -0x58(%rbp), %rdi
leaq -0x78(%rbp), %rdx
callq 0x2e060
jmp 0x57a42
leaq -0x28(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0xd3f0
jmp 0x57a51
leaq -0x58(%rbp), %rdi
callq 0xd1b0
leaq -0x78(%rbp), %rdi
callq 0xd1b0
movq -0x8(%rbp), %rax
movq %rax, -0xd8(%rbp)
leaq -0x99(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0xd5b0
movq -0xd0(%rbp), %rdx
leaq 0xd31f(%rip), %rsi      # 0x64dae
leaq -0x98(%rbp), %rdi
callq 0xd440
jmp 0x57a9d
movq -0xd8(%rbp), %rdi
leaq -0x98(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0x576d0
jmp 0x57ab6
leaq -0x98(%rbp), %rdi
callq 0xd1b0
leaq -0x99(%rbp), %rdi
callq 0xd370
movq -0x8(%rbp), %rax
movq %rax, -0xe8(%rbp)
leaq -0xc1(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0xd5b0
movq -0xe0(%rbp), %rdx
leaq 0xde2f(%rip), %rsi      # 0x65929
leaq -0xc0(%rbp), %rdi
callq 0xd440
jmp 0x57b08
movq -0xe8(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
leaq -0x28(%rbp), %rdx
callq 0x576d0
jmp 0x57b21
leaq -0xc0(%rbp), %rdi
callq 0xd1b0
leaq -0xc1(%rbp), %rdi
callq 0xd370
movq -0x8(%rbp), %rax
cmpl $0x0, 0xa0(%rax)
jne 0x57c00
leaq 0x108a9(%rip), %rsi     # 0x683fa
leaq -0x28(%rbp), %rdi
callq 0xd300
jmp 0x57b5c
jmp 0x57c00
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x57b84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x58(%rbp), %rdi
callq 0xd1b0
leaq -0x78(%rbp), %rdi
callq 0xd1b0
jmp 0x57d2b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x57bb8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0x98(%rbp), %rdi
callq 0xd1b0
leaq -0x99(%rbp), %rdi
callq 0xd370
jmp 0x57d2b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
jmp 0x57bef
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x30(%rbp)
movl %eax, -0x34(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0xd1b0
leaq -0xc1(%rbp), %rdi
callq 0xd370
jmp 0x57d2b
jmp 0x57c4c
movq -0x8(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x57c4a
movq -0x8(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x57c48
movq -0x8(%rbp), %rax
cmpl $0x2, 0xc(%rax)
je 0x57c33
movq -0x8(%rbp), %rax
cmpl $0x3, 0xc(%rax)
je 0x57c33
movq -0x8(%rbp), %rax
cmpl $0x4, 0xc(%rax)
jne 0x57c48
movq -0x8(%rbp), %rsi
addq $0x58, %rsi
leaq -0x28(%rbp), %rdi
callq 0xd050
jmp 0x57c46
jmp 0x57c48
jmp 0x57c4a
jmp 0x57c4c
leaq -0x28(%rbp), %rdi
callq 0xd540
testb $0x1, %al
jne 0x57d20
movq -0x8(%rbp), %rax
movl 0xc(%rax), %eax
movq %rax, -0xf0(%rbp)
subq $0x4, %rax
ja 0x57cec
movq -0xf0(%rbp), %rax
leaq 0x102f9(%rip), %rcx     # 0x67f78
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1076e(%rip), %rsi     # 0x683fd
leaq -0x28(%rbp), %rdi
callq 0xd300
jmp 0x57c9a
jmp 0x57d0b
leaq 0x1075f(%rip), %rsi     # 0x68402
leaq -0x28(%rbp), %rdi
callq 0xd300
jmp 0x57cae
jmp 0x57d0b
leaq 0x10752(%rip), %rsi     # 0x68409
leaq -0x28(%rbp), %rdi
callq 0xd300
jmp 0x57cc2
jmp 0x57d0b
leaq 0x1073c(%rip), %rsi     # 0x68407
leaq -0x28(%rbp), %rdi
callq 0xd300
jmp 0x57cd6
jmp 0x57d0b
leaq 0xad2a(%rip), %rsi      # 0x62a09
leaq -0x28(%rbp), %rdi
callq 0xd300
jmp 0x57cea
jmp 0x57d0b
leaq 0xc174(%rip), %rdi      # 0x63e67
leaq 0x106c5(%rip), %rsi     # 0x683bf
movl $0x5c, %edx
leaq 0x106c2(%rip), %rcx     # 0x683c8
callq 0xd1c0
movq -0x8(%rbp), %rdi
addq $0x78, %rdi
leaq -0x28(%rbp), %rsi
callq 0xd050
jmp 0x57d1e
jmp 0x57d20
leaq -0x28(%rbp), %rdi
callq 0xd1b0
jmp 0x57d36
leaq -0x28(%rbp), %rdi
callq 0xd1b0
jmp 0x57d3f
addq $0xf0, %rsp
popq %rbp
retq
movq -0x30(%rbp), %rdi
callq 0xd5a0
nopl (%rax,%rax)