#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 */
unsigned int DEKHash(unsigned char *, int);
unsigned int DJBHash(unsigned char *, int);
unsigned int FNVHash(unsigned char *, int);
unsigned int JSHash(unsigned char *, int);
unsigned int PJWHash(unsigned char *, int);
unsigned int RSHash(unsigned char *, int);
unsigned int SDBMHash(unsigned char *, int);
int strlen(char *);
void get_hashes(unsigned int hash[], char *in) {
  unsigned char *str = (unsigned char *)in;
  int pos = strlen(in);
  hash[0] = RSHash(str, pos);
  hash[1] = DJBHash(str, pos);
  hash[2] = FNVHash(str, pos);
  hash[3] = JSHash(str, pos);
  hash[4] = PJWHash(str, pos);
  hash[5] = SDBMHash(str, pos);
  hash[6] = DEKHash(str, pos);
}


x86 assembly (clang, -O0):
<get_hashes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1090 <RSHash@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1080 <DJBHash@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <FNVHash@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1070 <JSHash@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1060 <PJWHash@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   10a0 <SDBMHash@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <DEKHash@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x18(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hashes>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
mov    %eax,%esi
call   1090 <RSHash@plt>
mov    %eax,(%r14)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1080 <DJBHash@plt>
mov    %eax,0x4(%r14)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <FNVHash@plt>
mov    %eax,0x8(%r14)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1070 <JSHash@plt>
mov    %eax,0xc(%r14)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1060 <PJWHash@plt>
mov    %eax,0x10(%r14)
mov    %rbx,%rdi
mov    %ebp,%esi
call   10a0 <SDBMHash@plt>
mov    %eax,0x14(%r14)
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <DEKHash@plt>
mov    %eax,0x18(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @get_hashes(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %4
store i8* %7, i8** %5
%8 = load i8*, i8** %4
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %6
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @RSHash(i8* %10, i32 %11)
%13 = load i32*, i32** %3
%14 = getelementptr inbounds i32, i32* %13, i64 0
store i32 %12, i32* %14
%15 = load i8*, i8** %5
%16 = load i32, i32* %6
%17 = call i32 @DJBHash(i8* %15, i32 %16)
%18 = load i32*, i32** %3
%19 = getelementptr inbounds i32, i32* %18, i64 1
store i32 %17, i32* %19
%20 = load i8*, i8** %5
%21 = load i32, i32* %6
%22 = call i32 @FNVHash(i8* %20, i32 %21)
%23 = load i32*, i32** %3
%24 = getelementptr inbounds i32, i32* %23, i64 2
store i32 %22, i32* %24
%25 = load i8*, i8** %5
%26 = load i32, i32* %6
%27 = call i32 @JSHash(i8* %25, i32 %26)
%28 = load i32*, i32** %3
%29 = getelementptr inbounds i32, i32* %28, i64 3
store i32 %27, i32* %29
%30 = load i8*, i8** %5
%31 = load i32, i32* %6
%32 = call i32 @PJWHash(i8* %30, i32 %31)
%33 = load i32*, i32** %3
%34 = getelementptr inbounds i32, i32* %33, i64 4
store i32 %32, i32* %34
%35 = load i8*, i8** %5
%36 = load i32, i32* %6
%37 = call i32 @SDBMHash(i8* %35, i32 %36)
%38 = load i32*, i32** %3
%39 = getelementptr inbounds i32, i32* %38, i64 5
store i32 %37, i32* %39
%40 = load i8*, i8** %5
%41 = load i32, i32* %6
%42 = call i32 @DEKHash(i8* %40, i32 %41)
%43 = load i32*, i32** %3
%44 = getelementptr inbounds i32, i32* %43, i64 6
store i32 %42, i32* %44
ret void
}

LLVM IR (-O2):
define void @get_hashes(i32* nocapture writeonly %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @RSHash(i8* %1, i32 %3)
store i32 %4, i32* %0
%5 = tail call i32 @DJBHash(i8* %1, i32 %3)
%6 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %5, i32* %6
%7 = tail call i32 @FNVHash(i8* %1, i32 %3)
%8 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %7, i32* %8
%9 = tail call i32 @JSHash(i8* %1, i32 %3)
%10 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %9, i32* %10
%11 = tail call i32 @PJWHash(i8* %1, i32 %3)
%12 = getelementptr inbounds i32, i32* %0, i64 4
store i32 %11, i32* %12
%13 = tail call i32 @SDBMHash(i8* %1, i32 %3)
%14 = getelementptr inbounds i32, i32* %0, i64 5
store i32 %13, i32* %14
%15 = tail call i32 @DEKHash(i8* %1, i32 %3)
%16 = getelementptr inbounds i32, i32* %0, i64 6
store i32 %15, i32* %16
ret void
}