void test_removes_duplicates(void) {
  char *buf;
  do {
    seatest_assert_int_equal(0, vle_compl_add_match("mou"), __FUNCTION__, 267);
  } while (0);
  do {
    seatest_assert_int_equal(0, vle_compl_add_match("mount"), __FUNCTION__,
                             268);
  } while (0);
  do {
    seatest_assert_int_equal(0, vle_compl_add_match("mount"), __FUNCTION__,
                             269);
  } while (0);
  vle_compl_finish_group();
  do {
    seatest_assert_int_equal(0, vle_compl_add_last_match("m"), __FUNCTION__,
                             272);
  } while (0);
  buf = vle_compl_next();
  do {
    seatest_assert_string_equal("mou", buf, __FUNCTION__, 275);
  } while (0);
  free(buf);
  buf = vle_compl_next();
  do {
    seatest_assert_string_equal("mount", buf, __FUNCTION__, 279);
  } while (0);
  free(buf);
  buf = vle_compl_next();
  do {
    seatest_assert_string_equal("m", buf, __FUNCTION__, 283);
  } while (0);
  free(buf);
  buf = vle_compl_next();
  do {
    seatest_assert_string_equal("mou", buf, __FUNCTION__, 287);
  } while (0);
  free(buf);
}


x86 assembly (clang, -O0):
<test_removes_duplicates>:
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    $0x10b,%ecx
mov    $0x0,%al
call   1070 <seatest_assert_int_equal@plt>
jmp    11a2 <test_removes_duplicates+0x32>
lea    0xe73(%rip),%rdi
mov    $0x0,%al
call   1080 <vle_compl_add_match@plt>
mov    %eax,%esi
xor    %edi,%edi
lea    0xe49(%rip),%rdx
mov    $0x10c,%ecx
mov    $0x0,%al
call   1070 <seatest_assert_int_equal@plt>
jmp    11cc <test_removes_duplicates+0x5c>
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1080 <vle_compl_add_match@plt>
mov    %eax,%esi
xor    %edi,%edi
lea    0xe1f(%rip),%rdx
mov    $0x10d,%ecx
mov    $0x0,%al
call   1070 <seatest_assert_int_equal@plt>
mov    $0x0,%al
call   1050 <vle_compl_finish_group@plt>
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1090 <vle_compl_add_last_match@plt>
mov    %eax,%esi
xor    %edi,%edi
lea    0xdf3(%rip),%rdx
mov    $0x110,%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    0xdcb(%rip),%rdi
lea    0xdc8(%rip),%rdx
mov    $0x113,%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    0xdb3(%rip),%rdi
lea    0xd94(%rip),%rdx
mov    $0x117,%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    0xd85(%rip),%rdi
lea    0xd60(%rip),%rdx
mov    $0x11b,%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    0xd2f(%rip),%rdi
lea    0xd2c(%rip),%rdx
mov    $0x11f,%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_removes_duplicates>:
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    $0x10b,%ecx
xor    %eax,%eax
call   1070 <seatest_assert_int_equal@plt>
lea    0xe71(%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    $0x10c,%ecx
xor    %eax,%eax
call   1070 <seatest_assert_int_equal@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1080 <vle_compl_add_match@plt>
xor    %edi,%edi
mov    %eax,%esi
mov    %r13,%rdx
mov    $0x10d,%ecx
xor    %eax,%eax
call   1070 <seatest_assert_int_equal@plt>
xor    %eax,%eax
call   1050 <vle_compl_finish_group@plt>
lea    0xe2f(%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    $0x110,%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    $0x113,%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    $0x117,%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    $0x11b,%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    $0x11f,%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"mou\00"
@__FUNCTION__.test_removes_duplicates = [24 x i8] c"test_removes_duplicates\00"
@.str.1 = [6 x i8] c"mount\00"
@.str.2 = [2 x i8] c"m\00"
define void @test_removes_duplicates() {
%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 ([24 x i8], [24 x i8]* @__FUNCTION__.test_removes_duplicates, i64 0, i64 0), i32 267)
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 ([6 x i8], [6 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 ([24 x i8], [24 x i8]* @__FUNCTION__.test_removes_duplicates, i64 0, i64 0), i32 268)
br label %9
9: ; preds = %6
br label %10
10: ; preds = %9
%11 = call i32 (i8*, ...) bitcast (i32 (...)* @vle_compl_add_match to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 0, i32 %11, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.test_removes_duplicates, i64 0, i64 0), i32 269)
br label %13
13: ; preds = %10
%14 = call i32 (...) @vle_compl_finish_group()
br label %15
15: ; preds = %13
%16 = 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))
%17 = call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 0, i32 %16, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.test_removes_duplicates, i64 0, i64 0), i32 272)
br label %18
18: ; preds = %15
%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 = %18
%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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %23, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.test_removes_duplicates, i64 0, i64 0), i32 275)
br label %25
25: ; preds = %22
%26 = load i8*, i8** %1
%27 = call i32 (...) @vle_compl_next()
%28 = sext i32 %27 to i64
%29 = inttoptr i64 %28 to i8*
store i8* %29, i8** %1
br label %30
30: ; preds = %25
%31 = load i8*, i8** %1
%32 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %31, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.test_removes_duplicates, i64 0, i64 0), i32 279)
br label %33
33: ; preds = %30
%34 = load i8*, i8** %1
%35 = call i32 (...) @vle_compl_next()
%36 = sext i32 %35 to i64
%37 = inttoptr i64 %36 to i8*
store i8* %37, i8** %1
br label %38
38: ; preds = %33
%39 = load i8*, i8** %1
%40 = 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* %39, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.test_removes_duplicates, i64 0, i64 0), i32 283)
br label %41
41: ; preds = %38
%42 = load i8*, i8** %1
%43 = call i32 (...) @vle_compl_next()
%44 = sext i32 %43 to i64
%45 = inttoptr i64 %44 to i8*
store i8* %45, i8** %1
br label %46
46: ; preds = %41
%47 = load i8*, i8** %1
%48 = 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* %47, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.test_removes_duplicates, i64 0, i64 0), i32 287)
br label %49
49: ; preds = %46
%50 = load i8*, i8** %1
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"mou\00"
@__FUNCTION__.test_removes_duplicates = [24 x i8] c"test_removes_duplicates\00"
@.str.1 = [6 x i8] c"mount\00"
@.str.2 = [2 x i8] c"m\00"
define void @test_removes_duplicates() {
%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 ([24 x i8], [24 x i8]* @__FUNCTION__.test_removes_duplicates, i64 0, i64 0), i32 267)
%3 = tail call i32 (i8*, ...) bitcast (i32 (...)* @vle_compl_add_match to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 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 ([24 x i8], [24 x i8]* @__FUNCTION__.test_removes_duplicates, i64 0, i64 0), i32 268)
%5 = tail call i32 (i8*, ...) bitcast (i32 (...)* @vle_compl_add_match to i32 (i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (i32, i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_int_equal to i32 (i32, i32, i8*, i32, ...)*)(i32 0, i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.test_removes_duplicates, i64 0, i64 0), i32 269)
%7 = tail call i32 (...) @vle_compl_finish_group()
%8 = 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))
%9 = tail 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 ([24 x i8], [24 x i8]* @__FUNCTION__.test_removes_duplicates, i64 0, i64 0), i32 272)
%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 ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.test_removes_duplicates, i64 0, i64 0), i32 275)
tail call void @free(i8* %12)
%14 = tail call i32 (...) @vle_compl_next()
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i8*
%17 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i8* %16, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.test_removes_duplicates, i64 0, i64 0), i32 279)
tail call void @free(i8* %16)
%18 = tail call i32 (...) @vle_compl_next()
%19 = sext i32 %18 to i64
%20 = inttoptr i64 %19 to i8*
%21 = 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* %20, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.test_removes_duplicates, i64 0, i64 0), i32 283)
tail call void @free(i8* %20)
%22 = tail call i32 (...) @vle_compl_next()
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i8*
%25 = 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* %24, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @__FUNCTION__.test_removes_duplicates, i64 0, i64 0), i32 287)
tail call void @free(i8* %24)
ret void
}