#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 hashtable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free_hashtable(struct hashtable *);
int /*<<< orphan*/ ht_add_char(struct hashtable *, char, char *);
int /*<<< orphan*/ ht_add_int(struct hashtable *, int, char *);
int /*<<< orphan*/ ht_add_raw(struct hashtable *, struct hashtable *, int,
                              char *);
int /*<<< orphan*/ ht_add_str(struct hashtable *, char *, char *);
scalar_t__ ht_find_char(struct hashtable *, char);
scalar_t__ ht_find_int(struct hashtable *, int);
scalar_t__ ht_find_raw(struct hashtable *, struct hashtable *, int);
scalar_t__ ht_find_str(struct hashtable *, char *);
int /*<<< orphan*/ ht_rm_int(struct hashtable *, int);
struct hashtable *init_hashtable();
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  struct hashtable *ht = init_hashtable();
  char *a = "First test string";
  char *b = "Second test string";
  char *c = "Third test string";
  char *d = "Fourth test string";
  char *e = "Fifth test string";
  char *f = "Sixth test string";
  char *g = "This really works! :)";
  ht_add_int(ht, 1, a);
  ht_add_char(ht, 'a', b);
  ht_add_str(ht, "string", c);
  ht_add_int(ht, 2, d);
  ht_add_int(ht, 3, e);
  ht_add_int(ht, 4, f);
  ht_add_raw(ht, ht, 16, g);
  ht_rm_int(ht, 2);
  printf("Found> \"%s\"\n", (char *)ht_find_int(ht, 1));
  printf("Found> \"%s\"\n", (char *)ht_find_char(ht, 'a'));
  printf("Found> \"%s\"\n", (char *)ht_find_str(ht, "string"));
  printf("Found> \"%s\"\n", (char *)ht_find_int(ht, 2));
  printf("Found> \"%s\"\n", (char *)ht_find_int(ht, 3));
  printf("Found> \"%s\"\n", (char *)ht_find_int(ht, 4));
  printf("Found> \"%s\"\n", (char *)ht_find_raw(ht, ht, 16));
  free_hashtable(ht);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   10d0 <init_hashtable@plt>
