#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*/ djbhash(unsigned char *);
int /*<<< orphan*/ fnv1hash(unsigned char *);
int /*<<< orphan*/ krhash(unsigned char *);
int /*<<< orphan*/ newhash32(unsigned char *);
int /*<<< orphan*/ pearson64(unsigned char *);
int /*<<< orphan*/ pjwhash(unsigned char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/);
int /*<<< orphan*/ sdbmhash(unsigned char *);
void strhash(void) {
  unsigned char str[] = "hello world!\n";
  printf("%lx %lx %lx %lx %lx %lx %lx\n", pjwhash(str), sdbmhash(str),
         djbhash(str), krhash(str), fnv1hash(str), pearson64(str),
         newhash32(str));
}


x86 assembly (clang, -O0):
<strhash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0xe71(%rip),%rax
mov    %rax,-0xe(%rbp)
mov    0xe6f(%rip),%eax
mov    %eax,-0x6(%rbp)
mov    0xe69(%rip),%ax
mov    %ax,-0x2(%rbp)
lea    -0xe(%rbp),%rdi
call   1090 <pjwhash@plt>
mov    %eax,-0x28(%rbp)
lea    -0xe(%rbp),%rdi
call   1080 <sdbmhash@plt>
mov    %eax,-0x24(%rbp)
lea    -0xe(%rbp),%rdi
call   10a0 <djbhash@plt>
mov    %eax,-0x20(%rbp)
lea    -0xe(%rbp),%rdi
call   1070 <krhash@plt>
mov    %eax,-0x1c(%rbp)
lea    -0xe(%rbp),%rdi
call   1050 <fnv1hash@plt>
mov    %eax,-0x18(%rbp)
lea    -0xe(%rbp),%rdi
call   1060 <pearson64@plt>
mov    %eax,-0x14(%rbp)
lea    -0xe(%rbp),%rdi
call   1030 <newhash32@plt>
mov    -0x28(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x14(%rbp),%r10d
lea    0xdfa(%rip),%rdi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
call   1040 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strhash>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movabs $0xa21646c726f77,%rax
mov    %rax,0xe(%rsp)
movabs $0x6f77206f6c6c6568,%rax
20 77 6f
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1090 <pjwhash@plt>
mov    %eax,0x4(%rsp)
mov    %rbx,%rdi
call   1080 <sdbmhash@plt>
mov    %eax,%r15d
mov    %rbx,%rdi
call   10a0 <djbhash@plt>
mov    %eax,%r12d
mov    %rbx,%rdi
call   1070 <krhash@plt>
mov    %eax,%r13d
mov    %rbx,%rdi
call   1050 <fnv1hash@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1060 <pearson64@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1030 <newhash32@plt>
lea    0xe0c(%rip),%rdi
mov    0x4(%rsp),%esi
mov    %r15d,%edx
mov    %r12d,%ecx
mov    %r13d,%r8d
mov    %ebp,%r9d
push   %rax
push   %r14
call   1040 <printf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.strhash.str = [14 x i8] c"hello world!\0A\00"
@.str = [29 x i8] c"%lx %lx %lx %lx %lx %lx %lx\0A\00"
define void @strhash() {
%1 = alloca [14 x i8]
%2 = bitcast [14 x i8]* %1 to i8*
%3 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%4 = call i32 @pjwhash(i8* %3)
%5 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%6 = call i32 @sdbmhash(i8* %5)
%7 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%8 = call i32 @djbhash(i8* %7)
%9 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%10 = call i32 @krhash(i8* %9)
%11 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%12 = call i32 @fnv1hash(i8* %11)
%13 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%14 = call i32 @pearson64(i8* %13)
%15 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%16 = call i32 @newhash32(i8* %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6, i32 %8, i32 %10, i32 %12, i32 %14, i32 %16)
ret void
}

LLVM IR (-O2):
@__const.strhash.str = [14 x i8] c"hello world!\0A\00"
@.str = [29 x i8] c"%lx %lx %lx %lx %lx %lx %lx\0A\00"
define void @strhash() {
%1 = alloca [14 x i8]
%2 = getelementptr inbounds [14 x i8], [14 x i8]* %1, i64 0, i64 0
%3 = call i32 @pjwhash(i8* %2)
%4 = call i32 @sdbmhash(i8* %2)
%5 = call i32 @djbhash(i8* %2)
%6 = call i32 @krhash(i8* %2)
%7 = call i32 @fnv1hash(i8* %2)
%8 = call i32 @pearson64(i8* %2)
%9 = call i32 @newhash32(i8* %2)
%10 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9)
ret void
}