// File: /workspace/github_cpp_makefile_star2_O2/halfflat[P]tinyopt/test/test_parse.cc
// Function: parse_flag_Test::TestBody()
TEST(parse, flag) {
    {
        mockargs M("-s\0end\0");
        char** arg = M.argv;

        auto r = to::parse(arg, "-s", "--long");
        ASSERT_TRUE(r);
        ASSERT_EQ(M.argv+1, arg);
    }

    {
        mockargs M("--s\0end\0");
        char** arg = M.argv;
        auto r = to::parse(arg, "-s", "--long");

        ASSERT_FALSE(r);
        ASSERT_EQ(M.argv, arg);
    }

    {
        mockargs M("--long\0end\0");
        char** arg = M.argv;
        auto r = to::parse(arg, "-s", "--long");

        ASSERT_TRUE(r);
        ASSERT_EQ(M.argv+1, arg);
    }

    {
        mockargs M("-long\0end\0");
        char** arg = M.argv;
        auto r = to::parse(arg, "-s", "--long");

        ASSERT_FALSE(r);
        ASSERT_EQ(M.argv, arg);
    }

    {
        mockargs M("--xyz\0end\0");
        char** arg = M.argv;
        auto r = to::parse(arg, "-s", "--long");

        ASSERT_FALSE(r);
        ASSERT_EQ(M.argv, arg);
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
leaq 0x331ef(%rip), %rsi     # 0x588ac
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0x2488e
movq 0x8(%rbx), %rax
movq %rax, 0x30(%rsp)
leaq 0x32d5b(%rip), %rsi     # 0x58435
leaq 0x120(%rsp), %rdi
callq 0x1c660
leaq 0x31c32(%rip), %rcx     # 0x57320
leaq 0xf(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x120(%rsp), %rdx
callq 0x2742f
leaq 0x120(%rsp), %rdi
callq 0xdbe8
movb 0xf(%rsp), %al
leaq 0x28(%rsp), %r14
movb %al, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
je 0x25855
movq %r14, %rdi
callq 0x13646
movq 0x60(%rsp), %rax
addq $0x8, %rax
leaq 0x20(%rsp), %rcx
movq %rax, (%rcx)
leaq 0x32ced(%rip), %rsi     # 0x58438
leaq 0x31c9c(%rip), %rdx     # 0x573ee
leaq 0x38(%rsp), %rdi
leaq 0x30(%rsp), %r8
callq 0x276d1
cmpb $0x0, 0x38(%rsp)
je 0x258da
leaq 0x40(%rsp), %rdi
callq 0x13646
leaq 0x68(%rsp), %rdi
callq 0x25080
leaq 0x3313d(%rip), %rsi     # 0x588c4
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0x2488e
movq 0x8(%rbx), %rax
movq %rax, 0x30(%rsp)
leaq 0x32c91(%rip), %rsi     # 0x58435
leaq 0xf8(%rsp), %rdi
callq 0x1c660
leaq 0x31b68(%rip), %rcx     # 0x57320
leaq 0xf(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0xf8(%rsp), %rdx
callq 0x2742f
leaq 0xf8(%rsp), %rdi
callq 0xdbe8
movb 0xf(%rsp), %al
movl %eax, %ecx
xorb $0x1, %cl
leaq 0x28(%rsp), %r14
movb %cl, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
je 0x258fa
leaq 0x10(%rsp), %rdi
callq 0x3d5f6
leaq 0x32c3e(%rip), %rdx     # 0x58449
leaq 0x30903(%rip), %rcx     # 0x56115
leaq 0x308f6(%rip), %r8      # 0x5610f
leaq 0x38(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x399e5
movq 0x38(%rsp), %r8
leaq 0x32bb3(%rip), %rdx     # 0x583e7
leaq 0x18(%rsp), %rdi
pushq $0x2
popq %rsi
pushq $0x1b
popq %rcx
callq 0x3b5b6
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x39b08
jmp 0x258ae
leaq 0x10(%rsp), %rdi
callq 0x3d5f6
leaq 0x32be3(%rip), %rdx     # 0x58449
leaq 0x308a2(%rip), %rcx     # 0x5610f
leaq 0x308a1(%rip), %r8      # 0x56115
leaq 0x38(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x399e5
movq 0x38(%rsp), %r8
leaq 0x32b58(%rip), %rdx     # 0x583e7
leaq 0x18(%rsp), %rdi
pushq $0x2
popq %rsi
pushq $0x12
popq %rcx
callq 0x3b5b6
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x39b08
leaq 0x18(%rsp), %rdi
callq 0x3b616
leaq 0x38(%rsp), %rdi
callq 0xdbe8
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x258d2
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
jmp 0x25b37
leaq 0x20(%rsp), %rdi
callq 0x3d5f6
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0x25ae8
movq (%rax), %r8
jmp 0x25aef
leaq 0x60(%rsp), %rbx
movq %r14, %rdi
callq 0x13646
leaq 0x32b33(%rip), %rsi     # 0x58441
leaq 0x31ad9(%rip), %rdx     # 0x573ee
leaq 0x38(%rsp), %rdi
leaq 0x30(%rsp), %r8
movq %rbx, %rcx
callq 0x276d1
cmpb $0x0, 0x38(%rsp)
je 0x25b51
leaq 0x40(%rsp), %rdi
callq 0x13646
leaq 0x68(%rsp), %rdi
callq 0x25080
leaq 0x32f80(%rip), %rsi     # 0x588cd
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0x2488e
movq 0x8(%rbx), %rax
movq %rax, 0x30(%rsp)
leaq 0x32acb(%rip), %rsi     # 0x58435
leaq 0xd0(%rsp), %rdi
callq 0x1c660
leaq 0x319a2(%rip), %rcx     # 0x57320
leaq 0xf(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0xd0(%rsp), %rdx
callq 0x2742f
leaq 0xd0(%rsp), %rdi
callq 0xdbe8
movb 0xf(%rsp), %al
leaq 0x28(%rsp), %r14
movb %al, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
je 0x25b6a
movq %r14, %rdi
callq 0x13646
movq 0x60(%rsp), %rax
addq $0x8, %rax
leaq 0x20(%rsp), %rcx
movq %rax, (%rcx)
leaq 0x32a5d(%rip), %rsi     # 0x58438
leaq 0x31a0c(%rip), %rdx     # 0x573ee
leaq 0x38(%rsp), %rdi
leaq 0x30(%rsp), %r8
callq 0x276d1
cmpb $0x0, 0x38(%rsp)
je 0x25bfa
leaq 0x40(%rsp), %rdi
callq 0x13646
leaq 0x68(%rsp), %rdi
callq 0x25080
leaq 0x32ec2(%rip), %rsi     # 0x588d9
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0x2488e
movq 0x8(%rbx), %rax
movq %rax, 0x30(%rsp)
leaq 0x32a01(%rip), %rsi     # 0x58435
leaq 0xa8(%rsp), %rdi
callq 0x1c660
leaq 0x318d8(%rip), %rcx     # 0x57320
leaq 0xf(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0xa8(%rsp), %rdx
callq 0x2742f
leaq 0xa8(%rsp), %rdi
callq 0xdbe8
movb 0xf(%rsp), %al
movl %eax, %ecx
xorb $0x1, %cl
leaq 0x28(%rsp), %r14
movb %cl, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
je 0x25c1a
leaq 0x10(%rsp), %rdi
callq 0x3d5f6
leaq 0x329ae(%rip), %rdx     # 0x58449
leaq 0x30673(%rip), %rcx     # 0x56115
leaq 0x30666(%rip), %r8      # 0x5610f
leaq 0x38(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x399e5
movq 0x38(%rsp), %r8
leaq 0x32923(%rip), %rdx     # 0x583e7
leaq 0x18(%rsp), %rdi
pushq $0x2
popq %rsi
pushq $0x2d
popq %rcx
callq 0x3b5b6
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x39b08
jmp 0x258ae
leaq 0x3357b(%rip), %r8      # 0x5906a
leaq 0x328f1(%rip), %rdx     # 0x583e7
leaq 0x10(%rsp), %rdi
pushq $0x2
popq %rsi
pushq $0x13
popq %rcx
callq 0x3b5b6
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x39b08
leaq 0x40(%rsp), %rbx
leaq 0x10(%rsp), %rdi
callq 0x3b616
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x25b34
movq (%rdi), %rax
callq *0x8(%rax)
movq %rbx, %rdi
callq 0x13646
leaq 0x68(%rsp), %rdi
callq 0x25080
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r14
retq
leaq 0x20(%rsp), %rdi
callq 0x3d5f6
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0x25bc8
movq (%rax), %r8
jmp 0x25bcf
leaq 0x10(%rsp), %rdi
callq 0x3d5f6
leaq 0x328ce(%rip), %rdx     # 0x58449
leaq 0x3058d(%rip), %rcx     # 0x5610f
leaq 0x3058c(%rip), %r8      # 0x56115
leaq 0x38(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x399e5
movq 0x38(%rsp), %r8
leaq 0x32843(%rip), %rdx     # 0x583e7
leaq 0x18(%rsp), %rdi
pushq $0x2
popq %rsi
pushq $0x24
popq %rcx
callq 0x3b5b6
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x39b08
jmp 0x258ae
leaq 0x3349b(%rip), %r8      # 0x5906a
leaq 0x32811(%rip), %rdx     # 0x583e7
leaq 0x10(%rsp), %rdi
pushq $0x2
popq %rsi
pushq $0x1c
popq %rcx
callq 0x3b5b6
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x39b08
jmp 0x25b15
leaq 0x20(%rsp), %rdi
callq 0x3d5f6
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0x25d3e
movq (%rax), %r8
jmp 0x25d45
leaq 0x60(%rsp), %rbx
movq %r14, %rdi
callq 0x13646
leaq 0x32813(%rip), %rsi     # 0x58441
leaq 0x317b9(%rip), %rdx     # 0x573ee
leaq 0x38(%rsp), %rdi
leaq 0x30(%rsp), %r8
movq %rbx, %rcx
callq 0x276d1
cmpb $0x0, 0x38(%rsp)
je 0x25d70
leaq 0x40(%rsp), %rdi
callq 0x13646
leaq 0x68(%rsp), %rdi
callq 0x25080
leaq 0x32c77(%rip), %rsi     # 0x588e4
leaq 0x58(%rsp), %rbx
movq %rbx, %rdi
callq 0x2488e
movq 0x8(%rbx), %rax
movq %rax, 0x30(%rsp)
leaq 0x327ab(%rip), %rsi     # 0x58435
leaq 0x80(%rsp), %rdi
callq 0x1c660
leaq 0x31682(%rip), %rcx     # 0x57320
leaq 0xf(%rsp), %rdi
leaq 0x30(%rsp), %rsi
leaq 0x80(%rsp), %rdx
callq 0x2742f
leaq 0x80(%rsp), %rdi
callq 0xdbe8
movb 0xf(%rsp), %al
movl %eax, %ecx
xorb $0x1, %cl
leaq 0x28(%rsp), %r14
movb %cl, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
je 0x25d89
leaq 0x10(%rsp), %rdi
callq 0x3d5f6
leaq 0x32758(%rip), %rdx     # 0x58449
leaq 0x3041d(%rip), %rcx     # 0x56115
leaq 0x30410(%rip), %r8      # 0x5610f
leaq 0x38(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x399e5
movq 0x38(%rsp), %r8
leaq 0x326cd(%rip), %rdx     # 0x583e7
leaq 0x18(%rsp), %rdi
pushq $0x2
popq %rsi
pushq $0x36
popq %rcx
callq 0x3b5b6
leaq 0x18(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x39b08
jmp 0x258ae
leaq 0x33325(%rip), %r8      # 0x5906a
leaq 0x3269b(%rip), %rdx     # 0x583e7
leaq 0x10(%rsp), %rdi
pushq $0x2
popq %rsi
pushq $0x25
popq %rcx
callq 0x3b5b6
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x39b08
jmp 0x25b15
leaq 0x20(%rsp), %rdi
callq 0x3d5f6
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0x25dda
movq (%rax), %r8
jmp 0x25de1
leaq 0x60(%rsp), %rbx
movq %r14, %rdi
callq 0x13646
leaq 0x326a4(%rip), %rsi     # 0x58441
leaq 0x3164a(%rip), %rdx     # 0x573ee
leaq 0x38(%rsp), %rdi
leaq 0x30(%rsp), %r8
movq %rbx, %rcx
callq 0x276d1
cmpb $0x0, 0x38(%rsp)
jne 0x25e53
leaq 0x20(%rsp), %rdi
callq 0x3d5f6
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0x25e0c
movq (%rax), %r8
jmp 0x25e13
leaq 0x33289(%rip), %r8      # 0x5906a
leaq 0x325ff(%rip), %rdx     # 0x583e7
leaq 0x10(%rsp), %rdi
pushq $0x2
popq %rsi
pushq $0x2e
popq %rcx
callq 0x3b5b6
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x39b08
jmp 0x25b15
leaq 0x33257(%rip), %r8      # 0x5906a
leaq 0x325cd(%rip), %rdx     # 0x583e7
leaq 0x10(%rsp), %rdi
pushq $0x2
popq %rsi
pushq $0x37
popq %rcx
callq 0x3b5b6
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x39b08
leaq 0x10(%rsp), %rdi
callq 0x3b616
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x25e53
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x40(%rsp), %rdi
jmp 0x25b37
jmp 0x25f1b
jmp 0x25f2a
jmp 0x25f4c
jmp 0x25f58
jmp 0x25f67
jmp 0x25f76
jmp 0x25fac
jmp 0x25f8b
jmp 0x25f1b
jmp 0x25f2a
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
jmp 0x25fa5
jmp 0x25f4c
jmp 0x25fac
jmp 0x25f58
jmp 0x25f67
jmp 0x25f76
jmp 0x25fac
jmp 0x25f8b
jmp 0x25f1b
jmp 0x25f2a
movq %rax, %rbx
leaq 0xa8(%rsp), %rdi
jmp 0x25fa5
jmp 0x25f4c
jmp 0x25fac
jmp 0x25f58
jmp 0x25f67
jmp 0x25f76
jmp 0x25f8b
jmp 0x25fac
jmp 0x25f1b
jmp 0x25f2a
movq %rax, %rbx
leaq 0xd0(%rsp), %rdi
jmp 0x25fa5
jmp 0x25f4c
jmp 0x25fac
jmp 0x25f58
jmp 0x25f67
jmp 0x25f76
jmp 0x25fac
jmp 0x25f8b
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3b616
jmp 0x25f2d
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x25f4f
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x25f4f
movq %rax, %rbx
leaq 0xf8(%rsp), %rdi
jmp 0x25fa5
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
jmp 0x25f91
jmp 0x25fac
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3b616
jmp 0x25f6a
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0xdbe8
jmp 0x25f79
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x25f8e
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x25f8e
movq %rax, %rbx
movq %r14, %rdi
callq 0x13646
jmp 0x25faf
jmp 0x25fac
movq %rax, %rbx
leaq 0x120(%rsp), %rdi
callq 0xdbe8
jmp 0x25faf
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0x25080
movq %rbx, %rdi
callq 0xdaa0
nop