#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 hashFunction_1(char *);
int hashFunction_2(char *);
int hashFunction_3(char *);
int rand();
int /*<<< orphan*/ srand(int);
int hashFunction_4(char a[20]) {
  srand(hashFunction_3(a));
  int wat = rand() % 7919;
  int magicNr = hashFunction_3("GoOd ") - hashFunction_2("mOrNiNg ") +
                hashFunction_1("vIeTnAm!!!!!!");
  return wat % rand() + hashFunction_3(a) - hashFunction_2(a) +
         hashFunction_1(a) + magicNr;
}


x86 assembly (clang, -O0):
<hashFunction_4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <hashFunction_3@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x1eef,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
lea    0xe7b(%rip),%rdi
call   1030 <hashFunction_3@plt>
mov    %eax,-0x28(%rbp)
lea    0xe72(%rip),%rdi
call   1060 <hashFunction_2@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x24(%rbp)
lea    0xe65(%rip),%rdi
call   1040 <hashFunction_1@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    $0x0,%al
call   1070 <rand@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
cltd
idiv   %ecx
mov    %edx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <hashFunction_3@plt>
mov    -0x1c(%rbp),%edx
add    %eax,%edx
mov    %edx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <hashFunction_2@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <hashFunction_1@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
add    -0x10(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashFunction_4>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <hashFunction_3@plt>
mov    %eax,%edi
call   1050 <srand@plt>
xor    %eax,%eax
call   1070 <rand@plt>
movslq %eax,%rbx
imul   $0xffffffff8469a54b,%rbx,%rax
shr    $0x20,%rax
add    %ebx,%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
sar    $0xc,%eax
add    %ecx,%eax
imul   $0x1eef,%eax,%eax
sub    %eax,%ebx
lea    0xe66(%rip),%rdi
call   1030 <hashFunction_3@plt>
mov    %eax,%ebp
lea    0xe5e(%rip),%rdi
call   1060 <hashFunction_2@plt>
mov    %eax,0x4(%rsp)
lea    0xe57(%rip),%rdi
call   1040 <hashFunction_1@plt>
mov    %eax,%r12d
xor    %eax,%eax
call   1070 <rand@plt>
mov    %eax,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %edx,%r13d
mov    %r14,%rdi
call   1030 <hashFunction_3@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1060 <hashFunction_2@plt>
mov    %eax,%r15d
mov    %r14,%rdi
call   1040 <hashFunction_1@plt>
sub    0x4(%rsp),%ebp
add    %r12d,%ebp
add    %r13d,%ebp
add    %ebx,%ebp
sub    %r15d,%ebp
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"GoOd \00"
@.str.1 = [9 x i8] c"mOrNiNg \00"
@.str.2 = [14 x i8] c"vIeTnAm!!!!!!\00"
define i32 @hashFunction_4(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @hashFunction_3(i8* %5)
%7 = call i32 @srand(i32 %6)
%8 = call i32 (...) @rand()
%9 = srem i32 %8, 7919
store i32 %9, i32* %3
%10 = call i32 @hashFunction_3(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @hashFunction_2(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%12 = sub nsw i32 %10, %11
%13 = call i32 @hashFunction_1(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%14 = add nsw i32 %12, %13
store i32 %14, i32* %4
%15 = load i32, i32* %3
%16 = call i32 (...) @rand()
%17 = srem i32 %15, %16
%18 = load i8*, i8** %2
%19 = call i32 @hashFunction_3(i8* %18)
%20 = add nsw i32 %17, %19
%21 = load i8*, i8** %2
%22 = call i32 @hashFunction_2(i8* %21)
%23 = sub nsw i32 %20, %22
%24 = load i8*, i8** %2
%25 = call i32 @hashFunction_1(i8* %24)
%26 = add nsw i32 %23, %25
%27 = load i32, i32* %4
%28 = add nsw i32 %26, %27
ret i32 %28
}

LLVM IR (-O2):
@.str = [6 x i8] c"GoOd \00"
@.str.1 = [9 x i8] c"mOrNiNg \00"
@.str.2 = [14 x i8] c"vIeTnAm!!!!!!\00"
define i32 @hashFunction_4(i8* %0) {
%2 = tail call i32 @hashFunction_3(i8* %0)
%3 = tail call i32 @srand(i32 %2)
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 7919
%6 = tail call i32 @hashFunction_3(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @hashFunction_2(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%8 = tail call i32 @hashFunction_1(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 (...) @rand()
%10 = srem i32 %5, %9
%11 = tail call i32 @hashFunction_3(i8* %0)
%12 = tail call i32 @hashFunction_2(i8* %0)
%13 = tail call i32 @hashFunction_1(i8* %0)
%14 = sub i32 %6, %7
%15 = add i32 %14, %8
%16 = add i32 %15, %10
%17 = add i32 %16, %11
%18 = sub i32 %17, %12
%19 = add i32 %18, %13
ret i32 %19
}