void test_rewind_one_unambiguous_completion(void) {
  char *buf;
  do {
    seatest_assert_int_equal(0, vle_compl_add_match("abcd"), __FUNCTION__, 106);
  } while (0);
  vle_compl_finish_group();
  do {
    seatest_assert_int_equal(0, vle_compl_add_last_match("a"), __FUNCTION__,
                             109);
  } while (0);
  buf = vle_compl_next();
  do {
    seatest_assert_string_equal("abcd", buf, __FUNCTION__, 112);
  } while (0);
  free(buf);
  buf = vle_compl_next();
  do {
    seatest_assert_string_equal("abcd", buf, __FUNCTION__, 115);
  } while (0);
  free(buf);
  vle_compl_rewind();
  buf = vle_compl_next();
  do {
    seatest_assert_string_equal("a", buf, __FUNCTION__, 121);
  } while (0);
  free(buf);
  buf = vle_compl_next();
  do {
    seatest_assert_string_equal("abcd", buf, __FUNCTION__, 124);
  } while (0);
  free(buf);
}


x86 assembly (clang, -O0):
<test_rewind_one_unambiguous_completion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1090 <vle_compl_add_match@plt>
mov    %eax,%esi
xor    %edi,%edi
lea    0xe64(%rip),%rdx
mov    $0x6a,%ecx
mov    $0x0,%al
call   1080 <seatest_assert_int_equal@plt>
mov    $0x0,%al
call   1060 <vle_compl_finish_group@plt>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   10a0 <vle_compl_add_last_match@plt>
mov    %eax,%esi
xor    %edi,%edi
lea    0xe38(%rip),%rdx
mov    $0x6d,%ecx
mov    $0x0,%al
call   1080 <seatest_assert_int_equal@plt>
mov    $0x0,%al
call   1040 <vle_compl_next@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe0f(%rip),%rdi
lea    0xe0d(%rip),%rdx
mov    $0x70,%ecx
mov    $0x0,%al
call   1070 <seatest_assert_string_equal@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1040 <vle_compl_next@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xddb(%rip),%rdi
lea    0xdd9(%rip),%rdx
mov    $0x73,%ecx
mov    $0x0,%al
call   1070 <seatest_assert_string_equal@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1050 <vle_compl_rewind@plt>
mov    $0x0,%al
call   1040 <vle_compl_next@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xdcc(%rip),%rdi
lea    0xd9e(%rip),%rdx
mov    $0x79,%ecx
mov    $0x0,%al
call   1070 <seatest_assert_string_equal@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1040 <vle_compl_next@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xd6c(%rip),%rdi
lea    0xd6a(%rip),%rdx
mov    $0x7c,%ecx
mov    $0x0,%al
call   1070 <seatest_assert_string_equal@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_rewind_one_unambiguous_completion>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xe71(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1090 <vle_compl_add_match@plt>
lea    0xe65(%rip),%r12
xor    %edi,%edi
mov    %eax,%esi
mov    %r12,%rdx
mov    $0x6a,%ecx
xor    %eax,%eax
call   1080 <seatest_assert_int_equal@plt>
xor    %eax,%eax
call   1060 <vle_compl_finish_group@plt>
lea    0xe6b(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   10a0 <vle_compl_add_last_match@plt>
xor    %edi,%edi
mov    %eax,%esi
mov    %r12,%rdx
mov    $0x6d,%ecx
xor    %eax,%eax
call   1080 <seatest_assert_int_equal@plt>
xor    %eax,%eax
call   1040 <vle_compl_next@plt>
movslq %eax,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    $0x70,%ecx
xor    %eax,%eax
call   1070 <seatest_assert_string_equal@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1040 <vle_compl_next@plt>
movslq %eax,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    $0x73,%ecx
xor    %eax,%eax
call   1070 <seatest_assert_string_equal@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1050 <vle_compl_rewind@plt>
xor    %eax,%eax
call   1040 <vle_compl_next@plt>
movslq %eax,%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    $0x79,%ecx
xor    %eax,%eax
call   1070 <seatest_assert_string_equal@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   1040 <vle_compl_next@plt>
movslq %eax,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
mov    $0x7c,%ecx
xor    %eax,%eax
call   1070 <seatest_assert_string_equal@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"abcd\00"
@__FUNCTION__.test_rewind_one_unambiguous_completion = [39 x i8] c"test_rewind_one_unambiguous_completion\00"
@.str.1 = [2 x i8] c"a\00"
define void @test_rewind_one_unambiguous_completion() {
%1 = alloca i8*
br label %2
2: ; preds = %0
%3 = call i32 (i8*, ...) bitcast (i32 (...)* @vle_compl_add_match to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 0, i32 %3, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @__FUNCTION__.test_rewind_one_unambiguous_completion, i64 0, i64 0), i32 106)
br label %5
5: ; preds = %2
%6 = call i32 (...) @vle_compl_finish_group()
br label %7
7: ; preds = %5
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @vle_compl_add_last_match to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 0, i32 %8, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @__FUNCTION__.test_rewind_one_unambiguous_completion, i64 0, i64 0), i32 109)
br label %10
10: ; preds = %7
%11 = call i32 (...) @vle_compl_next()
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
store i8* %13, i8** %1
br label %14
14: ; preds = %10
%15 = load i8*, i8** %1
%16 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %15, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @__FUNCTION__.test_rewind_one_unambiguous_completion, i64 0, i64 0), i32 112)
br label %17
17: ; preds = %14
%18 = load i8*, i8** %1
%19 = call i32 (...) @vle_compl_next()
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i8*
store i8* %21, i8** %1
br label %22
22: ; preds = %17
%23 = load i8*, i8** %1
%24 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %23, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @__FUNCTION__.test_rewind_one_unambiguous_completion, i64 0, i64 0), i32 115)
br label %25
25: ; preds = %22
%26 = load i8*, i8** %1
%27 = call i32 (...) @vle_compl_rewind()
%28 = call i32 (...) @vle_compl_next()
%29 = sext i32 %28 to i64
%30 = inttoptr i64 %29 to i8*
store i8* %30, i8** %1
br label %31
31: ; preds = %25
%32 = load i8*, i8** %1
%33 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %32, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @__FUNCTION__.test_rewind_one_unambiguous_completion, i64 0, i64 0), i32 121)
br label %34
34: ; preds = %31
%35 = load i8*, i8** %1
%36 = call i32 (...) @vle_compl_next()
%37 = sext i32 %36 to i64
%38 = inttoptr i64 %37 to i8*
store i8* %38, i8** %1
br label %39
39: ; preds = %34
%40 = load i8*, i8** %1
%41 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %40, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @__FUNCTION__.test_rewind_one_unambiguous_completion, i64 0, i64 0), i32 124)
br label %42
42: ; preds = %39
%43 = load i8*, i8** %1
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"abcd\00"
@__FUNCTION__.test_rewind_one_unambiguous_completion = [39 x i8] c"test_rewind_one_unambiguous_completion\00"
@.str.1 = [2 x i8] c"a\00"
define void @test_rewind_one_unambiguous_completion() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @vle_compl_add_match to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 0, i32 %1, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @__FUNCTION__.test_rewind_one_unambiguous_completion, i64 0, i64 0), i32 106)
%3 = tail call i32 (...) @vle_compl_finish_group()
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @vle_compl_add_last_match to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = tail call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 0, i32 %4, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @__FUNCTION__.test_rewind_one_unambiguous_completion, i64 0, i64 0), i32 109)
%6 = tail call i32 (...) @vle_compl_next()
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %8, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @__FUNCTION__.test_rewind_one_unambiguous_completion, i64 0, i64 0), i32 112)
tail call void @free(i8* %8)
%10 = tail call i32 (...) @vle_compl_next()
%11 = sext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
%13 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %12, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @__FUNCTION__.test_rewind_one_unambiguous_completion, i64 0, i64 0), i32 115)
tail call void @free(i8* %12)
%14 = tail call i32 (...) @vle_compl_rewind()
%15 = tail call i32 (...) @vle_compl_next()
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i8*
%18 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* %17, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @__FUNCTION__.test_rewind_one_unambiguous_completion, i64 0, i64 0), i32 121)
tail call void @free(i8* %17)
%19 = tail call i32 (...) @vle_compl_next()
%20 = sext i32 %19 to i64
%21 = inttoptr i64 %20 to i8*
%22 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %21, i8* getelementptr inbounds ([39 x i8], [39 x i8]* @__FUNCTION__.test_rewind_one_unambiguous_completion, i64 0, i64 0), i32 124)
tail call void @free(i8* %21)
ret void
}