// File: /workspace/github_cpp_makefile_star2_O3/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)
leaq 0x110(%rsp), %rsi
movq $0x0, 0x8(%rsi)
movq %rax, (%rsi)
leaq -0x22143(%rip), %rax    # 0x16410
movq %rax, 0x18(%rsi)
leaq -0x22146(%rip), %rax    # 0x16418
movq %rax, 0x10(%rsi)
leaq 0x60(%rsp), %rcx
movl $0x1, (%rcx)
leaq 0x34a5a(%rip), %rdx     # 0x6cfce
leaq 0x130(%rsp), %rdi
callq 0x3bbc4
movq 0x120(%rsp), %rax
testq %rax, %rax
je 0x385a0
leaq 0x110(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
xorps %xmm0, %xmm0
movaps %xmm0, 0x90(%rsp)
movq $0x0, 0xa0(%rsp)
leaq 0xe0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x34a04(%rip), %rsi     # 0x6cfce
leaq 0x349ff(%rip), %rdx     # 0x6cfd0
leaq 0xd0(%rsp), %rdi
callq 0x1558a
leaq 0x90(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x33dd4
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x38610
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0xd530
leaq 0xc0(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x349ab(%rip), %rsi     # 0x6cfce
leaq 0x349a6(%rip), %rdx     # 0x6cfd0
leaq 0xb0(%rsp), %rdi
callq 0x1558a
leaq 0x90(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x33dd4
movq 0xb0(%rsp), %rdi
cmpq %r14, %rdi
je 0x38669
movq 0xc0(%rsp), %rsi
incq %rsi
callq 0xd530
leaq 0x40(%rsp), %rdx
movl $0x0, (%rdx)
leaq 0x60(%rsp), %rcx
movq $0x0, (%rcx)
leaq 0xf0(%rsp), %rdi
leaq 0x130(%rsp), %rsi
leaq 0x90(%rsp), %r8
callq 0x3c1fe
movb 0xf0(%rsp), %al
movb %al, 0x40(%rsp)
movq $0x0, 0x48(%rsp)
testb %al, %al
jne 0x38762
leaq 0x48(%rsp), %r14
leaq 0x20(%rsp), %rdi
callq 0x4ca86
leaq 0x36bf4(%rip), %rdx     # 0x6f2c3
leaq 0x33a30(%rip), %rcx     # 0x6c106
leaq 0x33a2f(%rip), %r8      # 0x6c10c
leaq 0x60(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x46893
movq 0x60(%rsp), %r8
leaq 0x36b6e(%rip), %rdx     # 0x6f266
leaq 0x10(%rsp), %rdi
movl $0x1, %esi
movl $0x8e, %ecx
callq 0x4902a
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rsi
callq 0x46a1c
leaq 0x10(%rsp), %rdi
callq 0x49096
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x38740
movq 0x70(%rsp), %rsi
incq %rsi
callq 0xd530
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x38750
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x48(%rsp), %rsi
testq %rsi, %rsi
je 0x38762
movq %r14, %rdi
callq 0x153ca
leaq 0x40(%rsp), %rcx
movl $0x2, (%rcx)
leaq 0x3582b(%rip), %rsi     # 0x6df9f
leaq 0x34854(%rip), %rdx     # 0x6cfcf
leaq 0x60(%rsp), %rdi
leaq 0xc(%rsp), %r8
callq 0x157b7
cmpb $0x0, 0x60(%rsp)
jne 0x387f5
leaq 0x40(%rsp), %rdi
callq 0x4ca86
movq 0x68(%rsp), %rax
testq %rax, %rax
je 0x387aa
movq (%rax), %r8
jmp 0x387b1
leaq 0x36824(%rip), %r8      # 0x6efd5
leaq 0x36aae(%rip), %rdx     # 0x6f266
leaq 0x20(%rsp), %rdi
movl $0x1, %esi
movl $0x8f, %ecx
callq 0x4902a
leaq 0x20(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x46a1c
leaq 0x20(%rsp), %rdi
callq 0x49096
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x387f5
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x68(%rsp), %rsi
testq %rsi, %rsi
je 0x38809
leaq 0x68(%rsp), %rdi
callq 0x153ca
movl $0x0, 0xc(%rsp)
leaq 0x36f73(%rip), %rsi     # 0x6f78b
leaq 0x60(%rsp), %rdi
callq 0x29a42
leaq 0x60(%rsp), %rdx
movq 0x8(%rdx), %rcx
leaq 0x40(%rsp), %rdi
leaq 0x130(%rsp), %rsi
leaq 0x90(%rsp), %r8
callq 0x3c1fe
movb 0x40(%rsp), %al
movb %al, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
testb %al, %al
jne 0x3890b
leaq 0x18(%rsp), %r14
movq %rsp, %rdi
callq 0x4ca86
leaq 0x36aa1(%rip), %rdx     # 0x6f313
leaq 0x3388d(%rip), %rcx     # 0x6c106
leaq 0x3388c(%rip), %r8      # 0x6c10c
leaq 0x20(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x46893
movq 0x20(%rsp), %r8
leaq 0x369cb(%rip), %rdx     # 0x6f266
leaq 0x88(%rsp), %rdi
movl $0x1, %esi
movl $0x94, %ecx
callq 0x4902a
leaq 0x88(%rsp), %rdi
movq %rsp, %rsi
callq 0x46a1c
leaq 0x88(%rsp), %rdi
callq 0x49096
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x388ea
movq 0x30(%rsp), %rsi
incq %rsi
callq 0xd530
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x388f9
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
je 0x3890b
movq %r14, %rdi
callq 0x153ca
leaq 0x10(%rsp), %rcx
movl $0x5, (%rcx)
leaq 0x3424b(%rip), %rsi     # 0x6cb68
leaq 0x346ab(%rip), %rdx     # 0x6cfcf
leaq 0x20(%rsp), %rdi
leaq 0xc(%rsp), %r8
callq 0x157b7
cmpb $0x0, 0x20(%rsp)
jne 0x38998
leaq 0x10(%rsp), %rdi
callq 0x4ca86
movq 0x28(%rsp), %rax
testq %rax, %rax
je 0x38953
movq (%rax), %r8
jmp 0x3895a
leaq 0x3667b(%rip), %r8      # 0x6efd5
leaq 0x36905(%rip), %rdx     # 0x6f266
movq %rsp, %rdi
movl $0x1, %esi
movl $0x95, %ecx
callq 0x4902a
movq %rsp, %rdi
leaq 0x10(%rsp), %rsi
callq 0x46a1c
movq %rsp, %rdi
callq 0x49096
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x38998
movq (%rdi), %rax
callq *0x8(%rax)
movq 0x28(%rsp), %rsi
testq %rsi, %rsi
je 0x389ac
leaq 0x28(%rsp), %rdi
callq 0x153ca
cmpb $0x1, 0x40(%rsp)
jne 0x389bd
leaq 0x48(%rsp), %rdi
callq 0x20770
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x389d7
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0xd530
cmpb $0x1, 0xf0(%rsp)
jne 0x389ee
leaq 0xf8(%rsp), %rdi
callq 0x20770
leaq 0x90(%rsp), %rdi
callq 0x20770
leaq 0x180(%rsp), %rdi
callq 0x2145a
leaq 0x168(%rsp), %rdi
callq 0x2148a
leaq 0x150(%rsp), %rbx
movq %rbx, %rdi
callq 0x214ba
movq -0x10(%rbx), %rax
testq %rax, %rax
je 0x38a40
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 0x49096
jmp 0x38a5b
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x38a70
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x38a70
movq %rax, %rbx
movq 0x28(%rsp), %rsi
testq %rsi, %rsi
je 0x38b8d
leaq 0x28(%rsp), %rdi
jmp 0x38adf
movq %rax, %rbx
leaq 0x88(%rsp), %rdi
callq 0x49096
jmp 0x38a9a
movq %rax, %rbx
leaq 0x30(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x38aba
movq 0x30(%rsp), %rsi
incq %rsi
callq 0xd530
jmp 0x38aba
movq %rax, %rbx
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x38ace
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x38ace
movq %rax, %rbx
movq 0x18(%rsp), %rsi
testq %rsi, %rsi
je 0x38b8d
movq %r14, %rdi
callq 0x153ca
jmp 0x38b8d
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x49096
jmp 0x38afb
movq %rax, %rbx
movq 0x40(%rsp), %rdi
testq %rdi, %rdi
je 0x38b10
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x38b10
movq %rax, %rbx
movq 0x68(%rsp), %rsi
testq %rsi, %rsi
je 0x38bc4
leaq 0x68(%rsp), %rdi
jmp 0x38b79
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x49096
jmp 0x38b37
movq %rax, %rbx
leaq 0x70(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x38b57
movq 0x70(%rsp), %rsi
incq %rsi
callq 0xd530
jmp 0x38b57
movq %rax, %rbx
movq 0x20(%rsp), %rdi
testq %rdi, %rdi
je 0x38b6c
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x38b6c
movq %rax, %rbx
movq 0x48(%rsp), %rsi
testq %rsi, %rsi
je 0x38bc4
movq %r14, %rdi
callq 0x153ca
jmp 0x38bc4
jmp 0x38c66
jmp 0x38c66
movq %rax, %rbx
cmpb $0x1, 0x40(%rsp)
jne 0x38ba3
leaq 0x48(%rsp), %rdi
callq 0x20770
jmp 0x38ba3
movq %rax, %rbx
movq 0x70(%rsp), %rdi
testq %rdi, %rdi
je 0x38bc4
movq 0x80(%rsp), %rsi
subq %rdi, %rsi
callq 0xd530
jmp 0x38bc4
jmp 0x38bc1
movq %rax, %rbx
cmpb $0x1, 0xf0(%rsp)
jne 0x38c20
leaq 0xf8(%rsp), %rdi
callq 0x20770
jmp 0x38c20
jmp 0x38c1d
movq %rax, %rbx
movq 0xb0(%rsp), %rdi
cmpq %r14, %rdi
je 0x38c20
movq 0xc0(%rsp), %rsi
jmp 0x38c13
jmp 0x38c1d
movq %rax, %rbx
movq 0xd0(%rsp), %rdi
cmpq %r14, %rdi
je 0x38c20
movq 0xe0(%rsp), %rsi
incq %rsi
callq 0xd530
jmp 0x38c20
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x20770
leaq 0x130(%rsp), %rdi
callq 0x206e8
movq %rbx, %rdi
callq 0xda70
movq %rax, %rbx
movq 0x120(%rsp), %rax
testq %rax, %rax
je 0x38c3a
leaq 0x110(%rsp), %rdi
movq %rdi, %rsi
movl $0x3, %edx
callq *%rax
jmp 0x38c3a
movq %rax, %rdi
callq 0x1536f