void test_general(void) {
  char *buf;
  do {
    seatest_assert_int_equal(0, vle_compl_add_match("abc"), __FUNCTION__, 12);
  } while (0);
  do {
    seatest_assert_int_equal(0, vle_compl_add_match("acd"), __FUNCTION__, 13);
  } while (0);
  vle_compl_finish_group();
  do {
    seatest_assert_int_equal(0, vle_compl_add_last_match("a"), __FUNCTION__,
                             16);
  } while (0);
  buf = vle_compl_next();
  do {
    seatest_assert_string_equal("abc", buf, __FUNCTION__, 19);
  } while (0);
  free(buf);
  buf = vle_compl_next();
  do {
    seatest_assert_string_equal("acd", buf, __FUNCTION__, 22);
  } while (0);
  free(buf);
  buf = vle_compl_next();
  do {
    seatest_assert_string_equal("a", buf, __FUNCTION__, 25);
  } while (0);
  free(buf);
  buf = vle_compl_next();
  do {
    seatest_assert_string_equal("abc", buf, __FUNCTION__, 28);
  } while (0);
  free(buf);
  buf = vle_compl_next();
  do {
    seatest_assert_string_equal("acd", buf, __FUNCTION__, 31);
  } while (0);
  free(buf);
}


x86 assembly (clang, -O0):
<test_general>:
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    0xe73(%rip),%rdx
mov    $0xc,%ecx
mov    $0x0,%al
call   1070 <seatest_assert_int_equal@plt>
jmp    11a2 <test_general+0x32>
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1080 <vle_compl_add_match@plt>
mov    %eax,%esi
xor    %edi,%edi
lea    0xe49(%rip),%rdx
mov    $0xd,%ecx
mov    $0x0,%al
call   1070 <seatest_assert_int_equal@plt>
mov    $0x0,%al
call   1050 <vle_compl_finish_group@plt>
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1090 <vle_compl_add_last_match@plt>
mov    %eax,%esi
xor    %edi,%edi
lea    0xe1d(%rip),%rdx
mov    $0x10,%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    0xdf5(%rip),%rdi
lea    0xdf2(%rip),%rdx
mov    $0x13,%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    0xdd2(%rip),%rdi
lea    0xdbe(%rip),%rdx
mov    $0x16,%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    0xda2(%rip),%rdi
lea    0xd8a(%rip),%rdx
mov    $0x19,%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    0xd59(%rip),%rdi
lea    0xd56(%rip),%rdx
mov    $0x1c,%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    0xd36(%rip),%rdi
lea    0xd22(%rip),%rdx
mov    $0x1f,%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_general>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
lea    0xe80(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <vle_compl_add_match@plt>
lea    0xe73(%rip),%r13
xor    %edi,%edi
mov    %eax,%esi
mov    %r13,%rdx
mov    $0xc,%ecx
xor    %eax,%eax
call   1070 <seatest_assert_int_equal@plt>
lea    0xe66(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1080 <vle_compl_add_match@plt>
xor    %edi,%edi
mov    %eax,%esi
mov    %r13,%rdx
mov    $0xd,%ecx
xor    %eax,%eax
call   1070 <seatest_assert_int_equal@plt>
xor    %eax,%eax
call   1050 <vle_compl_finish_group@plt>
lea    0xe3f(%rip),%r12
mov    %r12,%rdi
xor    %eax,%eax
call   1090 <vle_compl_add_last_match@plt>
xor    %edi,%edi
mov    %eax,%esi
mov    %r13,%rdx
mov    $0x10,%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    %r13,%rdx
mov    $0x13,%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    %r15,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
mov    $0x16,%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    %r12,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
mov    $0x19,%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    %r13,%rdx
mov    $0x1c,%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    %r15,%rdi
mov    %rbx,%rsi
mov    %r13,%rdx
mov    $0x1f,%ecx
xor    %eax,%eax
call   1060 <seatest_assert_string_equal@plt>
mov    %rbx,%rdi
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"abc\00"
@__FUNCTION__.test_general = [13 x i8] c"test_general\00"
@.str.1 = [4 x i8] c"acd\00"
@.str.2 = [2 x i8] c"a\00"
define void @test_general() {
%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 ([4 x i8], [4 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 ([13 x i8], [13 x i8]* @__FUNCTION__.test_general, i64 0, i64 0), i32 12)
br label %5
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = call i32 (i8*, ...) bitcast (i32 (...)* @vle_compl_add_match to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 0, i32 %7, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_general, i64 0, i64 0), i32 13)
br label %9
9: ; preds = %6
%10 = call i32 (...) @vle_compl_finish_group()
br label %11
11: ; preds = %9
%12 = call i32 (i8*, ...) bitcast (i32 (...)* @vle_compl_add_last_match to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 0, i32 %12, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_general, i64 0, i64 0), i32 16)
br label %14
14: ; preds = %11
%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 = %14
%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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %19, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_general, i64 0, i64 0), i32 19)
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 ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %27, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_general, i64 0, i64 0), i32 22)
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.2, i64 0, i64 0), i8* %35, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_general, i64 0, i64 0), i32 25)
br label %37
37: ; preds = %34
%38 = load i8*, i8** %1
%39 = call i32 (...) @vle_compl_next()
%40 = sext i32 %39 to i64
%41 = inttoptr i64 %40 to i8*
store i8* %41, i8** %1
br label %42
42: ; preds = %37
%43 = load i8*, i8** %1
%44 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %43, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_general, i64 0, i64 0), i32 28)
br label %45
45: ; preds = %42
%46 = load i8*, i8** %1
%47 = call i32 (...) @vle_compl_next()
%48 = sext i32 %47 to i64
%49 = inttoptr i64 %48 to i8*
store i8* %49, i8** %1
br label %50
50: ; preds = %45
%51 = load i8*, i8** %1
%52 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %51, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_general, i64 0, i64 0), i32 31)
br label %53
53: ; preds = %50
%54 = load i8*, i8** %1
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"abc\00"
@__FUNCTION__.test_general = [13 x i8] c"test_general\00"
@.str.1 = [4 x i8] c"acd\00"
@.str.2 = [2 x i8] c"a\00"
define void @test_general() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @vle_compl_add_match to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 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 ([13 x i8], [13 x i8]* @__FUNCTION__.test_general, i64 0, i64 0), i32 12)
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @vle_compl_add_match to i32 (i8*, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%4 = tail 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 ([13 x i8], [13 x i8]* @__FUNCTION__.test_general, i64 0, i64 0), i32 13)
%5 = tail call i32 (...) @vle_compl_finish_group()
%6 = tail call i32 (i8*, ...) bitcast (i32 (...)* @vle_compl_add_last_match to i32 (i8*, ...)*)(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 0, i32 %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_general, i64 0, i64 0), i32 16)
%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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %10, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_general, i64 0, i64 0), i32 19)
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 ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %14, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_general, i64 0, i64 0), i32 22)
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.2, i64 0, i64 0), i8* %18, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_general, i64 0, i64 0), i32 25)
tail call void @free(i8* %18)
%20 = tail call i32 (...) @vle_compl_next()
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i8*
%23 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %22, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_general, i64 0, i64 0), i32 28)
tail call void @free(i8* %22)
%24 = tail call i32 (...) @vle_compl_next()
%25 = sext i32 %24 to i64
%26 = inttoptr i64 %25 to i8*
%27 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %26, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_general, i64 0, i64 0), i32 31)
tail call void @free(i8* %26)
ret void
}