// File: /workspace/github_cpp_makefile_star2_O2/halfflat[P]tinyopt/test/test_state.cc
// Function: state_match_short_Test::TestBody()
TEST(state, match_short) {
    to::key k("key", to::key::shortfmt);

    {
        mockargs M("key\0value\0rest\0");
        to::state s(M.argc, M.argv);

        auto mmr = s.match_option(k);
        ASSERT_TRUE(mmr);
        EXPECT_EQ("value"s, mmr->argument);
        EXPECT_EQ(2u, mmr->shift);
        EXPECT_EQ(0u, mmr->offset);

        s.consume(*mmr);
        EXPECT_EQ("rest"s, M.argv[0]);
    }

    {
        mockargs M("key\0value\0rest\0");
        to::state s(M.argc, M.argv);

        auto mmr = s.match_flag(k);
        ASSERT_TRUE(mmr);
        EXPECT_EQ(nullptr, mmr->argument);
        EXPECT_EQ(1u, mmr->shift);
        EXPECT_EQ(0u, mmr->offset);

        s.consume(*mmr);
        EXPECT_EQ("value"s, M.argv[0]);
    }

    {
        mockargs M("key=value\0rest\0");
        to::state s(M.argc, M.argv);

        auto mmr = s.match_option(k);
        ASSERT_FALSE(mmr);
    }

    {
        mockargs M("key=value\0rest\0");
        to::state s(M.argc, M.argv);

        auto mmr = s.match_option(k);
        ASSERT_FALSE(mmr);
    }

    {
        mockargs M("keyvalue\0rest\0");
        to::state s(M.argc, M.argv);

        auto mmr = s.match_option(k);
        ASSERT_FALSE(mmr);
    }
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xe8, %rsp
leaq 0x3536a(%rip), %rsi     # 0x572cd
leaq 0xc8(%rsp), %rbx
leaq 0x60(%rsp), %rdx
movq %rbx, %rdi
callq 0x1337a
leaq 0x98(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq (%rbx), %rdx
leaq 0xd8(%rsp), %rax
cmpq %rax, %rdx
je 0x21fae
movq %rdx, 0x88(%rsp)
movq 0xd8(%rsp), %rcx
movq %rcx, 0x98(%rsp)
jmp 0x21fb4
movups (%rax), %xmm0
movups %xmm0, (%rcx)
leaq 0xc8(%rsp), %rdi
movq 0x8(%rdi), %rcx
movq %rcx, 0x90(%rsp)
movq %rax, (%rdi)
andq $0x0, 0x8(%rdi)
movb $0x0, 0x10(%rdi)
andl $0x0, 0xa8(%rsp)
callq 0xdbe8
leaq 0x36260(%rip), %rsi     # 0x58248
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0x2488e
movq 0x68(%rsp), %rax
leaq 0xb0(%rsp), %rsi
movq %rbx, (%rsi)
movq %rax, 0x8(%rsi)
andl $0x0, 0x10(%rsi)
leaq 0x48(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x24998
movb 0x48(%rsp), %al
leaq 0x18(%rsp), %r14
movb %al, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
je 0x220a3
movq %r14, %rdi
callq 0x13646
leaq 0x36085(%rip), %rsi     # 0x580c8
leaq 0x28(%rsp), %rdi
pushq $0x5
popq %rdx
callq 0x1cc63
leaq 0x50(%rsp), %rbx
leaq 0x35ff4(%rip), %rsi     # 0x58050
leaq 0x35ff6(%rip), %rdx     # 0x58059
leaq 0x10(%rsp), %rdi
leaq 0x28(%rsp), %rcx
movq %rbx, %r8
callq 0x25225
leaq 0x28(%rsp), %rdi
callq 0xdbe8
cmpb $0x0, 0x10(%rsp)
jne 0x2214c
leaq 0x28(%rsp), %rdi
callq 0x3d5f6
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x22103
movq (%rax), %r8
jmp 0x2210a
leaq 0x8(%rsp), %rdi
callq 0x3d5f6
leaq 0x35f98(%rip), %rdx     # 0x5804c
leaq 0x34054(%rip), %rcx     # 0x5610f
leaq 0x34053(%rip), %r8      # 0x56115
leaq 0x28(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x399e5
movq 0x28(%rsp), %r8
leaq 0x35e97(%rip), %rdx     # 0x57f74
leaq 0x20(%rsp), %rdi
pushq $0x2
popq %rsi
movl $0x96, %ecx
callq 0x3b5b6
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x39b08
jmp 0x228f8
leaq 0x36f60(%rip), %r8      # 0x5906a
leaq 0x35e63(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
movl $0x97, %ecx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x2214c
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x18(%rsp), %r14
movq %r14, %rdi
callq 0x13646
movl $0x2, -0x8(%r14)
leaq 0x58(%rsp), %r8
leaq 0x35469(%rip), %rsi     # 0x575d6
leaq 0x35ef3(%rip), %rdx     # 0x58067
leaq 0x28(%rsp), %rdi
leaq 0x10(%rsp), %rcx
callq 0x25308
cmpb $0x0, 0x28(%rsp)
jne 0x221ec
leaq 0x10(%rsp), %rdi
callq 0x3d5f6
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x221a3
movq (%rax), %r8
jmp 0x221aa
leaq 0x36ec0(%rip), %r8      # 0x5906a
leaq 0x35dc3(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
movl $0x98, %ecx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x221ec
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x30(%rsp), %rdi
callq 0x13646
leaq 0x10(%rsp), %rcx
andl $0x0, (%rcx)
leaq 0x5c(%rsp), %r8
leaq 0x353b2(%rip), %rsi     # 0x575bc
leaq 0x35e61(%rip), %rdx     # 0x58072
leaq 0x28(%rsp), %rdi
callq 0x25308
cmpb $0x0, 0x28(%rsp)
jne 0x22284
leaq 0x10(%rsp), %rdi
callq 0x3d5f6
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x2223b
movq (%rax), %r8
jmp 0x22242
leaq 0x36e28(%rip), %r8      # 0x5906a
leaq 0x35d2b(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
movl $0x99, %ecx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x22284
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x30(%rsp), %rdi
callq 0x13646
leaq 0xb0(%rsp), %rdi
movq %rbx, %rsi
callq 0x24976
leaq 0x35de1(%rip), %rsi     # 0x58086
leaq 0x28(%rsp), %rdi
pushq $0x4
popq %rdx
callq 0x1cc63
movq 0x68(%rsp), %r8
leaq 0x35dc0(%rip), %rsi     # 0x5807e
leaq 0x35d19(%rip), %rdx     # 0x57fde
leaq 0x10(%rsp), %rdi
leaq 0x28(%rsp), %rcx
callq 0x253bd
leaq 0x28(%rsp), %rdi
callq 0xdbe8
cmpb $0x0, 0x10(%rsp)
jne 0x22347
leaq 0x28(%rsp), %rdi
callq 0x3d5f6
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x222fe
movq (%rax), %r8
jmp 0x22305
leaq 0x36d65(%rip), %r8      # 0x5906a
leaq 0x35c68(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
movl $0x9c, %ecx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x22347
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x18(%rsp), %rdi
callq 0x13646
leaq 0x70(%rsp), %rdi
callq 0x25080
leaq 0x35ee6(%rip), %rsi     # 0x58248
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0x2488e
movq 0x68(%rsp), %rax
leaq 0xb0(%rsp), %rsi
movq %rbx, (%rsi)
movq %rax, 0x8(%rsi)
andl $0x0, 0x10(%rsi)
leaq 0x48(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x24a92
movb 0x48(%rsp), %al
leaq 0x18(%rsp), %r14
movb %al, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
je 0x223f9
movq %r14, %rdi
callq 0x13646
movq 0x50(%rsp), %r8
leaq 0x35cc9(%rip), %rsi     # 0x5808b
leaq 0x35c90(%rip), %rdx     # 0x58059
leaq 0x28(%rsp), %rdi
xorl %ecx, %ecx
callq 0x24b2c
cmpb $0x0, 0x28(%rsp)
jne 0x224a2
leaq 0x10(%rsp), %rdi
callq 0x3d5f6
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x22459
movq (%rax), %r8
jmp 0x22460
leaq 0x8(%rsp), %rdi
callq 0x3d5f6
leaq 0x35c42(%rip), %rdx     # 0x5804c
leaq 0x33cfe(%rip), %rcx     # 0x5610f
leaq 0x33cfd(%rip), %r8      # 0x56115
leaq 0x28(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x399e5
movq 0x28(%rsp), %r8
leaq 0x35b41(%rip), %rdx     # 0x57f74
leaq 0x20(%rsp), %rdi
pushq $0x2
popq %rsi
movl $0xa4, %ecx
callq 0x3b5b6
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x39b08
jmp 0x228f8
leaq 0x36c0a(%rip), %r8      # 0x5906a
leaq 0x35b0d(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
movl $0xa5, %ecx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x224a2
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x30(%rsp), %rdi
callq 0x13646
leaq 0x10(%rsp), %rcx
movl $0x1, (%rcx)
leaq 0x58(%rsp), %r8
leaq 0x350c9(%rip), %rsi     # 0x5758c
leaq 0x35b9d(%rip), %rdx     # 0x58067
leaq 0x28(%rsp), %rdi
callq 0x25308
cmpb $0x0, 0x28(%rsp)
jne 0x2253d
leaq 0x10(%rsp), %rdi
callq 0x3d5f6
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x224f4
movq (%rax), %r8
jmp 0x224fb
leaq 0x36b6f(%rip), %r8      # 0x5906a
leaq 0x35a72(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
movl $0xa6, %ecx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x2253d
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x30(%rsp), %rdi
callq 0x13646
leaq 0x10(%rsp), %rcx
andl $0x0, (%rcx)
leaq 0x5c(%rsp), %r8
leaq 0x35061(%rip), %rsi     # 0x575bc
leaq 0x35b10(%rip), %rdx     # 0x58072
leaq 0x28(%rsp), %rdi
callq 0x25308
cmpb $0x0, 0x28(%rsp)
jne 0x225d5
leaq 0x10(%rsp), %rdi
callq 0x3d5f6
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x2258c
movq (%rax), %r8
jmp 0x22593
leaq 0x36ad7(%rip), %r8      # 0x5906a
leaq 0x359da(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
movl $0xa7, %ecx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x225d5
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x50(%rsp), %rbx
leaq 0x30(%rsp), %rdi
callq 0x13646
leaq 0xb0(%rsp), %rdi
movq %rbx, %rsi
callq 0x24976
leaq 0x35acd(%rip), %rsi     # 0x580c8
leaq 0x28(%rsp), %rdi
pushq $0x5
popq %rdx
callq 0x1cc63
movq 0x68(%rsp), %r8
leaq 0x35a3c(%rip), %rsi     # 0x58050
leaq 0x359c3(%rip), %rdx     # 0x57fde
leaq 0x10(%rsp), %rdi
leaq 0x28(%rsp), %rcx
callq 0x253bd
leaq 0x28(%rsp), %rdi
callq 0xdbe8
cmpb $0x0, 0x10(%rsp)
jne 0x2269d
leaq 0x28(%rsp), %rdi
callq 0x3d5f6
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x22654
movq (%rax), %r8
jmp 0x2265b
leaq 0x36a0f(%rip), %r8      # 0x5906a
leaq 0x35912(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
movl $0xaa, %ecx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x2269d
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x18(%rsp), %rdi
callq 0x13646
leaq 0x70(%rsp), %rdi
callq 0x25080
leaq 0x35ba0(%rip), %rsi     # 0x58258
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0x2488e
movq 0x68(%rsp), %rax
leaq 0xb0(%rsp), %rsi
movq %rbx, (%rsi)
movq %rax, 0x8(%rsi)
andl $0x0, 0x10(%rsi)
leaq 0x48(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x24998
movb 0x48(%rsp), %al
movl %eax, %ecx
xorb $0x1, %cl
leaq 0x18(%rsp), %r14
movb %cl, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
je 0x22769
leaq 0x8(%rsp), %rdi
callq 0x3d5f6
leaq 0x35932(%rip), %rdx     # 0x5804c
leaq 0x339f4(%rip), %rcx     # 0x56115
leaq 0x339e7(%rip), %r8      # 0x5610f
leaq 0x28(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x399e5
movq 0x28(%rsp), %r8
leaq 0x35831(%rip), %rdx     # 0x57f74
leaq 0x20(%rsp), %rdi
pushq $0x2
popq %rsi
movl $0xb2, %ecx
callq 0x3b5b6
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x39b08
jmp 0x228f8
movq %r14, %rdi
callq 0x13646
leaq 0x70(%rsp), %rdi
callq 0x25080
leaq 0x35ad6(%rip), %rsi     # 0x58258
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0x2488e
movq 0x68(%rsp), %rax
leaq 0xb0(%rsp), %rsi
movq %rbx, (%rsi)
movq %rax, 0x8(%rsi)
andl $0x0, 0x10(%rsi)
leaq 0x48(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x24998
movb 0x48(%rsp), %al
movl %eax, %ecx
xorb $0x1, %cl
leaq 0x18(%rsp), %r14
movb %cl, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
je 0x22833
leaq 0x8(%rsp), %rdi
callq 0x3d5f6
leaq 0x35868(%rip), %rdx     # 0x5804c
leaq 0x3392a(%rip), %rcx     # 0x56115
leaq 0x3391d(%rip), %r8      # 0x5610f
leaq 0x28(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x399e5
movq 0x28(%rsp), %r8
leaq 0x35767(%rip), %rdx     # 0x57f74
leaq 0x20(%rsp), %rdi
pushq $0x2
popq %rsi
movl $0xba, %ecx
callq 0x3b5b6
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x39b08
jmp 0x228f8
movq %r14, %rdi
callq 0x13646
leaq 0x70(%rsp), %rdi
callq 0x25080
leaq 0x35937(%rip), %rsi     # 0x58183
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0x2488e
movq 0x68(%rsp), %rax
leaq 0xb0(%rsp), %rsi
movq %rbx, (%rsi)
movq %rax, 0x8(%rsi)
andl $0x0, 0x10(%rsi)
leaq 0x48(%rsp), %rdi
leaq 0x88(%rsp), %rdx
callq 0x24998
movb 0x48(%rsp), %al
movl %eax, %ecx
xorb $0x1, %cl
leaq 0x18(%rsp), %r14
movb %cl, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
je 0x2291c
leaq 0x8(%rsp), %rdi
callq 0x3d5f6
leaq 0x3579e(%rip), %rdx     # 0x5804c
leaq 0x33860(%rip), %rcx     # 0x56115
leaq 0x33853(%rip), %r8      # 0x5610f
leaq 0x28(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x399e5
movq 0x28(%rsp), %r8
leaq 0x3569d(%rip), %rdx     # 0x57f74
leaq 0x20(%rsp), %rdi
pushq $0x2
popq %rsi
movl $0xc2, %ecx
callq 0x3b5b6
leaq 0x20(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x39b08
leaq 0x20(%rsp), %rdi
callq 0x3b616
leaq 0x28(%rsp), %rdi
callq 0xdbe8
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x2291c
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
callq 0x13646
leaq 0x70(%rsp), %rdi
callq 0x25080
leaq 0x88(%rsp), %rdi
callq 0xdbe8
addq $0xe8, %rsp
popq %rbx
popq %r14
retq
jmp 0x22a65
jmp 0x22a74
jmp 0x22a83
jmp 0x22aa7
jmp 0x22a65
jmp 0x22a74
jmp 0x22ab6
jmp 0x22a83
jmp 0x22ad8
jmp 0x22aa7
jmp 0x22a65
jmp 0x22a74
jmp 0x22ab6
jmp 0x22a83
jmp 0x22ad8
jmp 0x22aa7
jmp 0x22a2b
jmp 0x22a3a
jmp 0x22a4f
jmp 0x229fa
jmp 0x22a09
jmp 0x22a1e
jmp 0x229fa
jmp 0x22a09
jmp 0x22a1e
jmp 0x229fa
jmp 0x22a09
jmp 0x22a1e
jmp 0x22ab6
jmp 0x22ad8
jmp 0x22a98
jmp 0x22ab6
jmp 0x22ab6
jmp 0x22a65
jmp 0x22ab6
jmp 0x22a74
jmp 0x22a83
jmp 0x22aa7
jmp 0x22ab6
jmp 0x22a2b
jmp 0x22a3a
jmp 0x22a4f
jmp 0x229fa
jmp 0x22a09
jmp 0x22a1e
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3b616
jmp 0x22a0c
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x22a21
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x22a21
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
jmp 0x22aad
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3b616
jmp 0x22a3d
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x22a52
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x22a52
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
jmp 0x22aad
jmp 0x22ab6
jmp 0x22ad8
jmp 0x22a98
jmp 0x22ab6
jmp 0x22ab6
jmp 0x22ab6
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3b616
jmp 0x22a77
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xdbe8
jmp 0x22a86
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x22aaa
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x22aaa
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xdbe8
jmp 0x22ab9
movq %rax, %rbx
movq %r14, %rdi
callq 0x13646
jmp 0x22ab9
jmp 0x22ab6
movq %rax, %rbx
leaq 0x70(%rsp), %rdi
callq 0x25080
leaq 0x88(%rsp), %rdi
callq 0xdbe8
movq %rbx, %rdi
callq 0xdaa0
movq %rax, %rbx
jmp 0x22ac3
nop