#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*/ output(char *);
char parseTraceCommand();
int /*<<< orphan*/ printTrace();
int /*<<< orphan*/ toggleInstructionTrace();
int /*<<< orphan*/ togglePushTrace();
int /*<<< orphan*/ toggleSectionTrace();
int /*<<< orphan*/ toggleSourceTrace();
int /*<<< orphan*/ toggleStackTrace();
void handleTraceCommand() {
  char subcommand = parseTraceCommand();
  switch (subcommand) {
  case 'e':
    toggleSectionTrace();
    break;
  case 's':
    toggleSourceTrace();
    break;
  case 'i':
    toggleInstructionTrace();
    break;
  case 'p':
    togglePushTrace();
    break;
  case 't':
    toggleStackTrace();
    break;
  case '-':
    output("Ambiguous Trace subcommand abbreviation. ? for help.");
    break;
  default:
    printTrace();
  }
}


x86 assembly (clang, -O0):
<handleTraceCommand>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
call   1090 <parseTraceCommand@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
mov    %eax,-0x8(%rbp)
sub    $0x2d,%eax
je     1238 <handleTraceCommand+0xb8>
jmp    11a7 <handleTraceCommand+0x27>
mov    -0x8(%rbp),%eax
sub    $0x65,%eax
je     11fc <handleTraceCommand+0x7c>
jmp    11b8 <handleTraceCommand+0x38>
mov    -0x8(%rbp),%eax
sub    $0x69,%eax
je     1214 <handleTraceCommand+0x94>
jmp    11c9 <handleTraceCommand+0x49>
mov    -0x8(%rbp),%eax
sub    $0x70,%eax
je     1220 <handleTraceCommand+0xa0>
jmp    11da <handleTraceCommand+0x5a>
mov    -0x8(%rbp),%eax
sub    $0x73,%eax
je     1208 <handleTraceCommand+0x88>
jmp    11eb <handleTraceCommand+0x6b>
mov    -0x8(%rbp),%eax
sub    $0x74,%eax
je     122c <handleTraceCommand+0xac>
jmp    1249 <handleTraceCommand+0xc9>
mov    $0x0,%al
call   1040 <toggleSectionTrace@plt>
jmp    1250 <handleTraceCommand+0xd0>
mov    $0x0,%al
call   1070 <toggleSourceTrace@plt>
jmp    1250 <handleTraceCommand+0xd0>
mov    $0x0,%al
call   1060 <toggleInstructionTrace@plt>
jmp    1250 <handleTraceCommand+0xd0>
mov    $0x0,%al
call   10a0 <togglePushTrace@plt>
jmp    1250 <handleTraceCommand+0xd0>
mov    $0x0,%al
call   1030 <toggleStackTrace@plt>
jmp    1250 <handleTraceCommand+0xd0>
lea    0xdc1(%rip),%rdi
call   1050 <output@plt>
jmp    1250 <handleTraceCommand+0xd0>
mov    $0x0,%al
call   1080 <printTrace@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handleTraceCommand>:
push   %rax
xor    %eax,%eax
call   1090 <parseTraceCommand@plt>
movsbl %al,%ecx
lea    -0x65(%rcx),%eax
cmp    $0xf,%eax
ja     11ab <handleTraceCommand+0x2b>
lea    0xe66(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
xor    %eax,%eax
pop    %rcx
jmp    1040 <toggleSectionTrace@plt>
cmp    $0x2d,%ecx
jne    11bd <handleTraceCommand+0x3d>
lea    0xe89(%rip),%rdi
pop    %rax
jmp    1050 <output@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <printTrace@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <toggleInstructionTrace@plt>
xor    %eax,%eax
pop    %rcx
jmp    10a0 <togglePushTrace@plt>
xor    %eax,%eax
pop    %rcx
jmp    1070 <toggleSourceTrace@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <toggleStackTrace@plt>

LLVM IR (-O0):
@.str = [53 x i8] c"Ambiguous Trace subcommand abbreviation. ? for help.\00"
define void @handleTraceCommand() {
%1 = alloca i8
%2 = call signext i8 (...) @parseTraceCommand()
store i8 %2, i8* %1
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
switch i32 %4, label %17 [
i32 101, label %5
i32 115, label %7
i32 105, label %9
i32 112, label %11
i32 116, label %13
i32 45, label %15
]
5: ; preds = %0
%6 = call i32 (...) @toggleSectionTrace()
br label %19
7: ; preds = %0
%8 = call i32 (...) @toggleSourceTrace()
br label %19
9: ; preds = %0
%10 = call i32 (...) @toggleInstructionTrace()
br label %19
11: ; preds = %0
%12 = call i32 (...) @togglePushTrace()
br label %19
13: ; preds = %0
%14 = call i32 (...) @toggleStackTrace()
br label %19
15: ; preds = %0
%16 = call i32 @output(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
br label %19
17: ; preds = %0
%18 = call i32 (...) @printTrace()
br label %19
19: ; preds = %17, %15, %13, %11, %9, %7, %5
ret void
}

LLVM IR (-O2):
@.str = [53 x i8] c"Ambiguous Trace subcommand abbreviation. ? for help.\00"
define void @handleTraceCommand() {
%1 = tail call signext i8 (...) @parseTraceCommand()
%2 = sext i8 %1 to i32
switch i32 %2, label %15 [
i32 101, label %3
i32 115, label %5
i32 105, label %7
i32 112, label %9
i32 116, label %11
i32 45, label %13
]
3: ; preds = %0
%4 = tail call i32 (...) @toggleSectionTrace()
br label %17
5: ; preds = %0
%6 = tail call i32 (...) @toggleSourceTrace()
br label %17
7: ; preds = %0
%8 = tail call i32 (...) @toggleInstructionTrace()
br label %17
9: ; preds = %0
%10 = tail call i32 (...) @togglePushTrace()
br label %17
11: ; preds = %0
%12 = tail call i32 (...) @toggleStackTrace()
br label %17
13: ; preds = %0
%14 = tail call i32 @output(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
br label %17
15: ; preds = %0
%16 = tail call i32 (...) @printTrace()
br label %17
17: ; preds = %15, %13, %11, %9, %7, %5, %3
ret void
}