// File: /workspace/github_cpp_makefile_star2_O1/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 $0x148, %rsp            # imm = 0x148
leaq 0x2d40(%rip), %rax      # 0x5104
leaq 0x70(%rsp), %rcx
movq %rax, (%rcx)
movl $0x1, 0x8(%rcx)
leaq 0x2d2e(%rip), %rax      # 0x5108
movq %rax, 0x10(%rcx)
movl $0x2, 0x18(%rcx)
movq %rsi, 0x68(%rsp)
leaq 0x8(%rsi), %rax
leaq 0x38(%rsp), %rcx
movq %rax, (%rcx)
xorl %r14d, %r14d
leaq 0xe8(%rsp), %rbx
leaq 0xc0(%rsp), %r13
leaq 0x98(%rsp), %rbp
movl $0x0, 0xc(%rsp)
movl $0x1, 0x10(%rsp)
movq 0x38(%rsp), %rax
cmpq $0x0, (%rax)
je 0x262f
movq %rbx, %rdi
leaq 0x2cd2(%rip), %rsi      # 0x510c
callq 0x2be6
leaq 0x18(%rsp), %rdi
leaq 0x38(%rsp), %rsi
movq %rbx, %r12
movq %rbx, %rdx
leaq 0x2cb9(%rip), %rcx      # 0x510f
callq 0x2af3
movb 0x18(%rsp), %bl
movzbl %r14b, %r14d
movb $0x1, 0xa(%rsp)
testb %bl, %bl
movl $0x1, %eax
cmovnel %eax, %r14d
je 0x247c
xorl %eax, %eax
jmp 0x2515
movq %r13, %r15
movq %r13, %rdi
leaq 0x2c8d(%rip), %rsi      # 0x5116
callq 0x2be6
leaq 0x58(%rsp), %rdi
leaq 0x38(%rsp), %rsi
movq %r15, %rdx
leaq 0x2c77(%rip), %rcx      # 0x5119
callq 0x2c6a
xorl %eax, %eax
cmpb $0x0, 0x58(%rsp)
je 0x24b8
movl 0x5c(%rsp), %ecx
movl %ecx, 0x10(%rsp)
jne 0x2515
leaq 0x110(%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x33c8
movq %rbp, %r15
movq %rbp, %rdi
leaq 0x2c49(%rip), %rsi      # 0x5122
callq 0x2be6
leaq 0x60(%rsp), %rdi
leaq 0x38(%rsp), %rsi
leaq 0x110(%rsp), %rdx
movq %r15, %rcx
leaq 0x2c2b(%rip), %r8       # 0x5125
callq 0x2d15
movb 0x60(%rsp), %al
movb %al, 0xa(%rsp)
testb %al, %al
je 0x2513
movl 0x64(%rsp), %eax
movl %eax, 0xc(%rsp)
movb $0x1, %al
testb %al, %al
je 0x2550
movb $0x0, 0x60(%rsp)
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x2543
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x2150
leaq 0x110(%rsp), %rdi
callq 0x3402
testb %bl, %bl
movq %r12, %rbx
jne 0x2581
movb $0x0, 0x58(%rsp)
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x2581
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x2150
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0x25a6
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x2150
cmpb $0x0, 0xa(%rsp)
jne 0x2421
movl $0x30, %edi
callq 0x20b0
movq %rax, %rbx
leaq 0x28(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x2b61(%rip), %rsi      # 0x5130
leaq 0x2b6f(%rip), %rdx      # 0x5145
leaq 0x18(%rsp), %rdi
callq 0x388a
movq 0x38(%rsp), %rax
movq (%rax), %rsi
leaq 0x128(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x302e
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
leaq 0x128(%rsp), %rdx
movq %rbx, %rdi
callq 0x306c
xorl %ebp, %ebp
leaq 0x46cd(%rip), %rsi      # 0x6ce8
leaq 0x1916(%rip), %rdx      # 0x3f38
movq %rbx, %rdi
callq 0x2210
jmp 0x281e
testb $0x1, %r14b
je 0x26bf
movq 0x68(%rsp), %rax
movq (%rax), %rbx
movq 0x4af8(%rip), %rsi      # 0x7140
leaq 0x18(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x302e
leaq 0x48(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x2ade(%rip), %rsi      # 0x5146
leaq 0x2ade(%rip), %rdx      # 0x514d
leaq 0x38(%rsp), %rdi
callq 0x388a
leaq 0x18(%rsp), %rsi
leaq 0x38(%rsp), %rdx
movq %rbx, %rdi
callq 0x31d5
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0x26a2
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2150
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2718
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x2718
cmpl $0x0, 0x10(%rsp)
jle 0x272c
cmpl $0x0, 0xc(%rsp)
jle 0x27a6
movq 0x48f8(%rip), %rbx      # 0x6fd0
leaq 0x2a91(%rip), %r14      # 0x5170
leaq 0x2a1c(%rip), %r15      # 0x5102
movl $0x15, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2180
movq %rbx, %rdi
movl 0xc(%rsp), %esi
callq 0x2220
movl $0x1, %edx
movq %rax, %rdi
movq %r15, %rsi
callq 0x2180
decl 0x10(%rsp)
jne 0x26e6
xorl %eax, %eax
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x30, %edi
callq 0x20b0
movq %rax, %rbx
leaq 0x28(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x2a04(%rip), %rsi      # 0x514e
leaq 0x2a11(%rip), %rdx      # 0x5162
leaq 0x18(%rsp), %rdi
callq 0x388a
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x2190
leaq 0x459e(%rip), %rax      # 0x6d10
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 0x4553(%rip), %rsi      # 0x6ce8
leaq 0x179c(%rip), %rdx      # 0x3f38
movq %rbx, %rdi
callq 0x2210
jmp 0x281e
movl $0x30, %edi
callq 0x20b0
movq %rax, %rbx
leaq 0x28(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x299f(%rip), %rsi      # 0x5163
leaq 0x29a4(%rip), %rdx      # 0x516f
leaq 0x18(%rsp), %rdi
callq 0x388a
movb $0x1, %bpl
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
callq 0x2190
leaq 0x4524(%rip), %rax      # 0x6d10
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 0x44d9(%rip), %rsi      # 0x6ce8
leaq 0x1722(%rip), %rdx      # 0x3f38
movq %rbx, %rdi
callq 0x2210
jmp 0x2825
jmp 0x2917
movq %rdx, %r15
movq %rax, %r14
jmp 0x28fc
jmp 0x2917
movq %rdx, %r15
movq %rax, %r14
movq 0x38(%rsp), %rdi
cmpq %r12, %rdi
je 0x285a
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x285a
movq %rdx, %r15
movq %rax, %r14
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2991
movq 0x28(%rsp), %rsi
jmp 0x2981
jmp 0x298b
movq %rdx, %r15
movq %rax, %r14
movq 0x98(%rsp), %rdi
leaq 0xa8(%rsp), %rax
cmpq %rax, %rdi
je 0x28ae
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x28ae
movq %rdx, %r15
movq %rax, %r14
leaq 0x110(%rsp), %rdi
callq 0x3402
jmp 0x28c3
movq %rdx, %r15
movq %rax, %r14
movb $0x0, 0x58(%rsp)
jmp 0x2935
movq %rdx, %r15
movq %rax, %r14
leaq 0x138(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x28fc
movq 0x138(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x28fc
movq %rdx, %r15
movq %rax, %r14
movb $0x1, %bpl
movq 0x18(%rsp), %rdi
cmpq %r12, %rdi
je 0x2920
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x2920
jmp 0x295e
movq %rdx, %r15
movq %rax, %r14
movb $0x1, %bpl
testb %bpl, %bpl
je 0x2991
movq %rbx, %rdi
callq 0x20f0
jmp 0x2991
movq %rdx, %r15
movq %rax, %r14
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x2964
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x2964
jmp 0x298b
movq %rdx, %r15
movq %rax, %r14
movq 0xe8(%rsp), %rdi
leaq 0xf8(%rsp), %rax
cmpq %rax, %rdi
je 0x2991
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x2991
movq %rdx, %r15
movq %rax, %r14
cmpl $0x1, %r15d
jne 0x2ae3
movq %r14, %rdi
callq 0x2080
movq %rax, %r14
movq 0x68(%rsp), %rax
movq (%rax), %rbx
movq 0x478b(%rip), %rsi      # 0x7140
leaq 0x70(%rsp), %rdi
leaq 0xb(%rsp), %rdx
callq 0x302e
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
leaq 0x18(%rsp), %rdi
leaq 0x17(%rsp), %rdx
movq %rax, %rsi
callq 0x302e
leaq 0x48(%rsp), %r15
movq %r15, -0x10(%r15)
leaq 0x2757(%rip), %rsi      # 0x5146
leaq 0x2757(%rip), %rdx      # 0x514d
leaq 0x38(%rsp), %rdi
callq 0x388a
leaq 0x70(%rsp), %rsi
leaq 0x18(%rsp), %rdx
leaq 0x38(%rsp), %rcx
movq %rbx, %rdi
callq 0x328a
movq 0x38(%rsp), %rdi
cmpq %r15, %rdi
je 0x2a2e
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2150
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2a49
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2150
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2a6a
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2150
callq 0x21e0
movl $0x1, %eax
jmp 0x271a
movq %rax, %r14
movq 0x38(%rsp), %rdi
cmpq %r15, %rdi
je 0x2a98
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x2a98
movq %rax, %r14
leaq 0x28(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2ab8
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x2ab8
movq %rax, %r14
leaq 0x80(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2ade
movq 0x80(%rsp), %rsi
incq %rsi
callq 0x2150
jmp 0x2ade
movq %rax, %r14
callq 0x21e0
movq %r14, %rdi
callq 0x2230
movq %rax, %rdi
callq 0x33bc