int rl_vi_search(count, key)
int count, key;
{
  switch (key) {
  case '?':
    _rl_free_saved_history_line();
    rl_noninc_forward_search(count, key);
    break;
  case '/':
    _rl_free_saved_history_line();
    rl_noninc_reverse_search(count, key);
    break;
  default:
    rl_ding();
    break;
  }
  return (0);
}


x86 assembly (clang, -O0):
<rl_vi_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2f,%eax
je     118c <rl_vi_search+0x4c>
jmp    1162 <rl_vi_search+0x22>
mov    -0xc(%rbp),%eax
sub    $0x3f,%eax
jne    11a5 <rl_vi_search+0x65>
jmp    1173 <rl_vi_search+0x33>
mov    $0x0,%al
call   1050 <_rl_free_saved_history_line@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1030 <rl_noninc_forward_search@plt>
jmp    11ac <rl_vi_search+0x6c>
mov    $0x0,%al
call   1050 <_rl_free_saved_history_line@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x0,%al
call   1060 <rl_noninc_reverse_search@plt>
jmp    11ac <rl_vi_search+0x6c>
mov    $0x0,%al
call   1040 <rl_ding@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rl_vi_search>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
cmp    $0x2f,%esi
je     1164 <rl_vi_search+0x24>
cmp    $0x3f,%esi
jne    1179 <rl_vi_search+0x39>
call   1050 <_rl_free_saved_history_line@plt>
mov    %ebx,%edi
mov    $0x3f,%esi
xor    %eax,%eax
call   1030 <rl_noninc_forward_search@plt>
jmp    117e <rl_vi_search+0x3e>
call   1050 <_rl_free_saved_history_line@plt>
mov    %ebx,%edi
mov    $0x2f,%esi
xor    %eax,%eax
call   1060 <rl_noninc_reverse_search@plt>
jmp    117e <rl_vi_search+0x3e>
call   1040 <rl_ding@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @rl_vi_search(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
switch i32 %5, label %16 [
i32 63, label %6
i32 47, label %11
]
6: ; preds = %2
%7 = call i32 (...) @_rl_free_saved_history_line()
%8 = load i32, i32* %3
%9 = load i32, i32* %4
%10 = call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_noninc_forward_search to i32 (i32, i32, ...)*)(i32 %8, i32 %9)
br label %18
11: ; preds = %2
%12 = call i32 (...) @_rl_free_saved_history_line()
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_noninc_reverse_search to i32 (i32, i32, ...)*)(i32 %13, i32 %14)
br label %18
16: ; preds = %2
%17 = call i32 (...) @rl_ding()
br label %18
18: ; preds = %16, %11, %6
ret i32 0
}

LLVM IR (-O2):
define i32 @rl_vi_search(i32 %0, i32 %1) {
switch i32 %1, label %9 [
i32 63, label %3
i32 47, label %6
]
3: ; preds = %2
%4 = tail call i32 (...) @_rl_free_saved_history_line()
%5 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_noninc_forward_search to i32 (i32, i32, ...)*)(i32 %0, i32 63)
br label %11
6: ; preds = %2
%7 = tail call i32 (...) @_rl_free_saved_history_line()
%8 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @rl_noninc_reverse_search to i32 (i32, i32, ...)*)(i32 %0, i32 47)
br label %11
9: ; preds = %2
%10 = tail call i32 (...) @rl_ding()
br label %11
11: ; preds = %9, %6, %3
ret i32 0
}