void test_set_values_completion(void) {
  char buf[] = "vifminfo=tui,c";
  const char *start;
  char *completed;
  vle_compl_reset();
  complete_options(buf, &start);
  do {
    seatest_assert_true(start == buf + 13, __FUNCTION__, 228);
  } while (0);
  completed = vle_compl_next();
  do {
    seatest_assert_string_equal("commands", completed, __FUNCTION__, 231);
  } while (0);
  free(completed);
  completed = vle_compl_next();
  do {
    seatest_assert_string_equal("cs", completed, __FUNCTION__, 235);
  } while (0);
  free(completed);
  completed = vle_compl_next();
  do {
    seatest_assert_string_equal("c", completed, __FUNCTION__, 239);
  } while (0);
  free(completed);
}


x86 assembly (clang, -O0):
<test_set_values_completion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xe91(%rip),%rax
mov    %rax,-0xf(%rbp)
mov    0xe8f(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xe89(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xe81(%rip),%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1080 <vle_compl_reset@plt>
lea    -0xf(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1060 <complete_options@plt>
mov    -0x18(%rbp),%rax
lea    -0xf(%rbp),%rcx
add    $0xd,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xe4b(%rip),%rsi
mov    $0xe4,%edx
mov    $0x0,%al
call   1050 <seatest_assert_true@plt>
mov    $0x0,%al
call   1040 <vle_compl_next@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe42(%rip),%rdi
lea    0xe20(%rip),%rdx
mov    $0xe7,%ecx
mov    $0x0,%al
call   1070 <seatest_assert_string_equal@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1040 <vle_compl_next@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe17(%rip),%rdi
lea    0xdec(%rip),%rdx
mov    $0xeb,%ecx
mov    $0x0,%al
call   1070 <seatest_assert_string_equal@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1040 <vle_compl_next@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xdbd(%rip),%rdi
lea    0xdb8(%rip),%rdx
mov    $0xef,%ecx
mov    $0x0,%al
call   1070 <seatest_assert_string_equal@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_set_values_completion>:
push   %r14
push   %rbx
sub    $0x18,%rsp
movabs $0x632c6975743d6f,%rax
mov    %rax,0x7(%rsp)
movabs $0x6f666e696d666976,%rax
6e 66 6f
mov    %rax,(%rsp)
xor    %eax,%eax
call   1080 <vle_compl_reset@plt>
mov    %rsp,%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1060 <complete_options@plt>
lea    0xd(%rsp),%rax
xor    %edi,%edi
cmp    %rax,0x10(%rsp)
sete   %dil
lea    0xe5e(%rip),%r14
mov    %r14,%rsi
mov    $0xe4,%edx
xor    %eax,%eax
call   1050 <seatest_assert_true@plt>
xor    %eax,%eax
call   1040 <vle_compl_next@plt>
movslq %eax,%rbx
lea    0xe59(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0xe7,%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
lea    0xe37(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0xeb,%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
lea    0xde6(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0xef,%ecx
xor    %eax,%eax
call   1070 <seatest_assert_string_equal@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.test_set_values_completion.buf = [15 x i8] c"vifminfo=tui,c\00"
@__FUNCTION__.test_set_values_completion = [27 x i8] c"test_set_values_completion\00"
@.str = [9 x i8] c"commands\00"
@.str.1 = [3 x i8] c"cs\00"
@.str.2 = [2 x i8] c"c\00"
define void @test_set_values_completion() {
%1 = alloca [15 x i8]
%2 = alloca i8*
%3 = alloca i8*
%4 = bitcast [15 x i8]* %1 to i8*
%5 = call i32 (...) @vle_compl_reset()
%6 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%7 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @complete_options to i32 (i8*, i8**, ...)*)(i8* %6, i8** %2)
br label %8
8: ; preds = %0
%9 = load i8*, i8** %2
%10 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%11 = getelementptr inbounds i8, i8* %10, i64 13
%12 = icmp eq i8* %9, %11
%13 = zext i1 %12 to i32
%14 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_true to i32 (i32, i8*, i32, ...)*)(i32 %13, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__FUNCTION__.test_set_values_completion, i64 0, i64 0), i32 228)
br label %15
15: ; preds = %8
%16 = call i32 (...) @vle_compl_next()
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i8*
store i8* %18, i8** %3
br label %19
19: ; preds = %15
%20 = load i8*, i8** %3
%21 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %20, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__FUNCTION__.test_set_values_completion, i64 0, i64 0), i32 231)
br label %22
22: ; preds = %19
%23 = load i8*, i8** %3
%24 = call i32 (...) @vle_compl_next()
%25 = sext i32 %24 to i64
%26 = inttoptr i64 %25 to i8*
store i8* %26, i8** %3
br label %27
27: ; preds = %22
%28 = load i8*, i8** %3
%29 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %28, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__FUNCTION__.test_set_values_completion, i64 0, i64 0), i32 235)
br label %30
30: ; preds = %27
%31 = load i8*, i8** %3
%32 = call i32 (...) @vle_compl_next()
%33 = sext i32 %32 to i64
%34 = inttoptr i64 %33 to i8*
store i8* %34, i8** %3
br label %35
35: ; preds = %30
%36 = load i8*, i8** %3
%37 = 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* %36, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__FUNCTION__.test_set_values_completion, i64 0, i64 0), i32 239)
br label %38
38: ; preds = %35
%39 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
@__const.test_set_values_completion.buf = [15 x i8] c"vifminfo=tui,c\00"
@__FUNCTION__.test_set_values_completion = [27 x i8] c"test_set_values_completion\00"
@.str = [9 x i8] c"commands\00"
@.str.1 = [3 x i8] c"cs\00"
@.str.2 = [2 x i8] c"c\00"
define void @test_set_values_completion() {
%1 = alloca [15 x i8]
%2 = alloca i8*
%3 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%4 = bitcast i8** %2 to i8*
%5 = tail call i32 (...) @vle_compl_reset()
%6 = call i32 (i8*, i8**, ...) bitcast (i32 (...)* @complete_options to i32 (i8*, i8**, ...)*)(i8* %3, i8** %2)
%7 = load i8*, i8** %2
%8 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 13
%9 = icmp eq i8* %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_true to i32 (i32, i8*, i32, ...)*)(i32 %10, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__FUNCTION__.test_set_values_completion, i64 0, i64 0), i32 228)
%12 = call i32 (...) @vle_compl_next()
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i8*
%15 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* %14, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__FUNCTION__.test_set_values_completion, i64 0, i64 0), i32 231)
%16 = call i32 (...) @vle_compl_next()
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i8*
%19 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %18, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__FUNCTION__.test_set_values_completion, i64 0, i64 0), i32 235)
%20 = call i32 (...) @vle_compl_next()
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i8*
%23 = 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* %22, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @__FUNCTION__.test_set_values_completion, i64 0, i64 0), i32 239)
ret void
}