#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 create_table(char *);
char *get_table(char *, char *);
char *set_table(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
char *main(int argc, char **argv) {
  int state = create_table(argv[2]);
  if (strcmp(argv[1], "get") == 0) {
    return get_table(argv[2], argv[3]);
  } else if (strcmp(argv[1], "set") == 0) {
    return set_table(argv[2], argv[3], argv[4]);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <create_table@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe92(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    119b <main+0x5b>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rsi
call   1050 <get_table@plt>
mov    %rax,-0x8(%rbp)
jmp    11e4 <main+0xa4>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe5a(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11df <main+0x9f>
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rdi
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rsi
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%rdx
call   1060 <set_table@plt>
mov    %rax,-0x8(%rbp)
jmp    11e4 <main+0xa4>
jmp    11e4 <main+0xa4>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
mov    0x10(%rsi),%rdi
call   1030 <create_table@plt>
mov    0x8(%rbx),%rdi
lea    0xea8(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1179 <main+0x39>
mov    0x8(%rbx),%rdi
lea    0xe97(%rip),%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1187 <main+0x47>
pop    %rbx
ret
mov    0x10(%rbx),%rdi
mov    0x18(%rbx),%rsi
pop    %rbx
jmp    1050 <get_table@plt>
mov    0x10(%rbx),%rdi
mov    0x18(%rbx),%rsi
mov    0x20(%rbx),%rdx
pop    %rbx
jmp    1060 <set_table@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"get\00"
@.str.1 = [4 x i8] c"set\00"
define i8* @main(i32 %0, i8** %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i64 2
%9 = load i8*, i8** %8
%10 = call i32 @create_table(i8* %9)
store i32 %10, i32* %6
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i64 @strcmp(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %24
16: ; preds = %2
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 3
%22 = load i8*, i8** %21
%23 = call i8* @get_table(i8* %19, i8* %22)
store i8* %23, i8** %3
br label %42
24: ; preds = %2
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i64 @strcmp(i8* %27, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %41
30: ; preds = %24
%31 = load i8**, i8*** %5
%32 = getelementptr inbounds i8*, i8** %31, i64 2
%33 = load i8*, i8** %32
%34 = load i8**, i8*** %5
%35 = getelementptr inbounds i8*, i8** %34, i64 3
%36 = load i8*, i8** %35
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 4
%39 = load i8*, i8** %38
%40 = call i8* @set_table(i8* %33, i8* %36, i8* %39)
store i8* %40, i8** %3
br label %42
41: ; preds = %24
br label %42
42: ; preds = %16, %30, %41
%43 = load i8*, i8** %3
ret i8* %43
}

LLVM IR (-O2):
@.str = [4 x i8] c"get\00"
@.str.1 = [4 x i8] c"set\00"
define i8* @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 2
%4 = load i8*, i8** %3
%5 = tail call i32 @create_table(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i8*, i8** %3
%12 = getelementptr inbounds i8*, i8** %1, i64 3
%13 = load i8*, i8** %12
%14 = tail call i8* @get_table(i8* %11, i8* %13)
br label %26
15: ; preds = %2
%16 = load i8*, i8** %6
%17 = tail call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %26
19: ; preds = %15
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8*, i8** %1, i64 3
%22 = load i8*, i8** %21
%23 = getelementptr inbounds i8*, i8** %1, i64 4
%24 = load i8*, i8** %23
%25 = tail call i8* @set_table(i8* %20, i8* %22, i8* %24)
br label %26
26: ; preds = %15, %19, %10
%27 = phi i8* [ %14, %10 ], [ %25, %19 ], [ undef, %15 ]
ret i8* %27
}