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

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

        auto help = [argv0 = argv[0]] { to::usage(argv0, usage_str); };

        to::option opts[] = {
            { n, "-n", "--number" },
            { {fn, to::keywords(functions)}, "-f", "--function", to::mandatory },
            { to::action(help), to::flag, to::exit, "-h", "--help" }
        };

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

        if (argv[1]) throw to::option_error("unrecognized argument", argv[1]);
        if (n<1) throw to::option_error("N must be at least 1");

        // 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 $0x268, %rsp            # imm = 0x268
movq %rsi, %rbx
movl %edi, 0x2c(%rsp)
movl $0x1, %eax
leaq 0x4(%rsp), %rcx
movl %eax, (%rcx)
movl $0x0, 0x28(%rsp)
leaq 0x4c71(%rip), %rdx      # 0x7150
movq %rdx, 0x30(%rsp)
movl %eax, 0x38(%rsp)
leaq 0x4c65(%rip), %rax      # 0x7154
movq %rax, 0x40(%rsp)
movl $0x2, 0x48(%rsp)
movq (%rsi), %r14
leaq 0xd0(%rsp), %rsi
movq $0x0, 0x8(%rsi)
movq %rcx, (%rsi)
leaq 0x1897(%rip), %rax      # 0x3db0
movq %rax, 0x18(%rsi)
leaq 0x18be(%rip), %rax      # 0x3de2
movq %rax, 0x10(%rsi)
leaq 0x110(%rsp), %r12
leaq 0x4c21(%rip), %rdx      # 0x7158
leaq 0x4c1d(%rip), %rcx      # 0x715b
movq %r12, %rdi
callq 0x2c5e
leaq 0x180(%rsp), %r12
leaq 0x98(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x35de
leaq 0x78(%rsp), %rdi
leaq 0x28(%rsp), %rsi
leaq 0x98(%rsp), %rdx
callq 0x2d60
leaq 0x8(%rsp), %r8
movl $0x8, (%r8)
leaq 0x4bda(%rip), %rdx      # 0x7164
leaq 0x4bd6(%rip), %rcx      # 0x7167
leaq 0x78(%rsp), %rsi
movq %r12, %rdi
callq 0x2df8
leaq 0x1f0(%rsp), %r12
leaq 0xb0(%rsp), %rsi
movq $0x0, 0x8(%rsi)
movq %r14, (%rsi)
leaq 0x5ae(%rip), %rax       # 0x2b6e
movq %rax, 0x18(%rsi)
leaq 0x66d(%rip), %rax       # 0x2c38
movq %rax, 0x10(%rsi)
leaq 0x50(%rsp), %rdx
movl $0x1, (%rdx)
leaq 0x74(%rsp), %rcx
movl $0x10, (%rcx)
leaq 0x4b86(%rip), %r8       # 0x7172
leaq 0x4b82(%rip), %r9       # 0x7175
movq %r12, %rdi
callq 0x2f00
movq 0xc0(%rsp), %rax
testq %rax, %rax
je 0x261a
leaq 0xb0(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
movq 0x88(%rsp), %rax
testq %rax, %rax
je 0x2636
leaq 0x78(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x98(%rsp), %rdi
callq 0x3618
movq 0xe0(%rsp), %rax
testq %rax, %rax
je 0x2662
leaq 0xd0(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x8(%rbx), %r14
xorps %xmm0, %xmm0
leaq 0x50(%rsp), %r8
movaps %xmm0, (%r8)
movq $0x0, 0x10(%r8)
leaq 0x8(%rsp), %rdi
leaq 0x110(%rsp), %rsi
leaq 0x2c(%rsp), %rdx
movq %r14, %rcx
callq 0x2fba
cmpb $0x0, 0x8(%rsp)
je 0x2719
leaq 0x10(%rsp), %r15
movq %r15, %rdi
callq 0x329c
movb $0x0, -0x8(%r15)
leaq 0x50(%rsp), %rdi
callq 0x329c
cmpq $0x0, (%r14)
jne 0x2799
cmpl $0x0, 0x4(%rsp)
jle 0x280e
xorl %ebp, %ebp
movq 0x88fb(%rip), %r14      # 0xafd0
leaq 0x4acb(%rip), %r15      # 0x71a7
leaq 0x4a6b(%rip), %r12      # 0x714e
movl $0x15, %edx
movq %r14, %rdi
movq %r15, %rsi
callq 0x21a0
movl 0x28(%rsp), %esi
movq %r14, %rdi
callq 0x2260
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x21a0
incl %ebp
cmpl 0x4(%rsp), %ebp
jl 0x26e3
jmp 0x2728
movb $0x0, 0x8(%rsp)
leaq 0x50(%rsp), %rdi
callq 0x329c
movl $0x150, %r14d           # imm = 0x150
leaq (%rsp,%r14), %rdi
addq $0xf0, %rdi
callq 0x39dc
leaq (%rsp,%r14), %rdi
addq $0xd8, %rdi
callq 0x3a0c
leaq (%rsp,%r14), %rbx
addq $0xc0, %rbx
movq %rbx, %rdi
callq 0x3a3c
movq -0x10(%rbx), %rax
testq %rax, %rax
je 0x277f
leaq (%rsp,%r14), %rdi
addq $0xa0, %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
addq $-0x70, %r14
jne 0x272e
xorl %eax, %eax
addq $0x268, %rsp            # imm = 0x268
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x30, %edi
callq 0x20c0
movq %rax, %r12
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x49c6(%rip), %rsi      # 0x717c
leaq 0x49d4(%rip), %rdx      # 0x7191
leaq 0x8(%rsp), %rdi
callq 0x3c66
movq (%r14), %rsi
leaq 0xf0(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x32fa
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
leaq 0xf0(%rsp), %rdx
movq %r12, %rdi
callq 0x3338
xorl %ebp, %ebp
leaq 0x847b(%rip), %rsi      # 0xac78
leaq 0x2672(%rip), %rdx      # 0x4e76
movq %r12, %rdi
callq 0x2250
jmp 0x288a
movl $0x30, %edi
callq 0x20c0
movq %rax, %r12
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x4967(%rip), %rsi      # 0x7192
leaq 0x4974(%rip), %rdx      # 0x71a6
leaq 0x8(%rsp), %rdi
callq 0x3c66
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r12, %rdi
callq 0x21c0
leaq 0x844d(%rip), %rax      # 0xaca0
movq %rax, (%r12)
movq %r12, %rax
addq $0x20, %rax
movq %rax, 0x10(%r12)
movq $0x0, 0x18(%r12)
movb $0x0, 0x20(%r12)
xorl %ebp, %ebp
leaq 0x83fd(%rip), %rsi      # 0xac78
leaq 0x25f4(%rip), %rdx      # 0x4e76
movq %r12, %rdi
callq 0x2250
movq %rdx, %r15
movq %rax, %r14
leaq 0x100(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x28d8
movq 0x100(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x28d8
movq %rdx, %r15
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x2901
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x2901
movq %rdx, %r15
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x28ef
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2170
testb %bpl, %bpl
jne 0x2901
jmp 0x29ee
jmp 0x28fb
movq %rdx, %r15
movq %rax, %r14
movq %r12, %rdi
callq 0x2110
jmp 0x29ee
jmp 0x29e0
jmp 0x29e0
jmp 0x29e0
movq %rdx, %r15
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x329c
jmp 0x29ee
movq %rdx, %r15
movq %rax, %r14
movq 0xc0(%rsp), %rax
testq %rax, %rax
je 0x2964
leaq 0xb0(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x2964
jmp 0x29e0
movq %rdx, %r15
movq %rax, %r14
movq 0x88(%rsp), %rax
testq %rax, %rax
je 0x298a
leaq 0x78(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x298a
jmp 0x29e0
movq %rdx, %r15
movq %rax, %r14
leaq 0x98(%rsp), %rdi
callq 0x3618
jmp 0x299f
movq %rdx, %r15
movq %rax, %r14
movq 0xe0(%rsp), %rax
testq %rax, %rax
je 0x29be
leaq 0xd0(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
leaq 0x110(%rsp), %r13
cmpq %r12, %r13
je 0x2a0e
addq $-0x70, %r12
movq %r12, %rdi
callq 0x556c
cmpq %r13, %r12
jne 0x29cb
jmp 0x2a0e
jmp 0x29e0
movq %rax, %rdi
callq 0x35d3
movq %rdx, %r15
movq %rax, %r14
movl $0xe0, %r12d
leaq (%rsp,%r12), %rdi
addq $0x110, %rdi            # imm = 0x110
callq 0x556c
addq $-0x70, %r12
cmpq $-0x70, %r12
jne 0x29f4
cmpl $0x1, %r15d
jne 0x2b61
movq %r14, %rdi
callq 0x2090
movq %rax, %r14
movq (%rbx), %rbx
movq 0x8733(%rip), %rsi      # 0xb160
leaq 0x110(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x32fa
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
leaq 0x30(%rsp), %rdi
leaq 0x4(%rsp), %rdx
movq %rax, %rsi
callq 0x32fa
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x4753(%rip), %rsi      # 0x71bd
leaq 0x4753(%rip), %rdx      # 0x71c4
leaq 0x8(%rsp), %rdi
callq 0x3c66
leaq 0x110(%rsp), %rsi
leaq 0x30(%rsp), %rdx
leaq 0x8(%rsp), %rcx
movq %rbx, %rdi
callq 0x34a1
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2aac
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2170
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2ac7
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2170
leaq 0x120(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2ae8
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x2170
callq 0x2220
movl $0x1, %eax
jmp 0x2787
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2b16
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x2b16
movq %rax, %r14
leaq 0x40(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b36
movq 0x40(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x2b36
movq %rax, %r14
leaq 0x120(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2b5c
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x2170
jmp 0x2b5c
movq %rax, %r14
callq 0x2220
movq %r14, %rdi
callq 0x2270
jmp 0x29e0