#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*/ TDB_cmd_help_print_bootstrap();
int /*<<< orphan*/ TDB_cmd_help_print_connect();
int /*<<< orphan*/ TDB_cmd_help_print_consensus();
int /*<<< orphan*/ TDB_cmd_help_print_control();
int /*<<< orphan*/ TDB_cmd_help_print_data();
int /*<<< orphan*/ TDB_cmd_help_print_general();
void TDB_cmd_help(char *cmd) {
  switch (cmd[5]) {
  case 'b':
    TDB_cmd_help_print_bootstrap();
    return;
  case 'c':
    switch (cmd[8]) {
    case 'n':
      TDB_cmd_help_print_connect();
      return;
    case 's':
      TDB_cmd_help_print_consensus();
      return;
    case 't':
      TDB_cmd_help_print_control();
      return;
    default:
      goto general_help;
    }
  case 'd':
    TDB_cmd_help_print_data();
    return;
  }
general_help:
  TDB_cmd_help_print_general();
}


x86 assembly (clang, -O0):
<TDB_cmd_help>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl 0x5(%rax),%eax
mov    %eax,-0xc(%rbp)
sub    $0x62,%eax
je     11a7 <TDB_cmd_help+0x47>
jmp    1185 <TDB_cmd_help+0x25>
mov    -0xc(%rbp),%eax
sub    $0x63,%eax
je     11b3 <TDB_cmd_help+0x53>
jmp    1196 <TDB_cmd_help+0x36>
mov    -0xc(%rbp),%eax
sub    $0x64,%eax
je     1217 <TDB_cmd_help+0xb7>
jmp    1223 <TDB_cmd_help+0xc3>
mov    $0x0,%al
call   1070 <TDB_cmd_help_print_bootstrap@plt>
jmp    122f <TDB_cmd_help+0xcf>
mov    -0x8(%rbp),%rax
movsbl 0x8(%rax),%eax
mov    %eax,-0x10(%rbp)
sub    $0x6e,%eax
je     11ee <TDB_cmd_help+0x8e>
jmp    11cc <TDB_cmd_help+0x6c>
mov    -0x10(%rbp),%eax
sub    $0x73,%eax
je     11fa <TDB_cmd_help+0x9a>
jmp    11dd <TDB_cmd_help+0x7d>
mov    -0x10(%rbp),%eax
sub    $0x74,%eax
je     1206 <TDB_cmd_help+0xa6>
jmp    1212 <TDB_cmd_help+0xb2>
mov    $0x0,%al
call   1040 <TDB_cmd_help_print_connect@plt>
jmp    122f <TDB_cmd_help+0xcf>
mov    $0x0,%al
call   1060 <TDB_cmd_help_print_consensus@plt>
jmp    122f <TDB_cmd_help+0xcf>
mov    $0x0,%al
call   1080 <TDB_cmd_help_print_control@plt>
jmp    122f <TDB_cmd_help+0xcf>
jmp    1228 <TDB_cmd_help+0xc8>
mov    $0x0,%al
call   1030 <TDB_cmd_help_print_data@plt>
jmp    122f <TDB_cmd_help+0xcf>
jmp    1228 <TDB_cmd_help+0xc8>
mov    $0x0,%al
call   1050 <TDB_cmd_help_print_general@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TDB_cmd_help>:
movsbl 0x5(%rdi),%eax
cmp    $0x64,%eax
je     119b <TDB_cmd_help+0x3b>
cmp    $0x63,%eax
je     117a <TDB_cmd_help+0x1a>
cmp    $0x62,%eax
jne    1194 <TDB_cmd_help+0x34>
xor    %eax,%eax
jmp    1070 <TDB_cmd_help_print_bootstrap@plt>
movsbl 0x8(%rdi),%eax
cmp    $0x74,%eax
je     11a2 <TDB_cmd_help+0x42>
cmp    $0x73,%eax
je     11a9 <TDB_cmd_help+0x49>
cmp    $0x6e,%eax
jne    1194 <TDB_cmd_help+0x34>
xor    %eax,%eax
jmp    1040 <TDB_cmd_help_print_connect@plt>
xor    %eax,%eax
jmp    1050 <TDB_cmd_help_print_general@plt>
xor    %eax,%eax
jmp    1030 <TDB_cmd_help_print_data@plt>
xor    %eax,%eax
jmp    1080 <TDB_cmd_help_print_control@plt>
xor    %eax,%eax
jmp    1060 <TDB_cmd_help_print_consensus@plt>

LLVM IR (-O0):
define void @TDB_cmd_help(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 5
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
switch i32 %6, label %23 [
i32 98, label %7
i32 99, label %9
i32 100, label %21
]
7: ; preds = %1
%8 = call i32 (...) @TDB_cmd_help_print_bootstrap()
br label %26
9: ; preds = %1
%10 = load i8*, i8** %2
%11 = getelementptr inbounds i8, i8* %10, i64 8
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
switch i32 %13, label %20 [
i32 110, label %14
i32 115, label %16
i32 116, label %18
]
14: ; preds = %9
%15 = call i32 (...) @TDB_cmd_help_print_connect()
br label %26
16: ; preds = %9
%17 = call i32 (...) @TDB_cmd_help_print_consensus()
br label %26
18: ; preds = %9
%19 = call i32 (...) @TDB_cmd_help_print_control()
br label %26
20: ; preds = %9
br label %24
21: ; preds = %1
%22 = call i32 (...) @TDB_cmd_help_print_data()
br label %26
23: ; preds = %1
br label %24
24: ; preds = %23, %20
%25 = call i32 (...) @TDB_cmd_help_print_general()
br label %26
26: ; preds = %24, %21, %18, %16, %14, %7
ret void
}

LLVM IR (-O2):
define void @TDB_cmd_help(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 5
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
switch i32 %4, label %19 [
i32 98, label %5
i32 99, label %7
i32 100, label %17
]
5: ; preds = %1
%6 = tail call i32 (...) @TDB_cmd_help_print_bootstrap()
br label %21
7: ; preds = %1
%8 = getelementptr inbounds i8, i8* %0, i64 8
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
switch i32 %10, label %19 [
i32 110, label %11
i32 115, label %13
i32 116, label %15
]
11: ; preds = %7
%12 = tail call i32 (...) @TDB_cmd_help_print_connect()
br label %21
13: ; preds = %7
%14 = tail call i32 (...) @TDB_cmd_help_print_consensus()
br label %21
15: ; preds = %7
%16 = tail call i32 (...) @TDB_cmd_help_print_control()
br label %21
17: ; preds = %1
%18 = tail call i32 (...) @TDB_cmd_help_print_data()
br label %21
19: ; preds = %1, %7
%20 = tail call i32 (...) @TDB_cmd_help_print_general()
br label %21
21: ; preds = %19, %17, %15, %13, %11, %5
ret void
}