// File: /workspace/github_cpp_makefile_star2_O2/halfflat[P]tinyopt/test/test_run.cc
// Function: run_restore_mandatory_Test::TestBody()
TEST(run, restore_mandatory) {
    bool m = false, a = false;
    to::option opts[] = {
        { to::set(m), "-m", to::flag, to::mandatory },
        { to::set(a), "-a", to::flag }
    };

    to::saved_options restore1;
    restore1.add("-m");
    mockargs M1("-a\0");

    auto r1 = to::run(opts, M1.argc, M1.argv, restore1);
    EXPECT_TRUE(r1);
    EXPECT_TRUE(a);
    EXPECT_TRUE(m);

    a = m = false;

    to::saved_options restore2;
    restore2.add("-a");
    mockargs M2("-m\0");

    auto r2 = to::run(opts, M2.argc, M2.argv, restore2);
    EXPECT_TRUE(r2);
    EXPECT_TRUE(a);
    EXPECT_TRUE(m);

    to::saved_options restore3;
    restore3.add("-a");
    mockargs M3("-a\0");

    EXPECT_THROW(to::run(opts, M3.argc, M3.argv), to::missing_mandatory_option);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x308, %rsp            # imm = 0x308
xorl %eax, %eax
leaq 0xf(%rsp), %rcx
movb %al, (%rcx)
movb %al, 0xe(%rsp)
leaq 0x1e0(%rsp), %rsi
movq $0x1, 0x8(%rsi)
movq %rcx, (%rsi)
leaq 0x312d(%rip), %rbx      # 0x3422c
movq %rbx, 0x18(%rsi)
leaq 0x312e(%rip), %r12      # 0x34238
movq %r12, 0x10(%rsi)
leaq 0x118(%rsp), %rcx
movl $0x1, (%rcx)
leaq 0xb8(%rsp), %r8
movl $0x8, (%r8)
leaq 0x282d3(%rip), %rdx     # 0x59405
leaq 0x220(%rsp), %r14
movq %r14, %rdi
callq 0x333c0
leaq 0x290(%rsp), %r15
leaq 0x1c0(%rsp), %rsi
movq $0x1, 0x8(%rsi)
leaq 0xe(%rsp), %rax
movq %rax, (%rsi)
movq %rbx, 0x18(%rsi)
movq %r12, 0x10(%rsi)
leaq 0x68(%rsp), %rcx
movl $0x1, (%rcx)
leaq 0x2626d(%rip), %rdx     # 0x573e9
movq %r15, %rdi
callq 0x32ff6
leaq 0x1c0(%rsp), %rdi
callq 0x1367e
leaq 0x1e0(%rsp), %rdi
callq 0x1367e
xorps %xmm0, %xmm0
movaps %xmm0, 0x100(%rsp)
andq $0x0, 0x110(%rsp)
leaq 0x2824c(%rip), %rsi     # 0x59405
leaq 0x1a0(%rsp), %rdi
leaq 0x118(%rsp), %rdx
callq 0x1337a
leaq 0x100(%rsp), %rdi
leaq 0x1a0(%rsp), %rsi
callq 0x2ce84
leaq 0x1a0(%rsp), %rdi
callq 0xdbe8
leaq 0x28744(%rip), %rsi     # 0x5993b
leaq 0x118(%rsp), %rdi
callq 0x2488e
leaq 0x118(%rsp), %rdx
movq 0x8(%rdx), %rcx
leaq 0x180(%rsp), %rdi
leaq 0x220(%rsp), %rsi
leaq 0x100(%rsp), %r8
callq 0x33094
movb 0x180(%rsp), %al
leaq 0x70(%rsp), %r14
movb %al, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
jne 0x312da
leaq 0x98(%rsp), %rdi
callq 0x3d5f6
leaq 0x280ea(%rip), %rdx     # 0x59347
leaq 0x24eab(%rip), %rcx     # 0x5610f
leaq 0x24eaa(%rip), %r8      # 0x56115
leaq 0xb8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x399e5
movq 0xb8(%rsp), %r8
leaq 0x2805e(%rip), %rdx     # 0x592ea
leaq 0x10(%rsp), %rdi
pushq $0x1
popq %rsi
movl $0xb6, %ecx
callq 0x3b5b6
leaq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x39b08
leaq 0x10(%rsp), %rdi
callq 0x3b616
leaq 0xb8(%rsp), %rdi
callq 0xdbe8
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x312da
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
callq 0x13646
movb 0xe(%rsp), %al
leaq 0x70(%rsp), %r14
movb %al, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
jne 0x3138c
leaq 0x98(%rsp), %rdi
callq 0x3d5f6
leaq 0x260db(%rip), %rdx     # 0x573ea
leaq 0x24df9(%rip), %rcx     # 0x5610f
leaq 0x24df8(%rip), %r8      # 0x56115
leaq 0xb8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x399e5
movq 0xb8(%rsp), %r8
leaq 0x27fac(%rip), %rdx     # 0x592ea
leaq 0x10(%rsp), %rdi
pushq $0x1
popq %rsi
movl $0xb7, %ecx
callq 0x3b5b6
leaq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x39b08
leaq 0x10(%rsp), %rdi
callq 0x3b616
leaq 0xb8(%rsp), %rdi
callq 0xdbe8
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x3138c
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
callq 0x13646
movb 0xf(%rsp), %al
leaq 0x70(%rsp), %r14
movb %al, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
jne 0x3143e
leaq 0x98(%rsp), %rdi
callq 0x3d5f6
leaq 0x28045(%rip), %rdx     # 0x59406
leaq 0x24d47(%rip), %rcx     # 0x5610f
leaq 0x24d46(%rip), %r8      # 0x56115
leaq 0xb8(%rsp), %rdi
leaq 0x68(%rsp), %rsi
callq 0x399e5
movq 0xb8(%rsp), %r8
leaq 0x27efa(%rip), %rdx     # 0x592ea
leaq 0x10(%rsp), %rdi
pushq $0x1
popq %rsi
movl $0xb8, %ecx
callq 0x3b5b6
leaq 0x10(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0x39b08
leaq 0x10(%rsp), %rdi
callq 0x3b616
leaq 0xb8(%rsp), %rdi
callq 0xdbe8
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x3143e
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
callq 0x13646
xorl %eax, %eax
movb %al, 0xf(%rsp)
movb %al, 0xe(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0xe0(%rsp)
andq $0x0, 0xf0(%rsp)
leaq 0x25f7e(%rip), %rsi     # 0x573e9
leaq 0x160(%rsp), %rdi
leaq 0xb8(%rsp), %rdx
callq 0x1337a
leaq 0xe0(%rsp), %rdi
leaq 0x160(%rsp), %rsi
callq 0x2ce84
leaq 0x160(%rsp), %rdi
callq 0xdbe8
leaq 0x28496(%rip), %rsi     # 0x5993f
leaq 0xb8(%rsp), %rdi
callq 0x2488e
leaq 0xb8(%rsp), %rdx
movq 0x8(%rdx), %rcx
leaq 0x98(%rsp), %rdi
leaq 0x220(%rsp), %rsi
leaq 0xe0(%rsp), %r8
callq 0x33094
movb 0x98(%rsp), %al
leaq 0x18(%rsp), %r14
movb %al, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
jne 0x31576
leaq 0x30(%rsp), %rdi
callq 0x3d5f6
leaq 0x27e8f(%rip), %rdx     # 0x59397
leaq 0x24c00(%rip), %rcx     # 0x5610f
leaq 0x24bff(%rip), %r8      # 0x56115
leaq 0x68(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x399e5
movq 0x68(%rsp), %r8
leaq 0x27db9(%rip), %rdx     # 0x592ea
leaq 0x50(%rsp), %rdi
pushq $0x1
popq %rsi
movl $0xc1, %ecx
callq 0x3b5b6
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x39b08
leaq 0x50(%rsp), %rdi
callq 0x3b616
leaq 0x68(%rsp), %rdi
callq 0xdbe8
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x31576
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
callq 0x13646
movb 0xe(%rsp), %al
leaq 0x18(%rsp), %r14
movb %al, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
jne 0x31612
leaq 0x30(%rsp), %rdi
callq 0x3d5f6
leaq 0x25e46(%rip), %rdx     # 0x573ea
leaq 0x24b64(%rip), %rcx     # 0x5610f
leaq 0x24b63(%rip), %r8      # 0x56115
leaq 0x68(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x399e5
movq 0x68(%rsp), %r8
leaq 0x27d1d(%rip), %rdx     # 0x592ea
leaq 0x50(%rsp), %rdi
pushq $0x1
popq %rsi
movl $0xc2, %ecx
callq 0x3b5b6
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x39b08
leaq 0x50(%rsp), %rdi
callq 0x3b616
leaq 0x68(%rsp), %rdi
callq 0xdbe8
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x31612
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
callq 0x13646
movb 0xf(%rsp), %al
leaq 0x18(%rsp), %r14
movb %al, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
jne 0x316ae
leaq 0x30(%rsp), %rdi
callq 0x3d5f6
leaq 0x27dc6(%rip), %rdx     # 0x59406
leaq 0x24ac8(%rip), %rcx     # 0x5610f
leaq 0x24ac7(%rip), %r8      # 0x56115
leaq 0x68(%rsp), %rdi
leaq 0x10(%rsp), %rsi
callq 0x399e5
movq 0x68(%rsp), %r8
leaq 0x27c81(%rip), %rdx     # 0x592ea
leaq 0x50(%rsp), %rdi
pushq $0x1
popq %rsi
movl $0xc3, %ecx
callq 0x3b5b6
leaq 0x50(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x39b08
leaq 0x50(%rsp), %rdi
callq 0x3b616
leaq 0x68(%rsp), %rdi
callq 0xdbe8
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x316ae
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
callq 0x13646
xorps %xmm0, %xmm0
movaps %xmm0, 0x50(%rsp)
andq $0x0, 0x60(%rsp)
leaq 0x25d1e(%rip), %rsi     # 0x573e9
leaq 0x140(%rsp), %rdi
leaq 0x68(%rsp), %rdx
callq 0x1337a
leaq 0x50(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0x2ce84
leaq 0x140(%rsp), %rdi
callq 0xdbe8
leaq 0x28238(%rip), %rsi     # 0x5993b
leaq 0x68(%rsp), %rdi
callq 0x2488e
leaq 0x20(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
callq 0x3d5f3
testb %al, %al
je 0x31770
leaq 0x68(%rsp), %rdx
movq 0x8(%rdx), %rcx
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %r8
movaps %xmm0, (%r8)
andq $0x0, 0x10(%r8)
leaq 0x200(%rsp), %rdi
leaq 0x220(%rsp), %rsi
callq 0x33094
leaq 0x200(%rsp), %rdi
callq 0x34214
leaq 0x30(%rsp), %rdi
callq 0x1cc42
leaq 0x27f41(%rip), %rsi     # 0x596b8
leaq 0x10(%rsp), %rdi
callq 0xdb70
leaq 0x30(%rsp), %rdi
callq 0x3d5f6
movq 0x10(%rsp), %r8
leaq 0x27b53(%rip), %rdx     # 0x592ea
leaq 0x90(%rsp), %rdi
pushq $0x1
popq %rsi
movl $0xc9, %ecx
callq 0x3b5b6
leaq 0x90(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0x39b08
leaq 0x90(%rsp), %rdi
callq 0x3b616
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x317db
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x10(%rsp), %rdi
callq 0xdbe8
leaq 0x78(%rsp), %rdi
callq 0x25080
leaq 0x50(%rsp), %rdi
callq 0x1cc42
leaq 0x98(%rsp), %rdi
callq 0x34214
leaq 0xc8(%rsp), %rdi
callq 0x25080
leaq 0xe0(%rsp), %rdi
callq 0x1cc42
leaq 0x180(%rsp), %rdi
callq 0x34214
leaq 0x128(%rsp), %rdi
callq 0x25080
leaq 0x100(%rsp), %rdi
callq 0x1cc42
pushq $0x70
popq %rbx
leaq (%rsp,%rbx), %rdi
addq $0x220, %rdi            # imm = 0x220
callq 0x1cbe0
addq $-0x70, %rbx
cmpq $-0x70, %rbx
jne 0x3184a
addq $0x308, %rsp            # imm = 0x308
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq %rdx, %r14
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0x1cc42
jmp 0x3196d
jmp 0x31896
jmp 0x318a7
jmp 0x318b6
jmp 0x31896
jmp 0x318cb
jmp 0x318a7
jmp 0x318b6
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x3b616
jmp 0x318aa
jmp 0x318cb
movq %rax, %rbx
leaq 0x68(%rsp), %rdi
callq 0xdbe8
jmp 0x318b9
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x318ce
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x318ce
movq %rax, %rbx
movq %r14, %rdi
callq 0x13646
jmp 0x31a9a
jmp 0x318e9
jmp 0x318fa
jmp 0x3190c
jmp 0x318e9
jmp 0x31924
jmp 0x318fa
jmp 0x3190c
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3b616
jmp 0x318fd
jmp 0x31924
movq %rax, %rbx
leaq 0xb8(%rsp), %rdi
callq 0xdbe8
jmp 0x3190f
movq %rax, %rbx
movq 0x98(%rsp), %rdi
testq %rdi, %rdi
je 0x31927
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x31927
movq %rax, %rbx
movq %r14, %rdi
callq 0x13646
jmp 0x31ac1
movq %rax, %rbx
leaq 0x90(%rsp), %rdi
callq 0x3b616
jmp 0x31949
movq %rax, %rbx
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x31a63
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x31a63
jmp 0x31a60
movq %rdx, %r14
movq %rax, %rbx
movq %rbx, %rdi
cmpl $0x3, %r14d
jne 0x31985
callq 0xd210
callq 0xda40
jmp 0x317db
callq 0xd210
cmpl $0x2, %r14d
jne 0x31a14
movq %rax, %rbx
leaq 0x27ca1(%rip), %rsi     # 0x5963f
leaq 0x10(%rsp), %rdi
callq 0xdb70
movq (%rbx), %rax
movq -0x8(%rax), %rsi
leaq 0x30(%rsp), %rdi
callq 0x1d219
leaq 0x10(%rsp), %rdi
leaq 0x30(%rsp), %rsi
callq 0xdb90
leaq 0x30(%rsp), %rdi
callq 0xdbe8
leaq 0x2bc8e(%rip), %rsi     # 0x5d667
leaq 0x10(%rsp), %rdi
callq 0xdb60
movq (%rbx), %rax
movq %rbx, %rdi
callq *0x10(%rax)
leaq 0x10(%rsp), %rdi
movq %rax, %rsi
callq 0xdb60
leaq 0x25deb(%rip), %rsi     # 0x577eb
leaq 0x10(%rsp), %rdi
callq 0xdb60
callq 0xda40
jmp 0x31781
leaq 0x27b9a(%rip), %rsi     # 0x595b5
leaq 0x10(%rsp), %rdi
callq 0xdb70
callq 0xda40
jmp 0x31781
jmp 0x31a60
movq %rax, %rbx
callq 0xda40
jmp 0x31a63
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
callq 0xdbe8
jmp 0x31a51
jmp 0x31a4e
jmp 0x31a60
movq %rax, %rbx
callq 0xda40
jmp 0x31a63
movq %rax, %rdi
callq 0x135af
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0xdbe8
leaq 0x78(%rsp), %rdi
callq 0x25080
jmp 0x31a90
jmp 0x31a8d
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0xdbe8
jmp 0x31a90
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0x1cc42
leaq 0x98(%rsp), %rdi
callq 0x34214
leaq 0xc8(%rsp), %rdi
callq 0x25080
leaq 0xe0(%rsp), %rdi
callq 0x1cc42
leaq 0x180(%rsp), %rdi
callq 0x34214
leaq 0x128(%rsp), %rdi
callq 0x25080
leaq 0x100(%rsp), %rdi
callq 0x1cc42
pushq $0x70
popq %r14
leaq (%rsp,%r14), %rdi
addq $0x220, %rdi            # imm = 0x220
callq 0x1cbe0
addq $-0x70, %r14
cmpq $-0x70, %r14
jne 0x31aec
movq %rbx, %rdi
callq 0xdaa0
movq %rax, %rbx
jmp 0x31aa7
jmp 0x31b27
movq %rax, %rbx
leaq 0x160(%rsp), %rdi
callq 0xdbe8
jmp 0x31ab4
movq %rax, %rbx
jmp 0x31ab4
movq %rax, %rbx
jmp 0x31ace
jmp 0x31b45
movq %rax, %rbx
leaq 0x1a0(%rsp), %rdi
callq 0xdbe8
jmp 0x31adb
movq %rax, %rbx
jmp 0x31adb
movq %rax, %rbx
leaq 0x1c0(%rsp), %rdi
callq 0x1367e
jmp 0x31b62
movq %rax, %rbx
movq %r14, %r15
leaq 0x1e0(%rsp), %rdi
callq 0x1367e
cmpq %r15, %r14
je 0x31b06
leaq 0x220(%rsp), %r14
addq $-0x70, %r15
movq %r15, %rdi
callq 0x1cbe0
cmpq %r14, %r15
jne 0x31b7c
jmp 0x31b06