void test_one_unambiguous_completion(void) {
  char *buf;
  do {
    seatest_assert_int_equal(0, vle_compl_add_match("abcd"), __FUNCTION__, 88);
  } while (0);
  vle_compl_finish_group();
  do {
    seatest_assert_int_equal(0, vle_compl_add_last_match("a"), __FUNCTION__,
                             91);
  } while (0);
  buf = vle_compl_next();
  do {
    seatest_assert_string_equal("abcd", buf, __FUNCTION__, 94);
  } while (0);
  free(buf);
  buf = vle_compl_next();
  do {
    seatest_assert_string_equal("abcd", buf, __FUNCTION__, 97);
  } while (0);
  free(buf);
}


x86 assembly (clang, -O0):
<test_one_unambiguous_completion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1080 <vle_compl_add_match@plt>
mov    %eax,%esi
xor    %edi,%edi
lea    0xe74(%rip),%rdx
mov    $0x58,%ecx
mov    $0x0,%al
call   1070 <seatest_assert_int_equal@plt>
mov    $0x0,%al
call   1050 <vle_compl_finish_group@plt>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1090 <vle_compl_add_last_match@plt>
mov    %eax,%esi
xor    %edi,%edi
lea    0xe48(%rip),%rdx
mov    $0x5b,%ecx
mov    $0x0,%al
call   1070 <seatest_assert_int_equal@plt>
mov    $0x0,%al
call   1040 <vle_compl_next@plt>
cltq
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe1f(%rip),%rdi
lea    0xe1d(%rip),%rdx
mov    $0x5e,%ecx
mov    $0x0,%al
call   1060 <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    0xdeb(%rip),%rdi
lea    0xde9(%rip),%rdx
mov    $0x61,%ecx
mov    $0x0,%al
call   1060 <seatest_assert_string_equal@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_one_unambiguous_completion>:
push   %r15
push   %r14
push   %rbx
lea    0xe84(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <vle_compl_add_match@plt>
lea    0xe78(%rip),%r15
xor    %edi,%edi
mov    %eax,%esi
mov    %r15,%rdx
mov    $0x58,%ecx
xor    %eax,%eax
call   1070 <seatest_assert_int_equal@plt>
xor    %eax,%eax
call   1050 <vle_compl_finish_group@plt>
lea    0xe77(%rip),%rdi
xor    %eax,%eax
call   1090 <vle_compl_add_last_match@plt>
xor    %edi,%edi
mov    %eax,%esi
mov    %r15,%rdx
mov    $0x5b,%ecx
xor    %eax,%eax
call   1070 <seatest_assert_int_equal@plt>
xor    %eax,%eax
call   1040 <vle_compl_next@plt>
movslq %eax,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r15,%rdx
mov    $0x5e,%ecx
xor    %eax,%eax
call   1060 <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    %r15,%rdx
mov    $0x61,%ecx
xor    %eax,%eax
call   1060 <seatest_assert_string_equal@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"abcd\00"
@__FUNCTION__.test_one_unambiguous_completion = [32 x i8] c"test_one_unambiguous_completion\00"
@.str.1 = [2 x i8] c"a\00"
define void @test_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 ([32 x i8], [32 x i8]* @__FUNCTION__.test_one_unambiguous_completion, i64 0, i64 0), i32 88)
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 ([32 x i8], [32 x i8]* @__FUNCTION__.test_one_unambiguous_completion, i64 0, i64 0), i32 91)
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 ([32 x i8], [32 x i8]* @__FUNCTION__.test_one_unambiguous_completion, i64 0, i64 0), i32 94)
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 ([32 x i8], [32 x i8]* @__FUNCTION__.test_one_unambiguous_completion, i64 0, i64 0), i32 97)
br label %25
25: ; preds = %22
%26 = load i8*, i8** %1
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"abcd\00"
@__FUNCTION__.test_one_unambiguous_completion = [32 x i8] c"test_one_unambiguous_completion\00"
@.str.1 = [2 x i8] c"a\00"
define void @test_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 ([32 x i8], [32 x i8]* @__FUNCTION__.test_one_unambiguous_completion, i64 0, i64 0), i32 88)
%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 ([32 x i8], [32 x i8]* @__FUNCTION__.test_one_unambiguous_completion, i64 0, i64 0), i32 91)
%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 ([32 x i8], [32 x i8]* @__FUNCTION__.test_one_unambiguous_completion, i64 0, i64 0), i32 94)
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 ([32 x i8], [32 x i8]* @__FUNCTION__.test_one_unambiguous_completion, i64 0, i64 0), i32 97)
tail call void @free(i8* %12)
ret void
}