// File: /workspace/github_cpp_makefile_star2_O2/halfflat[P]tinyopt/test/test_state.cc
// Function: state_shift_Test::TestBody()
TEST(state, shift) {
    const char* argstr = "zero\0one\0two\0three\0four\0five\0six\0";
    mockargs M(argstr);

    std::vector<char*> v0 = M.args;
    to::state s(M.argc, M.argv);

    s.shift(0);
    EXPECT_EQ(7, M.argc);
    EXPECT_EQ(0, M.argv[M.argc]);
    EXPECT_EQ(v0[0], M.argv[0]);

    s.shift();
    EXPECT_EQ(6, M.argc);
    EXPECT_EQ(0, M.argv[M.argc]);
    EXPECT_EQ(v0[1], M.argv[0]);

    s.skip();
    EXPECT_EQ(6, M.argc);
    EXPECT_EQ(0, M.argv[M.argc]);
    EXPECT_EQ(M.argv[1], s.argv[0]);
    EXPECT_EQ(v0[1], M.argv[0]);
    EXPECT_EQ(v0[2], s.argv[0]);

    s.shift(2);
    EXPECT_EQ(4, M.argc);
    EXPECT_EQ(0, M.argv[M.argc]);
    EXPECT_EQ(M.argv[1], s.argv[0]);
    EXPECT_EQ(v0[4], M.argv[1]);
    EXPECT_EQ(v0[4], s.argv[0]);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x78, %rsp
leaq 0x385af(%rip), %rsi     # 0x58161
leaq 0x20(%rsp), %r14
movq %r14, %rdi
callq 0x2488e
leaq 0x30(%rsp), %rbx
leaq 0x60(%rsp), %rdi
movq %rbx, %rsi
callq 0x248c2
movq 0x28(%rsp), %rax
leaq 0x48(%rsp), %rdi
movq %r14, (%rdi)
movq %rax, 0x8(%rdi)
andl $0x0, 0x10(%rdi)
xorl %esi, %esi
callq 0x24910
movq %rsp, %rcx
movl $0x7, (%rcx)
leaq 0x36540(%rip), %rsi     # 0x5613d
leaq 0x383be(%rip), %rdx     # 0x57fc2
leaq 0x10(%rsp), %rdi
movq %r14, %r8
callq 0x13a52
cmpb $0x0, 0x10(%rsp)
jne 0x1fc73
movq %rsp, %rdi
callq 0x3d5f6
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x1fc2f
movq (%rax), %r8
jmp 0x1fc36
leaq 0x39434(%rip), %r8      # 0x5906a
leaq 0x38337(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x14
popq %rcx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1fc73
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x18(%rsp), %rdi
callq 0x13646
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %r8
leaq 0x3d0b6(%rip), %rsi     # 0x5cd48
leaq 0x38330(%rip), %rdx     # 0x57fc9
leaq 0x10(%rsp), %rdi
xorl %ecx, %ecx
callq 0x2494e
cmpb $0x0, 0x10(%rsp)
jne 0x1fd07
movq %rsp, %rdi
callq 0x3d5f6
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x1fcc3
movq (%rax), %r8
jmp 0x1fcca
leaq 0x393a0(%rip), %r8      # 0x5906a
leaq 0x382a3(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x15
popq %rcx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1fd07
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x18(%rsp), %rdi
callq 0x13646
movq 0x60(%rsp), %rcx
movq 0x28(%rsp), %r8
leaq 0x382b6(%rip), %rsi     # 0x57fd8
leaq 0x382b5(%rip), %rdx     # 0x57fde
leaq 0x10(%rsp), %rdi
callq 0x250c4
cmpb $0x0, 0x10(%rsp)
jne 0x1fd95
movq %rsp, %rdi
callq 0x3d5f6
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x1fd51
movq (%rax), %r8
jmp 0x1fd58
leaq 0x39312(%rip), %r8      # 0x5906a
leaq 0x38215(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x16
popq %rcx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1fd95
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x18(%rsp), %rdi
callq 0x13646
leaq 0x48(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x24910
movq %rsp, %rcx
movl $0x6, (%rcx)
leaq 0x38d29(%rip), %rsi     # 0x58ae5
leaq 0x381ff(%rip), %rdx     # 0x57fc2
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %r8
callq 0x13a52
cmpb $0x0, 0x10(%rsp)
jne 0x1fe34
movq %rsp, %rdi
callq 0x3d5f6
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x1fdf0
movq (%rax), %r8
jmp 0x1fdf7
leaq 0x39273(%rip), %r8      # 0x5906a
leaq 0x38176(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x19
popq %rcx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1fe34
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x18(%rsp), %rdi
callq 0x13646
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %r8
leaq 0x3cef5(%rip), %rsi     # 0x5cd48
leaq 0x3816f(%rip), %rdx     # 0x57fc9
leaq 0x10(%rsp), %rdi
xorl %ecx, %ecx
callq 0x2494e
cmpb $0x0, 0x10(%rsp)
jne 0x1fec8
movq %rsp, %rdi
callq 0x3d5f6
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x1fe84
movq (%rax), %r8
jmp 0x1fe8b
leaq 0x391df(%rip), %r8      # 0x5906a
leaq 0x380e2(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x1a
popq %rcx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1fec8
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x18(%rsp), %rdi
callq 0x13646
movq 0x60(%rsp), %rcx
addq $0x8, %rcx
movq 0x28(%rsp), %r8
leaq 0x38101(%rip), %rsi     # 0x57fe8
leaq 0x380f0(%rip), %rdx     # 0x57fde
leaq 0x10(%rsp), %rdi
callq 0x250c4
cmpb $0x0, 0x10(%rsp)
jne 0x1ff5a
movq %rsp, %rdi
callq 0x3d5f6
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x1ff16
movq (%rax), %r8
jmp 0x1ff1d
leaq 0x3914d(%rip), %r8      # 0x5906a
leaq 0x38050(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x1b
popq %rcx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x1ff5a
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x18(%rsp), %rdi
callq 0x13646
movq 0x50(%rsp), %rax
cmpq $0x0, (%rax)
je 0x1ff78
addq $0x8, %rax
movq %rax, 0x50(%rsp)
movq %rsp, %rcx
movl $0x6, (%rcx)
leaq 0x38b5d(%rip), %rsi     # 0x58ae5
leaq 0x38033(%rip), %rdx     # 0x57fc2
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %r8
callq 0x13a52
cmpb $0x0, 0x10(%rsp)
jne 0x20000
movq %rsp, %rdi
callq 0x3d5f6
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x1ffbc
movq (%rax), %r8
jmp 0x1ffc3
leaq 0x390a7(%rip), %r8      # 0x5906a
leaq 0x37faa(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x1e
popq %rcx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x20000
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x18(%rsp), %rdi
callq 0x13646
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %r8
leaq 0x3cd29(%rip), %rsi     # 0x5cd48
leaq 0x37fa3(%rip), %rdx     # 0x57fc9
leaq 0x10(%rsp), %rdi
xorl %ecx, %ecx
callq 0x2494e
cmpb $0x0, 0x10(%rsp)
jne 0x20094
movq %rsp, %rdi
callq 0x3d5f6
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x20050
movq (%rax), %r8
jmp 0x20057
leaq 0x39013(%rip), %r8      # 0x5906a
leaq 0x37f16(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x1f
popq %rcx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x20094
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x18(%rsp), %rdi
callq 0x13646
movq 0x28(%rsp), %rcx
addq $0x8, %rcx
movq 0x50(%rsp), %r8
leaq 0x37f3b(%rip), %rsi     # 0x57fee
leaq 0x37f3e(%rip), %rdx     # 0x57ff8
leaq 0x10(%rsp), %rdi
callq 0x250c4
cmpb $0x0, 0x10(%rsp)
jne 0x20126
movq %rsp, %rdi
callq 0x3d5f6
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x200e2
movq (%rax), %r8
jmp 0x200e9
leaq 0x38f81(%rip), %r8      # 0x5906a
leaq 0x37e84(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x20
popq %rcx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x20126
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x18(%rsp), %rdi
callq 0x13646
movq 0x60(%rsp), %rcx
addq $0x8, %rcx
movq 0x28(%rsp), %r8
leaq 0x37ea3(%rip), %rsi     # 0x57fe8
leaq 0x37e92(%rip), %rdx     # 0x57fde
leaq 0x10(%rsp), %rdi
callq 0x250c4
cmpb $0x0, 0x10(%rsp)
jne 0x201b8
movq %rsp, %rdi
callq 0x3d5f6
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x20174
movq (%rax), %r8
jmp 0x2017b
leaq 0x38eef(%rip), %r8      # 0x5906a
leaq 0x37df2(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x21
popq %rcx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x201b8
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x18(%rsp), %rdi
callq 0x13646
movq 0x60(%rsp), %rcx
addq $0x10, %rcx
movq 0x50(%rsp), %r8
leaq 0x37e2b(%rip), %rsi     # 0x58002
leaq 0x37e1a(%rip), %rdx     # 0x57ff8
leaq 0x10(%rsp), %rdi
callq 0x250c4
cmpb $0x0, 0x10(%rsp)
jne 0x2024a
movq %rsp, %rdi
callq 0x3d5f6
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x20206
movq (%rax), %r8
jmp 0x2020d
leaq 0x38e5d(%rip), %r8      # 0x5906a
leaq 0x37d60(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x22
popq %rcx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x2024a
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x18(%rsp), %rdi
callq 0x13646
leaq 0x48(%rsp), %rdi
pushq $0x2
popq %rsi
callq 0x24910
movq %rsp, %rcx
movl $0x4, (%rcx)
leaq 0x38864(%rip), %rsi     # 0x58ad5
leaq 0x37d4a(%rip), %rdx     # 0x57fc2
leaq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %r8
callq 0x13a52
cmpb $0x0, 0x10(%rsp)
jne 0x202e9
movq %rsp, %rdi
callq 0x3d5f6
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x202a5
movq (%rax), %r8
jmp 0x202ac
leaq 0x38dbe(%rip), %r8      # 0x5906a
leaq 0x37cc1(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x25
popq %rcx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x202e9
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x18(%rsp), %rdi
callq 0x13646
movq 0x28(%rsp), %rax
movslq 0x20(%rsp), %rcx
movq (%rax,%rcx,8), %r8
leaq 0x3ca40(%rip), %rsi     # 0x5cd48
leaq 0x37cba(%rip), %rdx     # 0x57fc9
leaq 0x10(%rsp), %rdi
xorl %ecx, %ecx
callq 0x2494e
cmpb $0x0, 0x10(%rsp)
jne 0x2037d
movq %rsp, %rdi
callq 0x3d5f6
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x20339
movq (%rax), %r8
jmp 0x20340
leaq 0x38d2a(%rip), %r8      # 0x5906a
leaq 0x37c2d(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x26
popq %rcx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x2037d
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x18(%rsp), %rdi
callq 0x13646
movq 0x28(%rsp), %rcx
addq $0x8, %rcx
movq 0x50(%rsp), %r8
leaq 0x37c52(%rip), %rsi     # 0x57fee
leaq 0x37c55(%rip), %rdx     # 0x57ff8
leaq 0x10(%rsp), %rdi
callq 0x250c4
cmpb $0x0, 0x10(%rsp)
jne 0x2040f
movq %rsp, %rdi
callq 0x3d5f6
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x203cb
movq (%rax), %r8
jmp 0x203d2
leaq 0x38c98(%rip), %r8      # 0x5906a
leaq 0x37b9b(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x27
popq %rcx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x2040f
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x18(%rsp), %rdi
callq 0x13646
movq 0x60(%rsp), %rcx
addq $0x20, %rcx
movq 0x28(%rsp), %r8
addq $0x8, %r8
leaq 0x37bd6(%rip), %rsi     # 0x58008
leaq 0x37bb5(%rip), %rdx     # 0x57fee
leaq 0x10(%rsp), %rdi
callq 0x250c4
cmpb $0x0, 0x10(%rsp)
jne 0x204a5
movq %rsp, %rdi
callq 0x3d5f6
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x20461
movq (%rax), %r8
jmp 0x20468
leaq 0x38c02(%rip), %r8      # 0x5906a
leaq 0x37b05(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x28
popq %rcx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x204a5
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x18(%rsp), %rdi
callq 0x13646
movq 0x60(%rsp), %rcx
addq $0x20, %rcx
movq 0x50(%rsp), %r8
leaq 0x37b44(%rip), %rsi     # 0x58008
leaq 0x37b2d(%rip), %rdx     # 0x57ff8
leaq 0x10(%rsp), %rdi
callq 0x250c4
cmpb $0x0, 0x10(%rsp)
jne 0x20537
movq %rsp, %rdi
callq 0x3d5f6
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0x204f3
movq (%rax), %r8
jmp 0x204fa
leaq 0x38b70(%rip), %r8      # 0x5906a
leaq 0x37a73(%rip), %rdx     # 0x57f74
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x29
popq %rcx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x20537
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x18(%rsp), %rdi
callq 0x13646
leaq 0x60(%rsp), %rdi
callq 0x25080
movq %rbx, %rdi
callq 0x25080
addq $0x78, %rsp
popq %rbx
popq %r14
retq
jmp 0x205b5
jmp 0x205c4
jmp 0x205d8
jmp 0x205b5
jmp 0x205c4
jmp 0x205d8
jmp 0x205b5
jmp 0x205c4
jmp 0x205d8
jmp 0x205b5
jmp 0x205c4
jmp 0x205d8
jmp 0x205b5
jmp 0x205c4
jmp 0x205d8
jmp 0x205b5
jmp 0x205c4
jmp 0x205d8
jmp 0x205b5
jmp 0x205c4
jmp 0x205d8
jmp 0x205b5
jmp 0x205c4
jmp 0x205d8
jmp 0x205b5
jmp 0x205c4
jmp 0x205d8
jmp 0x205b5
jmp 0x205c4
jmp 0x205d8
jmp 0x205b5
jmp 0x205c4
jmp 0x205d8
jmp 0x205b5
jmp 0x205c4
jmp 0x205d8
jmp 0x205b5
jmp 0x205c4
jmp 0x205d8
jmp 0x205b5
jmp 0x205c4
jmp 0x205d8
jmp 0x205b5
jmp 0x205c4
jmp 0x205d8
movq %rax, %r14
leaq 0x8(%rsp), %rdi
callq 0x3b616
jmp 0x205c7
movq %rax, %r14
movq (%rsp), %rdi
testq %rdi, %rdi
je 0x205db
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x205db
movq %rax, %r14
leaq 0x18(%rsp), %rdi
callq 0x13646
jmp 0x20608
jmp 0x20605
jmp 0x20605
jmp 0x20605
jmp 0x20605
jmp 0x20605
jmp 0x20605
jmp 0x20605
jmp 0x20605
jmp 0x20605
jmp 0x20605
jmp 0x20605
jmp 0x20605
jmp 0x20605
jmp 0x20605
jmp 0x20605
movq %rax, %r14
leaq 0x60(%rsp), %rdi
callq 0x25080
movq %rbx, %rdi
callq 0x25080
movq %r14, %rdi
callq 0xdaa0
movq %rax, %r14
jmp 0x20612
nop