mov    %rax,-0x18(%rbp)
lea    0xe18(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe1f(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe27(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe2e(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe36(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xe3d(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xe44(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    $0x1,%esi
call   10e0 <ht_add_int@plt>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rdx
mov    $0x61,%esi
call   1080 <ht_add_char@plt>
mov    -0x18(%rbp),%rdi
mov    -0x30(%rbp),%rdx
lea    0xdbd(%rip),%rsi
call   10b0 <ht_add_str@plt>
mov    -0x18(%rbp),%rdi
mov    -0x38(%rbp),%rdx
mov    $0x2,%esi
call   10e0 <ht_add_int@plt>
mov    -0x18(%rbp),%rdi
mov    -0x40(%rbp),%rdx
mov    $0x3,%esi
call   10e0 <ht_add_int@plt>
mov    -0x18(%rbp),%rdi
mov    -0x48(%rbp),%rdx
mov    $0x4,%esi
call   10e0 <ht_add_int@plt>
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x50(%rbp),%rcx
mov    $0x10,%edx
call   1050 <ht_add_raw@plt>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   1090 <ht_rm_int@plt>
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
call   1040 <ht_find_int@plt>
mov    %rax,%rsi
lea    0xdac(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    $0x61,%esi
call   1060 <ht_find_char@plt>
mov    %rax,%rsi
lea    0xd8f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    0xd19(%rip),%rsi
call   1070 <ht_find_str@plt>
mov    %rax,%rsi
lea    0xd70(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    $0x2,%esi
call   1040 <ht_find_int@plt>
mov    %rax,%rsi
lea    0xd53(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    $0x3,%esi
call   1040 <ht_find_int@plt>
mov    %rax,%rsi
lea    0xd36(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    $0x4,%esi
call   1040 <ht_find_int@plt>
mov    %rax,%rsi
lea    0xd19(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x10,%edx
call   10a0 <ht_find_raw@plt>
mov    %rax,%rsi
lea    0xcf8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
call   10c0 <free_hashtable@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   10d0 <init_hashtable@plt>
mov    %rax,%rbx
lea    0xe2a(%rip),%rdx
mov    %rax,%rdi
mov    $0x1,%esi
call   10e0 <ht_add_int@plt>
lea    0xe28(%rip),%rdx
mov    %rbx,%rdi
mov    $0x61,%esi
call   1080 <ht_add_char@plt>
lea    0xe20(%rip),%r14
lea    0xe20(%rip),%rdx
mov    %rbx,%rdi
mov    %r14,%rsi
call   10b0 <ht_add_str@plt>
lea    0xe20(%rip),%rdx
mov    %rbx,%rdi
mov    $0x2,%esi
call   10e0 <ht_add_int@plt>
lea    0xe1f(%rip),%rdx
mov    %rbx,%rdi
mov    $0x3,%esi
call   10e0 <ht_add_int@plt>
lea    0xe1d(%rip),%rdx
mov    %rbx,%rdi
mov    $0x4,%esi
call   10e0 <ht_add_int@plt>
lea    0xe1b(%rip),%rcx
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    $0x10,%edx
call   1050 <ht_add_raw@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1090 <ht_rm_int@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1040 <ht_find_int@plt>
lea    0xe00(%rip),%r15
mov    %r15,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x61,%esi
call   1060 <ht_find_char@plt>
mov    %r15,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <ht_find_str@plt>
mov    %r15,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1040 <ht_find_int@plt>
mov    %r15,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1040 <ht_find_int@plt>
mov    %r15,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1040 <ht_find_int@plt>
mov    %r15,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
mov    $0x10,%edx
call   10a0 <ht_find_raw@plt>
mov    %r15,%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
call   10c0 <free_hashtable@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.hashtable = type { i32 }
@.str = [18 x i8] c"First test string\00"
@.str.1 = [19 x i8] c"Second test string\00"
@.str.2 = [18 x i8] c"Third test string\00"
@.str.3 = [19 x i8] c"Fourth test string\00"
@.str.4 = [18 x i8] c"Fifth test string\00"
@.str.5 = [18 x i8] c"Sixth test string\00"
@.str.6 = [22 x i8] c"This really works! :)\00"
@.str.7 = [7 x i8] c"string\00"
@.str.8 = [13 x i8] c"Found> \22%s\22\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.hashtable*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = call %struct.hashtable* (...) @init_hashtable()
store %struct.hashtable* %14, %struct.hashtable** %6
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8** %7
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8** %8
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8** %9
store i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8** %10
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8** %11
store i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8** %12
store i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0), i8** %13
%15 = load %struct.hashtable*, %struct.hashtable** %6
%16 = load i8*, i8** %7
%17 = call i32 @ht_add_int(%struct.hashtable* %15, i32 1, i8* %16)
%18 = load %struct.hashtable*, %struct.hashtable** %6
%19 = load i8*, i8** %8
%20 = call i32 @ht_add_char(%struct.hashtable* %18, i8 signext 97, i8* %19)
%21 = load %struct.hashtable*, %struct.hashtable** %6
%22 = load i8*, i8** %9
%23 = call i32 @ht_add_str(%struct.hashtable* %21, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* %22)
%24 = load %struct.hashtable*, %struct.hashtable** %6
%25 = load i8*, i8** %10
%26 = call i32 @ht_add_int(%struct.hashtable* %24, i32 2, i8* %25)
%27 = load %struct.hashtable*, %struct.hashtable** %6
%28 = load i8*, i8** %11
%29 = call i32 @ht_add_int(%struct.hashtable* %27, i32 3, i8* %28)
%30 = load %struct.hashtable*, %struct.hashtable** %6
%31 = load i8*, i8** %12
%32 = call i32 @ht_add_int(%struct.hashtable* %30, i32 4, i8* %31)
%33 = load %struct.hashtable*, %struct.hashtable** %6
%34 = load %struct.hashtable*, %struct.hashtable** %6
%35 = load i8*, i8** %13
%36 = call i32 @ht_add_raw(%struct.hashtable* %33, %struct.hashtable* %34, i32 16, i8* %35)
%37 = load %struct.hashtable*, %struct.hashtable** %6
%38 = call i32 @ht_rm_int(%struct.hashtable* %37, i32 2)
%39 = load %struct.hashtable*, %struct.hashtable** %6
%40 = call i64 @ht_find_int(%struct.hashtable* %39, i32 1)
%41 = inttoptr i64 %40 to i8*
%42 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %41)
%43 = load %struct.hashtable*, %struct.hashtable** %6
%44 = call i64 @ht_find_char(%struct.hashtable* %43, i8 signext 97)
%45 = inttoptr i64 %44 to i8*
%46 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %45)
%47 = load %struct.hashtable*, %struct.hashtable** %6
%48 = call i64 @ht_find_str(%struct.hashtable* %47, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%49 = inttoptr i64 %48 to i8*
%50 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %49)
%51 = load %struct.hashtable*, %struct.hashtable** %6
%52 = call i64 @ht_find_int(%struct.hashtable* %51, i32 2)
%53 = inttoptr i64 %52 to i8*
%54 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %53)
%55 = load %struct.hashtable*, %struct.hashtable** %6
%56 = call i64 @ht_find_int(%struct.hashtable* %55, i32 3)
%57 = inttoptr i64 %56 to i8*
%58 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %57)
%59 = load %struct.hashtable*, %struct.hashtable** %6
%60 = call i64 @ht_find_int(%struct.hashtable* %59, i32 4)
%61 = inttoptr i64 %60 to i8*
%62 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %61)
%63 = load %struct.hashtable*, %struct.hashtable** %6
%64 = load %struct.hashtable*, %struct.hashtable** %6
%65 = call i64 @ht_find_raw(%struct.hashtable* %63, %struct.hashtable* %64, i32 16)
%66 = inttoptr i64 %65 to i8*
%67 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %66)
%68 = load %struct.hashtable*, %struct.hashtable** %6
%69 = call i32 @free_hashtable(%struct.hashtable* %68)
ret i32 0
}

LLVM IR (-O2):
%struct.hashtable = type { i32 }
@.str = [18 x i8] c"First test string\00"
@.str.1 = [19 x i8] c"Second test string\00"
@.str.2 = [18 x i8] c"Third test string\00"
@.str.3 = [19 x i8] c"Fourth test string\00"
@.str.4 = [18 x i8] c"Fifth test string\00"
@.str.5 = [18 x i8] c"Sixth test string\00"
@.str.6 = [22 x i8] c"This really works! :)\00"
@.str.7 = [7 x i8] c"string\00"
@.str.8 = [13 x i8] c"Found> \22%s\22\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call %struct.hashtable* (...) @init_hashtable()
%4 = tail call i32 @ht_add_int(%struct.hashtable* %3, i32 1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @ht_add_char(%struct.hashtable* %3, i8 signext 97, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @ht_add_str(%struct.hashtable* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @ht_add_int(%struct.hashtable* %3, i32 2, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 @ht_add_int(%struct.hashtable* %3, i32 3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%9 = tail call i32 @ht_add_int(%struct.hashtable* %3, i32 4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0))
%10 = tail call i32 @ht_add_raw(%struct.hashtable* %3, %struct.hashtable* %3, i32 16, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
%11 = tail call i32 @ht_rm_int(%struct.hashtable* %3, i32 2)
%12 = tail call i64 @ht_find_int(%struct.hashtable* %3, i32 1)
%13 = inttoptr i64 %12 to i8*
%14 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %13)
%15 = tail call i64 @ht_find_char(%struct.hashtable* %3, i8 signext 97)
%16 = inttoptr i64 %15 to i8*
%17 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %16)
%18 = tail call i64 @ht_find_str(%struct.hashtable* %3, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.7, i64 0, i64 0))
%19 = inttoptr i64 %18 to i8*
%20 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %19)
%21 = tail call i64 @ht_find_int(%struct.hashtable* %3, i32 2)
%22 = inttoptr i64 %21 to i8*
%23 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %22)
%24 = tail call i64 @ht_find_int(%struct.hashtable* %3, i32 3)
%25 = inttoptr i64 %24 to i8*
%26 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %25)
%27 = tail call i64 @ht_find_int(%struct.hashtable* %3, i32 4)
%28 = inttoptr i64 %27 to i8*
%29 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %28)
%30 = tail call i64 @ht_find_raw(%struct.hashtable* %3, %struct.hashtable* %3, i32 16)
%31 = inttoptr i64 %30 to i8*
%32 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i8* %31)
%33 = tail call i32 @free_hashtable(%struct.hashtable* %3)
ret i32 0
}