// File: halfflat[P]tinyopt/test/test_run.cc
// Function: run_restore_single_Test::TestBody()
TEST(run, restore_single) {
    int c = 0, d = 0;
    to::option opts[] = {
        { to::increment(c), "-c", to::flag, to::single },
        { to::increment(d), "-c", to::flag, to::single }
    };

    to::saved_options restore;
    restore.add("-c");

    mockargs M("-c\0-c\0-c\0");
    auto r = to::run(opts, M.argc, M.argv, restore);
    EXPECT_EQ(1, c);
    EXPECT_EQ(1, d);
    EXPECT_EQ(2, M.argc);
    EXPECT_TRUE(r);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x330, %rsp            # imm = 0x330
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movb $0x1, -0x159(%rbp)
leaq -0xf0(%rbp), %rax
movq %rax, -0xf8(%rbp)
leaq -0x118(%rbp), %rdi
leaq -0xc(%rbp), %rsi
callq 0x1db80
jmp 0x69f14
movl $0x1, -0x128(%rbp)
movl $0x4, -0x12c(%rbp)
leaq 0x5f763(%rip), %rdx     # 0xc9692
leaq -0xf0(%rbp), %rdi
leaq -0x118(%rbp), %rsi
leaq -0x128(%rbp), %rcx
leaq -0x12c(%rbp), %r8
callq 0x6e820
jmp 0x69f52
leaq -0x80(%rbp), %rax
movq %rax, -0x2a8(%rbp)
movq %rax, -0xf8(%rbp)
leaq -0x150(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x1db80
jmp 0x69f76
movq -0x2a8(%rbp), %rdi
movl $0x1, -0x154(%rbp)
movl $0x4, -0x158(%rbp)
leaq 0x5f6fa(%rip), %rdx     # 0xc9692
leaq -0x150(%rbp), %rsi
leaq -0x154(%rbp), %rcx
leaq -0x158(%rbp), %r8
callq 0x6e820
jmp 0x69fb4
movb $0x0, -0x159(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x1d540
leaq -0x118(%rbp), %rdi
callq 0x1d540
leaq -0x178(%rbp), %rdi
callq 0x611a0
leaq -0x199(%rbp), %rdi
movq %rdi, -0x2b0(%rbp)
callq 0x10e10
movq -0x2b0(%rbp), %rdx
leaq 0x5f692(%rip), %rsi     # 0xc9692
leaq -0x198(%rbp), %rdi
callq 0x1d070
jmp 0x6a00e
leaq -0x178(%rbp), %rdi
leaq -0x198(%rbp), %rsi
callq 0x61220
jmp 0x6a023
leaq -0x198(%rbp), %rdi
callq 0x10fc8
leaq -0x199(%rbp), %rdi
callq 0x10810
leaq 0x61a77(%rip), %rsi     # 0xcbab9
leaq -0x1c8(%rbp), %rdi
callq 0x4bfe0
jmp 0x6a050
movq -0x1c0(%rbp), %rcx
leaq -0x1e8(%rbp), %rdi
leaq -0xf0(%rbp), %rsi
leaq -0x1c8(%rbp), %rdx
leaq -0x178(%rbp), %r8
callq 0x6e040
jmp 0x6a07a
movl $0x1, -0x1fc(%rbp)
leaq 0x6024b(%rip), %rsi     # 0xca2d6
leaq 0x65f07(%rip), %rdx     # 0xcff99
leaq -0x1f8(%rbp), %rdi
leaq -0x1fc(%rbp), %rcx
leaq -0xc(%rbp), %r8
callq 0x1d5d0
jmp 0x6a0ab
leaq -0x1f8(%rbp), %rdi
callq 0x1d4e0
movb %al, -0x2b1(%rbp)
jmp 0x6a0bf
movb -0x2b1(%rbp), %al
testb $0x1, %al
jne 0x6a0ce
jmp 0x6a221
jmp 0x6a2d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x6a125
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x6a119
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
leaq -0x150(%rbp), %rdi
callq 0x1d540
leaq -0x118(%rbp), %rdi
callq 0x1d540
testb $0x1, -0x159(%rbp)
jne 0x6a130
jmp 0x6a17d
movq -0xf8(%rbp), %rax
leaq -0xf0(%rbp), %rcx
cmpq %rax, %rcx
movq %rax, -0x2c0(%rbp)
je 0x6a17b
movq -0x2c0(%rbp), %rdi
addq $-0x70, %rdi
movq %rdi, -0x2c8(%rbp)
callq 0x38ed0
movq -0x2c8(%rbp), %rax
leaq -0xf0(%rbp), %rcx
cmpq %rcx, %rax
movq %rax, -0x2c0(%rbp)
jne 0x6a14a
jmp 0x6a17d
jmp 0x6a7d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x6a1b4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
leaq -0x198(%rbp), %rdi
callq 0x10fc8
leaq -0x199(%rbp), %rdi
callq 0x10810
jmp 0x6a77f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x6a77f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x6a773
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x6a767
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x6a33b
leaq -0x208(%rbp), %rdi
callq 0x84210
jmp 0x6a22f
leaq -0x1f8(%rbp), %rdi
callq 0x1d620
movq %rax, -0x2d0(%rbp)
jmp 0x6a244
movq -0x2d0(%rbp), %r8
leaq 0x61348(%rip), %rdx     # 0xcb59a
leaq -0x210(%rbp), %rdi
movl $0x1, %esi
movl $0xa4, %ecx
callq 0x80580
jmp 0x6a26a
leaq -0x210(%rbp), %rdi
leaq -0x208(%rbp), %rsi
callq 0x7d370
jmp 0x6a27f
leaq -0x210(%rbp), %rdi
callq 0x80600
leaq -0x208(%rbp), %rdi
callq 0x1d500
jmp 0x6a2d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x6a2cb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
leaq -0x210(%rbp), %rdi
callq 0x80600
leaq -0x208(%rbp), %rdi
callq 0x1d500
jmp 0x6a33b
leaq -0x1f8(%rbp), %rdi
callq 0x1d520
movl $0x1, -0x224(%rbp)
leaq 0x5ffe0(%rip), %rsi     # 0xca2d6
leaq 0x610ca(%rip), %rdx     # 0xcb3c7
leaq -0x220(%rbp), %rdi
leaq -0x224(%rbp), %rcx
leaq -0x10(%rbp), %r8
callq 0x1d5d0
jmp 0x6a316
leaq -0x220(%rbp), %rdi
callq 0x1d4e0
movb %al, -0x2d1(%rbp)
jmp 0x6a32a
movb -0x2d1(%rbp), %al
testb $0x1, %al
jne 0x6a336
jmp 0x6a363
jmp 0x6a41b
leaq -0x1f8(%rbp), %rdi
callq 0x1d520
jmp 0x6a767
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x6a480
leaq -0x230(%rbp), %rdi
callq 0x84210
jmp 0x6a371
leaq -0x220(%rbp), %rdi
callq 0x1d620
movq %rax, -0x2e0(%rbp)
jmp 0x6a386
movq -0x2e0(%rbp), %r8
leaq 0x61206(%rip), %rdx     # 0xcb59a
leaq -0x238(%rbp), %rdi
movl $0x1, %esi
movl $0xa5, %ecx
callq 0x80580
jmp 0x6a3ac
leaq -0x238(%rbp), %rdi
leaq -0x230(%rbp), %rsi
callq 0x7d370
jmp 0x6a3c1
leaq -0x238(%rbp), %rdi
callq 0x80600
leaq -0x230(%rbp), %rdi
callq 0x1d500
jmp 0x6a41b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x6a40d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
leaq -0x238(%rbp), %rdi
callq 0x80600
leaq -0x230(%rbp), %rdi
callq 0x1d500
jmp 0x6a480
leaq -0x220(%rbp), %rdi
callq 0x1d520
movl $0x2, -0x24c(%rbp)
leaq 0x5fe8e(%rip), %rsi     # 0xca2c6
leaq 0x5fe1a(%rip), %rdx     # 0xca259
leaq -0x248(%rbp), %rdi
leaq -0x24c(%rbp), %rcx
leaq -0x1c8(%rbp), %r8
callq 0x1d5d0
jmp 0x6a45b
leaq -0x248(%rbp), %rdi
callq 0x1d4e0
movb %al, -0x2e1(%rbp)
jmp 0x6a46f
movb -0x2e1(%rbp), %al
testb $0x1, %al
jne 0x6a47b
jmp 0x6a4a8
jmp 0x6a560
leaq -0x220(%rbp), %rdi
callq 0x1d520
jmp 0x6a767
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x6a5aa
leaq -0x258(%rbp), %rdi
callq 0x84210
jmp 0x6a4b6
leaq -0x248(%rbp), %rdi
callq 0x1d620
movq %rax, -0x2f0(%rbp)
jmp 0x6a4cb
movq -0x2f0(%rbp), %r8
leaq 0x610c1(%rip), %rdx     # 0xcb59a
leaq -0x260(%rbp), %rdi
movl $0x1, %esi
movl $0xa6, %ecx
callq 0x80580
jmp 0x6a4f1
leaq -0x260(%rbp), %rdi
leaq -0x258(%rbp), %rsi
callq 0x7d370
jmp 0x6a506
leaq -0x260(%rbp), %rdi
callq 0x80600
leaq -0x258(%rbp), %rdi
callq 0x1d500
jmp 0x6a560
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x6a552
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
leaq -0x260(%rbp), %rdi
callq 0x80600
leaq -0x258(%rbp), %rdi
callq 0x1d500
jmp 0x6a5aa
leaq -0x248(%rbp), %rdi
callq 0x1d520
xorl %eax, %eax
movl %eax, %edx
leaq -0x270(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x6e4b0
jmp 0x6a585
leaq -0x270(%rbp), %rdi
callq 0x1d4e0
movb %al, -0x2f1(%rbp)
jmp 0x6a599
movb -0x2f1(%rbp), %al
testb $0x1, %al
jne 0x6a5a5
jmp 0x6a5d2
jmp 0x6a6d6
leaq -0x248(%rbp), %rdi
callq 0x1d520
jmp 0x6a767
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x6a75b
leaq -0x278(%rbp), %rdi
callq 0x84210
jmp 0x6a5e0
leaq 0x600fa(%rip), %rdx     # 0xca6e1
leaq 0x5de61(%rip), %rcx     # 0xc844f
leaq 0x5de60(%rip), %r8      # 0xc8455
leaq -0x2a0(%rbp), %rdi
leaq -0x270(%rbp), %rsi
callq 0x7d210
jmp 0x6a60a
leaq -0x2a0(%rbp), %rdi
callq 0x102c0
movq %rax, %r8
leaq 0x60f7a(%rip), %rdx     # 0xcb59a
leaq -0x280(%rbp), %rdi
movl $0x1, %esi
movl $0xa7, %ecx
callq 0x80580
jmp 0x6a638
leaq -0x280(%rbp), %rdi
leaq -0x278(%rbp), %rsi
callq 0x7d370
jmp 0x6a64d
leaq -0x280(%rbp), %rdi
callq 0x80600
leaq -0x2a0(%rbp), %rdi
callq 0x10fc8
leaq -0x278(%rbp), %rdi
callq 0x1d500
jmp 0x6a6d6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x6a6c5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
jmp 0x6a6b9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x120(%rbp)
movl %eax, -0x124(%rbp)
leaq -0x280(%rbp), %rdi
callq 0x80600
leaq -0x2a0(%rbp), %rdi
callq 0x10fc8
leaq -0x278(%rbp), %rdi
callq 0x1d500
jmp 0x6a75b
leaq -0x270(%rbp), %rdi
callq 0x1d520
leaq -0x1e8(%rbp), %rdi
callq 0x6e5d0
leaq -0x1c8(%rbp), %rdi
callq 0x4c380
leaq -0x178(%rbp), %rdi
callq 0x61330
leaq -0xf0(%rbp), %rax
movq %rax, -0x308(%rbp)
addq $0xe0, %rax
movq %rax, -0x300(%rbp)
movq -0x300(%rbp), %rdi
addq $-0x70, %rdi
movq %rdi, -0x310(%rbp)
callq 0x38ed0
movq -0x308(%rbp), %rcx
movq -0x310(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x300(%rbp)
jne 0x6a721
addq $0x330, %rsp            # imm = 0x330
popq %rbp
retq
leaq -0x270(%rbp), %rdi
callq 0x1d520
leaq -0x1e8(%rbp), %rdi
callq 0x6e5d0
leaq -0x1c8(%rbp), %rdi
callq 0x4c380
leaq -0x178(%rbp), %rdi
callq 0x61330
leaq -0xf0(%rbp), %rax
movq %rax, -0x320(%rbp)
addq $0xe0, %rax
movq %rax, -0x318(%rbp)
movq -0x318(%rbp), %rdi
addq $-0x70, %rdi
movq %rdi, -0x328(%rbp)
callq 0x38ed0
movq -0x320(%rbp), %rcx
movq -0x328(%rbp), %rax
cmpq %rcx, %rax
movq %rax, -0x318(%rbp)
jne 0x6a7a6
jmp 0x6a7d9
movq -0x120(%rbp), %rdi
callq 0x10e00
nopw %cs:(%rax,%rax)