void test_one_choice_val(void) {
  char buf[] = "sort=n";
  const char *start;
  char *completed;
  vle_compl_reset();
  complete_options(buf, &start);
  do {
    seatest_assert_true(start == buf + 5, __FUNCTION__, 67);
  } while (0);
  completed = vle_compl_next();
  do {
    seatest_assert_string_equal("name", completed, __FUNCTION__, 70);
  } while (0);
  free(completed);
  completed = vle_compl_next();
  do {
    seatest_assert_string_equal("name", completed, __FUNCTION__, 74);
  } while (0);
  free(completed);
  completed = vle_compl_next();
  do {
    seatest_assert_string_equal("name", completed, __FUNCTION__, 78);
  } while (0);
  free(completed);
}


x86 assembly (clang, -O0):
<test_one_choice_val>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xe92(%rip),%eax
mov    %eax,-0x7(%rbp)
mov    0xe8c(%rip),%ax
mov    %ax,-0x3(%rbp)
mov    0xe84(%rip),%al
mov    %al,-0x1(%rbp)
mov    $0x0,%al
call   1080 <vle_compl_reset@plt>
lea    -0x7(%rbp),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1060 <complete_options@plt>
mov    -0x10(%rbp),%rax
lea    -0x7(%rbp),%rcx
add    $0x5,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xe4e(%rip),%rsi
mov    $0x43,%edx
mov    $0x0,%al
call   1050 <seatest_assert_true@plt>
mov    $0x0,%al
call   1040 <vle_compl_next@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe3e(%rip),%rdi
lea    0xe23(%rip),%rdx
mov    $0x46,%ecx
mov    $0x0,%al
call   1070 <seatest_assert_string_equal@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1040 <vle_compl_next@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xe0a(%rip),%rdi
lea    0xdef(%rip),%rdx
mov    $0x4a,%ecx
mov    $0x0,%al
call   1070 <seatest_assert_string_equal@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   1040 <vle_compl_next@plt>
cltq
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    0xdd6(%rip),%rdi
lea    0xdbb(%rip),%rdx
mov    $0x4e,%ecx
mov    $0x0,%al
call   1070 <seatest_assert_string_equal@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_one_choice_val>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
movl   $0x6e3d74,0x3(%rsp)
movl   $0x74726f73,(%rsp)
xor    %eax,%eax
call   1080 <vle_compl_reset@plt>
mov    %rsp,%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1060 <complete_options@plt>
lea    0x5(%rsp),%rax
xor    %edi,%edi
cmp    %rax,0x8(%rsp)
sete   %dil
lea    0xe62(%rip),%r14
mov    %r14,%rsi
mov    $0x43,%edx
xor    %eax,%eax
call   1050 <seatest_assert_true@plt>
xor    %eax,%eax
call   1040 <vle_compl_next@plt>
movslq %eax,%rbx
lea    0xe56(%rip),%r15
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x46,%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
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x4a,%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
mov    %r15,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0x4e,%ecx
xor    %eax,%eax
call   1070 <seatest_assert_string_equal@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.test_one_choice_val.buf = [7 x i8] c"sort=n\00"
@__FUNCTION__.test_one_choice_val = [20 x i8] c"test_one_choice_val\00"
@.str = [5 x i8] c"name\00"
define void @test_one_choice_val() {
%1 = alloca [7 x i8]
%2 = alloca i8*
%3 = alloca i8*
%4 = bitcast [7 x i8]* %1 to i8*
%5 = call i32 (...) @vle_compl_reset()
%6 = getelementptr inbounds [7 x i8], [7 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 [7 x i8], [7 x i8]* %1, i64 0, i64 0
%11 = getelementptr inbounds i8, i8* %10, i64 5
%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 ([20 x i8], [20 x i8]* @__FUNCTION__.test_one_choice_val, i64 0, i64 0), i32 67)
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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %20, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.test_one_choice_val, i64 0, i64 0), i32 70)
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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %28, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.test_one_choice_val, i64 0, i64 0), i32 74)
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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %36, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.test_one_choice_val, i64 0, i64 0), i32 78)
br label %38
38: ; preds = %35
%39 = load i8*, i8** %3
ret void
}

LLVM IR (-O2):
@__const.test_one_choice_val.buf = [7 x i8] c"sort=n\00"
@__FUNCTION__.test_one_choice_val = [20 x i8] c"test_one_choice_val\00"
@.str = [5 x i8] c"name\00"
define void @test_one_choice_val() {
%1 = alloca [7 x i8]
%2 = alloca i8*
%3 = getelementptr inbounds [7 x i8], [7 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 [7 x i8], [7 x i8]* %1, i64 0, i64 5
%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 ([20 x i8], [20 x i8]* @__FUNCTION__.test_one_choice_val, i64 0, i64 0), i32 67)
%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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %14, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.test_one_choice_val, i64 0, i64 0), i32 70)
%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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %18, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.test_one_choice_val, i64 0, i64 0), i32 74)
%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 ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %22, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @__FUNCTION__.test_one_choice_val, i64 0, i64 0), i32 78)
ret void
}