// File: /workspace/github_cpp_makefile_star2_O1/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 0x3a60
movq 0x2596(%rip), %rdi      # 0x5fe8
leaq 0x66c(%rip), %rsi       # 0x40c5
movl $0x1c, %edx
jmp 0x3a78
cmpl $0x2, %edi
jne 0x3a91
movq 0x257c(%rip), %rdi      # 0x5fe8
leaq 0x66f(%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
jl 0x3b62
movq 0x18(%rbx), %rsi
leaq 0x10(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x3c36
leaq 0x647(%rip), %rsi       # 0x4100
leaq 0x10(%rsp), %rdi
callq 0x2070
movb $0x1, %r15b
testl %eax, %eax
je 0x3b2f
leaq 0x636(%rip), %rsi       # 0x4107
leaq 0x10(%rsp), %rdi
callq 0x2070
testl %eax, %eax
je 0x3b39
movq 0x2502(%rip), %rdi      # 0x5fe8
leaq 0x620(%rip), %rsi       # 0x410d
movl $0x1a, %edx
callq 0x2200
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq 0x24e0(%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 0x3b3e
xorl %r14d, %r14d
movl $0x1, %ebp
jmp 0x3b3e
xorl %ebp, %ebp
xorl %r14d, %r14d
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3b59
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21b0
testb %r15b, %r15b
je 0x3a83
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 0x330a
movq 0x10(%rbx), %rdi
leaq 0x10(%rsp), %rsi
movl %ebp, %edx
callq 0x39ba
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x3bc5
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x21b0
movq 0x28(%rsp), %rdi
cmpq %r14, %rdi
je 0x3bdc
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x21b0
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x3bf3
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x21b0
xorl %r14d, %r14d
jmp 0x3a83
movq %rax, %rbx
jmp 0x3c2d
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x3c2d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x21b0
jmp 0x3c2d
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3cee
movq %rbx, %rdi
callq 0x2320
nop