#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 */
typedef char uint16_t;

/* Variables and functions */
int /*<<< orphan*/ chain_command(char);
int /*<<< orphan*/ dump_command(char *);
int /*<<< orphan*/ dump_fat_command(char *);
int /*<<< orphan*/ fat_command();
int /*<<< orphan*/ hdump_command(char *);
int /*<<< orphan*/ info_command();
int /*<<< orphan*/ ls_command(char *);
int /*<<< orphan*/ mount_command(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ quit_command();
int /*<<< orphan*/ show_command(char);
int sscanf(char const *, char *, char *, ...);
int /*<<< orphan*/ strcmp(char *, char *);
void command_dispatcher(const char *command) {
  char verb[10];
  int len;
  len = sscanf(command, "%s", verb);
  if (len < 1) {
    return;
  }
  if (!strcmp(verb, "quit")) {
    quit_command();
  } else if (!strcmp(verb, "mount")) {
    char dev[(1000 * 1000)];
    int len = 0;
    len = sscanf(command, "%s %s", verb, dev);
    if (len < 2) {
      printf("mount mount-device\n");
      return;
    }
    mount_command(dev);
  } else if (!strcmp(verb, "ls")) {
    char dir[(1000 * 1000)];
    int len;
    len = sscanf(command, "%s %s", verb, dir);
    if (len < 2) {
      printf("ls directory\n");
      return;
    }
    ls_command(dir);
  } else if (!strcmp(verb, "chain")) {
    uint16_t index;
    int len;
    len = sscanf(command, "%s %hu", verb, &index);
    if (len < 2) {
      printf("chain cluster-number\n");
      return;
    }
    chain_command(index);
  } else if (!strcmp(verb, "fat")) {
    fat_command();
  } else if (!strcmp(verb, "dump_fat")) {
    char path[(1000 * 1000)];
    int len;
    len = sscanf(command, "%s %s", verb, path);
    if (len < 2) {
      printf("dump_fat file-path\n");
      return;
    }
    dump_fat_command(path);
  } else if (!strcmp(verb, "dump")) {
    char dir[(1000 * 1000)];
    int len;
    len = sscanf(command, "%s %s", verb, dir);
    if (len < 2) {
      printf("dump file-name");
      return;
    }
    dump_command(dir);
  } else if (!strcmp(verb, "hdump")) {
    char dir[(1000 * 1000)];
    int len;
    len = sscanf(command, "%s %s", verb, dir);
    if (len < 2) {
      printf("hdump file-name");
      return;
    }
    hdump_command(dir);
  } else if (!strcmp(verb, "info")) {
    info_command();
  } else if (!strcmp(verb, "show")) {
    char c;
    int len;
    len = sscanf(command, "%s %c", verb, &c);
    if (len < 2) {
      printf("show w|c\n");
      return;
    }
    show_command(c);
  } else {
    printf("404 Not Found\n");
  }
}


x86 assembly (clang, -O0):
<command_dispatcher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x4c4bb0,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x12(%rbp),%rdx
lea    0xe20(%rip),%rsi
mov    $0x0,%al
call   10a0 <sscanf@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x1,-0x18(%rbp)
jge    1207 <command_dispatcher+0x37>
jmp    15a6 <command_dispatcher+0x3d6>
lea    -0x12(%rbp),%rdi
lea    0xdee(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    122c <command_dispatcher+0x5c>
mov    $0x0,%al
call   1050 <quit_command@plt>
jmp    15a6 <command_dispatcher+0x3d6>
lea    -0x12(%rbp),%rdi
lea    0xdce(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    12a1 <command_dispatcher+0xd1>
movl   $0x0,-0xf4264(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x12(%rbp),%rdx
lea    -0xf4260(%rbp),%rcx
lea    0xda6(%rip),%rsi
mov    $0x0,%al
call   10a0 <sscanf@plt>
mov    %eax,-0xf4264(%rbp)
cmpl   $0x2,-0xf4264(%rbp)
jge    1290 <command_dispatcher+0xc0>
lea    0xd8b(%rip),%rdi
call   1040 <printf@plt>
jmp    15a6 <command_dispatcher+0x3d6>
lea    -0xf4260(%rbp),%rdi
call   10d0 <mount_command@plt>
jmp    15a1 <command_dispatcher+0x3d1>
lea    -0x12(%rbp),%rdi
lea    0xd79(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    130c <command_dispatcher+0x13c>
mov    -0x8(%rbp),%rdi
lea    -0x12(%rbp),%rdx
lea    -0x1e84b0(%rbp),%rcx
lea    0xd3b(%rip),%rsi
mov    $0x0,%al
call   10a0 <sscanf@plt>
mov    %eax,-0x1e84b4(%rbp)
cmpl   $0x2,-0x1e84b4(%rbp)
jge    12fb <command_dispatcher+0x12b>
lea    0xd37(%rip),%rdi
call   1040 <printf@plt>
jmp    15a6 <command_dispatcher+0x3d6>
lea    -0x1e84b0(%rbp),%rdi
call   1080 <ls_command@plt>
jmp    159c <command_dispatcher+0x3cc>
lea    -0x12(%rbp),%rdi
lea    0xd1f(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1377 <command_dispatcher+0x1a7>
mov    -0x8(%rbp),%rdi
lea    -0x12(%rbp),%rdx
lea    0xd08(%rip),%rsi
lea    -0x1e84b5(%rbp),%rcx
mov    $0x0,%al
call   10a0 <sscanf@plt>
mov    %eax,-0x1e84bc(%rbp)
cmpl   $0x2,-0x1e84bc(%rbp)
jge    1366 <command_dispatcher+0x196>
lea    0xce7(%rip),%rdi
call   1040 <printf@plt>
jmp    15a6 <command_dispatcher+0x3d6>
movsbl -0x1e84b5(%rbp),%edi
call   10b0 <chain_command@plt>
jmp    1597 <command_dispatcher+0x3c7>
lea    -0x12(%rbp),%rdi
lea    0xcdc(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    139c <command_dispatcher+0x1cc>
mov    $0x0,%al
call   10c0 <fat_command@plt>
jmp    1592 <command_dispatcher+0x3c2>
lea    -0x12(%rbp),%rdi
lea    0xcb2(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1407 <command_dispatcher+0x237>
mov    -0x8(%rbp),%rdi
lea    -0x12(%rbp),%rdx
lea    -0x2dc700(%rbp),%rcx
lea    0xc40(%rip),%rsi
mov    $0x0,%al
call   10a0 <sscanf@plt>
mov    %eax,-0x2dc704(%rbp)
cmpl   $0x2,-0x2dc704(%rbp)
jge    13f6 <command_dispatcher+0x226>
lea    0xc76(%rip),%rdi
call   1040 <printf@plt>
jmp    15a6 <command_dispatcher+0x3d6>
lea    -0x2dc700(%rbp),%rdi
call   10e0 <dump_fat_command@plt>
jmp    158d <command_dispatcher+0x3bd>
lea    -0x12(%rbp),%rdi
lea    0xc65(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1472 <command_dispatcher+0x2a2>
mov    -0x8(%rbp),%rdi
lea    -0x12(%rbp),%rdx
lea    -0x3d0950(%rbp),%rcx
lea    0xbd5(%rip),%rsi
mov    $0x0,%al
call   10a0 <sscanf@plt>
mov    %eax,-0x3d0954(%rbp)
cmpl   $0x2,-0x3d0954(%rbp)
jge    1461 <command_dispatcher+0x291>
lea    0xc26(%rip),%rdi
call   1040 <printf@plt>
jmp    15a6 <command_dispatcher+0x3d6>
lea    -0x3d0950(%rbp),%rdi
call   10f0 <dump_command@plt>
jmp    1588 <command_dispatcher+0x3b8>
lea    -0x12(%rbp),%rdi
lea    0xbf9(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    14dd <command_dispatcher+0x30d>
mov    -0x8(%rbp),%rdi
lea    -0x12(%rbp),%rdx
lea    -0x4c4ba0(%rbp),%rcx
lea    0xb6a(%rip),%rsi
mov    $0x0,%al
call   10a0 <sscanf@plt>
mov    %eax,-0x4c4ba4(%rbp)
cmpl   $0x2,-0x4c4ba4(%rbp)
jge    14cc <command_dispatcher+0x2fc>
lea    0xbba(%rip),%rdi
call   1040 <printf@plt>
jmp    15a6 <command_dispatcher+0x3d6>
lea    -0x4c4ba0(%rbp),%rdi
call   1090 <hdump_command@plt>
jmp    1583 <command_dispatcher+0x3b3>
lea    -0x12(%rbp),%rdi
lea    0xba4(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1502 <command_dispatcher+0x332>
mov    $0x0,%al
call   1060 <info_command@plt>
jmp    157e <command_dispatcher+0x3ae>
lea    -0x12(%rbp),%rdi
lea    0xb84(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    156d <command_dispatcher+0x39d>
mov    -0x8(%rbp),%rdi
lea    -0x12(%rbp),%rdx
lea    0xb6c(%rip),%rsi
lea    -0x4c4ba5(%rbp),%rcx
mov    $0x0,%al
call   10a0 <sscanf@plt>
mov    %eax,-0x4c4bac(%rbp)
cmpl   $0x2,-0x4c4bac(%rbp)
jge    155c <command_dispatcher+0x38c>
lea    0xb4a(%rip),%rdi
call   1040 <printf@plt>
jmp    15a6 <command_dispatcher+0x3d6>
movsbl -0x4c4ba5(%rbp),%edi
call   1030 <show_command@plt>
jmp    1579 <command_dispatcher+0x3a9>
lea    0xb32(%rip),%rdi
call   1040 <printf@plt>
jmp    157e <command_dispatcher+0x3ae>
jmp    1583 <command_dispatcher+0x3b3>
jmp    1588 <command_dispatcher+0x3b8>
jmp    158d <command_dispatcher+0x3bd>
jmp    1592 <command_dispatcher+0x3c2>
jmp    1597 <command_dispatcher+0x3c7>
jmp    159c <command_dispatcher+0x3cc>
jmp    15a1 <command_dispatcher+0x3d1>
jmp    15a6 <command_dispatcher+0x3d6>
add    $0x4c4bb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<command_dispatcher>:
push   %rbx
sub    $0xf4250,%rsp
mov    %rdi,%rbx
lea    0xe2c(%rip),%rsi
lea    0x6(%rsp),%rdx
xor    %eax,%eax
call   10a0 <sscanf@plt>
test   %eax,%eax
jle    13cb <command_dispatcher+0x1fb>
mov    $0x74697571,%eax
xor    0x6(%rsp),%eax
movzbl 0xa(%rsp),%ecx
or     %eax,%ecx
je     12e8 <command_dispatcher+0x118>
mov    $0x6e756f6d,%eax
xor    0x6(%rsp),%eax
movzwl 0xa(%rsp),%ecx
xor    $0x74,%ecx
or     %eax,%ecx
je     12f4 <command_dispatcher+0x124>
movzwl 0x6(%rsp),%eax
xor    $0x736c,%eax
movzbl 0x8(%rsp),%ecx
or     %ax,%cx
je     1320 <command_dispatcher+0x150>
mov    $0x69616863,%eax
xor    0x6(%rsp),%eax
movzwl 0xa(%rsp),%ecx
xor    $0x6e,%ecx
or     %eax,%ecx
je     1355 <command_dispatcher+0x185>
cmpl   $0x746166,0x6(%rsp)
je     138a <command_dispatcher+0x1ba>
movabs $0x7461665f706d7564,%rax
66 61 74
xor    0x6(%rsp),%rax
movzbl 0xe(%rsp),%ecx
or     %rax,%rcx
je     139f <command_dispatcher+0x1cf>
mov    $0x706d7564,%eax
xor    0x6(%rsp),%eax
movzbl 0xa(%rsp),%ecx
or     %eax,%ecx
je     13d4 <command_dispatcher+0x204>
mov    $0x6d756468,%eax
xor    0x6(%rsp),%eax
movzwl 0xa(%rsp),%ecx
xor    $0x70,%ecx
or     %eax,%ecx
je     140e <command_dispatcher+0x23e>
mov    $0x6f666e69,%eax
xor    0x6(%rsp),%eax
movzbl 0xa(%rsp),%ecx
or     %eax,%ecx
je     1448 <command_dispatcher+0x278>
mov    $0x776f6873,%eax
xor    0x6(%rsp),%eax
movzbl 0xa(%rsp),%ecx
or     %eax,%ecx
je     1463 <command_dispatcher+0x293>
lea    0xdbe(%rip),%rdi
jmp    13c6 <command_dispatcher+0x1f6>
xor    %eax,%eax
call   1060 <quit_command@plt>
jmp    13cb <command_dispatcher+0x1fb>
lea    0xd10(%rip),%rsi
lea    0x6(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <sscanf@plt>
cmp    $0x1,%eax
jg     1349 <command_dispatcher+0x179>
lea    0xd35(%rip),%rdi
jmp    13c6 <command_dispatcher+0x1f6>
lea    0xce4(%rip),%rsi
lea    0x6(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <sscanf@plt>
cmp    $0x1,%eax
jg     137e <command_dispatcher+0x1ae>
lea    0xd1c(%rip),%rdi
jmp    13c6 <command_dispatcher+0x1f6>
lea    0x10(%rsp),%rdi
call   10d0 <mount_command@plt>
jmp    13cb <command_dispatcher+0x1fb>
lea    0xcbe(%rip),%rsi
lea    0x6(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <sscanf@plt>
cmp    $0x1,%eax
jg     1393 <command_dispatcher+0x1c3>
lea    0xcf4(%rip),%rdi
jmp    13c6 <command_dispatcher+0x1f6>
lea    0x10(%rsp),%rdi
call   1080 <ls_command@plt>
jmp    13cb <command_dispatcher+0x1fb>
xor    %eax,%eax
call   10c0 <fat_command@plt>
jmp    13cb <command_dispatcher+0x1fb>
movsbl 0x10(%rsp),%edi
call   10b0 <chain_command@plt>
jmp    13cb <command_dispatcher+0x1fb>
lea    0xc65(%rip),%rsi
lea    0x6(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <sscanf@plt>
cmp    $0x1,%eax
jg     1402 <command_dispatcher+0x232>
lea    0xcbf(%rip),%rdi
call   1030 <puts@plt>
add    $0xf4250,%rsp
pop    %rbx
ret
lea    0xc30(%rip),%rsi
lea    0x6(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <sscanf@plt>
cmp    $0x1,%eax
jg     143c <command_dispatcher+0x26c>
lea    0xc36(%rip),%rdi
call   1050 <printf@plt>
jmp    13cb <command_dispatcher+0x1fb>
lea    0x10(%rsp),%rdi
call   10e0 <dump_fat_command@plt>
jmp    13cb <command_dispatcher+0x1fb>
lea    0xbf6(%rip),%rsi
lea    0x6(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <sscanf@plt>
cmp    $0x1,%eax
jg     1454 <command_dispatcher+0x284>
lea    0xbfb(%rip),%rdi
call   1050 <printf@plt>
jmp    13cb <command_dispatcher+0x1fb>
lea    0x10(%rsp),%rdi
call   10f0 <dump_command@plt>
jmp    13cb <command_dispatcher+0x1fb>
xor    %eax,%eax
call   1070 <info_command@plt>
jmp    13cb <command_dispatcher+0x1fb>
lea    0x10(%rsp),%rdi
call   1090 <hdump_command@plt>
jmp    13cb <command_dispatcher+0x1fb>
lea    0xbe0(%rip),%rsi
lea    0x6(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <sscanf@plt>
cmp    $0x1,%eax
jg     148f <command_dispatcher+0x2bf>
lea    0xc0e(%rip),%rdi
jmp    13c6 <command_dispatcher+0x1f6>
movsbl 0x10(%rsp),%edi
call   1040 <show_command@plt>
jmp    13cb <command_dispatcher+0x1fb>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"quit\00"
@.str.2 = [6 x i8] c"mount\00"
@.str.3 = [6 x i8] c"%s %s\00"
@.str.4 = [20 x i8] c"mount mount-device\0A\00"
@.str.5 = [3 x i8] c"ls\00"
@.str.6 = [14 x i8] c"ls directory\0A\00"
@.str.7 = [6 x i8] c"chain\00"
@.str.8 = [7 x i8] c"%s %hu\00"
@.str.9 = [22 x i8] c"chain cluster-number\0A\00"
@.str.10 = [4 x i8] c"fat\00"
@.str.11 = [9 x i8] c"dump_fat\00"
@.str.12 = [20 x i8] c"dump_fat file-path\0A\00"
@.str.13 = [5 x i8] c"dump\00"
@.str.14 = [15 x i8] c"dump file-name\00"
@.str.15 = [6 x i8] c"hdump\00"
@.str.16 = [16 x i8] c"hdump file-name\00"
@.str.17 = [5 x i8] c"info\00"
@.str.18 = [5 x i8] c"show\00"
@.str.19 = [6 x i8] c"%s %c\00"
@.str.20 = [10 x i8] c"show w|c\0A\00"
@.str.21 = [15 x i8] c"404 Not Found\0A\00"
define void @command_dispatcher(i8* %0) {
%2 = alloca i8*
%3 = alloca [10 x i8]
%4 = alloca i32
%5 = alloca [1000000 x i8]
%6 = alloca i32
%7 = alloca [1000000 x i8]
%8 = alloca i32
%9 = alloca i8
%10 = alloca i32
%11 = alloca [1000000 x i8]
%12 = alloca i32
%13 = alloca [1000000 x i8]
%14 = alloca i32
%15 = alloca [1000000 x i8]
%16 = alloca i32
%17 = alloca i8
%18 = alloca i32
store i8* %0, i8** %2
%19 = load i8*, i8** %2
%20 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%21 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %20)
store i32 %21, i32* %4
%22 = load i32, i32* %4
%23 = icmp slt i32 %22, 1
br i1 %23, label %24, label %25
24: ; preds = %1
br label %164
25: ; preds = %1
%26 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%27 = call i32 @strcmp(i8* %26, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%28 = icmp ne i32 %27, 0
br i1 %28, label %31, label %29
29: ; preds = %25
%30 = call i32 (...) @quit_command()
br label %164
31: ; preds = %25
%32 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%33 = call i32 @strcmp(i8* %32, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%34 = icmp ne i32 %33, 0
br i1 %34, label %47, label %35
35: ; preds = %31
store i32 0, i32* %6
%36 = load i8*, i8** %2
%37 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%38 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %5, i64 0, i64 0
%39 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %36, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %37, i8* %38)
store i32 %39, i32* %6
%40 = load i32, i32* %6
%41 = icmp slt i32 %40, 2
br i1 %41, label %42, label %44
42: ; preds = %35
%43 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
br label %164
44: ; preds = %35
%45 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %5, i64 0, i64 0
%46 = call i32 @mount_command(i8* %45)
br label %163
47: ; preds = %31
%48 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%49 = call i32 @strcmp(i8* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%50 = icmp ne i32 %49, 0
br i1 %50, label %63, label %51
51: ; preds = %47
%52 = load i8*, i8** %2
%53 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%54 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %7, i64 0, i64 0
%55 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %52, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %53, i8* %54)
store i32 %55, i32* %8
%56 = load i32, i32* %8
%57 = icmp slt i32 %56, 2
br i1 %57, label %58, label %60
58: ; preds = %51
%59 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
br label %164
60: ; preds = %51
%61 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %7, i64 0, i64 0
%62 = call i32 @ls_command(i8* %61)
br label %162
63: ; preds = %47
%64 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%65 = call i32 @strcmp(i8* %64, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%66 = icmp ne i32 %65, 0
br i1 %66, label %78, label %67
67: ; preds = %63
%68 = load i8*, i8** %2
%69 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%70 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %68, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %69, i8* %9)
store i32 %70, i32* %10
%71 = load i32, i32* %10
%72 = icmp slt i32 %71, 2
br i1 %72, label %73, label %75
73: ; preds = %67
%74 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0))
br label %164
75: ; preds = %67
%76 = load i8, i8* %9
%77 = call i32 @chain_command(i8 signext %76)
br label %161
78: ; preds = %63
%79 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%80 = call i32 @strcmp(i8* %79, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0))
%81 = icmp ne i32 %80, 0
br i1 %81, label %84, label %82
82: ; preds = %78
%83 = call i32 (...) @fat_command()
br label %160
84: ; preds = %78
%85 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%86 = call i32 @strcmp(i8* %85, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0))
%87 = icmp ne i32 %86, 0
br i1 %87, label %100, label %88
88: ; preds = %84
%89 = load i8*, i8** %2
%90 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%91 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 0
%92 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %89, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %90, i8* %91)
store i32 %92, i32* %12
%93 = load i32, i32* %12
%94 = icmp slt i32 %93, 2
br i1 %94, label %95, label %97
95: ; preds = %88
%96 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0))
br label %164
97: ; preds = %88
%98 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %11, i64 0, i64 0
%99 = call i32 @dump_fat_command(i8* %98)
br label %159
100: ; preds = %84
%101 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%102 = call i32 @strcmp(i8* %101, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
%103 = icmp ne i32 %102, 0
br i1 %103, label %116, label %104
104: ; preds = %100
%105 = load i8*, i8** %2
%106 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%107 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %13, i64 0, i64 0
%108 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %105, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %106, i8* %107)
store i32 %108, i32* %14
%109 = load i32, i32* %14
%110 = icmp slt i32 %109, 2
br i1 %110, label %111, label %113
111: ; preds = %104
%112 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.14, i64 0, i64 0))
br label %164
113: ; preds = %104
%114 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %13, i64 0, i64 0
%115 = call i32 @dump_command(i8* %114)
br label %158
116: ; preds = %100
%117 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%118 = call i32 @strcmp(i8* %117, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0))
%119 = icmp ne i32 %118, 0
br i1 %119, label %132, label %120
120: ; preds = %116
%121 = load i8*, i8** %2
%122 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%123 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %15, i64 0, i64 0
%124 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %121, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %122, i8* %123)
store i32 %124, i32* %16
%125 = load i32, i32* %16
%126 = icmp slt i32 %125, 2
br i1 %126, label %127, label %129
127: ; preds = %120
%128 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0))
br label %164
129: ; preds = %120
%130 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %15, i64 0, i64 0
%131 = call i32 @hdump_command(i8* %130)
br label %157
132: ; preds = %116
%133 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%134 = call i32 @strcmp(i8* %133, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0))
%135 = icmp ne i32 %134, 0
br i1 %135, label %138, label %136
136: ; preds = %132
%137 = call i32 (...) @info_command()
br label %156
138: ; preds = %132
%139 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%140 = call i32 @strcmp(i8* %139, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0))
%141 = icmp ne i32 %140, 0
br i1 %141, label %153, label %142
142: ; preds = %138
%143 = load i8*, i8** %2
%144 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%145 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %143, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* %144, i8* %17)
store i32 %145, i32* %18
%146 = load i32, i32* %18
%147 = icmp slt i32 %146, 2
br i1 %147, label %148, label %150
148: ; preds = %142
%149 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.20, i64 0, i64 0))
br label %164
150: ; preds = %142
%151 = load i8, i8* %17
%152 = call i32 @show_command(i8 signext %151)
br label %155
153: ; preds = %138
%154 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.21, i64 0, i64 0))
br label %155
155: ; preds = %153, %150
br label %156
156: ; preds = %155, %136
br label %157
157: ; preds = %156, %129
br label %158
158: ; preds = %157, %113
br label %159
159: ; preds = %158, %97
br label %160
160: ; preds = %159, %82
br label %161
161: ; preds = %160, %75
br label %162
162: ; preds = %161, %60
br label %163
163: ; preds = %162, %44
br label %164
164: ; preds = %24, %42, %58, %73, %95, %111, %127, %148, %163, %29
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"quit\00"
@.str.2 = [6 x i8] c"mount\00"
@.str.3 = [6 x i8] c"%s %s\00"
@.str.5 = [3 x i8] c"ls\00"
@.str.7 = [6 x i8] c"chain\00"
@.str.8 = [7 x i8] c"%s %hu\00"
@.str.10 = [4 x i8] c"fat\00"
@.str.11 = [9 x i8] c"dump_fat\00"
@.str.13 = [5 x i8] c"dump\00"
@.str.14 = [15 x i8] c"dump file-name\00"
@.str.15 = [6 x i8] c"hdump\00"
@.str.16 = [16 x i8] c"hdump file-name\00"
@.str.17 = [5 x i8] c"info\00"
@.str.18 = [5 x i8] c"show\00"
@.str.19 = [6 x i8] c"%s %c\00"
@str = [19 x i8] c"mount mount-device\00"
@str.22 = [13 x i8] c"ls directory\00"
@str.23 = [21 x i8] c"chain cluster-number\00"
@str.24 = [19 x i8] c"dump_fat file-path\00"
@str.25 = [9 x i8] c"show w|c\00"
@str.26 = [14 x i8] c"404 Not Found\00"
define void @command_dispatcher(i8* nocapture %0) {
%2 = alloca [10 x i8]
%3 = alloca [1000000 x i8]
%4 = alloca [1000000 x i8]
%5 = alloca i8
%6 = alloca [1000000 x i8]
%7 = alloca [1000000 x i8]
%8 = alloca [1000000 x i8]
%9 = alloca i8
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%11 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %10)
%12 = icmp slt i32 %11, 1
br i1 %12, label %114, label %13
13: ; preds = %1
%14 = call i32 @bcmp(i8* dereferenceable(5) %10, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 5)
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 (...) @quit_command()
br label %114
18: ; preds = %13
%19 = call i32 @bcmp(i8* dereferenceable(6) %10, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i64 6)
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %30
21: ; preds = %18
%22 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %3, i64 0, i64 0
%23 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %10, i8* %22)
%24 = icmp slt i32 %23, 2
br i1 %24, label %25, label %27
25: ; preds = %21
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
br label %29
27: ; preds = %21
%28 = call i32 @mount_command(i8* %22)
br label %29
29: ; preds = %27, %25
br label %114
30: ; preds = %18
%31 = call i32 @bcmp(i8* dereferenceable(3) %10, i8* dereferenceable(3) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i64 3)
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %42
33: ; preds = %30
%34 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %4, i64 0, i64 0
%35 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %10, i8* %34)
%36 = icmp slt i32 %35, 2
br i1 %36, label %37, label %39
37: ; preds = %33
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.22, i64 0, i64 0))
br label %41
39: ; preds = %33
%40 = call i32 @ls_command(i8* %34)
br label %41
41: ; preds = %39, %37
br label %114
42: ; preds = %30
%43 = call i32 @bcmp(i8* dereferenceable(6) %10, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i64 6)
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %54
45: ; preds = %42
%46 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i8* %10, i8* %5)
%47 = icmp slt i32 %46, 2
br i1 %47, label %48, label %50
48: ; preds = %45
%49 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.23, i64 0, i64 0))
br label %53
50: ; preds = %45
%51 = load i8, i8* %5
%52 = call i32 @chain_command(i8 signext %51)
br label %53
53: ; preds = %50, %48
br label %114
54: ; preds = %42
%55 = call i32 @bcmp(i8* dereferenceable(4) %10, i8* dereferenceable(4) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i64 4)
%56 = icmp eq i32 %55, 0
br i1 %56, label %57, label %59
57: ; preds = %54
%58 = call i32 (...) @fat_command()
br label %114
59: ; preds = %54
%60 = call i32 @bcmp(i8* dereferenceable(9) %10, i8* dereferenceable(9) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.11, i64 0, i64 0), i64 9)
%61 = icmp eq i32 %60, 0
br i1 %61, label %62, label %71
62: ; preds = %59
%63 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %6, i64 0, i64 0
%64 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %10, i8* %63)
%65 = icmp slt i32 %64, 2
br i1 %65, label %66, label %68
66: ; preds = %62
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.24, i64 0, i64 0))
br label %70
68: ; preds = %62
%69 = call i32 @dump_fat_command(i8* %63)
br label %70
70: ; preds = %68, %66
br label %114
71: ; preds = %59
%72 = call i32 @bcmp(i8* dereferenceable(5) %10, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0), i64 5)
%73 = icmp eq i32 %72, 0
br i1 %73, label %74, label %83
74: ; preds = %71
%75 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %7, i64 0, i64 0
%76 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %10, i8* %75)
%77 = icmp slt i32 %76, 2
br i1 %77, label %78, label %80
78: ; preds = %74
%79 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.14, i64 0, i64 0))
br label %82
80: ; preds = %74
%81 = call i32 @dump_command(i8* %75)
br label %82
82: ; preds = %80, %78
br label %114
83: ; preds = %71
%84 = call i32 @bcmp(i8* dereferenceable(6) %10, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.15, i64 0, i64 0), i64 6)
%85 = icmp eq i32 %84, 0
br i1 %85, label %86, label %95
86: ; preds = %83
%87 = getelementptr inbounds [1000000 x i8], [1000000 x i8]* %8, i64 0, i64 0
%88 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8* %10, i8* %87)
%89 = icmp slt i32 %88, 2
br i1 %89, label %90, label %92
90: ; preds = %86
%91 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0))
br label %94
92: ; preds = %86
%93 = call i32 @hdump_command(i8* %87)
br label %94
94: ; preds = %92, %90
br label %114
95: ; preds = %83
%96 = call i32 @bcmp(i8* dereferenceable(5) %10, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i64 0, i64 0), i64 5)
%97 = icmp eq i32 %96, 0
br i1 %97, label %98, label %100
98: ; preds = %95
%99 = call i32 (...) @info_command()
br label %114
100: ; preds = %95
%101 = call i32 @bcmp(i8* dereferenceable(5) %10, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), i64 5)
%102 = icmp eq i32 %101, 0
br i1 %102, label %103, label %112
103: ; preds = %100
%104 = call i32 (i8*, i8*, i8*, ...) @sscanf(i8* %0, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0), i8* %10, i8* %9)
%105 = icmp slt i32 %104, 2
br i1 %105, label %106, label %108
106: ; preds = %103
%107 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.25, i64 0, i64 0))
br label %111
108: ; preds = %103
%109 = load i8, i8* %9
%110 = call i32 @show_command(i8 signext %109)
br label %111
111: ; preds = %108, %106
br label %114
112: ; preds = %100
%113 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.26, i64 0, i64 0))
br label %114
114: ; preds = %111, %94, %82, %70, %53, %41, %29, %16, %57, %98, %112, %1
ret void
}