// File: vsklad[P]cgen/commands.cpp
// Function: trace_setup(CGenTraceFormat, char const*)
void trace_setup(const CGenTraceFormat trace_format, const char* const output_file_name) {
    switch(trace_format) {
        case tfNone:
            bal::set_cnf_tracer(nullptr);
            break;
        case tfNativeStdOut:
            std::cout << "Trace output: std::cout" << std::endl;
            bal::set_cnf_tracer(new bal::CnfNativeTracer(std::cout));
            break;
        case tfNativeFile: {
            const std::string trace_file_name = std::string(output_file_name) + ".trace";
            std::cout << "Trace file: " << trace_file_name << std::endl;
            bal::set_cnf_tracer(new bal::CnfFileTracer<bal::CnfNativeTracer>(trace_file_name.c_str()));
            break;
        };
        case tfCnfVIGGEXF: {
            const std::string trace_file_name = std::string(output_file_name) + ".trace.gexf";
            std::cout << "Trace file: " << trace_file_name << std::endl;
            bal::set_cnf_tracer(new bal::CnfFileTracer<bal::CnfGexfTracer>(trace_file_name.c_str()));
            break;
        };
    };
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x150, %rsp            # imm = 0x150
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl -0x4(%rbp), %eax
movq %rax, -0xd8(%rbp)
subq $0x3, %rax
ja 0x2cab4
movq -0xd8(%rbp), %rax
leaq 0x35c14(%rip), %rcx     # 0x62288
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
xorl %eax, %eax
movl %eax, %esi
leaq -0x18(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x30e90
movq -0xe0(%rbp), %rdi
callq 0x15b80
jmp 0x2c69f
leaq -0x18(%rbp), %rdi
callq 0x161e0
jmp 0x2cab4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x161e0
jmp 0x2cabd
movq 0x568d2(%rip), %rdi     # 0x82fa0
movq %rdi, -0xf0(%rbp)
leaq 0x362fb(%rip), %rsi     # 0x629d7
callq 0xd320
movq %rax, %rdi
movq 0x56895(%rip), %rsi     # 0x82f80
callq 0xd360
movl $0x58, %edi
callq 0xd330
movq -0xf0(%rbp), %rsi
movq %rax, %rdi
movq %rdi, %rax
movq %rax, -0xe8(%rbp)
movl $0xff, %edx
callq 0x30ed0
jmp 0x2c71a
movq -0xe8(%rbp), %rsi
leaq -0x30(%rbp), %rdi
movq %rdi, -0xf8(%rbp)
callq 0x30e90
movq -0xf8(%rbp), %rdi
callq 0x15b80
jmp 0x2c73f
leaq -0x30(%rbp), %rdi
callq 0x161e0
jmp 0x2cab4
movq -0xe8(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0xd2d0
jmp 0x2cabd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x161e0
jmp 0x2cabd
movq -0x10(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq -0x71(%rbp), %rdi
movq %rdi, -0x100(%rbp)
callq 0xd5b0
movq -0x108(%rbp), %rsi
movq -0x100(%rbp), %rdx
leaq -0x70(%rbp), %rdi
callq 0xd440
jmp 0x2c7b8
leaq 0x36230(%rip), %rdx     # 0x629ef
leaq -0x50(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0x30f40
jmp 0x2c7ce
leaq -0x70(%rbp), %rdi
callq 0xd1b0
leaq -0x71(%rbp), %rdi
callq 0xd370
movq 0x567b9(%rip), %rdi     # 0x82fa0
leaq 0x36208(%rip), %rsi     # 0x629f6
callq 0xd320
movq %rax, -0x110(%rbp)
jmp 0x2c7fc
movq -0x110(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xd290
movq %rax, -0x118(%rbp)
jmp 0x2c815
movq -0x118(%rbp), %rdi
movq 0x5675d(%rip), %rsi     # 0x82f80
callq 0xd360
jmp 0x2c82a
movl $0x258, %edi            # imm = 0x258
callq 0xd330
movq %rax, -0x120(%rbp)
jmp 0x2c83d
leaq -0x50(%rbp), %rdi
callq 0xd120
movq -0x120(%rbp), %rdi
movq %rax, %rsi
callq 0x30f90
jmp 0x2c857
movq -0x120(%rbp), %rsi
leaq -0x80(%rbp), %rdi
callq 0x30e90
jmp 0x2c869
leaq -0x80(%rbp), %rdi
callq 0x15b80
jmp 0x2c874
leaq -0x80(%rbp), %rdi
callq 0x161e0
leaq -0x50(%rbp), %rdi
callq 0xd1b0
jmp 0x2cab4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x2c8ae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x70(%rbp), %rdi
callq 0xd1b0
leaq -0x71(%rbp), %rdi
callq 0xd370
jmp 0x2cabd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x2c8f9
movq -0x120(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0xd2d0
jmp 0x2c8f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0x80(%rbp), %rdi
callq 0x161e0
leaq -0x50(%rbp), %rdi
callq 0xd1b0
jmp 0x2cabd
movq -0x10(%rbp), %rax
movq %rax, -0x130(%rbp)
leaq -0xc1(%rbp), %rdi
movq %rdi, -0x128(%rbp)
callq 0xd5b0
movq -0x130(%rbp), %rsi
movq -0x128(%rbp), %rdx
leaq -0xc0(%rbp), %rdi
callq 0xd440
jmp 0x2c941
leaq 0x360bb(%rip), %rdx     # 0x62a03
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x30f40
jmp 0x2c95d
leaq -0xc0(%rbp), %rdi
callq 0xd1b0
leaq -0xc1(%rbp), %rdi
callq 0xd370
movq 0x56624(%rip), %rdi     # 0x82fa0
leaq 0x36073(%rip), %rsi     # 0x629f6
callq 0xd320
movq %rax, -0x138(%rbp)
jmp 0x2c991
movq -0x138(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
callq 0xd290
movq %rax, -0x140(%rbp)
jmp 0x2c9ad
movq -0x140(%rbp), %rdi
movq 0x565c5(%rip), %rsi     # 0x82f80
callq 0xd360
jmp 0x2c9c2
movl $0x270, %edi            # imm = 0x270
callq 0xd330
movq %rax, -0x148(%rbp)
jmp 0x2c9d5
leaq -0xa0(%rbp), %rdi
callq 0xd120
movq -0x148(%rbp), %rdi
movq %rax, %rsi
callq 0x31010
jmp 0x2c9f2
movq -0x148(%rbp), %rsi
leaq -0xd0(%rbp), %rdi
callq 0x30e90
jmp 0x2ca07
leaq -0xd0(%rbp), %rdi
callq 0x15b80
jmp 0x2ca15
leaq -0xd0(%rbp), %rdi
callq 0x161e0
leaq -0xa0(%rbp), %rdi
callq 0xd1b0
jmp 0x2cab4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x2ca58
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xc0(%rbp), %rdi
callq 0xd1b0
leaq -0xc1(%rbp), %rdi
callq 0xd370
jmp 0x2cabd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
jmp 0x2caa6
movq -0x148(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
callq 0xd2d0
jmp 0x2caa6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x20(%rbp)
movl %eax, -0x24(%rbp)
leaq -0xd0(%rbp), %rdi
callq 0x161e0
leaq -0xa0(%rbp), %rdi
callq 0xd1b0
jmp 0x2cabd
addq $0x150, %rsp            # imm = 0x150
popq %rbp
retq
movq -0x20(%rbp), %rdi
callq 0xd5a0
nopw %cs:(%rax,%rax)