// File: /workspace/github_cpp_makefile_star2_O3/halfflat[P]tinyopt/include/tinyopt/tinyopt.h
// Function: to::maybe<int> to::parse<int, to::default_parser<int>, void, void, char const*>(char**&, to::default_parser<int> const&, to::key, char const*)
maybe<V> parse(char**& argp, const P& parser, key k0, Tail... krest) {
    key keys[] = { std::move(k0), std::move(krest)... };

    const char* arg = argp[0];
    if (!arg) return nothing;

    const char* text = nullptr;
    for (const key& k: keys) {
        if (k.label==arg) {
            if (!argp[1]) throw missing_argument(arg);
            text = argp[1];
            argp += 2;
            goto match;
        }
        else if (k.style==key::longfmt) {
            const char* eq = std::strrchr(arg, '=');
            if (eq && !std::strncmp(arg, k.label.c_str(), eq-arg)) {
                text = eq+1;
                argp += 1;
                goto match;
            }
        }
    }
    return nothing;

match:
    if (auto v = parser(text)) return v;
    else throw option_parse_error(arg);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdx, 0x28(%rsp)
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x40(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rcx), %rdx
leaq 0x10(%rcx), %rax
cmpq %rax, %rdx
je 0x2d546
movq %rdx, 0x30(%rsp)
movq (%rax), %rdx
movq %rdx, 0x40(%rsp)
jmp 0x2d54d
movups (%rax), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rcx), %rdx
leaq 0x58(%rsp), %rdi
movq %rdx, -0x20(%rdi)
movq %rax, (%rcx)
movq $0x0, 0x8(%rcx)
movb $0x0, 0x10(%rcx)
movl 0x20(%rcx), %eax
movl %eax, -0x8(%rdi)
movq %r8, %rsi
callq 0x200cc
movq (%r12), %rax
movq (%rax), %r14
testq %r14, %r14
je 0x2d5da
xorl %r15d, %r15d
leaq (%rsp,%r15), %rbp
addq $0x30, %rbp
movq %rbp, %rdi
movq %r14, %rsi
callq 0xd170
testl %eax, %eax
je 0x2d5df
cmpl $0x1, 0x50(%rsp,%r15)
jne 0x2d5d0
movq %r14, %rdi
movl $0x3d, %esi
callq 0xd5b0
testq %rax, %rax
je 0x2d5d0
movq %rax, %r13
movq (%rbp), %rsi
movq %rax, %rdx
subq %r14, %rdx
movq %r14, %rdi
callq 0xd230
testl %eax, %eax
je 0x2d5f6
addq $0x28, %r15
cmpq $0x50, %r15
jne 0x2d586
movb $0x0, (%rbx)
jmp 0x2d61a
movq (%r12), %rax
movq 0x8(%rax), %r13
testq %r13, %r13
je 0x2d6b3
addq $0x10, %rax
jmp 0x2d601
incq %r13
movq (%r12), %rax
addq $0x8, %rax
movq %rax, (%r12)
movq %rbx, %rdi
movq 0x28(%rsp), %rsi
movq %r13, %rdx
callq 0x1567a
cmpb $0x0, (%rbx)
je 0x2d659
movq $-0x50, %r14
leaq 0x68(%rsp), %r15
movq -0x10(%r15), %rdi
cmpq %rdi, %r15
je 0x2d63a
movq (%r15), %rsi
incq %rsi
callq 0xd530
addq $-0x28, %r15
addq $0x28, %r14
jne 0x2d626
movq %rbx, %rax
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x30, %edi
callq 0xd240
movq %rax, %r15
leaq 0x18(%rsp), %r12
movq %r12, -0x10(%r12)
movq %r14, %rdi
callq 0xd210
leaq (%rax,%r14), %rdx
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x1558a
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %r15, %rdi
callq 0x219f0
xorl %ebp, %ebp
leaq 0x63ec6(%rip), %rsi     # 0x91568
leaq -0xbbd5(%rip), %rdx     # 0x21ad4
movq %r15, %rdi
callq 0xda20
jmp 0x2d70a
movl $0x30, %edi
callq 0xd240
movq %rax, %rbx
leaq 0x18(%rsp), %r15
movq %r15, -0x10(%r15)
movq %r14, %rdi
callq 0xd210
leaq (%rax,%r14), %rdx
leaq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0x1558a
movb $0x1, %bpl
leaq 0x8(%rsp), %rsi
movq %rbx, %rdi
callq 0x2190c
xorl %ebp, %ebp
leaq 0x642d5(%rip), %rsi     # 0x919d0
leaq -0xbc2e(%rip), %rdx     # 0x21ad4
movq %rbx, %rdi
callq 0xda20
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r15, %rdi
je 0x2d724
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xd530
testb %bpl, %bpl
jne 0x2d72e
jmp 0x2d76c
movq %rax, %r14
movq %rbx, %rdi
callq 0xd3a0
jmp 0x2d76c
movq %rax, %r14
movq 0x8(%rsp), %rdi
cmpq %r12, %rdi
je 0x2d752
movq 0x18(%rsp), %rsi
incq %rsi
callq 0xd530
testb %bpl, %bpl
jne 0x2d75c
jmp 0x2d764
movq %rax, %r14
movq %r15, %rdi
callq 0xd3a0
movb $0x0, (%rbx)
jmp 0x2d76c
movq %rax, %r14
leaq 0x68(%rsp), %rbx
xorl %r15d, %r15d
movq 0x58(%rsp,%r15), %rdi
leaq (%rbx,%r15), %rax
cmpq %rdi, %rax
je 0x2d78d
movq (%rax), %rsi
incq %rsi
callq 0xd530
addq $-0x28, %r15
cmpq $-0x50, %r15
jne 0x2d774
jmp 0x2d7b3
movq %rax, %r14
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0x2d7b3
movq 0x40(%rsp), %rsi
incq %rsi
callq 0xd530
movq %r14, %rdi
callq 0xda70