// File: /workspace/github_cpp_makefile_star2_O1/halfflat[P]tinyopt/test/test_parse.cc
// Function: parse_custom_parser_Test::TestBody()
TEST(parse, custom_parser) {
    auto custom = [](const char* s) -> to::maybe<bool> {
        if (!std::strcmp("no", s)) return false;
        if (!std::strcmp("yes", s)) return true;
        return to::nothing;
    };

    {
        mockargs M("-s\0yes\0");
        char** arg = M.argv;

        auto r = to::parse<bool>(arg, custom, "-s");
        ASSERT_TRUE(r);
        ASSERT_EQ(true, *r);
        ASSERT_EQ(M.argv+2, arg);
    }

    {
        mockargs M("-s\0no\0");
        char** arg = M.argv;

        auto r = to::parse<bool>(arg, custom, "-s");
        ASSERT_TRUE(r);
        ASSERT_EQ(false, *r);
        ASSERT_EQ(M.argv+2, arg);
    }

    {
        mockargs M("-s\0what?\0");
        char** arg = M.argv;

        EXPECT_THROW(to::parse<bool>(arg, custom, "-s"), to::option_parse_error);
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x110, %rsp            # imm = 0x110
leaq 0x43945(%rip), %rsi     # 0x7084a
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0x2a408
movq 0x8(%rbx), %rax
movq %rax, 0x60(%rsp)
leaq 0x4349e(%rip), %rsi     # 0x703c0
leaq 0xe8(%rsp), %rdi
callq 0x20926
leaq 0x6(%rsp), %rdi
leaq 0x60(%rsp), %rsi
leaq 0xe8(%rsp), %rdx
callq 0x2d839
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2cf67
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0xd530
movb 0x6(%rsp), %al
movb %al, 0x38(%rsp)
movq $0x0, 0x40(%rsp)
testb %al, %al
je 0x2d286
leaq 0x38(%rsp), %rcx
movb $0x1, (%rcx)
leaq 0x7(%rsp), %r8
leaq 0x41178(%rip), %rsi     # 0x6e10c
leaq 0x43438(%rip), %rdx     # 0x703d3
leaq 0x10(%rsp), %rdi
callq 0x2e583
cmpb $0x0, 0x10(%rsp)
je 0x2d333
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
je 0x2cfc4
leaq 0x18(%rsp), %rdi
callq 0x156d0
movq 0x78(%rsp), %rax
addq $0x10, %rax
leaq 0x38(%rsp), %rcx
movq %rax, (%rcx)
leaq 0x433fa(%rip), %rsi     # 0x703d6
leaq 0x4239b(%rip), %rdx     # 0x6f37e
leaq 0x10(%rsp), %rdi
leaq 0x60(%rsp), %r8
callq 0x2de44
cmpb $0x0, 0x10(%rsp)
je 0x2d34c
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
je 0x2d011
leaq 0x18(%rsp), %rdi
callq 0x156d0
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x2d02e
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0xd530
leaq 0x4386c(%rip), %rsi     # 0x708a1
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0x2a408
movq 0x8(%rbx), %rax
movq %rax, 0x60(%rsp)
leaq 0x4336e(%rip), %rsi     # 0x703c0
leaq 0xc0(%rsp), %rdi
callq 0x20926
leaq 0x6(%rsp), %rdi
leaq 0x60(%rsp), %rsi
leaq 0xc0(%rsp), %rdx
callq 0x2d839
leaq 0xd0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d097
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0xd530
movb 0x6(%rsp), %al
movb %al, 0x38(%rsp)
movq $0x0, 0x40(%rsp)
testb %al, %al
je 0x2d3a2
leaq 0x38(%rsp), %rcx
movb $0x0, (%rcx)
leaq 0x7(%rsp), %r8
leaq 0x41042(%rip), %rsi     # 0x6e106
leaq 0x43308(%rip), %rdx     # 0x703d3
leaq 0x10(%rsp), %rdi
callq 0x2e583
cmpb $0x0, 0x10(%rsp)
je 0x2d492
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
je 0x2d0f4
leaq 0x18(%rsp), %rdi
callq 0x156d0
movq 0x78(%rsp), %rax
addq $0x10, %rax
leaq 0x38(%rsp), %rcx
movq %rax, (%rcx)
leaq 0x432ca(%rip), %rsi     # 0x703d6
leaq 0x4226b(%rip), %rdx     # 0x6f37e
leaq 0x10(%rsp), %rdi
leaq 0x60(%rsp), %r8
callq 0x2de44
cmpb $0x0, 0x10(%rsp)
je 0x2d4ab
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
je 0x2d141
leaq 0x18(%rsp), %rdi
callq 0x156d0
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x2d15e
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0xd530
leaq 0x43743(%rip), %rsi     # 0x708a8
leaq 0x70(%rsp), %rbx
movq %rbx, %rdi
callq 0x2a408
movq 0x8(%rbx), %rax
movq %rax, 0x60(%rsp)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %r15
movaps %xmm0, -0x10(%r15)
movaps %xmm0, (%r15)
movq %r15, -0x10(%r15)
movq $0x0, -0x8(%r15)
movb $0x0, (%r15)
callq 0x4e2e5
testb %al, %al
je 0x2d1f6
leaq 0x43214(%rip), %rsi     # 0x703c0
leaq 0x98(%rsp), %rdi
callq 0x20926
leaq 0x6e(%rsp), %rdi
leaq 0x60(%rsp), %rsi
leaq 0x98(%rsp), %rdx
callq 0x2d839
movb $0x0, 0x6e(%rsp)
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d1f6
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0xd530
leaq 0x10(%rsp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x435af(%rip), %rcx     # 0x707b5
movl $0x7d, %r8d
xorl %esi, %esi
callq 0xd960
leaq 0x38(%rsp), %rdi
callq 0x4e2e8
movq 0x10(%rsp), %r8
leaq 0x43149(%rip), %rdx     # 0x70372
leaq 0x8(%rsp), %rdi
movl $0x1, %esi
movl $0x87, %ecx
callq 0x4a84c
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x481aa
leaq 0x8(%rsp), %rdi
callq 0x4a8b8
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x2d266
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x2d468
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xd530
jmp 0x2d468
leaq 0x40(%rsp), %r14
leaq 0x8(%rsp), %rdi
callq 0x4e2e8
leaq 0x43138(%rip), %rdx     # 0x703d4
leaq 0x40e63(%rip), %rcx     # 0x6e106
leaq 0x40e62(%rip), %r8      # 0x6e10c
leaq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x48021
movq 0x10(%rsp), %r8
leaq 0x430ad(%rip), %rdx     # 0x70372
leaq 0x58(%rsp), %rdi
movl $0x2, %esi
movl $0x74, %ecx
callq 0x4a84c
leaq 0x58(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x481aa
leaq 0x58(%rsp), %rdi
callq 0x4a8b8
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d30d
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xd530
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x2d31d
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x40(%rsp), %rsi
testq %rsi, %rsi
je 0x2d468
movq %r14, %rdi
jmp 0x2d463
leaq 0x38(%rsp), %rdi
callq 0x4e2e8
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x2d36c
movq (%rax), %r8
jmp 0x2d373
leaq 0x38(%rsp), %rdi
callq 0x4e2e8
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x2d409
movq (%rax), %r8
jmp 0x2d410
leaq 0x43c85(%rip), %r8      # 0x70ff8
leaq 0x42ff8(%rip), %rdx     # 0x70372
leaq 0x8(%rsp), %rdi
movl $0x2, %esi
movl $0x75, %ecx
callq 0x4a84c
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x481aa
jmp 0x2d43a
leaq 0x40(%rsp), %r14
leaq 0x8(%rsp), %rdi
callq 0x4e2e8
leaq 0x4301c(%rip), %rdx     # 0x703d4
leaq 0x40d47(%rip), %rcx     # 0x6e106
leaq 0x40d46(%rip), %r8      # 0x6e10c
leaq 0x10(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x48021
movq 0x10(%rsp), %r8
leaq 0x42f91(%rip), %rdx     # 0x70372
leaq 0x58(%rsp), %rdi
movl $0x2, %esi
movl $0x7e, %ecx
callq 0x4a84c
leaq 0x58(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x481aa
jmp 0x2d2e8
leaq 0x43be8(%rip), %r8      # 0x70ff8
leaq 0x42f5b(%rip), %rdx     # 0x70372
leaq 0x8(%rsp), %rdi
movl $0x2, %esi
movl $0x76, %ecx
callq 0x4a84c
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x481aa
leaq 0x8(%rsp), %rdi
callq 0x4a8b8
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x2d454
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
je 0x2d468
leaq 0x18(%rsp), %rdi
callq 0x156d0
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x2d485
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0xd530
addq $0x110, %rsp            # imm = 0x110
popq %rbx
popq %r14
popq %r15
retq
leaq 0x38(%rsp), %rdi
callq 0x4e2e8
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x2d4c4
movq (%rax), %r8
jmp 0x2d4cb
leaq 0x38(%rsp), %rdi
callq 0x4e2e8
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x2d4fa
movq (%rax), %r8
jmp 0x2d501
leaq 0x43b2d(%rip), %r8      # 0x70ff8
leaq 0x42ea0(%rip), %rdx     # 0x70372
leaq 0x8(%rsp), %rdi
movl $0x2, %esi
movl $0x7f, %ecx
callq 0x4a84c
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x481aa
jmp 0x2d43a
leaq 0x43af7(%rip), %r8      # 0x70ff8
leaq 0x42e6a(%rip), %rdx     # 0x70372
leaq 0x8(%rsp), %rdi
movl $0x2, %esi
movl $0x80, %ecx
callq 0x4a84c
leaq 0x8(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq 0x481aa
jmp 0x2d43a
movq %rdx, %r14
movq %rax, %rbx
leaq 0xa8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d5a3
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0xd530
jmp 0x2d5a3
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4a8b8
jmp 0x2d56b
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x2d57b
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x38(%rsp)
jmp 0x2d6c0
jmp 0x2d72c
jmp 0x2d6bd
jmp 0x2d73b
jmp 0x2d759
movq %rdx, %r14
movq %rax, %rbx
movq %rbx, %rdi
cmpl $0x3, %r14d
jne 0x2d5bb
callq 0xd200
callq 0xd9e0
jmp 0x2d266
callq 0xd200
cmpl $0x2, %r14d
jne 0x2d660
movq %rax, %rbx
leaq 0x4316b(%rip), %rsi     # 0x7073f
leaq 0x10(%rsp), %rdi
callq 0xd800
movq (%rbx), %rax
movq -0x8(%rax), %rsi
leaq 0x38(%rsp), %rdi
callq 0x21880
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
leaq 0x10(%rsp), %rdi
callq 0xd180
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d61e
movq 0x48(%rsp), %rsi
incq %rsi
callq 0xd530
leaq 0x47ff2(%rip), %rsi     # 0x75617
leaq 0x10(%rsp), %rdi
callq 0xdb40
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0xdb40
leaq 0x4212f(%rip), %rsi     # 0x6f77b
leaq 0x10(%rsp), %rdi
callq 0xdb40
callq 0xd9e0
jmp 0x2d213
leaq 0x43051(%rip), %rsi     # 0x706b8
leaq 0x10(%rsp), %rdi
callq 0xd800
callq 0xd9e0
jmp 0x2d213
movq %rax, %rbx
callq 0xd9e0
jmp 0x2d6c0
jmp 0x2d6bd
movq %rax, %rbx
leaq 0x48(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d6ae
movq 0x48(%rsp), %rsi
incq %rsi
callq 0xd530
jmp 0x2d6ae
jmp 0x2d6ab
jmp 0x2d6bd
movq %rax, %rbx
callq 0xd9e0
jmp 0x2d6c0
movq %rax, %rdi
callq 0x15674
movq %rax, %rbx
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0x2d814
movq 0x20(%rsp), %rsi
jmp 0x2d807
jmp 0x2d72c
jmp 0x2d73b
jmp 0x2d759
jmp 0x2d7e1
jmp 0x2d77d
jmp 0x2d78c
jmp 0x2d7ac
jmp 0x2d7ca
jmp 0x2d7e1
jmp 0x2d72c
jmp 0x2d73b
movq %rax, %rbx
leaq 0xd0(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d814
movq 0xd0(%rsp), %rsi
jmp 0x2d807
jmp 0x2d759
jmp 0x2d811
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x4a8b8
jmp 0x2d73e
movq %rax, %rbx
movq 0x38(%rsp), %rdi
testq %rdi, %rdi
je 0x2d74e
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x38(%rsp)
jmp 0x2d75c
movq %rax, %rbx
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
je 0x2d770
leaq 0x18(%rsp), %rdi
callq 0x156d0
movq $0x0, 0x18(%rsp)
jmp 0x2d7e4
jmp 0x2d7e1
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x4a8b8
jmp 0x2d78f
movq %rax, %rbx
leaq 0x20(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d7af
movq 0x20(%rsp), %rsi
incq %rsi
callq 0xd530
jmp 0x2d7af
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x2d7bf
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x8(%rsp)
jmp 0x2d7cd
movq %rax, %rbx
movq 0x40(%rsp), %rsi
testq %rsi, %rsi
je 0x2d7e4
movq %r14, %rdi
callq 0x156d0
jmp 0x2d7e4
movq %rax, %rbx
movb $0x0, 0x6(%rsp)
jmp 0x2d814
movq %rax, %rbx
leaq 0xf8(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2d814
movq 0xf8(%rsp), %rsi
incq %rsi
callq 0xd530
jmp 0x2d814
movq %rax, %rbx
movq 0x80(%rsp), %rdi
testq %rdi, %rdi
je 0x2d831
movq 0x90(%rsp), %rsi
subq %rdi, %rsi
callq 0xd530
movq %rbx, %rdi
callq 0xda70