#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 hashfun(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  char *aa[20] = {"GLY", "ALA", "VAL", "LEU", "ILE", "MET", "PRO",
                  "TRP", "PHE", "TYR", "SER", "CYS", "THR", "ASN",
                  "GLN", "HIS", "ASP", "GLU", "LYS", "ARG"};
  char *a1 = "GAVLIMPWFYSCTNQHDEKR";
  char translation[100];
  int i, val;
  for (i = 0; i < 20; i++) {
    val = hashfun(aa[i]);
    translation[val] = a1[i];
  }
  printf("\n");
  for (i = 0; i < 20; i++) {
    val = hashfun(aa[i]);
    printf("\t%2d  %3s   %5d %1c\n", i, aa[i], val, translation[val]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x130,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xb0(%rbp),%rdi
lea    0x2c29(%rip),%rsi
mov    $0xa0,%edx
call   1040 <memcpy@plt>
lea    0xee8(%rip),%rax
mov    %rax,-0xb8(%rbp)
movl   $0x0,-0x124(%rbp)
cmpl   $0x14,-0x124(%rbp)
jge    11d3 <main+0xa3>
movslq -0x124(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rdi
ff
call   1050 <hashfun@plt>
mov    %eax,-0x128(%rbp)
mov    -0xb8(%rbp),%rax
movslq -0x124(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x128(%rbp),%rax
mov    %cl,-0x120(%rbp,%rax,1)
mov    -0x124(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x124(%rbp)
jmp    1179 <main+0x49>
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x124(%rbp)
cmpl   $0x14,-0x124(%rbp)
jge    125f <main+0x12f>
movslq -0x124(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rdi
ff
call   1050 <hashfun@plt>
mov    %eax,-0x128(%rbp)
mov    -0x124(%rbp),%esi
movslq -0x124(%rbp),%rax
mov    -0xb0(%rbp,%rax,8),%rdx
ff
mov    -0x128(%rbp),%ecx
movslq -0x128(%rbp),%rax
movsbl -0x120(%rbp,%rax,1),%r8d
ff ff
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x124(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x124(%rbp)
jmp    11eb <main+0xbb>
lea    0xe12(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x130,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x68,%rsp
lea    0x2c3e(%rip),%r14
xor    %ebx,%ebx
lea    0xf05(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    (%r14),%rdi
call   1050 <hashfun@plt>
movzbl (%rbx,%r15,1),%ecx
cltq
mov    %cl,(%rsp,%rax,1)
add    $0x1,%rbx
add    $0x8,%r14
cmp    $0x14,%rbx
jne    1150 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x2bff(%rip),%r12
lea    0xedd(%rip),%r14
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r12),%r15
mov    %r15,%rdi
call   1050 <hashfun@plt>
movslq %eax,%rcx
movsbl (%rsp,%rcx,1),%r8d
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r15,%rdx
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
add    $0x8,%r12
cmp    $0x14,%rbx
jne    1190 <main+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"GLY\00"
@.str.1 = [4 x i8] c"ALA\00"
@.str.2 = [4 x i8] c"VAL\00"
@.str.3 = [4 x i8] c"LEU\00"
@.str.4 = [4 x i8] c"ILE\00"
@.str.5 = [4 x i8] c"MET\00"
@.str.6 = [4 x i8] c"PRO\00"
@.str.7 = [4 x i8] c"TRP\00"
@.str.8 = [4 x i8] c"PHE\00"
@.str.9 = [4 x i8] c"TYR\00"
@.str.10 = [4 x i8] c"SER\00"
@.str.11 = [4 x i8] c"CYS\00"
@.str.12 = [4 x i8] c"THR\00"
@.str.13 = [4 x i8] c"ASN\00"
@.str.14 = [4 x i8] c"GLN\00"
@.str.15 = [4 x i8] c"HIS\00"
@.str.16 = [4 x i8] c"ASP\00"
@.str.17 = [4 x i8] c"GLU\00"
@.str.18 = [4 x i8] c"LYS\00"
@.str.19 = [4 x i8] c"ARG\00"
@__const.main.aa = [20 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 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 ([4 x i8], [4 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 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 ([4 x i8], [4 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i32 0, i32 0)]
@.str.20 = [21 x i8] c"GAVLIMPWFYSCTNQHDEKR\00"
@.str.21 = [2 x i8] c"\0A\00"
@.str.22 = [21 x i8] c"\09%2d %3s %5d %1c\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [20 x i8*]
%7 = alloca i8*
%8 = alloca [100 x i8]
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = bitcast [20 x i8*]* %6 to i8*
store i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.20, i64 0, i64 0), i8** %7
store i32 0, i32* %9
br label %12
12: ; preds = %29, %2
%13 = load i32, i32* %9
%14 = icmp slt i32 %13, 20
br i1 %14, label %15, label %32
15: ; preds = %12
%16 = load i32, i32* %9
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [20 x i8*], [20 x i8*]* %6, i64 0, i64 %17
%19 = load i8*, i8** %18
%20 = call i32 @hashfun(i8* %19)
store i32 %20, i32* %10
%21 = load i8*, i8** %7
%22 = load i32, i32* %9
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = load i32, i32* %10
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 %27
store i8 %25, i8* %28
br label %29
29: ; preds = %15
%30 = load i32, i32* %9
%31 = add nsw i32 %30, 1
store i32 %31, i32* %9
br label %12
32: ; preds = %12
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.21, i64 0, i64 0))
store i32 0, i32* %9
br label %34
34: ; preds = %55, %32
%35 = load i32, i32* %9
%36 = icmp slt i32 %35, 20
br i1 %36, label %37, label %58
37: ; preds = %34
%38 = load i32, i32* %9
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [20 x i8*], [20 x i8*]* %6, i64 0, i64 %39
%41 = load i8*, i8** %40
%42 = call i32 @hashfun(i8* %41)
store i32 %42, i32* %10
%43 = load i32, i32* %9
%44 = load i32, i32* %9
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [20 x i8*], [20 x i8*]* %6, i64 0, i64 %45
%47 = load i8*, i8** %46
%48 = load i32, i32* %10
%49 = load i32, i32* %10
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 %50
%52 = load i8, i8* %51
%53 = sext i8 %52 to i32
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.22, i64 0, i64 0), i32 %43, i8* %47, i32 %48, i32 %53)
br label %55
55: ; preds = %37
%56 = load i32, i32* %9
%57 = add nsw i32 %56, 1
store i32 %57, i32* %9
br label %34
58: ; preds = %34
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.21, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"GLY\00"
@.str.1 = [4 x i8] c"ALA\00"
@.str.2 = [4 x i8] c"VAL\00"
@.str.3 = [4 x i8] c"LEU\00"
@.str.4 = [4 x i8] c"ILE\00"
@.str.5 = [4 x i8] c"MET\00"
@.str.6 = [4 x i8] c"PRO\00"
@.str.7 = [4 x i8] c"TRP\00"
@.str.8 = [4 x i8] c"PHE\00"
@.str.9 = [4 x i8] c"TYR\00"
@.str.10 = [4 x i8] c"SER\00"
@.str.11 = [4 x i8] c"CYS\00"
@.str.12 = [4 x i8] c"THR\00"
@.str.13 = [4 x i8] c"ASN\00"
@.str.14 = [4 x i8] c"GLN\00"
@.str.15 = [4 x i8] c"HIS\00"
@.str.16 = [4 x i8] c"ASP\00"
@.str.17 = [4 x i8] c"GLU\00"
@.str.18 = [4 x i8] c"LYS\00"
@.str.19 = [4 x i8] c"ARG\00"
@__const.main.aa = [20 x i8*] [i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 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 ([4 x i8], [4 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 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 ([4 x i8], [4 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i32 0, i32 0)]
@.str.20 = [21 x i8] c"GAVLIMPWFYSCTNQHDEKR\00"
@.str.22 = [21 x i8] c"\09%2d %3s %5d %1c\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
br label %5
5: ; preds = %2, %5
%6 = phi i64 [ 0, %2 ], [ %14, %5 ]
%7 = getelementptr inbounds [20 x i8*], [20 x i8*]* @__const.main.aa, i64 0, i64 %6
%8 = load i8*, i8** %7
%9 = tail call i32 @hashfun(i8* %8)
%10 = getelementptr inbounds [21 x i8], [21 x i8]* @.str.20, i64 0, i64 %6
%11 = load i8, i8* %10
%12 = sext i32 %9 to i64
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %12
store i8 %11, i8* %13
%14 = add nuw nsw i64 %6, 1
%15 = icmp eq i64 %14, 20
br i1 %15, label %16, label %5
16: ; preds = %5
%17 = tail call i32 @putchar(i32 10)
br label %18
18: ; preds = %16, %18
%19 = phi i64 [ 0, %16 ], [ %29, %18 ]
%20 = getelementptr inbounds [20 x i8*], [20 x i8*]* @__const.main.aa, i64 0, i64 %19
%21 = load i8*, i8** %20
%22 = tail call i32 @hashfun(i8* %21)
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %23
%25 = load i8, i8* %24
%26 = sext i8 %25 to i32
%27 = trunc i64 %19 to i32
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.22, i64 0, i64 0), i32 %27, i8* %21, i32 %22, i32 %26)
%29 = add nuw nsw i64 %19, 1
%30 = icmp eq i64 %29, 20
br i1 %30, label %31, label %18
31: ; preds = %18
%32 = tail call i32 @putchar(i32 10)
ret i32 0
}