// File: /workspace/github_cpp_makefile_star2_O1/halfflat[P]tinyopt/ex/ex3-parse.cc
// Function: main
int main(int, char** argv) {
    try {
        std::vector<std::string> remaining;
        auto print_apple = [] { std::cout << "apple!\n"; };
        bool help = false;
        bool stop = false;

        char** arg = argv+1;
        while (*arg && !help && !stop) {
            bool match =
                help        << to::parse(arg, "-h", "--help") ||
                print_apple << to::parse(arg, "-a", "--apple") ||
                stop        << to::parse(arg, "--");

            if (!match) remaining.push_back(*arg++);
        }

        if (help) {
            to::usage(argv[0], usage_str);
            return 0;
        }

        // Grab any remaining unprocessed arguments, too.
        while (*arg) remaining.push_back(*arg++);

        std::cout << "remaining arguments:";
        for (auto& a: remaining) std::cout << ' ' << a;
        std::cout << "\n";
    }
    catch (to::option_error& e) {
        to::usage_error(argv[0], usage_str, e.what());
        return 1;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x108, %rsp            # imm = 0x108
movq %rsi, %r13
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
movq $0x0, 0x60(%rsp)
leaq 0x8(%rsi), %rax
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x8(%rsi)
je 0x157a
movq %r13, 0x48(%rsp)
movl $0x0, 0x1c(%rsp)
leaq 0xb8(%rsp), %r15
leaq 0x28(%rsp), %r12
leaq 0x90(%rsp), %r14
leaq 0xe0(%rsp), %rbp
movl $0x0, 0x20(%rsp)
movq %r15, %rdi
leaq 0x1dd0(%rip), %rsi      # 0x30e1
callq 0x19b0
movq %r12, %rbx
movq %r12, %rdi
leaq 0x10(%rsp), %rsi
movq %r15, %r13
movq %r15, %rdx
leaq 0x1db6(%rip), %rcx      # 0x30e4
callq 0x18bc
movb 0x28(%rsp), %r12b
movl 0x1c(%rsp), %ecx
movzbl %cl, %ecx
movb $0x1, 0xe(%rsp)
testb %r12b, %r12b
movl $0x1, %eax
cmovnel %eax, %ecx
movl %ecx, 0x1c(%rsp)
je 0x135c
xorl %eax, %eax
jmp 0x13f2
movq %r14, %r15
movq %r14, %rdi
leaq 0x1d82(%rip), %rsi      # 0x30eb
callq 0x19b0
leaq 0xd(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq %r15, %rdx
leaq 0x1d6c(%rip), %rcx      # 0x30ee
callq 0x18bc
movb 0xd(%rsp), %r15b
cmpb $0x1, %r15b
jne 0x13af
movl $0x7, %edx
movq 0x3c32(%rip), %rdi      # 0x4fd0
leaq 0x1db5(%rip), %rsi      # 0x315a
callq 0x1100
testb %r15b, %r15b
jne 0x1355
movq %rbp, %r15
movq %rbp, %rdi
leaq 0x1d3a(%rip), %rsi      # 0x30f6
callq 0x19b0
leaq 0xf(%rsp), %rdi
leaq 0x10(%rsp), %rsi
movq %r15, %rdx
callq 0x1a34
movb 0xf(%rsp), %al
movl 0x20(%rsp), %ecx
movzbl %cl, %ecx
movb %al, 0xe(%rsp)
testb %al, %al
movl $0x1, %eax
cmovnel %eax, %ecx
movl %ecx, 0x20(%rsp)
movb $0x1, %al
testb %al, %al
je 0x141b
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x141b
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x10e0
testb %r12b, %r12b
jne 0x1445
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x1445
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x10e0
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x146a
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x10e0
cmpb $0x0, 0xe(%rsp)
movq %r13, %r15
movq %rbx, %r12
jne 0x14be
movq 0x10(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq (%rax), %rsi
movq %r12, %rdi
leaq 0x70(%rsp), %rdx
callq 0x1ad2
leaq 0x50(%rsp), %rdi
movq %r12, %rsi
callq 0x1dec
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x14be
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x10e0
movq 0x10(%rsp), %rax
cmpq $0x0, (%rax)
je 0x14db
testb $0x1, 0x1c(%rsp)
jne 0x14db
testb $0x1, 0x20(%rsp)
je 0x1307
testb $0x1, 0x1c(%rsp)
movq 0x48(%rsp), %r13
je 0x157a
movq (%r13), %rbx
movq 0x3bca(%rip), %rsi      # 0x50c0
leaq 0x28(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x1ad2
leaq 0x80(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1be1(%rip), %rsi      # 0x30f9
leaq 0x1be1(%rip), %rdx      # 0x3100
leaq 0x70(%rsp), %rdi
callq 0x1d5c
leaq 0x28(%rsp), %rsi
leaq 0x70(%rsp), %rdx
movq %rbx, %rdi
callq 0x1b0f
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x1555
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x10e0
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1655
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x10e0
jmp 0x1655
movq 0x10(%rsp), %rax
cmpq $0x0, (%rax)
je 0x15dd
leaq 0x38(%rsp), %r12
leaq 0x28(%rsp), %rbx
leaq 0x70(%rsp), %r14
leaq 0x50(%rsp), %r15
leaq 0x8(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq (%rax), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x1ad2
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1dec
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x15d2
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x10e0
movq 0x10(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x1599
movq 0x39ec(%rip), %rdi      # 0x4fd0
leaq 0x1b16(%rip), %rsi      # 0x3101
movl $0x14, %edx
callq 0x1100
movq 0x50(%rsp), %r15
movq 0x58(%rsp), %r12
cmpq %r12, %r15
je 0x163d
movq 0x39c5(%rip), %rbx      # 0x4fd0
leaq 0xd(%rsp), %r14
movb $0x20, 0xd(%rsp)
movl $0x1, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1100
movq (%r15), %rsi
movq 0x8(%r15), %rdx
movq %rax, %rdi
callq 0x1100
addq $0x20, %r15
cmpq %r12, %r15
jne 0x1610
movq 0x398c(%rip), %rdi      # 0x4fd0
leaq 0x1b15(%rip), %rsi      # 0x3160
movl $0x1, %edx
callq 0x1100
leaq 0x50(%rsp), %rdi
callq 0x1bc4
xorl %eax, %eax
addq $0x108, %rsp            # imm = 0x108
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %rbx
movq %rax, %r14
movq 0x70(%rsp), %rdi
cmpq %r15, %rdi
je 0x16a8
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x10e0
jmp 0x16a8
jmp 0x16a2
jmp 0x1715
jmp 0x174f
jmp 0x16e8
jmp 0x1715
movq %rdx, %rbx
movq %rax, %r14
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x1748
movq 0x38(%rsp), %rsi
jmp 0x1740
jmp 0x171d
jmp 0x174f
movq %rdx, %rbx
movq %rax, %r14
movq 0x28(%rsp), %rdi
cmpq %r12, %rdi
je 0x1755
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x10e0
jmp 0x1755
movq %rdx, %rbx
movq %rax, %r14
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x1723
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x10e0
jmp 0x1723
movq %rdx, %rbx
movq %rax, %r14
jmp 0x1748
movq %rdx, %rbx
movq %rax, %r14
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x1748
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x10e0
movq 0x48(%rsp), %r13
jmp 0x1755
movq %rdx, %rbx
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x1bc4
cmpl $0x1, %ebx
jne 0x18ac
movq %r14, %rdi
callq 0x1060
movq %rax, %r14
movq (%r13), %rbx
movq 0x3942(%rip), %rsi      # 0x50c0
leaq 0x28(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x1ad2
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
leaq 0x70(%rsp), %rdi
leaq 0x27(%rsp), %rdx
movq %rax, %rsi
callq 0x1ad2
leaq 0x60(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x1941(%rip), %rsi      # 0x30f9
leaq 0x1941(%rip), %rdx      # 0x3100
leaq 0x50(%rsp), %rdi
callq 0x1d5c
leaq 0x28(%rsp), %rsi
leaq 0x70(%rsp), %rdx
leaq 0x50(%rsp), %rcx
movq %rbx, %rdi
callq 0x1c1f
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0x17f7
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x10e0
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1818
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x10e0
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1833
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x10e0
callq 0x1120
movl $0x1, %eax
jmp 0x1661
movq %rax, %r14
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0x1861
movq 0x60(%rsp), %rsi
incq %rsi
callq 0x10e0
jmp 0x1861
movq %rax, %r14
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1887
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x10e0
jmp 0x1887
movq %rax, %r14
leaq 0x38(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x18a7
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x10e0
jmp 0x18a7
movq %rax, %r14
callq 0x1120
movq %r14, %rdi
callq 0x1140
movq %rax, %rdi
callq 0x1d51