// File: /workspace/github_cpp_makefile_star2_O3/dacunni[P]stlloader/stlcopy.cpp
// Function: main
int main(int argc, char ** argv)
{
    if(argc < 2) {
        std::cerr << "Please supply an input file\n";
        return EXIT_FAILURE;
    }
    if(argc < 3) {
        std::cerr << "Please supply an output file\n";
        return EXIT_FAILURE;
    }

    stlloader::Format format = stlloader::Format::ascii;
    if(argc > 3) {
        std::string format_arg(argv[3]);
        if(format_arg == "binary") format = stlloader::Format::binary;
        else if(format_arg == "ascii") format = stlloader::Format::ascii;
        else {
            std::cerr << "Unexpected output format: " << format_arg << '\n';
            return EXIT_FAILURE;
        }
    }

    stlloader::Mesh mesh;
    stlloader::parse_file(argv[1], mesh);
    stlloader::write_file(argv[2], mesh, format);

    return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x68, %rsp
cmpl $0x1, %edi
jg 0x3a3a
movq 0x25bc(%rip), %rdi      # 0x5fe8
leaq 0x692(%rip), %rsi       # 0x40c5
movl $0x1c, %edx
jmp 0x3a52
cmpl $0x2, %edi
jne 0x3a6b
movq 0x25a2(%rip), %rdi      # 0x5fe8
leaq 0x695(%rip), %rsi       # 0x40e2
movl $0x1d, %edx
callq 0x2200
movl $0x1, %r14d
movl %r14d, %eax
addq $0x68, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %rbx
xorl %ebp, %ebp
cmpl $0x4, %edi
jb 0x3b3c
movq 0x18(%rbx), %rsi
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x3c10
leaq 0x66d(%rip), %rsi       # 0x4100
leaq 0x10(%rsp), %rdi
callq 0x2070
movb $0x1, %r15b
testl %eax, %eax
je 0x3b09
leaq 0x65c(%rip), %rsi       # 0x4107
leaq 0x10(%rsp), %rdi
callq 0x2070
testl %eax, %eax
je 0x3b13
movq 0x2528(%rip), %rdi      # 0x5fe8
leaq 0x646(%rip), %rsi       # 0x410d
movl $0x1a, %edx
callq 0x2200
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x2506(%rip), %rdi      # 0x5fe8
callq 0x2200
leaq 0xf(%rsp), %rsi
movb $0xa, (%rsi)
movl $0x1, %edx
movq %rax, %rdi
callq 0x2200
movl $0x1, %r14d
xorl %ebp, %ebp
xorl %r15d, %r15d
jmp 0x3b18
xorl %r14d, %r14d
movl $0x1, %ebp
jmp 0x3b18
xorl %ebp, %ebp
xorl %r14d, %r14d
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3b33
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21b0
testb %r15b, %r15b
je 0x3a5d
xorps %xmm0, %xmm0
leaq 0x38(%rsp), %r14
movaps %xmm0, -0x28(%r14)
xorl %eax, %eax
movq %rax, -0x18(%r14)
movq %r14, -0x10(%r14)
movq %rax, -0x8(%r14)
movb %al, (%r14)
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rax, -0x8(%r15)
movb %al, (%r15)
movq 0x8(%rbx), %rdi
leaq 0x10(%rsp), %rsi
callq 0x32ef
movq 0x10(%rbx), %rdi
leaq 0x10(%rsp), %rsi
movl %ebp, %edx
callq 0x3994
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x3b9f
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21b0
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x3bb6
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21b0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3bcd
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
xorl %r14d, %r14d
jmp 0x3a5d
movq %rax, %rbx
jmp 0x3c07
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3c07
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21b0
jmp 0x3c07
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3cc8
movq %rbx, %rdi
callq 0x2320
nop