// File: /workspace/github_cpp_makefile_star2_O2/halfflat[P]tinyopt/ex/ex3-run.cc
// Function: main
int main(int argc, char** argv) {
    try {
        auto print_apple = [] { std::cout << "apple!\n"; };
        auto help = [argv0 = argv[0]] { to::usage(argv0, usage_str); };

        to::option opts[] = {
            { to::action(print_apple), to::flag, "-a", "--apple" },
            { to::action(help), to::flag, to::exit, "-h", "--help" },
            { {}, to::flag, to::stop, "--" }
        };

        if (!to::run(opts, argc, argv+1)) return 0;

        std::cout << "remaining arguments:";
        for (auto a = argv+1; *a; ++a) 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 $0x208, %rsp            # imm = 0x208
movq %rsi, %rbx
movl %edi, 0xc(%rsp)
movq (%rsi), %r14
xorps %xmm0, %xmm0
leaq 0x70(%rsp), %rsi
movaps %xmm0, (%rsi)
leaq 0x353(%rip), %rax       # 0x271c
movq %rax, 0x18(%rsi)
leaq 0x360(%rip), %rax       # 0x2734
movq %rax, 0x10(%rsi)
leaq 0x30(%rsp), %rdx
movl $0x1, (%rdx)
leaq 0x3d33(%rip), %rcx      # 0x611d
leaq 0x3d2f(%rip), %r8       # 0x6120
leaq 0xb0(%rsp), %r12
movq %r12, %rdi
callq 0x2806
leaq 0x120(%rsp), %r13
leaq 0x90(%rsp), %rsi
andq $0x0, 0x8(%rsi)
movq %r14, (%rsi)
leaq 0x33a(%rip), %rax       # 0x275a
movq %rax, 0x18(%rsi)
leaq 0x3b5(%rip), %rax       # 0x27e0
movq %rax, 0x10(%rsi)
leaq 0x10(%rsp), %rdx
movl $0x1, (%rdx)
leaq 0x8(%rsp), %rcx
movl $0x10, (%rcx)
leaq 0x3cdc(%rip), %r8       # 0x6128
leaq 0x3cd8(%rip), %r9       # 0x612b
movq %r13, %rdi
callq 0x2888
leaq 0x190(%rsp), %r13
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %rsi
movaps %xmm0, (%rsi)
leaq 0x897(%rip), %rax       # 0x2d0c
movq %rax, 0x18(%rsi)
leaq 0x890(%rip), %rax       # 0x2d10
movq %rax, 0x10(%rsi)
leaq 0x4(%rsp), %rdx
movl $0x1, (%rdx)
movq %rsp, %rcx
movl $0x20, (%rcx)
leaq 0x3c93(%rip), %r8       # 0x6132
movq %r13, %rdi
callq 0x2916
leaq 0x50(%rsp), %rdi
callq 0x2e2c
leaq 0x90(%rsp), %rdi
callq 0x2e2c
leaq 0x70(%rsp), %rdi
callq 0x2e2c
leaq 0x8(%rbx), %r14
leaq 0x10(%rsp), %r8
xorps %xmm0, %xmm0
movaps %xmm0, (%r8)
andq $0x0, 0x10(%r8)
leaq 0x30(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
leaq 0xc(%rsp), %rdx
movq %r14, %rcx
callq 0x2997
leaq 0x30(%rsp), %rdi
movb (%rdi), %bpl
callq 0x2fb0
leaq 0x10(%rsp), %rdi
callq 0x2bfa
testb %bpl, %bpl
je 0x2564
movq 0x7ab6(%rip), %rdi      # 0x9fd0
leaq 0x3c14(%rip), %rsi      # 0x6135
callq 0x2140
movq 0x7aa3(%rip), %r15      # 0x9fd0
pushq $0x20
popq %rbp
cmpq $0x0, (%r14)
je 0x2551
movq %r15, %rdi
movl %ebp, %esi
callq 0x2190
movq (%r14), %rsi
movq %rax, %rdi
callq 0x2140
addq $0x8, %r14
jmp 0x2530
movq 0x7a78(%rip), %rdi      # 0x9fd0
leaq 0x3c23(%rip), %rsi      # 0x6182
callq 0x2140
movl $0xe0, %ebx
leaq (%rsp,%rbx), %rdi
addq $0xb0, %rdi
callq 0x423c
addq $-0x70, %rbx
cmpq $-0x70, %rbx
jne 0x2569
xorl %eax, %eax
addq $0x208, %rsp            # imm = 0x208
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2605
movq %rdx, %r15
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x2bfa
jmp 0x260b
movq %rdx, %r15
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x2e2c
jmp 0x25c3
movq %rdx, %r15
movq %rax, %r14
leaq 0x90(%rsp), %rdi
callq 0x2e2c
jmp 0x25db
movq %rdx, %r15
movq %rax, %r14
movq %r12, %r13
leaq 0x70(%rsp), %rdi
callq 0x2e2c
cmpq %r13, %r12
je 0x262b
leaq 0xb0(%rsp), %r12
addq $-0x70, %r13
movq %r13, %rdi
callq 0x423c
cmpq %r12, %r13
jne 0x25f2
jmp 0x262b
movq %rdx, %r15
movq %rax, %r14
movl $0xe0, %r12d
leaq (%rsp,%r12), %rdi
addq $0xb0, %rdi
callq 0x423c
addq $-0x70, %r12
cmpq $-0x70, %r12
jne 0x2611
cmpl $0x1, %r15d
jne 0x270b
movq %r14, %rdi
callq 0x2070
movq %rax, %r14
movq (%rbx), %rbx
movq 0x7afe(%rip), %rsi      # 0xa148
leaq 0xb0(%rsp), %rdi
leaq 0x8(%rsp), %rdx
callq 0x2cc6
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
leaq 0x30(%rsp), %rdi
leaq 0x4(%rsp), %rdx
movq %rax, %rsi
callq 0x2cc6
leaq 0x3acc(%rip), %rsi      # 0x614a
leaq 0x10(%rsp), %rdi
movq %rsp, %rdx
callq 0x2cc6
leaq 0xb0(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x10(%rsp), %rcx
movq %rbx, %rdi
callq 0x2c1b
leaq 0x10(%rsp), %rdi
callq 0x2090
leaq 0x30(%rsp), %rdi
callq 0x2090
leaq 0xb0(%rsp), %rdi
callq 0x2090
callq 0x2210
pushq $0x1
popq %rax
jmp 0x2585
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x2090
jmp 0x26e5
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x2090
jmp 0x26f4
movq %rax, %r14
leaq 0xb0(%rsp), %rdi
callq 0x2090
jmp 0x2706
movq %rax, %r14
callq 0x2210
movq %r14, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2d01
nop