#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 */
struct lsm_tree {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ atoi(char *);
int /*<<< orphan*/ delete (struct lsm_tree *, int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ get(struct lsm_tree *, int /*<<< orphan*/);
int /*<<< orphan*/ load(struct lsm_tree *, char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ put(struct lsm_tree *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ quit(struct lsm_tree *);
int /*<<< orphan*/ range(struct lsm_tree *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int /*<<< orphan*/ stat(struct lsm_tree *);
int /*<<< orphan*/ strcmp(char *, char *);
char *strdup(char *);
char *strtok(char *, char const *);
int process_input(struct lsm_tree *tree, char *input) {
  int args;
  char *token;
  int op;
  const char *s = " ";
  token = strtok(input, s);
  if (!strcmp(token, "p")) {
    op = 0;
    args = 2;
  } else if (!strcmp(token, "g")) {
    op = 1;
    args = 1;
  } else if (!strcmp(token, "r")) {
    op = 2;
    args = 2;
  } else if (!strcmp(token, "d")) {
    op = 3;
    args = 1;
  } else if (!strcmp(token, "l")) {
    op = 4;
    args = 1;
  } else if (!strcmp(token, "s")) {
    op = 5;
    args = 0;
  } else if (!strcmp(token, "q")) {
    quit(tree);
    return 1;
  } else {
    printf("Invalid input, try again.\n");
    free(input);
    return 1;
  }
  char **argv = (char **)malloc(args * sizeof(char **));
  for (int i = 0; i < args; i++) {
    argv[i] = strdup(strtok(NULL, s));
  }
  switch (op) {
  case 0:
    put(tree, atoi(argv[0]), atoi(argv[1]));
    break;
  case 1:
    get(tree, atoi(argv[0]));
    break;
  case 2:
    range(tree, atoi(argv[0]), atoi(argv[1]));
    break;
  case 3:
    delete (tree, atoi(argv[0]));
    break;
  case 4:
    load(tree, argv[0]);
    break;
  case 5:
    stat(tree);
    break;
  case 6:
    quit(tree);
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<process_input>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    0xe22(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   10c0 <strtok@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xe04(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    123b <process_input+0x5b>
movl   $0x0,-0x2c(%rbp)
movl   $0x2,-0x1c(%rbp)
jmp    137f <process_input+0x19f>
mov    -0x28(%rbp),%rdi
lea    0xdda(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1267 <process_input+0x87>
movl   $0x1,-0x2c(%rbp)
movl   $0x1,-0x1c(%rbp)
jmp    137a <process_input+0x19a>
mov    -0x28(%rbp),%rdi
lea    0xdb0(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1293 <process_input+0xb3>
movl   $0x2,-0x2c(%rbp)
movl   $0x2,-0x1c(%rbp)
jmp    1375 <process_input+0x195>
mov    -0x28(%rbp),%rdi
lea    0xd86(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    12bf <process_input+0xdf>
movl   $0x3,-0x2c(%rbp)
movl   $0x1,-0x1c(%rbp)
jmp    1370 <process_input+0x190>
mov    -0x28(%rbp),%rdi
lea    0xd5c(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    12eb <process_input+0x10b>
movl   $0x4,-0x2c(%rbp)
movl   $0x1,-0x1c(%rbp)
jmp    136b <process_input+0x18b>
mov    -0x28(%rbp),%rdi
lea    0xd32(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1317 <process_input+0x137>
movl   $0x5,-0x2c(%rbp)
movl   $0x0,-0x1c(%rbp)
jmp    1366 <process_input+0x186>
mov    -0x28(%rbp),%rdi
lea    0xd08(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%eax
jne    1345 <process_input+0x165>
mov    -0x10(%rbp),%rdi
call   1060 <quit@plt>
movl   $0x1,-0x4(%rbp)
jmp    14e5 <process_input+0x305>
lea    0xce0(%rip),%rdi
call   1050 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movl   $0x1,-0x4(%rbp)
jmp    14e5 <process_input+0x305>
jmp    136b <process_input+0x18b>
jmp    1370 <process_input+0x190>
jmp    1375 <process_input+0x195>
jmp    137a <process_input+0x19a>
jmp    137f <process_input+0x19f>
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1090 <malloc@plt>
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13d7 <process_input+0x1f7>
mov    -0x38(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   10c0 <strtok@plt>
mov    %rax,%rdi
call   1100 <strdup@plt>
mov    %rax,%rdx
mov    -0x40(%rbp),%rax
movslq -0x44(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1399 <process_input+0x1b9>
mov    -0x2c(%rbp),%eax
mov    %rax,-0x50(%rbp)
sub    $0x6,%rax
ja     14de <process_input+0x2fe>
mov    -0x50(%rbp),%rax
lea    0xc0d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x40(%rbp),%rax
mov    (%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x54(%rbp)
mov    -0x40(%rbp),%rax
mov    0x8(%rax),%rdi
call   10d0 <atoi@plt>
mov    -0x60(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    %eax,%edx
call   1040 <put@plt>
jmp    14de <process_input+0x2fe>
mov    -0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x40(%rbp),%rax
mov    (%rax),%rdi
call   10d0 <atoi@plt>
mov    -0x68(%rbp),%rdi
mov    %eax,%esi
call   10a0 <get@plt>
jmp    14de <process_input+0x2fe>
mov    -0x10(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x40(%rbp),%rax
mov    (%rax),%rdi
call   10d0 <atoi@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x40(%rbp),%rax
mov    0x8(%rax),%rdi
call   10d0 <atoi@plt>
mov    -0x78(%rbp),%rdi
mov    -0x6c(%rbp),%esi
mov    %eax,%edx
call   10b0 <range@plt>
jmp    14de <process_input+0x2fe>
mov    -0x10(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x40(%rbp),%rax
mov    (%rax),%rdi
call   10d0 <atoi@plt>
mov    -0x80(%rbp),%rdi
mov    %eax,%esi
call   10e0 <delete@plt>
jmp    14de <process_input+0x2fe>
mov    -0x10(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    (%rax),%rsi
call   10f0 <load@plt>
jmp    14de <process_input+0x2fe>
mov    -0x10(%rbp),%rdi
call   1080 <stat@plt>
jmp    14de <process_input+0x2fe>
mov    -0x10(%rbp),%rdi
call   1060 <quit@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<process_input>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r14
lea    0xe20(%rip),%rsi
mov    %r15,%rdi
call   10c0 <strtok@plt>
mov    %rax,%rbx
lea    0xe10(%rip),%rsi
mov    %rax,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12bf <process_input+0xdf>
lea    0xdfb(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
mov    $0x1,%ebp
test   %eax,%eax
je     12c9 <process_input+0xe9>
lea    0xde1(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12d1 <process_input+0xf1>
lea    0xdcc(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12de <process_input+0xfe>
lea    0xdbb(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     12e6 <process_input+0x106>
lea    0xdaa(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     13cf <process_input+0x1ef>
lea    0xd95(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     13f1 <process_input+0x211>
lea    0xd80(%rip),%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    $0x1,%ebp
jmp    13e0 <process_input+0x200>
mov    $0x2,%ebp
xor    %r15d,%r15d
jmp    12ec <process_input+0x10c>
mov    $0x1,%r15d
jmp    12ec <process_input+0x10c>
mov    $0x2,%r15d
mov    $0x2,%ebp
jmp    12ec <process_input+0x10c>
mov    $0x3,%r15d
jmp    12ec <process_input+0x10c>
mov    $0x4,%r15d
lea    0x0(,%rbp,8),%edi
call   1090 <malloc@plt>
mov    %rax,%r13
mov    %ebp,%ebp
xor    %ebx,%ebx
lea    0xd12(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
xor    %edi,%edi
mov    %r12,%rsi
call   10c0 <strtok@plt>
mov    %rax,%rdi
call   1100 <strdup@plt>
mov    %rax,0x0(%r13,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1310 <process_input+0x130>
xor    %ebp,%ebp
cmp    $0x5,%r15d
ja     13e0 <process_input+0x200>
mov    %r15d,%eax
lea    0xcba(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x0(%r13),%rdi
call   10d0 <atoi@plt>
mov    %eax,%r15d
mov    0x8(%r13),%rdi
call   10d0 <atoi@plt>
mov    %r14,%rdi
mov    %r15d,%esi
mov    %eax,%edx
call   1050 <put@plt>
jmp    13e0 <process_input+0x200>
mov    0x0(%r13),%rdi
call   10d0 <atoi@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   10a0 <get@plt>
jmp    13e0 <process_input+0x200>
mov    0x0(%r13),%rdi
call   10d0 <atoi@plt>
mov    %eax,%r15d
mov    0x8(%r13),%rdi
call   10d0 <atoi@plt>
mov    %r14,%rdi
mov    %r15d,%esi
mov    %eax,%edx
call   10b0 <range@plt>
jmp    13e0 <process_input+0x200>
mov    0x0(%r13),%rdi
call   10d0 <atoi@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   10e0 <delete@plt>
jmp    13e0 <process_input+0x200>
mov    0x0(%r13),%rsi
mov    %r14,%rdi
call   10f0 <load@plt>
jmp    13e0 <process_input+0x200>
xor    %edi,%edi
call   1090 <malloc@plt>
mov    %r14,%rdi
call   1080 <stat@plt>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %r14,%rdi
call   1060 <quit@plt>
mov    $0x1,%ebp
jmp    13e0 <process_input+0x200>

LLVM IR (-O0):
%struct.lsm_tree = type { i32 }
@.str = [2 x i8] c" \00"
@.str.1 = [2 x i8] c"p\00"
@.str.2 = [2 x i8] c"g\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [2 x i8] c"d\00"
@.str.5 = [2 x i8] c"l\00"
@.str.6 = [2 x i8] c"s\00"
@.str.7 = [2 x i8] c"q\00"
@.str.8 = [27 x i8] c"Invalid input, try again.\0A\00"
define i32 @process_input(%struct.lsm_tree* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.lsm_tree*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8**
%11 = alloca i32
store %struct.lsm_tree* %0, %struct.lsm_tree** %4
store i8* %1, i8** %5
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %9
%12 = load i8*, i8** %5
%13 = load i8*, i8** %9
%14 = call i8* @strtok(i8* %12, i8* %13)
store i8* %14, i8** %7
%15 = load i8*, i8** %7
%16 = call i32 @strcmp(i8* %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = icmp ne i32 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %2
store i32 0, i32* %8
store i32 2, i32* %6
br label %60
19: ; preds = %2
%20 = load i8*, i8** %7
%21 = call i32 @strcmp(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%22 = icmp ne i32 %21, 0
br i1 %22, label %24, label %23
23: ; preds = %19
store i32 1, i32* %8
store i32 1, i32* %6
br label %59
24: ; preds = %19
%25 = load i8*, i8** %7
%26 = call i32 @strcmp(i8* %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%27 = icmp ne i32 %26, 0
br i1 %27, label %29, label %28
28: ; preds = %24
store i32 2, i32* %8
store i32 2, i32* %6
br label %58
29: ; preds = %24
%30 = load i8*, i8** %7
%31 = call i32 @strcmp(i8* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%32 = icmp ne i32 %31, 0
br i1 %32, label %34, label %33
33: ; preds = %29
store i32 3, i32* %8
store i32 1, i32* %6
br label %57
34: ; preds = %29
%35 = load i8*, i8** %7
%36 = call i32 @strcmp(i8* %35, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%37 = icmp ne i32 %36, 0
br i1 %37, label %39, label %38
38: ; preds = %34
store i32 4, i32* %8
store i32 1, i32* %6
br label %56
39: ; preds = %34
%40 = load i8*, i8** %7
%41 = call i32 @strcmp(i8* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%42 = icmp ne i32 %41, 0
br i1 %42, label %44, label %43
43: ; preds = %39
store i32 5, i32* %8
store i32 0, i32* %6
br label %55
44: ; preds = %39
%45 = load i8*, i8** %7
%46 = call i32 @strcmp(i8* %45, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%47 = icmp ne i32 %46, 0
br i1 %47, label %51, label %48
48: ; preds = %44
%49 = load %struct.lsm_tree*, %struct.lsm_tree** %4
%50 = call i32 @quit(%struct.lsm_tree* %49)
store i32 1, i32* %3
br label %133
51: ; preds = %44
%52 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
%53 = load i8*, i8** %5
%54 = call i32 @free(i8* %53)
store i32 1, i32* %3
br label %133
55: ; preds = %43
br label %56
56: ; preds = %55, %38
br label %57
57: ; preds = %56, %33
br label %58
58: ; preds = %57, %28
br label %59
59: ; preds = %58, %23
br label %60
60: ; preds = %59, %18
%61 = load i32, i32* %6
%62 = sext i32 %61 to i64
%63 = mul i64 %62, 8
%64 = trunc i64 %63 to i32
%65 = call i64 @malloc(i32 %64)
%66 = inttoptr i64 %65 to i8**
store i8** %66, i8*** %10
store i32 0, i32* %11
br label %67
67: ; preds = %79, %60
%68 = load i32, i32* %11
%69 = load i32, i32* %6
%70 = icmp slt i32 %68, %69
br i1 %70, label %71, label %82
71: ; preds = %67
%72 = load i8*, i8** %9
%73 = call i8* @strtok(i8* null, i8* %72)
%74 = call i8* @strdup(i8* %73)
%75 = load i8**, i8*** %10
%76 = load i32, i32* %11
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8*, i8** %75, i64 %77
store i8* %74, i8** %78
br label %79
79: ; preds = %71
%80 = load i32, i32* %11
%81 = add nsw i32 %80, 1
store i32 %81, i32* %11
br label %67
82: ; preds = %67
%83 = load i32, i32* %8
switch i32 %83, label %132 [
i32 0, label %84
i32 1, label %95
i32 2, label %102
i32 3, label %113
i32 4, label %120
i32 5, label %126
i32 6, label %129
]
84: ; preds = %82
%85 = load %struct.lsm_tree*, %struct.lsm_tree** %4
%86 = load i8**, i8*** %10
%87 = getelementptr inbounds i8*, i8** %86, i64 0
%88 = load i8*, i8** %87
%89 = call i32 @atoi(i8* %88)
%90 = load i8**, i8*** %10
%91 = getelementptr inbounds i8*, i8** %90, i64 1
%92 = load i8*, i8** %91
%93 = call i32 @atoi(i8* %92)
%94 = call i32 @put(%struct.lsm_tree* %85, i32 %89, i32 %93)
br label %132
95: ; preds = %82
%96 = load %struct.lsm_tree*, %struct.lsm_tree** %4
%97 = load i8**, i8*** %10
%98 = getelementptr inbounds i8*, i8** %97, i64 0
%99 = load i8*, i8** %98
%100 = call i32 @atoi(i8* %99)
%101 = call i32 @get(%struct.lsm_tree* %96, i32 %100)
br label %132
102: ; preds = %82
%103 = load %struct.lsm_tree*, %struct.lsm_tree** %4
%104 = load i8**, i8*** %10
%105 = getelementptr inbounds i8*, i8** %104, i64 0
%106 = load i8*, i8** %105
%107 = call i32 @atoi(i8* %106)
%108 = load i8**, i8*** %10
%109 = getelementptr inbounds i8*, i8** %108, i64 1
%110 = load i8*, i8** %109
%111 = call i32 @atoi(i8* %110)
%112 = call i32 @range(%struct.lsm_tree* %103, i32 %107, i32 %111)
br label %132
113: ; preds = %82
%114 = load %struct.lsm_tree*, %struct.lsm_tree** %4
%115 = load i8**, i8*** %10
%116 = getelementptr inbounds i8*, i8** %115, i64 0
%117 = load i8*, i8** %116
%118 = call i32 @atoi(i8* %117)
%119 = call i32 @delete(%struct.lsm_tree* %114, i32 %118)
br label %132
120: ; preds = %82
%121 = load %struct.lsm_tree*, %struct.lsm_tree** %4
%122 = load i8**, i8*** %10
%123 = getelementptr inbounds i8*, i8** %122, i64 0
%124 = load i8*, i8** %123
%125 = call i32 @load(%struct.lsm_tree* %121, i8* %124)
br label %132
126: ; preds = %82
%127 = load %struct.lsm_tree*, %struct.lsm_tree** %4
%128 = call i32 @stat(%struct.lsm_tree* %127)
br label %132
129: ; preds = %82
%130 = load %struct.lsm_tree*, %struct.lsm_tree** %4
%131 = call i32 @quit(%struct.lsm_tree* %130)
br label %132
132: ; preds = %82, %129, %126, %120, %113, %102, %95, %84
store i32 0, i32* %3
br label %133
133: ; preds = %132, %51, %48
%134 = load i32, i32* %3
ret i32 %134
}

LLVM IR (-O2):
%struct.lsm_tree = type { i32 }
@.str = [2 x i8] c" \00"
@.str.1 = [2 x i8] c"p\00"
@.str.2 = [2 x i8] c"g\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [2 x i8] c"d\00"
@.str.5 = [2 x i8] c"l\00"
@.str.6 = [2 x i8] c"s\00"
@.str.7 = [2 x i8] c"q\00"
@str = [26 x i8] c"Invalid input, try again.\00"
define i32 @process_input(%struct.lsm_tree* %0, i8* %1) {
%3 = tail call i8* @strtok(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %31, label %6
6: ; preds = %2
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %31, label %9
9: ; preds = %6
%10 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %31, label %12
12: ; preds = %9
%13 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %31, label %15
15: ; preds = %12
%16 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %31, label %18
18: ; preds = %15
%19 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %29, label %21
21: ; preds = %18
%22 = tail call i32 @strcmp(i8* dereferenceable(1) %3, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %21
%25 = tail call i32 @quit(%struct.lsm_tree* %0)
br label %73
26: ; preds = %21
%27 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%28 = tail call i32 @free(i8* %1)
br label %73
29: ; preds = %18
%30 = tail call i64 @malloc(i32 0)
br label %71
31: ; preds = %2, %6, %9, %12, %15
%32 = phi i32 [ 4, %15 ], [ 3, %12 ], [ 2, %9 ], [ 1, %6 ], [ 0, %2 ]
%33 = phi i32 [ 1, %15 ], [ 1, %12 ], [ 2, %9 ], [ 1, %6 ], [ 2, %2 ]
%34 = shl nuw nsw i32 %33, 3
%35 = tail call i64 @malloc(i32 %34)
%36 = inttoptr i64 %35 to i8**
%37 = zext i32 %33 to i64
br label %39
38: ; preds = %39
switch i32 %32, label %73 [
i32 0, label %46
i32 1, label %53
i32 2, label %57
i32 3, label %64
i32 4, label %68
i32 5, label %71
]
39: ; preds = %31, %39
%40 = phi i64 [ 0, %31 ], [ %44, %39 ]
%41 = tail call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%42 = tail call i8* @strdup(i8* %41)
%43 = getelementptr inbounds i8*, i8** %36, i64 %40
store i8* %42, i8** %43
%44 = add nuw nsw i64 %40, 1
%45 = icmp eq i64 %44, %37
br i1 %45, label %38, label %39
46: ; preds = %38
%47 = load i8*, i8** %36
%48 = tail call i32 @atoi(i8* %47)
%49 = getelementptr inbounds i8*, i8** %36, i64 1
%50 = load i8*, i8** %49
%51 = tail call i32 @atoi(i8* %50)
%52 = tail call i32 @put(%struct.lsm_tree* %0, i32 %48, i32 %51)
br label %73
53: ; preds = %38
%54 = load i8*, i8** %36
%55 = tail call i32 @atoi(i8* %54)
%56 = tail call i32 @get(%struct.lsm_tree* %0, i32 %55)
br label %73
57: ; preds = %38
%58 = load i8*, i8** %36
%59 = tail call i32 @atoi(i8* %58)
%60 = getelementptr inbounds i8*, i8** %36, i64 1
%61 = load i8*, i8** %60
%62 = tail call i32 @atoi(i8* %61)
%63 = tail call i32 @range(%struct.lsm_tree* %0, i32 %59, i32 %62)
br label %73
64: ; preds = %38
%65 = load i8*, i8** %36
%66 = tail call i32 @atoi(i8* %65)
%67 = tail call i32 @delete(%struct.lsm_tree* %0, i32 %66)
br label %73
68: ; preds = %38
%69 = load i8*, i8** %36
%70 = tail call i32 @load(%struct.lsm_tree* %0, i8* %69)
br label %73
71: ; preds = %29, %38
%72 = tail call i32 @stat(%struct.lsm_tree* %0)
br label %73
73: ; preds = %46, %53, %57, %64, %68, %71, %38, %26, %24
%74 = phi i32 [ 1, %26 ], [ 1, %24 ], [ 0, %38 ], [ 0, %71 ], [ 0, %68 ], [ 0, %64 ], [ 0, %57 ], [ 0, %53 ], [ 0, %46 ]
ret i32 %74
}