void test_one_element_completion(void) {
  char *buf;
  vle_compl_finish_group();
  do {
    seatest_assert_int_equal(0, vle_compl_add_match("a"), __FUNCTION__, 67);
  } while (0);
  buf = vle_compl_next();
  do {
    seatest_assert_string_equal("a", buf, __FUNCTION__, 70);
  } while (0);
  free(buf);
  buf = vle_compl_next();
  do {
    seatest_assert_string_equal("a", buf, __FUNCTION__, 73);
  } while (0);
  free(buf);
  buf = vle_compl_next();
  do {
    seatest_assert_string_equal("a", buf, __FUNCTION__, 76);
  } while (0);
  free(buf);
  buf = vle_compl_next();
  do {
    seatest_assert_string_equal("a", buf, __FUNCTION__, 79);
  } while (0);
  free(buf);
}


x86 assembly (clang, -O0):
<test_one_element_completion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <vle_compl_finish_group@plt>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1080 <vle_compl_add_match@plt>
mov    %eax,%esi
xor    %edi,%edi
lea    0xe7a(%rip),%rdx
mov    $0x43,%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    0xe54(%rip),%rdi
lea    0xe4f(%rip),%rdx
mov    $0x46,%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    0xe20(%rip),%rdi
lea    0xe1b(%rip),%rdx
mov    $0x49,%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    0xdec(%rip),%rdi
lea    0xde7(%rip),%rdx
mov    $0x4c,%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    0xdb8(%rip),%rdi
lea    0xdb3(%rip),%rdx
mov    $0x4f,%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_element_completion>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1050 <vle_compl_finish_group@plt>
lea    0xe8d(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <vle_compl_add_match@plt>
lea    0xe7e(%rip),%r15
xor    %edi,%edi
mov    %eax,%esi
mov    %r15,%rdx
mov    $0x43,%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    $0x46,%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    $0x49,%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    $0x4c,%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    $0x4f,%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 = [2 x i8] c"a\00"
@__FUNCTION__.test_one_element_completion = [28 x i8] c"test_one_element_completion\00"
define void @test_one_element_completion() {
%1 = alloca i8*
%2 = call i32 (...) @vle_compl_finish_group()
br label %3
3: ; preds = %0
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @vle_compl_add_match to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = 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 ([28 x i8], [28 x i8]* @__FUNCTION__.test_one_element_completion, i64 0, i64 0), i32 67)
br label %6
6: ; preds = %3
%7 = call i32 (...) @vle_compl_next()
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %1
br label %10
10: ; preds = %6
%11 = load i8*, i8** %1
%12 = 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, i64 0, i64 0), i8* %11, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__FUNCTION__.test_one_element_completion, i64 0, i64 0), i32 70)
br label %13
13: ; preds = %10
%14 = load i8*, i8** %1
%15 = call i32 (...) @vle_compl_next()
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i8*
store i8* %17, i8** %1
br label %18
18: ; preds = %13
%19 = load i8*, i8** %1
%20 = 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, i64 0, i64 0), i8* %19, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__FUNCTION__.test_one_element_completion, i64 0, i64 0), i32 73)
br label %21
21: ; preds = %18
%22 = load i8*, i8** %1
%23 = call i32 (...) @vle_compl_next()
%24 = sext i32 %23 to i64
%25 = inttoptr i64 %24 to i8*
store i8* %25, i8** %1
br label %26
26: ; preds = %21
%27 = load i8*, i8** %1
%28 = 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, i64 0, i64 0), i8* %27, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__FUNCTION__.test_one_element_completion, i64 0, i64 0), i32 76)
br label %29
29: ; preds = %26
%30 = load i8*, i8** %1
%31 = call i32 (...) @vle_compl_next()
%32 = sext i32 %31 to i64
%33 = inttoptr i64 %32 to i8*
store i8* %33, i8** %1
br label %34
34: ; preds = %29
%35 = load i8*, i8** %1
%36 = 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, i64 0, i64 0), i8* %35, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__FUNCTION__.test_one_element_completion, i64 0, i64 0), i32 79)
br label %37
37: ; preds = %34
%38 = load i8*, i8** %1
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"a\00"
@__FUNCTION__.test_one_element_completion = [28 x i8] c"test_one_element_completion\00"
define void @test_one_element_completion() {
%1 = tail call i32 (...) @vle_compl_finish_group()
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @vle_compl_add_match to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 0, i32 %2, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__FUNCTION__.test_one_element_completion, i64 0, i64 0), i32 67)
%4 = tail call i32 (...) @vle_compl_next()
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
%7 = 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, i64 0, i64 0), i8* %6, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__FUNCTION__.test_one_element_completion, i64 0, i64 0), i32 70)
tail call void @free(i8* %6)
%8 = tail call i32 (...) @vle_compl_next()
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = 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, i64 0, i64 0), i8* %10, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__FUNCTION__.test_one_element_completion, i64 0, i64 0), i32 73)
tail call void @free(i8* %10)
%12 = tail call i32 (...) @vle_compl_next()
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
%15 = 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, i64 0, i64 0), i8* %14, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__FUNCTION__.test_one_element_completion, i64 0, i64 0), i32 76)
tail call void @free(i8* %14)
%16 = tail call i32 (...) @vle_compl_next()
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i8*
%19 = 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, i64 0, i64 0), i8* %18, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @__FUNCTION__.test_one_element_completion, i64 0, i64 0), i32 79)
tail call void @free(i8* %18)
ret void
}