#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 */
char *hashtable_getvalue(char *);
int /*<<< orphan*/ hashtable_insert(char *, char *);
int /*<<< orphan*/ printf(char *, char *, ...);
int main(int argc, char *argv[]) {
  char *ret;
  if (argc < 2) {
    printf("Usage: %s string\n", argv[0]);
    return -1;
  }
  hashtable_insert("INT_MAX", "32767");
  hashtable_insert("INT_MIN", "-32768");
  hashtable_insert("LONG_MAX", "2147483647");
  hashtable_insert("LONG_MIN", "-2147483647");
  if ((ret = hashtable_getvalue(argv[1])) == NULL)
    printf("%s not found\n", argv[1]);
  else
    printf("%s = %s\n", argv[1], ret);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1171 <main+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    120d <main+0xdd>
lea    0xe9a(%rip),%rdi
lea    0xe9b(%rip),%rsi
call   1050 <hashtable_insert@plt>
lea    0xe95(%rip),%rdi
lea    0xe96(%rip),%rsi
call   1050 <hashtable_insert@plt>
lea    0xe91(%rip),%rdi
lea    0xe9d(%rip),%rsi
call   1050 <hashtable_insert@plt>
lea    0xe87(%rip),%rdi
lea    0xe89(%rip),%rsi
call   1050 <hashtable_insert@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <hashtable_getvalue@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    11f3 <main+0xc3>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    120d <main+0xdd>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %rsi,%rbx
cmp    $0x1,%edi
jg     1154 <main+0x24>
mov    (%rbx),%rsi
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0xffffffff,%ebx
jmp    11d7 <main+0xa7>
lea    0xeb7(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1050 <hashtable_insert@plt>
lea    0xeb2(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   1050 <hashtable_insert@plt>
lea    0xeae(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1050 <hashtable_insert@plt>
lea    0xea4(%rip),%rdi
lea    0xea6(%rip),%rsi
call   1050 <hashtable_insert@plt>
mov    0x8(%rbx),%rdi
call   1040 <hashtable_getvalue@plt>
mov    0x8(%rbx),%rsi
test   %rax,%rax
je     11c7 <main+0x97>
lea    0xea2(%rip),%rdi
xor    %ebx,%ebx
mov    %rax,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11d7 <main+0xa7>
lea    0xe7f(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Usage: %s string\0A\00"
@.str.1 = [8 x i8] c"INT_MAX\00"
@.str.2 = [6 x i8] c"32767\00"
@.str.3 = [8 x i8] c"INT_MIN\00"
@.str.4 = [7 x i8] c"-32768\00"
@.str.5 = [9 x i8] c"LONG_MAX\00"
@.str.6 = [11 x i8] c"2147483647\00"
@.str.7 = [9 x i8] c"LONG_MIN\00"
@.str.8 = [12 x i8] c"-2147483647\00"
@.str.9 = [14 x i8] c"%s not found\0A\00"
@.str.10 = [9 x i8] c"%s = %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 -1, i32* %3
br label %35
14: ; preds = %2
%15 = call i32 @hashtable_insert(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @hashtable_insert(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%17 = call i32 @hashtable_insert(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%18 = call i32 @hashtable_insert(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = call i8* @hashtable_getvalue(i8* %21)
store i8* %22, i8** %6
%23 = icmp eq i8* %22, null
br i1 %23, label %24, label %29
24: ; preds = %14
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i8* %27)
br label %35
29: ; preds = %14
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i64 1
%32 = load i8*, i8** %31
%33 = load i8*, i8** %6
%34 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8* %32, i8* %33)
br label %35
35: ; preds = %9, %29, %24
%36 = load i32, i32* %3
ret i32 %36
}

LLVM IR (-O2):
@.str = [18 x i8] c"Usage: %s string\0A\00"
@.str.1 = [8 x i8] c"INT_MAX\00"
@.str.2 = [6 x i8] c"32767\00"
@.str.3 = [8 x i8] c"INT_MIN\00"
@.str.4 = [7 x i8] c"-32768\00"
@.str.5 = [9 x i8] c"LONG_MAX\00"
@.str.6 = [11 x i8] c"2147483647\00"
@.str.7 = [9 x i8] c"LONG_MIN\00"
@.str.8 = [12 x i8] c"-2147483647\00"
@.str.9 = [14 x i8] c"%s not found\0A\00"
@.str.10 = [9 x i8] c"%s = %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %21
7: ; preds = %2
%8 = tail call i32 @hashtable_insert(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 @hashtable_insert(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i32 @hashtable_insert(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%11 = tail call i32 @hashtable_insert(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
%12 = getelementptr inbounds i8*, i8** %1, i64 1
%13 = load i8*, i8** %12
%14 = tail call i8* @hashtable_getvalue(i8* %13)
%15 = icmp eq i8* %14, null
%16 = load i8*, i8** %12
br i1 %15, label %17, label %19
17: ; preds = %7
%18 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i8* %16)
br label %21
19: ; preds = %7
%20 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8* %16, i8* %14)
br label %21
21: ; preds = %17, %19, %4
%22 = phi i32 [ -1, %4 ], [ 0, %19 ], [ 0, %17 ]
ret i32 %22
}