#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 h(int, int);
int /*<<< orphan*/ printf(char *, ...);
void MoveToHashTable(char hashTable[][5], char word[5], int key, int i) {
  int j;
  int hashIndex = h(key, i);
  if (1)
    printf("key: %d i: %d hashIndex: %d\n", key, i, hashIndex);
  if (hashTable[hashIndex][0] == 0) {
    if (1)
      printf("%d adresi bos, kelime yerlestiriliyor: %s\n", hashIndex, word);
    for (j = 0; j < 5 - 1; j++) {
      hashTable[hashIndex][j] = word[j];
    }
    hashTable[hashIndex][5 - 1] = '\0';
  } else {
    if (1)
      printf("%d adresi dolu, su kelime var: %s\n", hashIndex,
             hashTable[hashIndex]);
    if (1)
      printf("Yeni hashIndex uretiliyor\n");
    MoveToHashTable(hashTable, word, key, i + 1);
  }
}


x86 assembly (clang, -O0):
<MoveToHashTable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1030 <h@plt>
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x20(%rbp),%ecx
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x5,%rcx,%rcx
add    %rcx,%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    11f3 <MoveToHashTable+0xc3>
mov    -0x20(%rbp),%esi
mov    -0x10(%rbp),%rdx
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x4,-0x1c(%rbp)
jge    11db <MoveToHashTable+0xab>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x5,%rcx,%rcx
add    %rcx,%rax
movslq -0x1c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11a2 <MoveToHashTable+0x72>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
imul   $0x5,%rcx,%rcx
add    %rcx,%rax
movb   $0x0,0x4(%rax)
jmp    1237 <MoveToHashTable+0x107>
mov    -0x20(%rbp),%esi
mov    -0x8(%rbp),%rdx
movslq -0x20(%rbp),%rax
imul   $0x5,%rax,%rax
add    %rax,%rdx
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
call   1050 <MoveToHashTable@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MoveToHashTable>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%ebp
mov    %edx,%r12d
mov    %rsi,(%rsp)
mov    %rdi,%r15
mov    %edx,%edi
mov    %ecx,%esi
call   1040 <h@plt>
mov    %eax,%ebx
lea    0xea7(%rip),%rdi
mov    %r12d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
movslq %ebx,%r14
lea    (%r14,%r14,4),%rdx
cmpb   $0x0,(%r15,%rdx,1)
je     11de <MoveToHashTable+0xae>
add    %r15,%rdx
add    $0x1,%ebp
lea    0xe7e(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xeb1(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
mov    %r12d,%edi
mov    %ebp,%esi
call   1040 <h@plt>
mov    %eax,%ebx
mov    %r13,%rdi
mov    %r12d,%esi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
movslq %ebx,%r14
lea    (%r14,%r14,4),%rax
lea    (%r15,%rax,1),%rdx
add    $0x1,%ebp
cmpb   $0x0,(%r15,%rax,1)
jne    1190 <MoveToHashTable+0x60>
lea    0xe38(%rip),%rdi
mov    %ebx,%esi
mov    (%rsp),%rbx
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rbx),%al
lea    (%r14,%r14,4),%rcx
mov    %al,(%r15,%rcx,1)
mov    0x1(%rbx),%al
mov    %al,0x1(%r15,%rcx,1)
mov    0x2(%rbx),%al
mov    %al,0x2(%r15,%rcx,1)
mov    0x3(%rbx),%al
mov    %al,0x3(%r15,%rcx,1)
movb   $0x0,0x4(%r15,%rcx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"key: %d i: %d hashIndex: %d\0A\00"
@.str.1 = [43 x i8] c"%d adresi bos, kelime yerlestiriliyor: %s\0A\00"
@.str.2 = [35 x i8] c"%d adresi dolu, su kelime var: %s\0A\00"
@.str.3 = [27 x i8] c"Yeni hashIndex uretiliyor\0A\00"
define void @MoveToHashTable([5 x i8]* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca [5 x i8]*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store [5 x i8]* %0, [5 x i8]** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @h(i32 %11, i32 %12)
store i32 %13, i32* %10
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = load i32, i32* %10
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %14, i32 %15, i32 %16)
%18 = load [5 x i8]*, [5 x i8]** %5
%19 = load i32, i32* %10
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [5 x i8], [5 x i8]* %18, i64 %20
%22 = getelementptr inbounds [5 x i8], [5 x i8]* %21, i64 0, i64 0
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %55
26: ; preds = %4
%27 = load i32, i32* %10
%28 = load i8*, i8** %6
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %27, i8* %28)
store i32 0, i32* %9
br label %30
30: ; preds = %46, %26
%31 = load i32, i32* %9
%32 = icmp slt i32 %31, 4
br i1 %32, label %33, label %49
33: ; preds = %30
%34 = load i8*, i8** %6
%35 = load i32, i32* %9
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8, i8* %34, i64 %36
%38 = load i8, i8* %37
%39 = load [5 x i8]*, [5 x i8]** %5
%40 = load i32, i32* %10
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [5 x i8], [5 x i8]* %39, i64 %41
%43 = load i32, i32* %9
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds [5 x i8], [5 x i8]* %42, i64 0, i64 %44
store i8 %38, i8* %45
br label %46
46: ; preds = %33
%47 = load i32, i32* %9
%48 = add nsw i32 %47, 1
store i32 %48, i32* %9
br label %30
49: ; preds = %30
%50 = load [5 x i8]*, [5 x i8]** %5
%51 = load i32, i32* %10
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [5 x i8], [5 x i8]* %50, i64 %52
%54 = getelementptr inbounds [5 x i8], [5 x i8]* %53, i64 0, i64 4
store i8 0, i8* %54
br label %69
55: ; preds = %4
%56 = load i32, i32* %10
%57 = load [5 x i8]*, [5 x i8]** %5
%58 = load i32, i32* %10
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [5 x i8], [5 x i8]* %57, i64 %59
%61 = getelementptr inbounds [5 x i8], [5 x i8]* %60, i64 0, i64 0
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %56, i8* %61)
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0))
%64 = load [5 x i8]*, [5 x i8]** %5
%65 = load i8*, i8** %6
%66 = load i32, i32* %7
%67 = load i32, i32* %8
%68 = add nsw i32 %67, 1
br label %69
69: ; preds = %55, %49
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"key: %d i: %d hashIndex: %d\0A\00"
@.str.1 = [43 x i8] c"%d adresi bos, kelime yerlestiriliyor: %s\0A\00"
@.str.2 = [35 x i8] c"%d adresi dolu, su kelime var: %s\0A\00"
@str = [26 x i8] c"Yeni hashIndex uretiliyor\00"
define void @MoveToHashTable([5 x i8]* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @h(i32 %2, i32 %3)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %3, i32 %5)
%7 = sext i32 %5 to i64
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %0, i64 %7, i64 0
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %27
11: ; preds = %27, %4
%12 = phi i32 [ %5, %4 ], [ %34, %27 ]
%13 = phi i64 [ %7, %4 ], [ %36, %27 ]
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i32 %12, i8* %1)
%15 = load i8, i8* %1
%16 = getelementptr inbounds [5 x i8], [5 x i8]* %0, i64 %13, i64 0
store i8 %15, i8* %16
%17 = getelementptr inbounds i8, i8* %1, i64 1
%18 = load i8, i8* %17
%19 = getelementptr inbounds [5 x i8], [5 x i8]* %0, i64 %13, i64 1
store i8 %18, i8* %19
%20 = getelementptr inbounds i8, i8* %1, i64 2
%21 = load i8, i8* %20
%22 = getelementptr inbounds [5 x i8], [5 x i8]* %0, i64 %13, i64 2
store i8 %21, i8* %22
%23 = getelementptr inbounds i8, i8* %1, i64 3
%24 = load i8, i8* %23
%25 = getelementptr inbounds [5 x i8], [5 x i8]* %0, i64 %13, i64 3
store i8 %24, i8* %25
%26 = getelementptr inbounds [5 x i8], [5 x i8]* %0, i64 %13, i64 4
store i8 0, i8* %26
ret void
27: ; preds = %4, %27
%28 = phi i8* [ %37, %27 ], [ %8, %4 ]
%29 = phi i32 [ %34, %27 ], [ %5, %4 ]
%30 = phi i32 [ %33, %27 ], [ %3, %4 ]
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i32 %29, i8* %28)
%32 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%33 = add nsw i32 %30, 1
%34 = tail call i32 @h(i32 %2, i32 %33)
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %33, i32 %34)
%36 = sext i32 %34 to i64
%37 = getelementptr inbounds [5 x i8], [5 x i8]* %0, i64 %36, i64 0
%38 = load i8, i8* %37
%39 = icmp eq i8 %38, 0
br i1 %39, label %11, label %27
}