// File: /workspace/github_cpp_makefile_star2_O2/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)
pushq $0x1
popq %rbp
movl $0x0, 0x24(%rsp)
leaq 0x100(%rsp), %r13
leaq 0xd8(%rsp), %r12
leaq 0xb0(%rsp), %rbx
movl $0x0, 0x10(%rsp)
movq 0x48(%rsp), %rax
cmpq $0x0, (%rax)
je 0x2595
movq %r13, %rdi
leaq 0x1cd2(%rip), %rsi      # 0x410c
callq 0x2952
leaq 0xf(%rsp), %rdi
movq %r15, %rsi
movq %r13, %rdx
leaq 0x1cbe(%rip), %rcx      # 0x410f
callq 0x28b8
movb $0x1, %r14b
cmpb $0x0, 0xf(%rsp)
je 0x246b
movb $0x1, %al
movl %eax, 0x24(%rsp)
jmp 0x2514
movq %r12, %rdi
leaq 0x1ca1(%rip), %rsi      # 0x4116
callq 0x2952
movq %rbx, %r14
leaq 0x14(%rsp), %rdi
movq %r15, %rsi
movq %r12, %rdx
leaq 0x1c8a(%rip), %rcx      # 0x4119
callq 0x29a0
cmpb $0x0, 0x14(%rsp)
je 0x24a4
movb $0x1, %r14b
movl 0x18(%rsp), %ebp
jmp 0x2507
leaq 0x28(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x2e6a
movq %r14, %rdi
leaq 0x1c65(%rip), %rsi      # 0x4122
callq 0x2952
leaq 0x1c(%rsp), %rdi
movq %r15, %rsi
leaq 0x28(%rsp), %rdx
movq %r14, %rcx
leaq 0x1c4c(%rip), %r8       # 0x4125
callq 0x2a08
movb 0x1c(%rsp), %r14b
testb %r14b, %r14b
je 0x24f0
movl 0x20(%rsp), %eax
movl %eax, 0x10(%rsp)
movb $0x0, 0x1c(%rsp)
movq %rbx, %rdi
callq 0x2080
leaq 0x28(%rsp), %rdi
callq 0x2ea0
movb $0x0, 0x14(%rsp)
movq %r12, %rdi
callq 0x2080
movq %r13, %rdi
callq 0x2080
testb %r14b, %r14b
jne 0x2421
pushq $0x30
popq %rdi
callq 0x20b0
movq %rax, %rbx
leaq 0x1bf9(%rip), %rsi      # 0x4130
leaq 0x28(%rsp), %rdi
leaq 0x14(%rsp), %rdx
callq 0x2c28
movq 0x48(%rsp), %rax
movq (%rax), %rsi
leaq 0x90(%rsp), %rdi
leaq 0x1c(%rsp), %rdx
callq 0x2c28
movb $0x1, %bpl
leaq 0x28(%rsp), %rsi
leaq 0x90(%rsp), %rdx
movq %rbx, %rdi
callq 0x2c64
xorl %ebp, %ebp
leaq 0x476f(%rip), %rsi      # 0x6cf0
leaq 0x11d2(%rip), %rdx      # 0x375a
movq %rbx, %rdi
callq 0x2210
jmp 0x26eb
testb $0x1, 0x24(%rsp)
je 0x260a
movq 0x68(%rsp), %rax
movq (%rax), %rbx
movq 0x4ba5(%rip), %rsi      # 0x7150
leaq 0x28(%rsp), %rdi
leaq 0x14(%rsp), %rdx
callq 0x2c28
leaq 0x1b85(%rip), %rsi      # 0x4146
leaq 0x48(%rsp), %rdi
leaq 0x1c(%rsp), %rdx
callq 0x2c28
leaq 0x28(%rsp), %rsi
leaq 0x48(%rsp), %rdx
movq %rbx, %rdi
callq 0x2cf7
leaq 0x48(%rsp), %rdi
callq 0x2080
leaq 0x28(%rsp), %rdi
callq 0x2080
xorl %eax, %eax
addq $0x128, %rsp            # imm = 0x128
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %ebp, %ebp
jle 0x2657
cmpl $0x0, 0x10(%rsp)
jle 0x26a2
movq 0x49b0(%rip), %rbx      # 0x6fd0
leaq 0x1b49(%rip), %r14      # 0x4170
leaq 0x1ad4(%rip), %r15      # 0x4102
subl $0x1, %ebp
jb 0x25f6
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2150
movq %rax, %rdi
movl 0x10(%rsp), %esi
callq 0x2220
movq %rax, %rdi
movq %r15, %rsi
callq 0x2150
jmp 0x262e
pushq $0x30
popq %rdi
callq 0x20b0
movq %rax, %rbx
leaq 0x1ae5(%rip), %rsi      # 0x414e
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x2c28
movb $0x1, %bpl
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x2d6a
xorl %ebp, %ebp
leaq 0x465f(%rip), %rsi      # 0x6cf0
leaq 0x10c2(%rip), %rdx      # 0x375a
movq %rbx, %rdi
callq 0x2210
jmp 0x26eb
pushq $0x30
popq %rdi
callq 0x20b0
movq %rax, %rbx
leaq 0x1aaf(%rip), %rsi      # 0x4163
leaq 0x28(%rsp), %rdi
leaq 0x48(%rsp), %rdx
callq 0x2c28
movb $0x1, %bpl
leaq 0x28(%rsp), %rsi
movq %rbx, %rdi
callq 0x2d6a
xorl %ebp, %ebp
leaq 0x4614(%rip), %rsi      # 0x6cf0
leaq 0x1077(%rip), %rdx      # 0x375a
movq %rbx, %rdi
callq 0x2210
jmp 0x26f2
jmp 0x278b
movq %rdx, %r15
movq %rax, %r14
jmp 0x2778
jmp 0x278b
movq %rdx, %r15
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x2080
jmp 0x2717
movq %rdx, %r15
movq %rax, %r14
leaq 0x28(%rsp), %rdi
jmp 0x27c0
jmp 0x27c7
movq %rdx, %r15
movq %rax, %r14
leaq 0xb0(%rsp), %rdi
callq 0x2080
jmp 0x2741
movq %rdx, %r15
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x2ea0
jmp 0x2753
movq %rdx, %r15
movq %rax, %r14
movb $0x0, 0x14(%rsp)
jmp 0x27a1
movq %rdx, %r15
movq %rax, %r14
leaq 0x90(%rsp), %rdi
callq 0x2080
jmp 0x2778
movq %rdx, %r15
movq %rax, %r14
movb $0x1, %bpl
leaq 0x28(%rsp), %rdi
callq 0x2080
testb %bpl, %bpl
jne 0x2791
jmp 0x27cd
jmp 0x27b2
movq %rdx, %r15
movq %rax, %r14
movq %rbx, %rdi
callq 0x20f0
jmp 0x27cd
movq %rdx, %r15
movq %rax, %r14
leaq 0xd8(%rsp), %rdi
callq 0x2080
jmp 0x27b8
jmp 0x27c7
movq %rdx, %r15
movq %rax, %r14
leaq 0x100(%rsp), %rdi
callq 0x2080
jmp 0x27cd
movq %rdx, %r15
movq %rax, %r14
cmpl $0x1, %r15d
jne 0x28a8
movq %r14, %rdi
callq 0x2060
movq %rax, %r14
movq 0x68(%rsp), %rax
movq (%rax), %rbx
movq 0x495f(%rip), %rsi      # 0x7150
leaq 0x70(%rsp), %rdi
leaq 0x14(%rsp), %rdx
callq 0x2c28
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
leaq 0x28(%rsp), %rdi
leaq 0x1c(%rsp), %rdx
movq %rax, %rsi
callq 0x2c28
leaq 0x1924(%rip), %rsi      # 0x4146
leaq 0x48(%rsp), %rdi
leaq 0xf(%rsp), %rdx
callq 0x2c28
leaq 0x70(%rsp), %rsi
leaq 0x28(%rsp), %rdx
leaq 0x48(%rsp), %rcx
movq %rbx, %rdi
callq 0x2d90
leaq 0x48(%rsp), %rdi
callq 0x2080
leaq 0x28(%rsp), %rdi
callq 0x2080
leaq 0x70(%rsp), %rdi
callq 0x2080
callq 0x21f0
pushq $0x1
popq %rax
jmp 0x25f8
movq %rax, %r14
leaq 0x48(%rsp), %rdi
callq 0x2080
jmp 0x2885
movq %rax, %r14
leaq 0x28(%rsp), %rdi
callq 0x2080
jmp 0x2894
movq %rax, %r14
leaq 0x70(%rsp), %rdi
callq 0x2080
jmp 0x28a3
movq %rax, %r14
callq 0x21f0
movq %r14, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x2e3a