#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ insert_statusbar_message(char);
int /*<<< orphan*/ ischaracter(char);
int /*<<< orphan*/ statusbar_command_begin();
int /*<<< orphan*/ statusbar_command_end();
int /*<<< orphan*/ statusbar_command_exec();
void input_command(char c) {
  switch (c) {
  case 0x1b:
    statusbar_command_end();
    return;
  case 0x0D:
  case 0x0A:
    statusbar_command_exec();
    statusbar_command_begin();
    return;
  default:
    if (!ischaracter(c))
      return;
    insert_statusbar_message(c);
    return;
  }
}


x86 assembly (clang, -O0):
<input_command>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0xa,%eax
je     11a1 <input_command+0x51>
jmp    1173 <input_command+0x23>
mov    -0x8(%rbp),%eax
sub    $0xd,%eax
je     11a1 <input_command+0x51>
jmp    1184 <input_command+0x34>
mov    -0x8(%rbp),%eax
sub    $0x1b,%eax
jne    11b4 <input_command+0x64>
jmp    1195 <input_command+0x45>
mov    $0x0,%al
call   1070 <statusbar_command_end@plt>
jmp    11d4 <input_command+0x84>
mov    $0x0,%al
call   1050 <statusbar_command_exec@plt>
mov    $0x0,%al
call   1030 <statusbar_command_begin@plt>
jmp    11d4 <input_command+0x84>
movsbl -0x1(%rbp),%edi
call   1060 <ischaracter@plt>
cmp    $0x0,%eax
jne    11cb <input_command+0x7b>
jmp    11d4 <input_command+0x84>
movsbl -0x1(%rbp),%edi
call   1040 <insert_statusbar_message@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_command>:
push   %rbx
cmp    $0xa,%edi
je     1168 <input_command+0x18>
cmp    $0xd,%edi
je     1168 <input_command+0x18>
cmp    $0x1b,%edi
jne    1177 <input_command+0x27>
xor    %eax,%eax
pop    %rbx
jmp    1070 <statusbar_command_end@plt>
xor    %eax,%eax
call   1050 <statusbar_command_exec@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <statusbar_command_begin@plt>
movsbl %dil,%ebx
mov    %ebx,%edi
call   1060 <ischaracter@plt>
test   %eax,%eax
je     118e <input_command+0x3e>
mov    %ebx,%edi
pop    %rbx
jmp    1040 <insert_statusbar_message@plt>
pop    %rbx
ret

LLVM IR (-O0):
define void @input_command(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
switch i32 %4, label %10 [
i32 27, label %5
i32 13, label %7
i32 10, label %7
]
5: ; preds = %1
%6 = call i32 (...) @statusbar_command_end()
br label %18
7: ; preds = %1, %1
%8 = call i32 (...) @statusbar_command_exec()
%9 = call i32 (...) @statusbar_command_begin()
br label %18
10: ; preds = %1
%11 = load i8, i8* %2
%12 = call i32 @ischaracter(i8 signext %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %10
br label %18
15: ; preds = %10
%16 = load i8, i8* %2
%17 = call i32 @insert_statusbar_message(i8 signext %16)
br label %18
18: ; preds = %15, %14, %7, %5
ret void
}

LLVM IR (-O2):
define void @input_command(i8 signext %0) {
%2 = sext i8 %0 to i32
switch i32 %2, label %8 [
i32 27, label %3
i32 13, label %5
i32 10, label %5
]
3: ; preds = %1
%4 = tail call i32 (...) @statusbar_command_end()
br label %13
5: ; preds = %1, %1
%6 = tail call i32 (...) @statusbar_command_exec()
%7 = tail call i32 (...) @statusbar_command_begin()
br label %13
8: ; preds = %1
%9 = tail call i32 @ischaracter(i8 signext %0)
%10 = icmp eq i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = tail call i32 @insert_statusbar_message(i8 signext %0)
br label %13
13: ; preds = %8, %11, %5, %3
ret void
}