#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*/ comparing(long *, int);
long hashing(char *);
int /*<<< orphan*/ scanf(char *, char *);
scalar_t__ strcmp(char *, char *);
int main() {
  char str[200];
  int i = 0;
  long hashes[3000] = {0};
  for (i = 0; i < 3000 && strcmp(str, "vsmisal") != 0; i++) {
    scanf("%s", str);
    hashes[i] = hashing(str);
  }
  comparing(hashes, i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x5eb0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xd4(%rbp)
lea    -0x5ea0(%rbp),%rdi
xor    %esi,%esi
mov    $0x5dc0,%edx
call   1030 <memset@plt>
movl   $0x0,-0xd4(%rbp)
xor    %eax,%eax
cmpl   $0xbb8,-0xd4(%rbp)
mov    %al,-0x5ea1(%rbp)
jge    11c1 <main+0x71>
lea    -0xd0(%rbp),%rdi
lea    0xe51(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5ea1(%rbp)
mov    -0x5ea1(%rbp),%al
test   $0x1,%al
jne    11d4 <main+0x84>
jmp    1219 <main+0xc9>
lea    -0xd0(%rbp),%rsi
lea    0xe26(%rip),%rdi
call   1070 <scanf@plt>
lea    -0xd0(%rbp),%rdi
call   1060 <hashing@plt>
mov    %rax,%rcx
movslq -0xd4(%rbp),%rax
mov    %rcx,-0x5ea0(%rbp,%rax,8)
ff
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    1189 <main+0x39>
lea    -0x5ea0(%rbp),%rdi
mov    -0xd4(%rbp),%esi
call   1050 <comparing@plt>
xor    %eax,%eax
add    $0x5eb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x5e98,%rsp
lea    0xd0(%rsp),%rdi
xor    %ebx,%ebx
mov    $0x5dc0,%edx
xor    %esi,%esi
call   1030 <memset@plt>
lea    0xe85(%rip),%r14
mov    %rsp,%r15
lea    0xe83(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11cd <main+0x7d>
mov    %r12,%rdi
mov    %r15,%rsi
call   1070 <scanf@plt>
mov    %r15,%rdi
call   1060 <hashing@plt>
mov    %rax,0xd0(%rsp,%rbx,8)
add    $0x1,%rbx
cmp    $0xbb8,%rbx
jne    1190 <main+0x40>
mov    $0xbb8,%ebx
lea    0xd0(%rsp),%rdi
mov    %ebx,%esi
call   1050 <comparing@plt>
xor    %eax,%eax
add    $0x5e98,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"vsmisal\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
%3 = alloca i32
%4 = alloca [3000 x i64]
store i32 0, i32* %1
store i32 0, i32* %3
%5 = bitcast [3000 x i64]* %4 to i8*
store i32 0, i32* %3
br label %6
6: ; preds = %23, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 3000
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%11 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%12 = icmp ne i64 %11, 0
br label %13
13: ; preds = %9, %6
%14 = phi i1 [ false, %6 ], [ %12, %9 ]
br i1 %14, label %15, label %26
15: ; preds = %13
%16 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%19 = call i64 @hashing(i8* %18)
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [3000 x i64], [3000 x i64]* %4, i64 0, i64 %21
store i64 %19, i64* %22
br label %23
23: ; preds = %15
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %6
26: ; preds = %13
%27 = getelementptr inbounds [3000 x i64], [3000 x i64]* %4, i64 0, i64 0
%28 = load i32, i32* %3
%29 = call i32 @comparing(i64* %27, i32 %28)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"vsmisal\00"
@.str.1 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = alloca [3000 x i64]
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%4 = bitcast [3000 x i64]* %2 to i8*
br label %5
5: ; preds = %0, %9
%6 = phi i64 [ 0, %0 ], [ %13, %9 ]
%7 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %5
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%11 = call i64 @hashing(i8* %3)
%12 = getelementptr inbounds [3000 x i64], [3000 x i64]* %2, i64 0, i64 %6
store i64 %11, i64* %12
%13 = add nuw nsw i64 %6, 1
%14 = icmp eq i64 %13, 3000
br i1 %14, label %17, label %5
15: ; preds = %5
%16 = trunc i64 %6 to i32
br label %17
17: ; preds = %9, %15
%18 = phi i32 [ %16, %15 ], [ 3000, %9 ]
%19 = getelementptr inbounds [3000 x i64], [3000 x i64]* %2, i64 0, i64 0
%20 = call i32 @comparing(i64* %19, i32 %18)
ret i32 0
}