#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 /*<<< orphan*/ printf(char *);
int test(int /*<<< orphan*/, char *);
int /*<<< orphan*/ testHashTable(int, int);
int main(int argc, char **argv) {
  int res;
  printf("\nTesting "
         "hash.c"
         "\n\n");
  ;
  res = test(testHashTable(1, 100), "HashTable with 1 bucket/ 100 entries");
  res = res |
        test(testHashTable(20, 10), "HashTable with 20 buckets/ 10 entries");
  res = res | test(testHashTable(100, 150),
                   "HashTable with 100 buckets/ 150 entries");
  res = res | test(testHashTable(100, 1000),
                   "HashTable with 100 buckets/ 1000 entries");
  res = res | test(testHashTable(1000, 10000),
                   "HashTable with 1000 buckets/ 10000 entries");
  return res;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
mov    $0x64,%esi
call   1040 <testHashTable@plt>
mov    %eax,%edi
lea    0xea8(%rip),%rsi
call   1050 <test@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    $0x14,%edi
mov    $0xa,%esi
call   1040 <testHashTable@plt>
mov    %eax,%edi
lea    0xea7(%rip),%rsi
call   1050 <test@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    $0x64,%edi
mov    $0x96,%esi
call   1040 <testHashTable@plt>
mov    %eax,%edi
lea    0xea0(%rip),%rsi
call   1050 <test@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x64,%edi
mov    $0x3e8,%esi
call   1040 <testHashTable@plt>
mov    %eax,%edi
lea    0xe9b(%rip),%rsi
call   1050 <test@plt>
mov    %eax,%ecx
mov    -0x1c(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    $0x3e8,%edi
mov    $0x2710,%esi
call   1040 <testHashTable@plt>
mov    %eax,%edi
lea    0xe97(%rip),%rsi
call   1050 <test@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xf8c(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
mov    $0x64,%esi
call   1040 <testHashTable@plt>
lea    0xeaa(%rip),%rsi
mov    %eax,%edi
call   1050 <test@plt>
mov    %eax,%ebp
mov    $0x14,%edi
mov    $0xa,%esi
call   1040 <testHashTable@plt>
lea    0xeb0(%rip),%rsi
mov    %eax,%edi
call   1050 <test@plt>
mov    %eax,%ebx
or     %ebp,%ebx
mov    $0x64,%edi
mov    $0x96,%esi
call   1040 <testHashTable@plt>
lea    0xeb5(%rip),%rsi
mov    %eax,%edi
call   1050 <test@plt>
mov    %eax,%r14d
mov    $0x64,%edi
mov    $0x3e8,%esi
call   1040 <testHashTable@plt>
lea    0xebd(%rip),%rsi
mov    %eax,%edi
call   1050 <test@plt>
mov    %eax,%ebp
or     %r14d,%ebp
or     %ebx,%ebp
mov    $0x3e8,%edi
mov    $0x2710,%esi
call   1040 <testHashTable@plt>
lea    0xec2(%rip),%rsi
mov    %eax,%edi
call   1050 <test@plt>
or     %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"\0ATesting hash.c\0A\0A\00"
@.str.1 = [37 x i8] c"HashTable with 1 bucket/ 100 entries\00"
@.str.2 = [38 x i8] c"HashTable with 20 buckets/ 10 entries\00"
@.str.3 = [40 x i8] c"HashTable with 100 buckets/ 150 entries\00"
@.str.4 = [41 x i8] c"HashTable with 100 buckets/ 1000 entries\00"
@.str.5 = [43 x i8] c"HashTable with 1000 buckets/ 10000 entries\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @testHashTable(i32 1, i32 100)
%9 = call i32 @test(i32 %8, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = call i32 @testHashTable(i32 20, i32 10)
%12 = call i32 @test(i32 %11, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%13 = or i32 %10, %12
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = call i32 @testHashTable(i32 100, i32 150)
%16 = call i32 @test(i32 %15, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
%17 = or i32 %14, %16
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = call i32 @testHashTable(i32 100, i32 1000)
%20 = call i32 @test(i32 %19, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
%21 = or i32 %18, %20
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = call i32 @testHashTable(i32 1000, i32 10000)
%24 = call i32 @test(i32 %23, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
%25 = or i32 %22, %24
store i32 %25, i32* %6
%26 = load i32, i32* %6
ret i32 %26
}

LLVM IR (-O2):
@.str.1 = [37 x i8] c"HashTable with 1 bucket/ 100 entries\00"
@.str.2 = [38 x i8] c"HashTable with 20 buckets/ 10 entries\00"
@.str.3 = [40 x i8] c"HashTable with 100 buckets/ 150 entries\00"
@.str.4 = [41 x i8] c"HashTable with 100 buckets/ 1000 entries\00"
@.str.5 = [43 x i8] c"HashTable with 1000 buckets/ 10000 entries\00"
@str = [17 x i8] c"\0ATesting hash.c\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @testHashTable(i32 1, i32 100)
%5 = tail call i32 @test(i32 %4, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @testHashTable(i32 20, i32 10)
%7 = tail call i32 @test(i32 %6, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.2, i64 0, i64 0))
%8 = or i32 %7, %5
%9 = tail call i32 @testHashTable(i32 100, i32 150)
%10 = tail call i32 @test(i32 %9, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
%11 = or i32 %8, %10
%12 = tail call i32 @testHashTable(i32 100, i32 1000)
%13 = tail call i32 @test(i32 %12, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
%14 = or i32 %11, %13
%15 = tail call i32 @testHashTable(i32 1000, i32 10000)
%16 = tail call i32 @test(i32 %15, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
%17 = or i32 %14, %16
ret i32 %17
}