#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 hash(char *);
int /*<<< orphan*/ printf(char *, char *, int);
int main(int argc, char const *argv[]) {
  char s1[100] = "Tell me about it";
  printf("%s, %i\n", s1, hash(s1));
  char s2[100] = "a";
  printf("%s, %i\n", s2, hash(s2));
  char s3[100] = "";
  printf("%s, %i\n", s3, hash(s3));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x180,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
lea    0xe9c(%rip),%rsi
mov    $0x64,%edx
call   1060 <memcpy@plt>
lea    -0x80(%rbp),%rax
mov    %rax,-0x178(%rbp)
lea    -0x80(%rbp),%rdi
call   1030 <hash@plt>
mov    -0x178(%rbp),%rsi
mov    %eax,%edx
lea    0xed2(%rip),%rdi
call   1040 <printf@plt>
lea    -0xf0(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
movb   $0x61,-0xf0(%rbp)
lea    -0xf0(%rbp),%rax
mov    %rax,-0x170(%rbp)
lea    -0xf0(%rbp),%rdi
call   1030 <hash@plt>
mov    -0x170(%rbp),%rsi
mov    %eax,%edx
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
lea    -0x160(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
lea    -0x160(%rbp),%rax
mov    %rax,-0x168(%rbp)
lea    -0x160(%rbp),%rdi
call   1030 <hash@plt>
mov    -0x168(%rbp),%rsi
mov    %eax,%edx
lea    0xe47(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x180,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x148,%rsp
movaps 0xf1f(%rip),%xmm0
movaps %xmm0,0x130(%rsp)
movaps 0xf00(%rip),%xmm0
movaps %xmm0,0x120(%rsp)
movaps 0xee1(%rip),%xmm0
movaps %xmm0,0x110(%rsp)
movaps 0xec2(%rip),%xmm0
movaps %xmm0,0x100(%rsp)
movaps 0xea3(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
movaps 0xe84(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movl   $0x0,0x140(%rsp)
lea    0xe0(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <hash@plt>
lea    0xebe(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x60(%rsp)
movb   $0x61,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <hash@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0xc0(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movl   $0x0,0xd0(%rsp)
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <hash@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x148,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.s1 = [100 x i8] c"Tell me about it\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [8 x i8] c"%s, %i\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [100 x i8]
%7 = alloca [100 x i8]
%8 = alloca [100 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [100 x i8]* %6 to i8*
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%12 = call i32 @hash(i8* %11)
%13 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %10, i32 %12)
%14 = bitcast [100 x i8]* %7 to i8*
%15 = bitcast i8* %14 to [100 x i8]*
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %15, i32 0, i32 0
store i8 97, i8* %16
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%19 = call i32 @hash(i8* %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %17, i32 %19)
%21 = bitcast [100 x i8]* %8 to i8*
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %8, i64 0, i64 0
%24 = call i32 @hash(i8* %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %22, i32 %24)
ret i32 0
}

LLVM IR (-O2):
@__const.main.s1 = [100 x i8] c"Tell me about it\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [8 x i8] c"%s, %i\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [100 x i8]
%4 = alloca [100 x i8]
%5 = alloca [100 x i8]
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%7 = call i32 @hash(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6, i32 %7)
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
store i8 97, i8* %9
%10 = call i32 @hash(i8* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %10)
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%13 = call i32 @hash(i8* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %12, i32 %13)
ret i32 0
}