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

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

    auto r1 = to::run(opts, restore);
    EXPECT_TRUE(r1);
    EXPECT_EQ(2, c);

    c = 0;
    mockargs M2("-c\0-c\0-c\0");
    auto r2 = to::run(opts, M2.argc, M2.argv, restore);
    EXPECT_TRUE(r2);
    EXPECT_EQ(5, c);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
leaq 0xc(%rsp), %rax
movl $0x0, (%rax)
xorps %xmm0, %xmm0
leaq 0x110(%rsp), %rsi
movaps %xmm0, (%rsi)
movaps %xmm0, 0x10(%rsi)
movq %rax, (%rsi)
leaq -0x23221(%rip), %rax    # 0x1676c
movq %rax, 0x18(%rsi)
leaq -0x23224(%rip), %rax    # 0x16774
movq %rax, 0x10(%rsi)
leaq 0x60(%rsp), %rcx
movl $0x1, (%rcx)
leaq 0x359dd(%rip), %rdx     # 0x6f38b
leaq 0x130(%rsp), %rdi
callq 0x3d1ba
movq 0x120(%rsp), %rax
testq %rax, %rax
je 0x399da
leaq 0x110(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x90(%rsp)
movq $0x0, 0xa0(%rsp)
leaq 0x100(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x35987(%rip), %rsi     # 0x6f38b
leaq 0x35982(%rip), %rdx     # 0x6f38d
leaq 0xf0(%rsp), %rdi
callq 0x15892
leaq 0x90(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x34fc4
movq 0xf0(%rsp), %rdi
cmpq %r14, %rdi
je 0x39a4a
movq 0x100(%rsp), %rsi
incq %rsi
callq 0xd530
leaq 0xe0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x3592e(%rip), %rsi     # 0x6f38b
leaq 0x35929(%rip), %rdx     # 0x6f38d
leaq 0xd0(%rsp), %rdi
callq 0x15892
leaq 0x90(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x34fc4
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x39aa3
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0xd530
leaq 0x40(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x60(%rsp), %rcx
movq $0x0, (%rcx)
leaq 0xb0(%rsp), %rdi
leaq 0x130(%rsp), %rsi
leaq 0x90(%rsp), %r8
callq 0x3d80e
movb 0xb0(%rsp), %al
leaq 0x48(%rsp), %r14
movb %al, -0x8(%r14)
movq $0x0, (%r14)
testb %al, %al
jne 0x39b88
leaq 0x20(%rsp), %rdi
callq 0x4e2e8
leaq 0x377ce(%rip), %rdx     # 0x712d5
leaq 0x345f8(%rip), %rcx     # 0x6e106
leaq 0x345f7(%rip), %r8      # 0x6e10c
leaq 0x60(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x48021
movq 0x60(%rsp), %r8
leaq 0x37748(%rip), %rdx     # 0x71278
leaq 0x10(%rsp), %rdi
movl $0x1, %esi
movl $0x8e, %ecx
callq 0x4a84c
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x481aa
leaq 0x10(%rsp), %rdi
callq 0x4a8b8
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x39b78
movq 0x70(%rsp), %rsi
incq %rsi
callq 0xd530
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x39b88
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x48(%rsp), %rsi
testq %rsi, %rsi
je 0x39b9a
movq %r14, %rdi
callq 0x156d0
leaq 0x40(%rsp), %rcx
movl $0x2, (%rcx)
leaq 0x36413(%rip), %rsi     # 0x6ffbf
leaq 0x357d9(%rip), %rdx     # 0x6f38c
leaq 0x60(%rsp), %rdi
leaq 0xc(%rsp), %r8
callq 0x15aba
cmpb $0x0, 0x60(%rsp)
jne 0x39c2d
leaq 0x40(%rsp), %rdi
callq 0x4e2e8
movq 0x68(%rsp), %rax
testq %rax, %rax
je 0x39be2
movq (%rax), %r8
jmp 0x39be9
leaq 0x3740f(%rip), %r8      # 0x70ff8
leaq 0x37688(%rip), %rdx     # 0x71278
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
movl $0x8f, %ecx
callq 0x4a84c
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x481aa
leaq 0x20(%rsp), %rdi
callq 0x4a8b8
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x39c2d
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x68(%rsp), %rsi
testq %rsi, %rsi
je 0x39c41
leaq 0x68(%rsp), %rdi
callq 0x156d0
movl $0x0, 0xc(%rsp)
leaq 0x37b4d(%rip), %rsi     # 0x7179d
leaq 0x60(%rsp), %rdi
callq 0x2a408
leaq 0x60(%rsp), %rdx
movq 0x8(%rdx), %rcx
leaq 0x40(%rsp), %rdi
leaq 0x130(%rsp), %rsi
leaq 0x90(%rsp), %r8
callq 0x3d80e
movb 0x40(%rsp), %al
leaq 0x18(%rsp), %r14
movb %al, -0x8(%r14)
movq $0x0, (%r14)
testb %al, %al
jne 0x39d2f
movq %rsp, %rdi
callq 0x4e2e8
leaq 0x3767d(%rip), %rdx     # 0x71325
leaq 0x34457(%rip), %rcx     # 0x6e106
leaq 0x34456(%rip), %r8      # 0x6e10c
leaq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x48021
movq 0x20(%rsp), %r8
leaq 0x375a7(%rip), %rdx     # 0x71278
leaq 0x88(%rsp), %rdi
movl $0x1, %esi
movl $0x94, %ecx
callq 0x4a84c
leaq 0x88(%rsp), %rdi
movq %rsp, %rsi
callq 0x481aa
leaq 0x88(%rsp), %rdi
callq 0x4a8b8
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x39d20
movq 0x30(%rsp), %rsi
incq %rsi
callq 0xd530
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x39d2f
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
je 0x39d41
movq %r14, %rdi
callq 0x156d0
leaq 0x10(%rsp), %rcx
movl $0x5, (%rcx)
leaq 0x34e15(%rip), %rsi     # 0x6eb68
leaq 0x35632(%rip), %rdx     # 0x6f38c
leaq 0x20(%rsp), %rdi
leaq 0xc(%rsp), %r8
callq 0x15aba
cmpb $0x0, 0x20(%rsp)
jne 0x39dce
leaq 0x10(%rsp), %rdi
callq 0x4e2e8
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0x39d89
movq (%rax), %r8
jmp 0x39d90
leaq 0x37268(%rip), %r8      # 0x70ff8
leaq 0x374e1(%rip), %rdx     # 0x71278
movq %rsp, %rdi
movl $0x1, %esi
movl $0x95, %ecx
callq 0x4a84c
movq %rsp, %rdi
leaq 0x10(%rsp), %rsi
callq 0x481aa
movq %rsp, %rdi
callq 0x4a8b8
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x39dce
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x28(%rsp), %rsi
testq %rsi, %rsi
je 0x39de2
leaq 0x28(%rsp), %rdi
callq 0x156d0
cmpb $0x1, 0x40(%rsp)
jne 0x39df3
leaq 0x48(%rsp), %rdi
callq 0x20fca
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x39e0d
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0xd530
cmpb $0x1, 0xb0(%rsp)
jne 0x39e24
leaq 0xb8(%rsp), %rdi
callq 0x20fca
leaq 0x90(%rsp), %rdi
callq 0x20fca
leaq 0x180(%rsp), %rdi
callq 0x21caa
leaq 0x168(%rsp), %rdi
callq 0x21cda
leaq 0x150(%rsp), %rbx
movq %rbx, %rdi
callq 0x21d0a
movq -0x10(%rbx), %rax
testq %rax, %rax
je 0x39e76
leaq 0x130(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r14
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4a8b8
jmp 0x39e91
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x39ea1
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x10(%rsp)
jmp 0x39eaf
movq %rax, %rbx
movq 0x28(%rsp), %rsi
testq %rsi, %rsi
je 0x39ec3
leaq 0x28(%rsp), %rdi
callq 0x156d0
movq $0x0, 0x28(%rsp)
jmp 0x3a000
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x4a8b8
jmp 0x39ee6
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x39f06
movq 0x30(%rsp), %rsi
incq %rsi
callq 0xd530
jmp 0x39f06
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x39f15
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, (%rsp)
jmp 0x39f22
movq %rax, %rbx
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
je 0x3a000
movq %r14, %rdi
callq 0x156d0
jmp 0x3a000
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x4a8b8
jmp 0x39f4f
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x39f5f
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x40(%rsp)
jmp 0x39f6d
movq %rax, %rbx
movq 0x68(%rsp), %rsi
testq %rsi, %rsi
je 0x39f81
leaq 0x68(%rsp), %rdi
callq 0x156d0
movq $0x0, 0x68(%rsp)
jmp 0x3a03c
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x4a8b8
jmp 0x39fa1
movq %rax, %rbx
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x39fc1
movq 0x70(%rsp), %rsi
incq %rsi
callq 0xd530
jmp 0x39fc1
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x39fd1
movq (%rdi), %rax
callq *0x8(%rax)
movq $0x0, 0x20(%rsp)
jmp 0x39fdf
movq %rax, %rbx
movq 0x48(%rsp), %rsi
testq %rsi, %rsi
je 0x3a03c
movq %r14, %rdi
callq 0x156d0
jmp 0x3a03c
jmp 0x3a0e6
jmp 0x3a0e6
movq %rax, %rbx
cmpb $0x1, 0x40(%rsp)
jne 0x3a011
leaq 0x48(%rsp), %rdi
callq 0x20fca
movb $0x0, 0x40(%rsp)
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x3a03c
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0xd530
jmp 0x3a03c
movq %rax, %rbx
jmp 0x3a016
jmp 0x3a039
movq %rax, %rbx
cmpb $0x1, 0xb0(%rsp)
jne 0x3a053
leaq 0xb8(%rsp), %rdi
callq 0x20fca
movb $0x0, 0xb0(%rsp)
jmp 0x3a0a0
jmp 0x3a09d
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x3a0a0
movq 0xe0(%rsp), %rsi
jmp 0x3a093
jmp 0x3a09d
movq %rax, %rbx
movq 0xf0(%rsp), %rdi
cmpq %r14, %rdi
je 0x3a0a0
movq 0x100(%rsp), %rsi
incq %rsi
callq 0xd530
jmp 0x3a0a0
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x20fca
leaq 0x130(%rsp), %rdi
callq 0x20f42
movq %rbx, %rdi
callq 0xda70
movq %rax, %rbx
movq 0x120(%rsp), %rax
testq %rax, %rax
je 0x3a0ba
leaq 0x110(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x3a0ba
movq %rax, %rdi
callq 0x15674