// File: halfflat[P]tinyopt/test/test_parsers.cc
// Function: tinyopt_delimited_custom_Test::TestBody()
TEST(tinyopt, delimited_custom) {
    using ivector = std::vector<int>;

    std::pair<const char*, int> kw[] = {
        { "one", 1 }, { "two", 2}
    };

    auto kw_parser = to::keywords(kw);
    auto delim_parser = to::delimited(',', kw_parser);

    auto p1 = delim_parser("one,one,two");
    ASSERT_TRUE(p1);
    EXPECT_EQ((ivector{1, 1, 2}),*p1);

    auto p2 = delim_parser("");
    ASSERT_TRUE(p2);
    EXPECT_EQ((ivector{}),*p2);

    EXPECT_FALSE(delim_parser("one, one,two"));
    EXPECT_FALSE(delim_parser("one,three"));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x320, %rsp            # imm = 0x320
movq %rdi, -0x8(%rbp)
leaq 0x71bd7(%rip), %rax     # 0xcadbd
movq %rax, -0x38(%rbp)
movl $0x1, -0x3c(%rbp)
leaq -0x30(%rbp), %rdi
movq %rdi, -0x2d0(%rbp)
leaq -0x38(%rbp), %rsi
leaq -0x3c(%rbp), %rdx
callq 0x59f90
leaq -0x20(%rbp), %rdi
leaq 0x71cf1(%rip), %rax     # 0xcaf05
movq %rax, -0x48(%rbp)
movl $0x2, -0x4c(%rbp)
leaq -0x48(%rbp), %rsi
leaq -0x4c(%rbp), %rdx
callq 0x59f90
movq -0x2d0(%rbp), %rsi
leaq -0x68(%rbp), %rdi
movq %rdi, -0x2c8(%rbp)
callq 0x59fc0
movq -0x2c8(%rbp), %rdx
leaq -0x88(%rbp), %rdi
movl $0x2c, %esi
callq 0x5aaf0
jmp 0x5925d
leaq 0x71c79(%rip), %rdx     # 0xcaedd
leaq -0xb8(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x5ab30
jmp 0x59279
xorl %eax, %eax
movl %eax, %edx
leaq -0xc8(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x5a440
jmp 0x59292
leaq -0xc8(%rbp), %rdi
callq 0x1d4e0
movb %al, -0x2d1(%rbp)
jmp 0x592a6
movb -0x2d1(%rbp), %al
testb $0x1, %al
jne 0x592b2
jmp 0x59313
jmp 0x59421
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x59dd3
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x59dc7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x59dbb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x59523
leaq -0xd0(%rbp), %rdi
callq 0x84210
jmp 0x59321
leaq 0x71a36(%rip), %rdx     # 0xcad5e
leaq 0x6f120(%rip), %rcx     # 0xc844f
leaq 0x6f11f(%rip), %r8      # 0xc8455
leaq -0xf8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
callq 0x7d210
jmp 0x5934b
leaq -0xf8(%rbp), %rdi
callq 0x102c0
movq %rax, %r8
leaq 0x71968(%rip), %rdx     # 0xcacc9
leaq -0xd8(%rbp), %rdi
movl $0x2, %esi
movl $0x78, %ecx
callq 0x80580
jmp 0x59379
leaq -0xd8(%rbp), %rdi
leaq -0xd0(%rbp), %rsi
callq 0x7d370
jmp 0x5938e
leaq -0xd8(%rbp), %rdi
callq 0x80600
leaq -0xf8(%rbp), %rdi
callq 0x10fc8
leaq -0xd0(%rbp), %rdi
callq 0x1d500
movl $0x1, -0xfc(%rbp)
jmp 0x5942b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x59410
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x59404
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0xd8(%rbp), %rdi
callq 0x80600
leaq -0xf8(%rbp), %rdi
callq 0x10fc8
leaq -0xd0(%rbp), %rdi
callq 0x1d500
jmp 0x59523
movl $0x0, -0xfc(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x1d520
movl -0xfc(%rbp), %eax
testl %eax, %eax
jne 0x59d79
jmp 0x59447
movl $0x1, -0x144(%rbp)
movl $0x1, -0x140(%rbp)
movl $0x2, -0x13c(%rbp)
leaq -0x144(%rbp), %rax
movq %rax, -0x138(%rbp)
movq $0x3, -0x130(%rbp)
leaq -0x145(%rbp), %rdi
movq %rdi, -0x2e0(%rbp)
callq 0x5a4d0
movq -0x2e0(%rbp), %rcx
movq -0x138(%rbp), %rsi
movq -0x130(%rbp), %rdx
leaq -0x128(%rbp), %rdi
callq 0x5a4f0
jmp 0x594b4
leaq -0xb8(%rbp), %rdi
callq 0x5a570
movq %rax, %r8
leaq 0x71a1f(%rip), %rsi     # 0xcaee9
leaq 0x7188c(%rip), %rdx     # 0xcad5d
leaq -0x110(%rbp), %rdi
leaq -0x128(%rbp), %rcx
callq 0x5a480
jmp 0x594e6
leaq -0x128(%rbp), %rdi
callq 0x5a590
leaq -0x145(%rbp), %rdi
callq 0x5a5f0
leaq -0x110(%rbp), %rdi
callq 0x1d4e0
movb %al, -0x2e1(%rbp)
jmp 0x59512
movb -0x2e1(%rbp), %al
testb $0x1, %al
jne 0x5951e
jmp 0x5958e
jmp 0x59646
leaq -0xc8(%rbp), %rdi
callq 0x1d520
jmp 0x59dbb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x59566
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x128(%rbp), %rdi
callq 0x5a590
leaq -0x145(%rbp), %rdi
callq 0x5a5f0
jmp 0x59dbb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x596ac
leaq -0x150(%rbp), %rdi
callq 0x84210
jmp 0x5959c
leaq -0x110(%rbp), %rdi
callq 0x1d620
movq %rax, -0x2f0(%rbp)
jmp 0x595b1
movq -0x2f0(%rbp), %r8
leaq 0x7170a(%rip), %rdx     # 0xcacc9
leaq -0x158(%rbp), %rdi
movl $0x1, %esi
movl $0x79, %ecx
callq 0x80580
jmp 0x595d7
leaq -0x158(%rbp), %rdi
leaq -0x150(%rbp), %rsi
callq 0x7d370
jmp 0x595ec
leaq -0x158(%rbp), %rdi
callq 0x80600
leaq -0x150(%rbp), %rdi
callq 0x1d500
jmp 0x59646
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x59638
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x158(%rbp), %rdi
callq 0x80600
leaq -0x150(%rbp), %rdi
callq 0x1d500
jmp 0x596ac
leaq -0x110(%rbp), %rdi
callq 0x1d520
leaq 0x71cae(%rip), %rdx     # 0xcb307
leaq -0x178(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x5ab30
jmp 0x5966e
xorl %eax, %eax
movl %eax, %edx
leaq -0x188(%rbp), %rdi
leaq -0x178(%rbp), %rsi
callq 0x5a440
jmp 0x59687
leaq -0x188(%rbp), %rdi
callq 0x1d4e0
movb %al, -0x2f1(%rbp)
jmp 0x5969b
movb -0x2f1(%rbp), %al
testb $0x1, %al
jne 0x596a7
jmp 0x596eb
jmp 0x597f9
leaq -0x110(%rbp), %rdi
callq 0x1d520
jmp 0x59dbb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x59daf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x598aa
leaq -0x190(%rbp), %rdi
callq 0x84210
jmp 0x596f9
leaq 0x7169e(%rip), %rdx     # 0xcad9e
leaq 0x6ed48(%rip), %rcx     # 0xc844f
leaq 0x6ed47(%rip), %r8      # 0xc8455
leaq -0x1b8(%rbp), %rdi
leaq -0x188(%rbp), %rsi
callq 0x7d210
jmp 0x59723
leaq -0x1b8(%rbp), %rdi
callq 0x102c0
movq %rax, %r8
leaq 0x71590(%rip), %rdx     # 0xcacc9
leaq -0x198(%rbp), %rdi
movl $0x2, %esi
movl $0x7c, %ecx
callq 0x80580
jmp 0x59751
leaq -0x198(%rbp), %rdi
leaq -0x190(%rbp), %rsi
callq 0x7d370
jmp 0x59766
leaq -0x198(%rbp), %rdi
callq 0x80600
leaq -0x1b8(%rbp), %rdi
callq 0x10fc8
leaq -0x190(%rbp), %rdi
callq 0x1d500
movl $0x1, -0xfc(%rbp)
jmp 0x59803
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x597e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x597dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x80600
leaq -0x1b8(%rbp), %rdi
callq 0x10fc8
leaq -0x190(%rbp), %rdi
callq 0x1d500
jmp 0x598aa
movl $0x0, -0xfc(%rbp)
leaq -0x188(%rbp), %rdi
callq 0x1d520
movl -0xfc(%rbp), %eax
testl %eax, %eax
jne 0x59d6d
jmp 0x5981f
xorps %xmm0, %xmm0
movaps %xmm0, -0x1e0(%rbp)
movq $0x0, -0x1d0(%rbp)
leaq -0x1e0(%rbp), %rdi
movq %rdi, -0x300(%rbp)
callq 0x5a610
leaq -0x178(%rbp), %rdi
callq 0x5a570
movq -0x300(%rbp), %rcx
movq %rax, %r8
leaq 0x715ab(%rip), %rsi     # 0xcae0f
leaq 0x71532(%rip), %rdx     # 0xcad9d
leaq -0x1c8(%rbp), %rdi
callq 0x5a480
jmp 0x59879
leaq -0x1e0(%rbp), %rdi
callq 0x5a590
leaq -0x1c8(%rbp), %rdi
callq 0x1d4e0
movb %al, -0x301(%rbp)
jmp 0x59899
movb -0x301(%rbp), %al
testb $0x1, %al
jne 0x598a5
jmp 0x598f5
jmp 0x599b0
leaq -0x188(%rbp), %rdi
callq 0x1d520
jmp 0x59daf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x1e0(%rbp), %rdi
callq 0x5a590
jmp 0x59daf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x59a36
leaq -0x1e8(%rbp), %rdi
callq 0x84210
jmp 0x59903
leaq -0x1c8(%rbp), %rdi
callq 0x1d620
movq %rax, -0x310(%rbp)
jmp 0x59918
movq -0x310(%rbp), %r8
leaq 0x713a3(%rip), %rdx     # 0xcacc9
leaq -0x1f0(%rbp), %rdi
movl $0x1, %esi
movl $0x7d, %ecx
callq 0x80580
jmp 0x5993e
leaq -0x1f0(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x7d370
jmp 0x59953
leaq -0x1f0(%rbp), %rdi
callq 0x80600
leaq -0x1e8(%rbp), %rdi
callq 0x1d500
jmp 0x599b0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x5999f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x1f0(%rbp), %rdi
callq 0x80600
leaq -0x1e8(%rbp), %rdi
callq 0x1d500
jmp 0x59a36
leaq -0x1c8(%rbp), %rdi
callq 0x1d520
leaq 0x71539(%rip), %rdx     # 0xcaefc
leaq -0x228(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x5ab30
jmp 0x599d8
leaq -0x228(%rbp), %rdi
callq 0x5a630
xorb $0x1, %al
movb %al, -0x201(%rbp)
xorl %eax, %eax
movl %eax, %edx
leaq -0x200(%rbp), %rdi
leaq -0x201(%rbp), %rsi
callq 0x1d4a0
jmp 0x59a05
leaq -0x228(%rbp), %rdi
callq 0x5a650
leaq -0x200(%rbp), %rdi
callq 0x1d4e0
movb %al, -0x311(%rbp)
jmp 0x59a25
movb -0x311(%rbp), %al
testb $0x1, %al
jne 0x59a31
jmp 0x59a81
jmp 0x59b85
leaq -0x1c8(%rbp), %rdi
callq 0x1d520
jmp 0x59daf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x228(%rbp), %rdi
callq 0x5a650
jmp 0x59daf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x59c0b
leaq -0x230(%rbp), %rdi
callq 0x84210
jmp 0x59a8f
leaq 0x71473(%rip), %rdx     # 0xcaf09
leaq 0x6e9b8(%rip), %rcx     # 0xc8455
leaq 0x6e9ab(%rip), %r8      # 0xc844f
leaq -0x258(%rbp), %rdi
leaq -0x200(%rbp), %rsi
callq 0x7d210
jmp 0x59ab9
leaq -0x258(%rbp), %rdi
callq 0x102c0
movq %rax, %r8
leaq 0x711fa(%rip), %rdx     # 0xcacc9
leaq -0x238(%rbp), %rdi
movl $0x1, %esi
movl $0x7f, %ecx
callq 0x80580
jmp 0x59ae7
leaq -0x238(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x7d370
jmp 0x59afc
leaq -0x238(%rbp), %rdi
callq 0x80600
leaq -0x258(%rbp), %rdi
callq 0x10fc8
leaq -0x230(%rbp), %rdi
callq 0x1d500
jmp 0x59b85
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x59b74
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x59b68
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x80600
leaq -0x258(%rbp), %rdi
callq 0x10fc8
leaq -0x230(%rbp), %rdi
callq 0x1d500
jmp 0x59c0b
leaq -0x200(%rbp), %rdi
callq 0x1d520
leaq 0x7138e(%rip), %rdx     # 0xcaf26
leaq -0x290(%rbp), %rdi
leaq -0x88(%rbp), %rsi
callq 0x5ab30
jmp 0x59bad
leaq -0x290(%rbp), %rdi
callq 0x5a630
xorb $0x1, %al
movb %al, -0x269(%rbp)
xorl %eax, %eax
movl %eax, %edx
leaq -0x268(%rbp), %rdi
leaq -0x269(%rbp), %rsi
callq 0x1d4a0
jmp 0x59bda
leaq -0x290(%rbp), %rdi
callq 0x5a650
leaq -0x268(%rbp), %rdi
callq 0x1d4e0
movb %al, -0x312(%rbp)
jmp 0x59bfa
movb -0x312(%rbp), %al
testb $0x1, %al
jne 0x59c06
jmp 0x59c56
jmp 0x59d57
leaq -0x200(%rbp), %rdi
callq 0x1d520
jmp 0x59daf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x290(%rbp), %rdi
callq 0x5a650
jmp 0x59daf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x59da3
leaq -0x298(%rbp), %rdi
callq 0x84210
jmp 0x59c64
leaq 0x712c5(%rip), %rdx     # 0xcaf30
leaq 0x6e7e3(%rip), %rcx     # 0xc8455
leaq 0x6e7d6(%rip), %r8      # 0xc844f
leaq -0x2c0(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x7d210
jmp 0x59c8e
leaq -0x2c0(%rbp), %rdi
callq 0x102c0
movq %rax, %r8
leaq 0x71025(%rip), %rdx     # 0xcacc9
leaq -0x2a0(%rbp), %rdi
movl $0x1, %esi
movl $0x80, %ecx
callq 0x80580
jmp 0x59cbc
leaq -0x2a0(%rbp), %rdi
leaq -0x298(%rbp), %rsi
callq 0x7d370
jmp 0x59cd1
leaq -0x2a0(%rbp), %rdi
callq 0x80600
leaq -0x2c0(%rbp), %rdi
callq 0x10fc8
leaq -0x298(%rbp), %rdi
callq 0x1d500
jmp 0x59d57
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x59d49
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
jmp 0x59d3d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x90(%rbp)
movl %eax, -0x94(%rbp)
leaq -0x2a0(%rbp), %rdi
callq 0x80600
leaq -0x2c0(%rbp), %rdi
callq 0x10fc8
leaq -0x298(%rbp), %rdi
callq 0x1d500
jmp 0x59da3
leaq -0x268(%rbp), %rdi
callq 0x1d520
movl $0x0, -0xfc(%rbp)
leaq -0x178(%rbp), %rdi
callq 0x5a650
leaq -0xb8(%rbp), %rdi
callq 0x5a650
leaq -0x88(%rbp), %rdi
callq 0x5ae20
leaq -0x68(%rbp), %rdi
callq 0x5a0c0
addq $0x320, %rsp            # imm = 0x320
popq %rbp
retq
leaq -0x268(%rbp), %rdi
callq 0x1d520
leaq -0x178(%rbp), %rdi
callq 0x5a650
leaq -0xb8(%rbp), %rdi
callq 0x5a650
leaq -0x88(%rbp), %rdi
callq 0x5ae20
leaq -0x68(%rbp), %rdi
callq 0x5a0c0
movq -0x90(%rbp), %rdi
callq 0x10e00
nopl (%rax,%rax)