// File: halfflat[P]tinyopt/test/test_run.cc
// Function: run_exit_Test::TestBody()
TEST(run, exit) {
    int a = 0;
    int b = 0;

    to::option opts[] = {
        { a, "-a", to::exit },
        { b, "-b" }
    };

    mockargs M("-a\09\0-b\08\0");
    auto r = to::run(opts, M.argc, M.argv);
    EXPECT_FALSE(r);
    EXPECT_EQ(9, a);
    EXPECT_EQ(0, b);
    EXPECT_EQ(2, M.argc);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x300, %rsp            # imm = 0x300
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movb $0x1, -0x149(%rbp)
leaq -0xf0(%rbp), %rax
movq %rax, -0xf8(%rbp)
leaq -0x118(%rbp), %rdi
leaq -0xc(%rbp), %rsi
callq 0x1d5a0
jmp 0x65a34
movl $0x10, -0x128(%rbp)
leaq 0x63c3b(%rip), %rdx     # 0xc9680
leaq -0xf0(%rbp), %rdi
leaq -0x118(%rbp), %rsi
leaq -0x128(%rbp), %rcx
callq 0x6df30
jmp 0x65a61
leaq -0x80(%rbp), %rax
movq %rax, -0x278(%rbp)
movq %rax, -0xf8(%rbp)
leaq -0x148(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x1d5a0
jmp 0x65a85
movq -0x278(%rbp), %rdi
leaq 0x63bf6(%rip), %rdx     # 0xc9689
leaq -0x148(%rbp), %rsi
callq 0x6e640
jmp 0x65aa1
movb $0x0, -0x149(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x1d540
leaq -0x118(%rbp), %rdi
callq 0x1d540
leaq 0x65fc3(%rip), %rsi     # 0xcba8a
leaq -0x178(%rbp), %rdi
callq 0x4bfe0
jmp 0x65ad5
movq -0x170(%rbp), %rax
movq %rax, -0x288(%rbp)
xorps %xmm0, %xmm0
movaps %xmm0, -0x1b0(%rbp)
movq $0x0, -0x1a0(%rbp)
leaq -0x1b0(%rbp), %rdi
movq %rdi, -0x280(%rbp)
callq 0x611a0
movq -0x288(%rbp), %rcx
movq -0x280(%rbp), %r8
leaq -0x198(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
leaq -0x178(%rbp), %rdx
callq 0x6e040
jmp 0x65b35
leaq -0x1b0(%rbp), %rdi
callq 0x61330
leaq -0x198(%rbp), %rdi
callq 0x6e740
xorb $0x1, %al
movb %al, -0x1c1(%rbp)
xorl %eax, %eax
movl %eax, %edx
leaq -0x1c0(%rbp), %rdi
leaq -0x1c1(%rbp), %rsi
callq 0x1d4a0
jmp 0x65b6e
leaq -0x1c0(%rbp), %rdi
callq 0x1d4e0
movb %al, -0x289(%rbp)
jmp 0x65b82
movb -0x289(%rbp), %al
testb $0x1, %al
jne 0x65b91
jmp 0x65cad
jmp 0x65dae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x65be8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x65bdc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
leaq -0x148(%rbp), %rdi
callq 0x1d540
leaq -0x118(%rbp), %rdi
callq 0x1d540
testb $0x1, -0x149(%rbp)
jne 0x65bf3
jmp 0x65c40
movq -0xf8(%rbp), %rax
leaq -0xf0(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x298(%rbp)
je 0x65c3e
movq -0x298(%rbp), %rdi
addq $-0x70, %rdi
movq %rdi, -0x2a0(%rbp)
callq 0x38ed0
movq -0x2a0(%rbp), %rax
leaq -0xf0(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x298(%rbp)
jne 0x65c0d
jmp 0x65c40
jmp 0x66262
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x66214
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x61330
jmp 0x66208
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x661fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x65e10
leaq -0x1d0(%rbp), %rdi
callq 0x84210
jmp 0x65cbb
leaq 0x64a1f(%rip), %rdx     # 0xca6e1
leaq 0x6278c(%rip), %rcx     # 0xc8455
leaq 0x6277f(%rip), %r8      # 0xc844f
leaq -0x1f8(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0x7d210
jmp 0x65ce5
leaq -0x1f8(%rbp), %rdi
callq 0x102c0
movq %rax, %r8
leaq 0x6589f(%rip), %rdx     # 0xcb59a
leaq -0x1d8(%rbp), %rdi
movl $0x1, %esi
movl $0x32, %ecx
callq 0x80580
jmp 0x65d13
leaq -0x1d8(%rbp), %rdi
leaq -0x1d0(%rbp), %rsi
callq 0x7d370
jmp 0x65d28
leaq -0x1d8(%rbp), %rdi
callq 0x80600
leaq -0x1f8(%rbp), %rdi
callq 0x10fc8
leaq -0x1d0(%rbp), %rdi
callq 0x1d500
jmp 0x65dae
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x65da0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x65d94
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
leaq -0x1d8(%rbp), %rdi
callq 0x80600
leaq -0x1f8(%rbp), %rdi
callq 0x10fc8
leaq -0x1d0(%rbp), %rdi
callq 0x1d500
jmp 0x65e10
leaq -0x1c0(%rbp), %rdi
callq 0x1d520
movl $0x9, -0x20c(%rbp)
leaq 0x63c3c(%rip), %rsi     # 0xc9a07
leaq 0x638af(%rip), %rdx     # 0xc9681
leaq -0x208(%rbp), %rdi
leaq -0x20c(%rbp), %rcx
leaq -0xc(%rbp), %r8
callq 0x1d5d0
jmp 0x65deb
leaq -0x208(%rbp), %rdi
callq 0x1d4e0
movb %al, -0x2a1(%rbp)
jmp 0x65dff
movb -0x2a1(%rbp), %al
testb $0x1, %al
jne 0x65e0b
jmp 0x65e38
jmp 0x65ef0
leaq -0x1c0(%rbp), %rdi
callq 0x1d520
jmp 0x661fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x65f52
leaq -0x218(%rbp), %rdi
callq 0x84210
jmp 0x65e46
leaq -0x208(%rbp), %rdi
callq 0x1d620
movq %rax, -0x2b0(%rbp)
jmp 0x65e5b
movq -0x2b0(%rbp), %r8
leaq 0x65731(%rip), %rdx     # 0xcb59a
leaq -0x220(%rbp), %rdi
movl $0x1, %esi
movl $0x33, %ecx
callq 0x80580
jmp 0x65e81
leaq -0x220(%rbp), %rdi
leaq -0x218(%rbp), %rsi
callq 0x7d370
jmp 0x65e96
leaq -0x220(%rbp), %rdi
callq 0x80600
leaq -0x218(%rbp), %rdi
callq 0x1d500
jmp 0x65ef0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x65ee2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x80600
leaq -0x218(%rbp), %rdi
callq 0x1d500
jmp 0x65f52
leaq -0x208(%rbp), %rdi
callq 0x1d520
movl $0x0, -0x234(%rbp)
leaq 0x69861(%rip), %rsi     # 0xcf76e
leaq 0x63776(%rip), %rdx     # 0xc968a
leaq -0x230(%rbp), %rdi
leaq -0x234(%rbp), %rcx
leaq -0x10(%rbp), %r8
callq 0x1d5d0
jmp 0x65f2d
leaq -0x230(%rbp), %rdi
callq 0x1d4e0
movb %al, -0x2b1(%rbp)
jmp 0x65f41
movb -0x2b1(%rbp), %al
testb $0x1, %al
jne 0x65f4d
jmp 0x65f7a
jmp 0x66032
leaq -0x208(%rbp), %rdi
callq 0x1d520
jmp 0x661fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x66097
leaq -0x240(%rbp), %rdi
callq 0x84210
jmp 0x65f88
leaq -0x230(%rbp), %rdi
callq 0x1d620
movq %rax, -0x2c0(%rbp)
jmp 0x65f9d
movq -0x2c0(%rbp), %r8
leaq 0x655ef(%rip), %rdx     # 0xcb59a
leaq -0x248(%rbp), %rdi
movl $0x1, %esi
movl $0x34, %ecx
callq 0x80580
jmp 0x65fc3
leaq -0x248(%rbp), %rdi
leaq -0x240(%rbp), %rsi
callq 0x7d370
jmp 0x65fd8
leaq -0x248(%rbp), %rdi
callq 0x80600
leaq -0x240(%rbp), %rdi
callq 0x1d500
jmp 0x66032
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x66024
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
leaq -0x248(%rbp), %rdi
callq 0x80600
leaq -0x240(%rbp), %rdi
callq 0x1d500
jmp 0x66097
leaq -0x230(%rbp), %rdi
callq 0x1d520
movl $0x2, -0x25c(%rbp)
leaq 0x64277(%rip), %rsi     # 0xca2c6
leaq 0x64203(%rip), %rdx     # 0xca259
leaq -0x258(%rbp), %rdi
leaq -0x25c(%rbp), %rcx
leaq -0x178(%rbp), %r8
callq 0x1d5d0
jmp 0x66072
leaq -0x258(%rbp), %rdi
callq 0x1d4e0
movb %al, -0x2c1(%rbp)
jmp 0x66086
movb -0x2c1(%rbp), %al
testb $0x1, %al
jne 0x66092
jmp 0x660bf
jmp 0x66177
leaq -0x230(%rbp), %rdi
callq 0x1d520
jmp 0x661fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x661f0
leaq -0x268(%rbp), %rdi
callq 0x84210
jmp 0x660cd
leaq -0x258(%rbp), %rdi
callq 0x1d620
movq %rax, -0x2d0(%rbp)
jmp 0x660e2
movq -0x2d0(%rbp), %r8
leaq 0x654aa(%rip), %rdx     # 0xcb59a
leaq -0x270(%rbp), %rdi
movl $0x1, %esi
movl $0x35, %ecx
callq 0x80580
jmp 0x66108
leaq -0x270(%rbp), %rdi
leaq -0x268(%rbp), %rsi
callq 0x7d370
jmp 0x6611d
leaq -0x270(%rbp), %rdi
callq 0x80600
leaq -0x268(%rbp), %rdi
callq 0x1d500
jmp 0x66177
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x66169
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
leaq -0x270(%rbp), %rdi
callq 0x80600
leaq -0x268(%rbp), %rdi
callq 0x1d500
jmp 0x661f0
leaq -0x258(%rbp), %rdi
callq 0x1d520
leaq -0x198(%rbp), %rdi
callq 0x6e5d0
leaq -0x178(%rbp), %rdi
callq 0x4c380
leaq -0xf0(%rbp), %rax
movq %rax, -0x2e0(%rbp)
addq $0xe0, %rax
movq %rax, -0x2d8(%rbp)
movq -0x2d8(%rbp), %rdi
addq $-0x70, %rdi
movq %rdi, -0x2e8(%rbp)
callq 0x38ed0
movq -0x2e0(%rbp), %rcx
movq -0x2e8(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x2d8(%rbp)
jne 0x661b6
addq $0x300, %rsp            # imm = 0x300
popq %rbp
retq
leaq -0x258(%rbp), %rdi
callq 0x1d520
leaq -0x198(%rbp), %rdi
callq 0x6e5d0
leaq -0x178(%rbp), %rdi
callq 0x4c380
leaq -0xf0(%rbp), %rax
movq %rax, -0x2f8(%rbp)
addq $0xe0, %rax
movq %rax, -0x2f0(%rbp)
movq -0x2f0(%rbp), %rdi
addq $-0x70, %rdi
movq %rdi, -0x300(%rbp)
callq 0x38ed0
movq -0x2f8(%rbp), %rcx
movq -0x300(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x2f0(%rbp)
jne 0x6622f
jmp 0x66262
movq -0x120(%rbp), %rdi
callq 0x10e00
nop