#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 */
typedef int /*<<< orphan*/ keywords;

/* Variables and functions */
int SDBMHash(char *);
int /*<<< orphan*/ printf(char *, char *, int, int);
int main(void) {
  char *keywords[] = {"auto",     "break",   "case",   "char",     "const",
                      "continue", "default", "do",     "double",   "else",
                      "enum",     "extern",  "float",  "for",      "goto",
                      "if",       "int",     "long",   "register", "return",
                      "short",    "signed",  "sizeof", "static",   "struct",
                      "switch",   "typedef", "union",  "unsigned", "void",
                      "volatile", "while"};
  int count[101] = {0};
  int i;
  int size = sizeof(keywords) / sizeof(keywords[0]);
  for (i = 0; i < size; i++) {
    int pos = SDBMHash(keywords[i]);
    count[pos]++;
  }
  for (i = 0; i < size; i++) {
    int pos = SDBMHash(keywords[i]);
    printf("%-10s %d %d\n", keywords[i], pos, count[pos]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2c0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x110(%rbp),%rdi
lea    0x2bc0(%rip),%rsi
mov    $0x100,%edx
call   1050 <memcpy@plt>
lea    -0x2b0(%rbp),%rdi
xor    %esi,%esi
mov    $0x194,%edx
call   1040 <memset@plt>
movl   $0x20,-0x2b8(%rbp)
movl   $0x0,-0x2b4(%rbp)
mov    -0x2b4(%rbp),%eax
cmp    -0x2b8(%rbp),%eax
jge    11e9 <main+0xa9>
movslq -0x2b4(%rbp),%rax
mov    -0x110(%rbp,%rax,8),%rdi
ff
call   1060 <SDBMHash@plt>
mov    %eax,-0x2bc(%rbp)
movslq -0x2bc(%rbp),%rax
mov    -0x2b0(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x2b0(%rbp,%rax,4)
mov    -0x2b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2b4(%rbp)
jmp    1191 <main+0x51>
movl   $0x0,-0x2b4(%rbp)
mov    -0x2b4(%rbp),%eax
cmp    -0x2b8(%rbp),%eax
jge    1262 <main+0x122>
movslq -0x2b4(%rbp),%rax
mov    -0x110(%rbp,%rax,8),%rdi
ff
call   1060 <SDBMHash@plt>
mov    %eax,-0x2c0(%rbp)
movslq -0x2b4(%rbp),%rax
mov    -0x110(%rbp,%rax,8),%rsi
ff
mov    -0x2c0(%rbp),%edx
movslq -0x2c0(%rbp),%rax
mov    -0x2b0(%rbp,%rax,4),%ecx
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
mov    -0x2b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2b4(%rbp)
jmp    11f3 <main+0xb3>
xor    %eax,%eax
add    $0x2c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x198,%rsp
mov    %rsp,%rdi
xor    %ebx,%ebx
mov    $0x194,%edx
xor    %esi,%esi
call   1040 <memset@plt>
lea    0x2bca(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
mov    (%rbx,%r15,1),%rdi
call   1050 <SDBMHash@plt>
cltq
addl   $0x1,(%rsp,%rax,4)
add    $0x8,%rbx
cmp    $0x100,%rbx
jne    1160 <main+0x30>
xor    %ebx,%ebx
lea    0xf3a(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%rbx,%r15,1),%r12
mov    %r12,%rdi
call   1050 <SDBMHash@plt>
movslq %eax,%rdx
mov    (%rsp,%rdx,4),%ecx
mov    %r14,%rdi
mov    %r12,%rsi
call   1030 <printf@plt>
add    $0x8,%rbx
cmp    $0x100,%rbx
jne    1190 <main+0x60>
xor    %eax,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"auto\00"
@.str.1 = [6 x i8] c"break\00"
@.str.2 = [5 x i8] c"case\00"
@.str.3 = [5 x i8] c"char\00"
@.str.4 = [6 x i8] c"const\00"
@.str.5 = [9 x i8] c"continue\00"
@.str.6 = [8 x i8] c"default\00"
@.str.7 = [3 x i8] c"do\00"
@.str.8 = [7 x i8] c"double\00"
@.str.9 = [5 x i8] c"else\00"
@.str.10 = [5 x i8] c"enum\00"
@.str.11 = [7 x i8] c"extern\00"
@.str.12 = [6 x i8] c"float\00"
@.str.13 = [4 x i8] c"for\00"
@.str.14 = [5 x i8] c"goto\00"
@.str.15 = [3 x i8] c"if\00"
@.str.16 = [4 x i8] c"int\00"
@.str.17 = [5 x i8] c"long\00"
@.str.18 = [9 x i8] c"register\00"
@.str.19 = [7 x i8] c"return\00"
@.str.20 = [6 x i8] c"short\00"
@.str.21 = [7 x i8] c"signed\00"
@.str.22 = [7 x i8] c"sizeof\00"
@.str.23 = [7 x i8] c"static\00"
@.str.24 = [7 x i8] c"struct\00"
@.str.25 = [7 x i8] c"switch\00"
@.str.26 = [8 x i8] c"typedef\00"
@.str.27 = [6 x i8] c"union\00"
@.str.28 = [9 x i8] c"unsigned\00"
@.str.29 = [5 x i8] c"void\00"
@.str.30 = [9 x i8] c"volatile\00"
@.str.31 = [6 x i8] c"while\00"
@__const.main.keywords = [32 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.27, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.31, i32 0, i32 0)]
@.str.32 = [13 x i8] c"%-10s %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [32 x i8*]
%3 = alloca [101 x i32]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = bitcast [32 x i8*]* %2 to i8*
%9 = bitcast [101 x i32]* %3 to i8*
store i32 32, i32* %5
store i32 0, i32* %4
br label %10
10: ; preds = %25, %0
%11 = load i32, i32* %4
%12 = load i32, i32* %5
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %28
14: ; preds = %10
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [32 x i8*], [32 x i8*]* %2, i64 0, i64 %16
%18 = load i8*, i8** %17
%19 = call i32 @SDBMHash(i8* %18)
store i32 %19, i32* %6
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = add nsw i32 %23, 1
store i32 %24, i32* %22
br label %25
25: ; preds = %14
%26 = load i32, i32* %4
%27 = add nsw i32 %26, 1
store i32 %27, i32* %4
br label %10
28: ; preds = %10
store i32 0, i32* %4
br label %29
29: ; preds = %49, %28
%30 = load i32, i32* %4
%31 = load i32, i32* %5
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %52
33: ; preds = %29
%34 = load i32, i32* %4
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [32 x i8*], [32 x i8*]* %2, i64 0, i64 %35
%37 = load i8*, i8** %36
%38 = call i32 @SDBMHash(i8* %37)
store i32 %38, i32* %7
%39 = load i32, i32* %4
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [32 x i8*], [32 x i8*]* %2, i64 0, i64 %40
%42 = load i8*, i8** %41
%43 = load i32, i32* %7
%44 = load i32, i32* %7
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [101 x i32], [101 x i32]* %3, i64 0, i64 %45
%47 = load i32, i32* %46
%48 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.32, i64 0, i64 0), i8* %42, i32 %43, i32 %47)
br label %49
49: ; preds = %33
%50 = load i32, i32* %4
%51 = add nsw i32 %50, 1
store i32 %51, i32* %4
br label %29
52: ; preds = %29
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"auto\00"
@.str.1 = [6 x i8] c"break\00"
@.str.2 = [5 x i8] c"case\00"
@.str.3 = [5 x i8] c"char\00"
@.str.4 = [6 x i8] c"const\00"
@.str.5 = [9 x i8] c"continue\00"
@.str.6 = [8 x i8] c"default\00"
@.str.7 = [3 x i8] c"do\00"
@.str.8 = [7 x i8] c"double\00"
@.str.9 = [5 x i8] c"else\00"
@.str.10 = [5 x i8] c"enum\00"
@.str.11 = [7 x i8] c"extern\00"
@.str.12 = [6 x i8] c"float\00"
@.str.13 = [4 x i8] c"for\00"
@.str.14 = [5 x i8] c"goto\00"
@.str.15 = [3 x i8] c"if\00"
@.str.16 = [4 x i8] c"int\00"
@.str.17 = [5 x i8] c"long\00"
@.str.18 = [9 x i8] c"register\00"
@.str.19 = [7 x i8] c"return\00"
@.str.20 = [6 x i8] c"short\00"
@.str.21 = [7 x i8] c"signed\00"
@.str.22 = [7 x i8] c"sizeof\00"
@.str.23 = [7 x i8] c"static\00"
@.str.24 = [7 x i8] c"struct\00"
@.str.25 = [7 x i8] c"switch\00"
@.str.26 = [8 x i8] c"typedef\00"
@.str.27 = [6 x i8] c"union\00"
@.str.28 = [9 x i8] c"unsigned\00"
@.str.29 = [5 x i8] c"void\00"
@.str.30 = [9 x i8] c"volatile\00"
@.str.31 = [6 x i8] c"while\00"
@__const.main.keywords = [32 x i8*] [i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.27, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.31, i32 0, i32 0)]
@.str.32 = [13 x i8] c"%-10s %d %d\0A\00"
define i32 @main() {
%1 = alloca [101 x i32]
%2 = bitcast [101 x i32]* %1 to i8*
br label %3
3: ; preds = %0, %3
%4 = phi i64 [ 0, %0 ], [ %12, %3 ]
%5 = getelementptr inbounds [32 x i8*], [32 x i8*]* @__const.main.keywords, i64 0, i64 %4
%6 = load i8*, i8** %5
%7 = tail call i32 @SDBMHash(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 %8
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 1
store i32 %11, i32* %9
%12 = add nuw nsw i64 %4, 1
%13 = icmp eq i64 %12, 32
br i1 %13, label %14, label %3
14: ; preds = %3, %14
%15 = phi i64 [ %23, %14 ], [ 0, %3 ]
%16 = getelementptr inbounds [32 x i8*], [32 x i8*]* @__const.main.keywords, i64 0, i64 %15
%17 = load i8*, i8** %16
%18 = tail call i32 @SDBMHash(i8* %17)
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [101 x i32], [101 x i32]* %1, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.32, i64 0, i64 0), i8* %17, i32 %18, i32 %21)
%23 = add nuw nsw i64 %15, 1
%24 = icmp eq i64 %23, 32
br i1 %24, label %25, label %14
25: ; preds = %14
ret i32 0
}