// File: /workspace/github_cpp_makefile_star2_O3/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
movq %rsi, %r13
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movq $0x0, 0x50(%rsp)
leaq 0x8(%rsi), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, 0x8(%rsi)
je 0x158c
movq %r13, 0x38(%rsp)
xorl %r14d, %r14d
leaq 0xa8(%rsp), %r15
leaq 0x18(%rsp), %r13
leaq 0x8(%rsp), %rbp
leaq 0x80(%rsp), %rbx
leaq 0xd0(%rsp), %r12
movq %r15, %rdi
leaq 0xdd8(%rip), %rsi       # 0x20e1
callq 0x192c
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
leaq 0xdc6(%rip), %rcx       # 0x20e4
callq 0x1839
cmpb $0x1, 0x18(%rsp)
jne 0x1337
movb $0x1, %r14b
xorl %r12d, %r12d
movb $0x1, %bl
jmp 0x13f4
movq %rbx, %rdi
leaq 0xdaa(%rip), %rsi       # 0x20eb
callq 0x192c
leaq 0x6(%rsp), %rdi
movq %rbp, %rsi
movq %rbx, %rdx
leaq 0xd96(%rip), %rcx       # 0x20ee
callq 0x1839
cmpb $0x1, 0x6(%rsp)
jne 0x1383
movl $0x7, %edx
movq 0x2c60(%rip), %rdi      # 0x3fd0
leaq 0xde3(%rip), %rsi       # 0x215a
callq 0x1100
movb $0x1, %bl
xorl %r12d, %r12d
jmp 0x13cf
movq %r12, %rdi
leaq 0xd69(%rip), %rsi       # 0x20f6
callq 0x192c
leaq 0x7(%rsp), %rdi
movq %rbp, %rsi
movq %r12, %rdx
callq 0x19b0
movb 0x7(%rsp), %r12b
movq 0xd0(%rsp), %rdi
leaq 0xe0(%rsp), %rax
cmpq %rax, %rdi
je 0x13cc
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0x10e0
movl %r12d, %ebx
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x13f4
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x10e0
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x1419
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x10e0
testb %bl, %bl
jne 0x1464
movq 0x8(%rsp), %rax
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rsi
movq %r13, %rdi
leaq 0x60(%rsp), %rdx
callq 0x1a4e
leaq 0x40(%rsp), %rdi
movq %r13, %rsi
callq 0x1d72
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x1464
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x10e0
movq 0x8(%rsp), %rax
movq (%rax), %rcx
testq %rcx, %rcx
sete %dl
orb %r14b, %r12b
orb %dl, %r12b
testb $0x1, %r12b
leaq 0x80(%rsp), %rbx
leaq 0xd0(%rsp), %r12
je 0x12ff
testb $0x1, %r14b
je 0x152a
movq 0x38(%rsp), %rax
movq (%rax), %rbx
movq 0x2c15(%rip), %rsi      # 0x40c0
leaq 0x18(%rsp), %rdi
leaq 0x6(%rsp), %rdx
callq 0x1a4e
leaq 0x70(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xc2e(%rip), %rsi       # 0x20f9
leaq 0xc2e(%rip), %rdx       # 0x2100
leaq 0x60(%rsp), %rdi
callq 0x1cdc
leaq 0x18(%rsp), %rsi
leaq 0x60(%rsp), %rdx
movq %rbx, %rdi
callq 0x1a8b
movq 0x60(%rsp), %rdi
cmpq %r12, %rdi
je 0x1505
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x10e0
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x1604
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x10e0
jmp 0x1604
testq %rcx, %rcx
movq 0x38(%rsp), %r13
je 0x158c
leaq 0x18(%rsp), %rbx
leaq 0x60(%rsp), %r14
leaq 0x40(%rsp), %r15
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq (%rax), %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x1a4e
movq %r15, %rdi
movq %rbx, %rsi
callq 0x1d72
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x1581
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x10e0
movq 0x8(%rsp), %rax
cmpq $0x0, (%rax)
jne 0x1543
movq 0x2a3d(%rip), %rdi      # 0x3fd0
leaq 0xb67(%rip), %rsi       # 0x2101
movl $0x14, %edx
callq 0x1100
movq 0x40(%rsp), %r15
movq 0x48(%rsp), %r12
cmpq %r12, %r15
je 0x15ec
movq 0x2a16(%rip), %rbx      # 0x3fd0
leaq 0x6(%rsp), %r14
movb $0x20, 0x6(%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 0x15bf
movq 0x29dd(%rip), %rdi      # 0x3fd0
leaq 0xb66(%rip), %rsi       # 0x2160
movl $0x1, %edx
callq 0x1100
leaq 0x40(%rsp), %rdi
callq 0x1b40
xorl %eax, %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r15
movq %rax, %r14
movq 0x60(%rsp), %rdi
cmpq %r12, %rdi
je 0x165a
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x10e0
jmp 0x165a
jmp 0x1654
jmp 0x169d
jmp 0x16d7
jmp 0x1670
jmp 0x169d
jmp 0x1654
jmp 0x169d
jmp 0x16a5
movq %rdx, %r15
movq %rax, %r14
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x16d0
movq 0x28(%rsp), %rsi
jmp 0x16c8
movq %rdx, %r15
movq %rax, %r14
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x16ab
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x10e0
jmp 0x16ab
movq %rdx, %r15
movq %rax, %r14
jmp 0x16d0
movq %rdx, %r15
movq %rax, %r14
movq 0xa8(%rsp), %rdi
leaq 0xb8(%rsp), %rax
cmpq %rax, %rdi
je 0x16d0
movq 0xb8(%rsp), %rsi
incq %rsi
callq 0x10e0
movq 0x38(%rsp), %r13
jmp 0x16dd
movq %rdx, %r15
movq %rax, %r14
leaq 0x40(%rsp), %rdi
callq 0x1b40
cmpl $0x1, %r15d
jne 0x1829
movq %r14, %rdi
callq 0x1060
movq %rax, %r14
movq (%r13), %rbx
movq 0x29b9(%rip), %rsi      # 0x40c0
leaq 0x18(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x1a4e
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
leaq 0x60(%rsp), %rdi
leaq 0x17(%rsp), %rdx
movq %rax, %rsi
callq 0x1a4e
leaq 0x50(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x9b8(%rip), %rsi       # 0x20f9
leaq 0x9b8(%rip), %rdx       # 0x2100
leaq 0x40(%rsp), %rdi
callq 0x1cdc
leaq 0x18(%rsp), %rsi
leaq 0x60(%rsp), %rdx
leaq 0x40(%rsp), %rcx
movq %rbx, %rdi
callq 0x1b9e
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x1780
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x10e0
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x179b
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x10e0
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x17b6
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x10e0
callq 0x1120
movl $0x1, %eax
jmp 0x1610
movq %rax, %r14
movq 0x40(%rsp), %rdi
cmpq %r15, %rdi
je 0x17e4
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x10e0
jmp 0x17e4
movq %rax, %r14
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1804
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x10e0
jmp 0x1804
movq %rax, %r14
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x1824
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x10e0
jmp 0x1824
movq %rax, %r14
callq 0x1120
movq %r14, %rdi
callq 0x1140
movq %rax, %rdi
callq 0x1cd0