// File: /workspace/github_cpp_makefile_star2_O2/halfflat[P]tinyopt/test/test_run.cc
// Function: run_modal_Test::TestBody()
TEST(run, modal) {
    int a0 = 0, a1 = 0, a2 = 0;
    to::option opts[] = {
        {to::increment(a0), "-a", to::flag, to::when(0)},
        {to::increment(a1), "-a", to::flag, to::when(1)},
        {to::increment(a2), "-a", to::flag, to::when(2)},
        {{}, "one", to::flag, to::then(1)},
        {{}, "two", to::flag, to::then(2)}
    };

    mockargs M("-a\0one\0-a\0two\0-a\0-a\0one\0-a\0-a\0");
    auto r = to::run(opts, M.argc, M.argv);
    EXPECT_TRUE(r);

    EXPECT_EQ(1, a0);
    EXPECT_EQ(3, a1);
    EXPECT_EQ(2, a2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x3c8, %rsp            # imm = 0x3C8
leaq 0x8c(%rsp), %rax
andl $0x0, (%rax)
andl $0x0, 0x2c(%rsp)
andl $0x0, 0x28(%rsp)
leaq 0x170(%rsp), %rsi
andq $0x0, 0x8(%rsi)
movq %rax, (%rsi)
leaq -0x1e30b(%rip), %rbx    # 0x1461c
movq %rbx, 0x18(%rsi)
leaq -0x1e30e(%rip), %r12    # 0x14624
movq %r12, 0x10(%rsi)
leaq 0x58(%rsp), %rcx
movl $0x1, (%rcx)
xorps %xmm0, %xmm0
leaq 0xc0(%rsp), %r8
movaps %xmm0, (%r8)
leaq -0x153cf(%rip), %r13    # 0x1d588
movq %r13, 0x18(%r8)
leaq -0x153d2(%rip), %r14    # 0x1d590
movq %r14, 0x10(%r8)
leaq 0x24a7c(%rip), %rdx     # 0x573e9
leaq 0x190(%rsp), %rdi
callq 0x339c6
leaq 0x200(%rsp), %r15
leaq 0x150(%rsp), %rsi
andq $0x0, 0x8(%rsi)
leaq 0x2c(%rsp), %rax
movq %rax, (%rsi)
movq %rbx, 0x18(%rsi)
movq %r12, 0x10(%rsi)
pushq $0x1
popq %rbp
leaq 0x9c(%rsp), %rcx
movl %ebp, (%rcx)
leaq 0xa0(%rsp), %r8
xorps %xmm0, %xmm0
movaps %xmm0, (%r8)
movl %ebp, (%r8)
movq %r13, 0x18(%r8)
movq %r14, 0x10(%r8)
leaq 0x24a1c(%rip), %rdx     # 0x573e9
movq %r15, %rdi
callq 0x339c6
leaq 0x270(%rsp), %r15
leaq 0x130(%rsp), %rsi
andq $0x0, 0x8(%rsi)
leaq 0x28(%rsp), %rax
movq %rax, (%rsi)
movq %rbx, 0x18(%rsi)
movq %r12, 0x10(%rsi)
leaq 0x98(%rsp), %rcx
movl $0x1, (%rcx)
xorps %xmm0, %xmm0
movq %rsp, %r8
movaps %xmm0, (%r8)
movl $0x2, (%r8)
movq %r13, 0x18(%r8)
movq %r14, 0x10(%r8)
leaq 0x249c1(%rip), %rdx     # 0x573e9
movq %r15, %rdi
callq 0x339c6
leaq 0x2e0(%rsp), %r15
leaq 0x110(%rsp), %rsi
xorps %xmm0, %xmm0
movaps %xmm0, (%rsi)
leaq -0x1f43d(%rip), %rbx    # 0x13610
movq %rbx, 0x18(%rsi)
leaq -0x1f444(%rip), %r14    # 0x13614
movq %r14, 0x10(%rsi)
leaq 0x94(%rsp), %rcx
movl %ebp, (%rcx)
leaq 0x30(%rsp), %r8
movaps %xmm0, (%r8)
movl %ebp, (%r8)
leaq -0x1549b(%rip), %r12    # 0x1d5de
movq %r12, 0x18(%r8)
leaq -0x154a2(%rip), %r13    # 0x1d5e2
movq %r13, 0x10(%r8)
leaq 0x26092(%rip), %rdx     # 0x58b21
movq %r15, %rdi
callq 0x33a6a
leaq 0x350(%rsp), %r15
xorps %xmm0, %xmm0
leaq 0xf0(%rsp), %rsi
movaps %xmm0, (%rsi)
movq %rbx, 0x18(%rsi)
movq %r14, 0x10(%rsi)
leaq 0x90(%rsp), %rcx
movl $0x1, (%rcx)
leaq 0x60(%rsp), %r8
movaps %xmm0, (%r8)
movl $0x2, (%r8)
movq %r12, 0x18(%r8)
movq %r13, 0x10(%r8)
leaq 0x26187(%rip), %rdx     # 0x58c69
movq %r15, %rdi
callq 0x33a6a
leaq 0x60(%rsp), %rdi
callq 0x1367e
leaq 0xf0(%rsp), %rdi
callq 0x1367e
leaq 0x30(%rsp), %rdi
callq 0x1367e
leaq 0x110(%rsp), %rdi
callq 0x1367e
movq %rsp, %rdi
callq 0x1367e
leaq 0x130(%rsp), %rdi
callq 0x1367e
leaq 0xa0(%rsp), %rdi
callq 0x1367e
leaq 0x150(%rsp), %rdi
callq 0x1367e
leaq 0xc0(%rsp), %rdi
callq 0x1367e
leaq 0x170(%rsp), %rdi
callq 0x1367e
leaq 0x26ccb(%rip), %rsi     # 0x59833
leaq 0xc0(%rsp), %rdi
callq 0x2488e
leaq 0xc0(%rsp), %rdx
movq 0x8(%rdx), %rcx
xorps %xmm0, %xmm0
movq %rsp, %r8
movaps %xmm0, (%r8)
andq $0x0, 0x10(%r8)
leaq 0xa0(%rsp), %rdi
leaq 0x190(%rsp), %rsi
callq 0x33b0e
movq %rsp, %rdi
callq 0x1cc42
movb 0xa0(%rsp), %al
leaq 0x38(%rsp), %r14
movb %al, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
jne 0x32c3f
leaq 0x60(%rsp), %rdi
callq 0x3d5f6
leaq 0x25873(%rip), %rdx     # 0x58449
leaq 0x23532(%rip), %rcx     # 0x5610f
leaq 0x23531(%rip), %r8      # 0x56115
movq %rsp, %rdi
leaq 0x30(%rsp), %rsi
callq 0x399e5
movq (%rsp), %r8
leaq 0x266ee(%rip), %rdx     # 0x592ea
leaq 0x58(%rsp), %rdi
pushq $0x1
popq %rsi
movl $0xf7, %ecx
callq 0x3b5b6
leaq 0x58(%rsp), %rdi
leaq 0x60(%rsp), %rsi
callq 0x39b08
leaq 0x58(%rsp), %rdi
callq 0x3b616
movq %rsp, %rdi
callq 0xdbe8
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x32c3f
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
callq 0x13646
leaq 0x30(%rsp), %rcx
movl $0x1, (%rcx)
leaq 0x253e6(%rip), %rsi     # 0x5803f
leaq 0x26b57(%rip), %rdx     # 0x597b7
movq %rsp, %rdi
leaq 0x8c(%rsp), %r8
callq 0x13a52
cmpb $0x0, (%rsp)
jne 0x32cd8
leaq 0x30(%rsp), %rdi
callq 0x3d5f6
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0x32c8f
movq (%rax), %r8
jmp 0x32c96
leaq 0x263d4(%rip), %r8      # 0x5906a
leaq 0x2664d(%rip), %rdx     # 0x592ea
leaq 0x60(%rsp), %rdi
pushq $0x1
popq %rsi
movl $0xf9, %ecx
callq 0x3b5b6
leaq 0x60(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x39b08
leaq 0x60(%rsp), %rdi
callq 0x3b616
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x32cd8
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x8(%rsp), %rdi
callq 0x13646
leaq 0x30(%rsp), %rcx
movl $0x3, (%rcx)
leaq 0x25e6a(%rip), %rsi     # 0x58b5e
leaq 0x26abf(%rip), %rdx     # 0x597ba
movq %rsp, %rdi
leaq 0x2c(%rsp), %r8
callq 0x13a52
cmpb $0x0, (%rsp)
jne 0x32d70
leaq 0x30(%rsp), %rdi
callq 0x3d5f6
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0x32d27
movq (%rax), %r8
jmp 0x32d2e
leaq 0x2633c(%rip), %r8      # 0x5906a
leaq 0x265b5(%rip), %rdx     # 0x592ea
leaq 0x60(%rsp), %rdi
pushq $0x1
popq %rsi
movl $0xfa, %ecx
callq 0x3b5b6
leaq 0x60(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x39b08
leaq 0x60(%rsp), %rdi
callq 0x3b616
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x32d70
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x8(%rsp), %rdi
callq 0x13646
leaq 0x30(%rsp), %rcx
movl $0x2, (%rcx)
leaq 0x252a3(%rip), %rsi     # 0x5802f
leaq 0x26a2a(%rip), %rdx     # 0x597bd
movq %rsp, %rdi
leaq 0x28(%rsp), %r8
callq 0x13a52
cmpb $0x0, (%rsp)
jne 0x32e08
leaq 0x30(%rsp), %rdi
callq 0x3d5f6
movq 0x8(%rsp), %rax
testq %rax, %rax
je 0x32dbf
movq (%rax), %r8
jmp 0x32dc6
leaq 0x262a4(%rip), %r8      # 0x5906a
leaq 0x2651d(%rip), %rdx     # 0x592ea
leaq 0x60(%rsp), %rdi
pushq $0x1
popq %rsi
movl $0xfb, %ecx
callq 0x3b5b6
leaq 0x60(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x39b08
leaq 0x60(%rsp), %rdi
callq 0x3b616
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x32e08
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x8(%rsp), %rdi
callq 0x13646
leaq 0xa0(%rsp), %rdi
callq 0x34214
leaq 0xd0(%rsp), %rdi
callq 0x25080
movl $0x1c0, %ebx            # imm = 0x1C0
leaq (%rsp,%rbx), %rdi
addq $0x190, %rdi            # imm = 0x190
callq 0x1cbe0
addq $-0x70, %rbx
cmpq $-0x70, %rbx
jne 0x32e31
addq $0x3c8, %rsp            # imm = 0x3C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x32e69
jmp 0x32e78
jmp 0x32e8d
jmp 0x32e69
jmp 0x32e78
jmp 0x32e8d
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x3b616
jmp 0x32e7b
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x32e90
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x32e90
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
jmp 0x32ece
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x3b616
jmp 0x32ea9
movq %rax, %rbx
movq %rsp, %rdi
callq 0xdbe8
jmp 0x32eb6
movq %rax, %rbx
movq 0x60(%rsp), %rdi
testq %rdi, %rdi
je 0x32ecb
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x32ecb
movq %rax, %rbx
movq %r14, %rdi
callq 0x13646
jmp 0x32edc
jmp 0x32ed9
jmp 0x32ed9
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x34214
leaq 0xd0(%rsp), %rdi
callq 0x25080
movl $0x1c0, %r14d           # imm = 0x1C0
leaq (%rsp,%r14), %rdi
addq $0x190, %rdi            # imm = 0x190
callq 0x1cbe0
addq $-0x70, %r14
cmpq $-0x70, %r14
jne 0x32efc
movq %rbx, %rdi
callq 0xdaa0
movq %rax, %rbx
movq %rsp, %rdi
callq 0x1cc42
jmp 0x32ee9
movq %rax, %rbx
jmp 0x32ef6
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
callq 0x1367e
leaq 0xf0(%rsp), %rdi
callq 0x1367e
jmp 0x32f4f
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x1367e
leaq 0x110(%rsp), %rdi
callq 0x1367e
jmp 0x32f6b
movq %rax, %rbx
movq %rsp, %rdi
callq 0x1367e
leaq 0x130(%rsp), %rdi
callq 0x1367e
jmp 0x32f85
movq %rax, %rbx
leaq 0xa0(%rsp), %rdi
callq 0x1367e
leaq 0x150(%rsp), %rdi
callq 0x1367e
jmp 0x32fac
movq %rax, %rbx
leaq 0x190(%rsp), %r15
leaq 0xc0(%rsp), %rdi
callq 0x1367e
leaq 0x170(%rsp), %rdi
callq 0x1367e
leaq 0x190(%rsp), %rax
cmpq %r15, %rax
je 0x32f16
leaq 0x190(%rsp), %r14
addq $-0x70, %r15
movq %r15, %rdi
callq 0x1cbe0
cmpq %r14, %r15
jne 0x32fdf
jmp 0x32f16
nop