// File: /workspace/github_cpp_makefile_star2_O3/halfflat[P]tinyopt/ex/ex1-parse.cc
// Function: main
int main(int, char** argv) {
    try {
        int n = 1, fn = 0;
        bool help = false;

        std::pair<const char*, int> functions[] = {
            { "one", 1 }, { "two", 2 }
        };

        for (auto arg = argv+1; *arg; ) {
            bool ok =
                help << to::parse(arg, "-h", "--help") ||
                n    << to::parse<int>(arg, "-n", "--number") ||
                fn   << to::parse<int>(arg, to::keywords(functions), "-f", "--function");

            if (!ok) throw to::option_error("unrecognized argument", *arg);
        }

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

        if (n<1) throw to::option_error("N must be at least 1");
        if (fn<1) throw to::option_error("Require FUNC");

        // Do things with arguments:

        for (int i = 0; i<n; ++i) {
            std::cout << "Performing function #" << fn << "\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 $0x128, %rsp            # imm = 0x128
leaq 0x1d40(%rip), %rax      # 0x4104
leaq 0x70(%rsp), %rcx
movq %rax, (%rcx)
movl $0x1, 0x8(%rcx)
leaq 0x1d2e(%rip), %rax      # 0x4108
movq %rax, 0x10(%rcx)
movl $0x2, 0x18(%rcx)
movq %rsi, 0x68(%rsp)
leaq 0x8(%rsi), %rax
leaq 0x48(%rsp), %r15
movq %rax, (%r15)
movl $0x1, %r12d
movl $0x0, 0x3c(%rsp)
leaq 0xe0(%rsp), %r13
leaq 0xb8(%rsp), %r14
xorl %ebp, %ebp
movq 0x48(%rsp), %rax
cmpq $0x0, (%rax)
je 0x25f2
movq %r13, %rdi
leaq 0x1cdd(%rip), %rsi      # 0x410c
callq 0x2bb4
leaq 0xf(%rsp), %rdi
movq %r15, %rsi
movq %r13, %rdx
leaq 0x1cc9(%rip), %rcx      # 0x410f
callq 0x2ac0
movb $0x1, %bl
cmpb $0x0, 0xf(%rsp)
je 0x245f
movb $0x1, %al
movl %eax, 0x3c(%rsp)
jmp 0x2547
movq %r14, %rbx
movq %r14, %rdi
leaq 0x1caa(%rip), %rsi      # 0x4116
callq 0x2bb4
leaq 0x34(%rsp), %rdi
movq %r15, %rsi
movq %rbx, %rdx
leaq 0x1c96(%rip), %rcx      # 0x4119
callq 0x2c38
cmpb $0x0, 0x34(%rsp)
je 0x249b
movb $0x1, %bl
movl 0x38(%rsp), %r12d
jmp 0x251d
leaq 0x10(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x3332
leaq 0x90(%rsp), %rbx
movq %rbx, %rdi
leaq 0x1c66(%rip), %rsi      # 0x4122
callq 0x2bb4
leaq 0x40(%rsp), %rdi
movq %r15, %rsi
leaq 0x10(%rsp), %rdx
movq %rbx, %rcx
leaq 0x1c4d(%rip), %r8       # 0x4125
callq 0x2ce3
movb 0x40(%rsp), %bl
testb %bl, %bl
je 0x24e9
movl 0x44(%rsp), %ebp
movb $0x0, 0x40(%rsp)
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x2513
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x2150
leaq 0x10(%rsp), %rdi
callq 0x336c
movb $0x0, 0x34(%rsp)
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x2547
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x2150
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x256c
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x2150
testb %bl, %bl
jne 0x2416
movl $0x30, %edi
callq 0x20b0
movq %rax, %rbx
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1b9e(%rip), %rsi      # 0x4130
leaq 0x1bac(%rip), %rdx      # 0x4145
leaq 0x10(%rsp), %rdi
callq 0x3802
movq 0x48(%rsp), %rax
movq (%rax), %rsi
leaq 0x108(%rsp), %rdi
leaq 0x34(%rsp), %rdx
callq 0x2f98
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
leaq 0x108(%rsp), %rdx
movq %rbx, %rdi
callq 0x2fd6
xorl %ebp, %ebp
leaq 0x370a(%rip), %rsi      # 0x5ce8
leaq 0x186d(%rip), %rdx      # 0x3e52
movq %rbx, %rdi
callq 0x2210
jmp 0x27da
testb $0x1, 0x3c(%rsp)
je 0x2683
movq 0x68(%rsp), %rax
movq (%rax), %rbx
movq 0x3b34(%rip), %rsi      # 0x6140
leaq 0x10(%rsp), %rdi
leaq 0x34(%rsp), %rdx
callq 0x2f98
leaq 0x58(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1b1a(%rip), %rsi      # 0x4146
leaq 0x1b1a(%rip), %rdx      # 0x414d
leaq 0x48(%rsp), %rdi
callq 0x3802
leaq 0x10(%rsp), %rsi
leaq 0x48(%rsp), %rdx
movq %rbx, %rdi
callq 0x313f
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x2666
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2150
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x26d4
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x26d4
testl %r12d, %r12d
jle 0x26e8
testl %ebp, %ebp
jle 0x2762
movq 0x3939(%rip), %rbx      # 0x5fd0
leaq 0x1ad2(%rip), %r14      # 0x4170
leaq 0x1a5d(%rip), %r15      # 0x4102
movl $0x15, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2180
movq %rbx, %rdi
movl %ebp, %esi
callq 0x2220
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2180
decl %r12d
jne 0x26a5
xorl %eax, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x30, %edi
callq 0x20b0
movq %rax, %rbx
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x1a48(%rip), %rsi      # 0x414e
leaq 0x1a55(%rip), %rdx      # 0x4162
leaq 0x10(%rsp), %rdi
callq 0x3802
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x2190
leaq 0x35e2(%rip), %rax      # 0x5d10
movq %rax, (%rbx)
movq %rbx, %rax
addq $0x20, %rax
movq %rax, 0x10(%rbx)
movq $0x0, 0x18(%rbx)
movb $0x0, 0x20(%rbx)
xorl %ebp, %ebp
leaq 0x3597(%rip), %rsi      # 0x5ce8
leaq 0x16fa(%rip), %rdx      # 0x3e52
movq %rbx, %rdi
callq 0x2210
jmp 0x27da
movl $0x30, %edi
callq 0x20b0
movq %rax, %rbx
leaq 0x20(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x19e3(%rip), %rsi      # 0x4163
leaq 0x19e8(%rip), %rdx      # 0x416f
leaq 0x10(%rsp), %rdi
callq 0x3802
movb $0x1, %bpl
leaq 0x10(%rsp), %rsi
movq %rbx, %rdi
callq 0x2190
leaq 0x3568(%rip), %rax      # 0x5d10
movq %rax, (%rbx)
movq %rbx, %rax
addq $0x20, %rax
movq %rax, 0x10(%rbx)
movq $0x0, 0x18(%rbx)
movb $0x0, 0x20(%rbx)
xorl %ebp, %ebp
leaq 0x351d(%rip), %rsi      # 0x5ce8
leaq 0x1680(%rip), %rdx      # 0x3e52
movq %rbx, %rdi
callq 0x2210
jmp 0x27e1
jmp 0x28ec
movq %rdx, %r15
movq %rax, %r14
jmp 0x28aa
jmp 0x28ec
movq %rdx, %r15
movq %rax, %r14
movq 0x48(%rsp), %rdi
cmpq %r12, %rdi
je 0x2816
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x2816
movq %rdx, %r15
movq %rax, %r14
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x295e
movq 0x20(%rsp), %rsi
jmp 0x294e
jmp 0x2958
movq %rdx, %r15
movq %rax, %r14
movq 0x90(%rsp), %rdi
leaq 0xa0(%rsp), %rax
cmpq %rax, %rdi
je 0x286a
movq 0xa0(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x286a
movq %rdx, %r15
movq %rax, %r14
leaq 0x10(%rsp), %rdi
callq 0x336c
jmp 0x287c
movq %rdx, %r15
movq %rax, %r14
movb $0x0, 0x34(%rsp)
jmp 0x2902
movq %rdx, %r15
movq %rax, %r14
leaq 0x118(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x28aa
movq 0x118(%rsp), %rsi
incq %rsi
callq 0x2150
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x28c1
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2150
testb %bpl, %bpl
jne 0x28f2
jmp 0x295e
movq %rdx, %r15
movq %rax, %r14
movq 0x10(%rsp), %rdi
cmpq %r12, %rdi
je 0x28f2
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x28f2
jmp 0x292b
movq %rdx, %r15
movq %rax, %r14
movq %rbx, %rdi
callq 0x20f0
jmp 0x295e
movq %rdx, %r15
movq %rax, %r14
movq 0xb8(%rsp), %rdi
leaq 0xc8(%rsp), %rax
cmpq %rax, %rdi
je 0x2931
movq 0xc8(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x2931
jmp 0x2958
movq %rdx, %r15
movq %rax, %r14
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x295e
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x295e
movq %rdx, %r15
movq %rax, %r14
cmpl $0x1, %r15d
jne 0x2ab0
movq %r14, %rdi
callq 0x2080
movq %rax, %r14
movq 0x68(%rsp), %rax
movq (%rax), %rbx
movq 0x37be(%rip), %rsi      # 0x6140
leaq 0x70(%rsp), %rdi
leaq 0x34(%rsp), %rdx
callq 0x2f98
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
leaq 0x10(%rsp), %rdi
leaq 0x40(%rsp), %rdx
movq %rax, %rsi
callq 0x2f98
leaq 0x58(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x178a(%rip), %rsi      # 0x4146
leaq 0x178a(%rip), %rdx      # 0x414d
leaq 0x48(%rsp), %rdi
callq 0x3802
leaq 0x70(%rsp), %rsi
leaq 0x10(%rsp), %rdx
leaq 0x48(%rsp), %rcx
movq %rbx, %rdi
callq 0x31f4
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x29fb
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2150
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2a16
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2150
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2a37
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2150
callq 0x21e0
movl $0x1, %eax
jmp 0x26d6
movq %rax, %r14
movq 0x48(%rsp), %rdi
cmpq %r15, %rdi
je 0x2a65
movq 0x58(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x2a65
movq %rax, %r14
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2a85
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x2a85
movq %rax, %r14
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2aab
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x2aab
movq %rax, %r14
callq 0x21e0
movq %r14, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x3326