// File: /workspace/github_cpp_makefile_star2_O2/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 $0xf8, %rsp
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rax
andq $0x0, 0x10(%rax)
movaps %xmm0, (%rax)
movq %rsi, 0x38(%rsp)
leaq 0x8(%rsi), %rax
leaq 0x10(%rsp), %r15
movq %rax, (%r15)
xorl %ebp, %ebp
leaq 0xa8(%rsp), %r13
leaq 0x18(%rsp), %rbx
leaq 0x80(%rsp), %r14
xorl %r12d, %r12d
movq (%rax), %rcx
testq %rcx, %rcx
je 0x243d
testb $0x1, %r12b
jne 0x243d
testb $0x1, %bpl
jne 0x243d
movq %r13, %rdi
leaq 0xdaf(%rip), %rsi       # 0x30e1
callq 0x2750
movq %rbx, %rdi
movq %r15, %rsi
movq %r13, %rdx
leaq 0xd9d(%rip), %rcx       # 0x30e4
callq 0x26b7
leaq 0xd0(%rsp), %rbp
cmpb $0x1, 0x18(%rsp)
jne 0x2368
movb $0x1, %r12b
xorl %ebp, %ebp
movb $0x1, %r14b
jmp 0x23eb
movq %r14, %rdi
leaq 0xd79(%rip), %rsi       # 0x30eb
callq 0x2750
leaq 0xd(%rsp), %rdi
movq %r15, %rsi
movq %r14, %rdx
leaq 0xd65(%rip), %rcx       # 0x30ee
callq 0x26b7
cmpb $0x1, 0xd(%rsp)
jne 0x23af
movq 0x2c34(%rip), %rdi      # 0x4fd0
leaq 0xdb7(%rip), %rsi       # 0x315a
callq 0x20f0
movb $0x1, %r14b
xorl %ebp, %ebp
jmp 0x23de
movq %rbp, %rdi
leaq 0xd3d(%rip), %rsi       # 0x30f6
callq 0x2750
leaq 0xc(%rsp), %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x279e
movq %rbp, %rdi
movb 0xc(%rsp), %bpl
callq 0x2080
movl %ebp, %r14d
leaq 0x80(%rsp), %rdi
callq 0x2080
movq %r13, %rdi
callq 0x2080
testb %r14b, %r14b
leaq 0x80(%rsp), %r14
jne 0x2433
movq 0x10(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq (%rax), %rsi
movq %rbx, %rdi
leaq 0x60(%rsp), %rdx
callq 0x2806
leaq 0x40(%rsp), %rdi
movq %rbx, %rsi
callq 0x2a44
movq %rbx, %rdi
callq 0x2080
movq 0x10(%rsp), %rax
jmp 0x2308
testb $0x1, %r12b
je 0x24a2
movq 0x38(%rsp), %rax
movq (%rax), %rbx
movq 0x2c86(%rip), %rsi      # 0x50d8
leaq 0x18(%rsp), %rdi
leaq 0xd(%rsp), %rdx
callq 0x2806
leaq 0xc91(%rip), %rsi       # 0x30f9
leaq 0x60(%rsp), %rdi
leaq 0xc(%rsp), %rdx
callq 0x2806
leaq 0x18(%rsp), %rsi
leaq 0x60(%rsp), %rdx
movq %rbx, %rdi
callq 0x2841
leaq 0x60(%rsp), %rdi
callq 0x2080
leaq 0x18(%rsp), %rdi
callq 0x2080
jmp 0x2544
leaq 0x18(%rsp), %rbx
leaq 0x60(%rsp), %r14
leaq 0x40(%rsp), %r15
testq %rcx, %rcx
je 0x24ea
leaq 0x8(%rax), %rcx
movq %rcx, 0x10(%rsp)
movq (%rax), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x2806
movq %r15, %rdi
movq %rbx, %rsi
callq 0x2a44
movq %rbx, %rdi
callq 0x2080
movq 0x10(%rsp), %rax
movq (%rax), %rcx
jmp 0x24b1
movq 0x2adf(%rip), %rdi      # 0x4fd0
leaq 0xc09(%rip), %rsi       # 0x3101
callq 0x20f0
movq 0x40(%rsp), %rbx
movq 0x48(%rsp), %r15
movq 0x2ac2(%rip), %r14      # 0x4fd0
pushq $0x20
popq %rbp
cmpq %r15, %rbx
je 0x2531
movq %r14, %rdi
movl %ebp, %esi
callq 0x2130
movq %rax, %rdi
movq %rbx, %rsi
callq 0x20e0
addq $0x20, %rbx
jmp 0x2511
movq 0x2a98(%rip), %rdi      # 0x4fd0
leaq 0xc21(%rip), %rsi       # 0x3160
callq 0x20f0
leaq 0x40(%rsp), %rdi
callq 0x28b4
xorl %eax, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %rbx
movq %rax, %r14
leaq 0x60(%rsp), %rdi
callq 0x2080
jmp 0x258a
jmp 0x2584
jmp 0x25bd
jmp 0x25bd
jmp 0x2591
jmp 0x25bd
jmp 0x2584
jmp 0x25bd
jmp 0x25a8
movq %rdx, %rbx
movq %rax, %r14
leaq 0x18(%rsp), %rdi
jmp 0x25b6
movq %rdx, %rbx
movq %rax, %r14
leaq 0x80(%rsp), %rdi
callq 0x2080
jmp 0x25ae
jmp 0x25bd
movq %rdx, %rbx
movq %rax, %r14
leaq 0xa8(%rsp), %rdi
callq 0x2080
jmp 0x25c3
movq %rdx, %rbx
movq %rax, %r14
leaq 0x40(%rsp), %rdi
callq 0x28b4
cmpl $0x1, %ebx
jne 0x26a7
movq %r14, %rdi
callq 0x2060
movq %rax, %r14
movq 0x38(%rsp), %rax
movq (%rax), %rbx
movq 0x2ae8(%rip), %rsi      # 0x50d8
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x2806
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
leaq 0x60(%rsp), %rdi
leaq 0xf(%rsp), %rdx
movq %rax, %rsi
callq 0x2806
leaq 0xad8(%rip), %rsi       # 0x30f9
leaq 0x40(%rsp), %rdi
leaq 0xe(%rsp), %rdx
callq 0x2806
leaq 0x18(%rsp), %rsi
leaq 0x60(%rsp), %rdx
leaq 0x40(%rsp), %rcx
movq %rbx, %rdi
callq 0x28d5
leaq 0x40(%rsp), %rdi
callq 0x2080
leaq 0x60(%rsp), %rdi
callq 0x2080
leaq 0x18(%rsp), %rdi
callq 0x2080
callq 0x2160
pushq $0x1
popq %rax
jmp 0x2550
movq %rax, %r14
leaq 0x40(%rsp), %rdi
callq 0x2080
jmp 0x2684
movq %rax, %r14
leaq 0x60(%rsp), %rdi
callq 0x2080
jmp 0x2693
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x2080
jmp 0x26a2
movq %rax, %r14
callq 0x2160
movq %r14, %rdi
callq 0x2170
movq %rax, %rdi
callq 0x297f