#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 atoi(char *);
int ft_atoi(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char *test_str[11];
  int t;
  int nbr_atoi;
  int nbr_ft_atoi;
  test_str[0] = "2362";
  test_str[1] = "000";
  test_str[2] = "0";
  test_str[3] = "-00";
  test_str[4] = "678nsaf9n8";
  test_str[5] = "fsd23";
  test_str[6] = "-f32";
  test_str[7] = "7957";
  test_str[8] = "";
  test_str[9] = "-";
  test_str[10] = "-3467";
  t = 0;
  while (t < 11) {
    nbr_atoi = atoi(test_str[t]);
    nbr_ft_atoi = ft_atoi(test_str[t]);
    printf("string: %s, atoi: %i, ft_atoi: %i\n", test_str[t], nbr_atoi,
           nbr_ft_atoi);
    if (nbr_atoi != nbr_ft_atoi) {
      printf("FAKE AND GAY\n");
      return (0);
    }
    ++t;
  }
  printf("CORRECT\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x60(%rbp)
lea    0xeb4(%rip),%rax
mov    %rax,-0x58(%rbp)
lea    0xeaf(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xea2(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xe9b(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xe9b(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe96(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    0xe90(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xecb(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xe7f(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe76(%rip),%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x64(%rbp)
cmpl   $0xb,-0x64(%rbp)
jge    123c <main+0x10c>
movslq -0x64(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x68(%rbp)
movslq -0x64(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rdi
call   1050 <ft_atoi@plt>
mov    %eax,-0x6c(%rbp)
movslq -0x64(%rbp),%rax
mov    -0x60(%rbp,%rax,8),%rsi
mov    -0x68(%rbp),%edx
mov    -0x6c(%rbp),%ecx
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x68(%rbp),%eax
cmp    -0x6c(%rbp),%eax
je     122e <main+0xfe>
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1251 <main+0x121>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    11bf <main+0x8f>
lea    0xe1e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
lea    0xeb5(%rip),%rbx
mov    %rbx,%rdi
call   1060 <ft_atoi@plt>
mov    %eax,%ebp
lea    0xed4(%rip),%rdi
mov    %rbx,%rsi
mov    $0x93a,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x93a,%ebp
jne    1378 <main+0x238>
lea    0xe85(%rip),%rbx
mov    %rbx,%rdi
call   1060 <ft_atoi@plt>
mov    %eax,%ebp
lea    0xe9f(%rip),%rdi
mov    %rbx,%rsi
xor    %edx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebp,%ebp
jne    1378 <main+0x238>
lea    0xe5d(%rip),%rbx
mov    %rbx,%rdi
call   1060 <ft_atoi@plt>
mov    %eax,%ebp
lea    0xe71(%rip),%rdi
mov    %rbx,%rsi
xor    %edx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebp,%ebp
jne    1378 <main+0x238>
lea    0xe2d(%rip),%rbx
mov    %rbx,%rdi
call   1060 <ft_atoi@plt>
mov    %eax,%ebp
lea    0xe43(%rip),%rdi
mov    %rbx,%rsi
xor    %edx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebp,%ebp
jne    1378 <main+0x238>
lea    0xe03(%rip),%r14
mov    %r14,%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1060 <ft_atoi@plt>
mov    %eax,%ebx
lea    0xe0b(%rip),%rdi
mov    %r14,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %ebx,%ebp
jne    1378 <main+0x238>
lea    0xdd6(%rip),%r14
mov    %r14,%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1060 <ft_atoi@plt>
mov    %eax,%ebx
lea    0xdd3(%rip),%rdi
mov    %r14,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %ebx,%ebp
jne    1378 <main+0x238>
lea    0xda4(%rip),%r14
mov    %r14,%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1060 <ft_atoi@plt>
mov    %eax,%ebx
lea    0xd9b(%rip),%rdi
mov    %r14,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %ebx,%ebp
jne    1378 <main+0x238>
lea    0xd71(%rip),%rbx
mov    %rbx,%rdi
call   1060 <ft_atoi@plt>
mov    %eax,%ebp
lea    0xd6d(%rip),%rdi
mov    %rbx,%rsi
mov    $0x1f15,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1f15,%ebp
jne    1378 <main+0x238>
lea    0xd6b(%rip),%rbx
mov    %rbx,%rdi
call   1060 <ft_atoi@plt>
mov    %eax,%ebp
lea    0xd38(%rip),%rdi
mov    %rbx,%rsi
xor    %edx,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebp,%ebp
jne    1378 <main+0x238>
lea    0xd17(%rip),%r14
mov    %r14,%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1060 <ft_atoi@plt>
mov    %eax,%ebx
lea    0xd04(%rip),%rdi
mov    %r14,%rsi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    %ebx,%ebp
jne    1378 <main+0x238>
lea    0xce5(%rip),%rbx
mov    %rbx,%rdi
call   1060 <ft_atoi@plt>
mov    %eax,%ebp
lea    0xcda(%rip),%rdi
mov    %rbx,%rsi
mov    $0xfffff275,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0xfffff275,%ebp
jne    1378 <main+0x238>
lea    0xcdd(%rip),%rdi
jmp    137f <main+0x23f>
lea    0xcdc(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"2362\00"
@.str.1 = [4 x i8] c"000\00"
@.str.2 = [2 x i8] c"0\00"
@.str.3 = [4 x i8] c"-00\00"
@.str.4 = [11 x i8] c"678nsaf9n8\00"
@.str.5 = [6 x i8] c"fsd23\00"
@.str.6 = [5 x i8] c"-f32\00"
@.str.7 = [5 x i8] c"7957\00"
@.str.8 = [1 x i8] zeroinitializer
@.str.9 = [2 x i8] c"-\00"
@.str.10 = [6 x i8] c"-3467\00"
@.str.11 = [35 x i8] c"string: %s, atoi: %i, ft_atoi: %i\0A\00"
@.str.12 = [14 x i8] c"FAKE AND GAY\0A\00"
@.str.13 = [9 x i8] c"CORRECT\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [11 x i8*]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds [11 x i8*], [11 x i8*]* %2, i64 0, i64 0
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8** %6
%7 = getelementptr inbounds [11 x i8*], [11 x i8*]* %2, i64 0, i64 1
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %7
%8 = getelementptr inbounds [11 x i8*], [11 x i8*]* %2, i64 0, i64 2
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds [11 x i8*], [11 x i8*]* %2, i64 0, i64 3
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %9
%10 = getelementptr inbounds [11 x i8*], [11 x i8*]* %2, i64 0, i64 4
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [11 x i8*], [11 x i8*]* %2, i64 0, i64 5
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8** %11
%12 = getelementptr inbounds [11 x i8*], [11 x i8*]* %2, i64 0, i64 6
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8** %12
%13 = getelementptr inbounds [11 x i8*], [11 x i8*]* %2, i64 0, i64 7
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8** %13
%14 = getelementptr inbounds [11 x i8*], [11 x i8*]* %2, i64 0, i64 8
store i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0), i8** %14
%15 = getelementptr inbounds [11 x i8*], [11 x i8*]* %2, i64 0, i64 9
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i8** %15
%16 = getelementptr inbounds [11 x i8*], [11 x i8*]* %2, i64 0, i64 10
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i8** %16
store i32 0, i32* %3
br label %17
17: ; preds = %43, %0
%18 = load i32, i32* %3
%19 = icmp slt i32 %18, 11
br i1 %19, label %20, label %46
20: ; preds = %17
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [11 x i8*], [11 x i8*]* %2, i64 0, i64 %22
%24 = load i8*, i8** %23
%25 = call i32 @atoi(i8* %24)
store i32 %25, i32* %4
%26 = load i32, i32* %3
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [11 x i8*], [11 x i8*]* %2, i64 0, i64 %27
%29 = load i8*, i8** %28
%30 = call i32 @ft_atoi(i8* %29)
store i32 %30, i32* %5
%31 = load i32, i32* %3
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [11 x i8*], [11 x i8*]* %2, i64 0, i64 %32
%34 = load i8*, i8** %33
%35 = load i32, i32* %4
%36 = load i32, i32* %5
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i8* %34, i32 %35, i32 %36)
%38 = load i32, i32* %4
%39 = load i32, i32* %5
%40 = icmp ne i32 %38, %39
br i1 %40, label %41, label %43
41: ; preds = %20
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.12, i64 0, i64 0))
store i32 0, i32* %1
br label %48
43: ; preds = %20
%44 = load i32, i32* %3
%45 = add nsw i32 %44, 1
store i32 %45, i32* %3
br label %17
46: ; preds = %17
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0))
store i32 0, i32* %1
br label %48
48: ; preds = %46, %41
%49 = load i32, i32* %1
ret i32 %49
}

LLVM IR (-O2):
@.str = [5 x i8] c"2362\00"
@.str.1 = [4 x i8] c"000\00"
@.str.2 = [2 x i8] c"0\00"
@.str.3 = [4 x i8] c"-00\00"
@.str.4 = [11 x i8] c"678nsaf9n8\00"
@.str.5 = [6 x i8] c"fsd23\00"
@.str.6 = [5 x i8] c"-f32\00"
@.str.7 = [5 x i8] c"7957\00"
@.str.8 = [1 x i8] zeroinitializer
@.str.9 = [2 x i8] c"-\00"
@.str.10 = [6 x i8] c"-3467\00"
@.str.11 = [35 x i8] c"string: %s, atoi: %i, ft_atoi: %i\0A\00"
@str = [8 x i8] c"CORRECT\00"
@str.14 = [13 x i8] c"FAKE AND GAY\00"
define i32 @main() {
%1 = tail call i32 @ft_atoi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 2362, i32 %1)
%3 = icmp eq i32 %1, 2362
br i1 %3, label %4, label %48
4: ; preds = %0
%5 = tail call i32 @ft_atoi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 %5)
%7 = icmp eq i32 %5, 0
br i1 %7, label %8, label %48
8: ; preds = %4
%9 = tail call i32 @ft_atoi(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 0, i32 %9)
%11 = icmp eq i32 %9, 0
br i1 %11, label %12, label %48
12: ; preds = %8
%13 = tail call i32 @ft_atoi(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 0, i32 %13)
%15 = icmp eq i32 %13, 0
br i1 %15, label %16, label %48
16: ; preds = %12
%17 = tail call i32 @atoi(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%18 = tail call i32 @ft_atoi(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %17, i32 %18)
%20 = icmp eq i32 %17, %18
br i1 %20, label %21, label %48
21: ; preds = %16
%22 = tail call i32 @atoi(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%23 = tail call i32 @ft_atoi(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i32 %22, i32 %23)
%25 = icmp eq i32 %22, %23
br i1 %25, label %26, label %48
26: ; preds = %21
%27 = tail call i32 @atoi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%28 = tail call i32 @ft_atoi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i32 %27, i32 %28)
%30 = icmp eq i32 %27, %28
br i1 %30, label %31, label %48
31: ; preds = %26
%32 = tail call i32 @ft_atoi(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 7957, i32 %32)
%34 = icmp eq i32 %32, 7957
br i1 %34, label %35, label %48
35: ; preds = %31
%36 = tail call i32 @ft_atoi(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0))
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0), i32 0, i32 %36)
%38 = icmp eq i32 %36, 0
br i1 %38, label %39, label %48
39: ; preds = %35
%40 = tail call i32 @atoi(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%41 = tail call i32 @ft_atoi(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0), i32 %40, i32 %41)
%43 = icmp eq i32 %40, %41
br i1 %43, label %44, label %48
44: ; preds = %39
%45 = tail call i32 @ft_atoi(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i32 -3467, i32 %45)
%47 = icmp eq i32 %45, -3467
br i1 %47, label %49, label %48
48: ; preds = %44, %39, %35, %31, %26, %21, %16, %12, %8, %4, %0
br label %49
49: ; preds = %44, %48
%50 = phi i8* [ getelementptr inbounds ([13 x i8], [13 x i8]* @str.14, i64 0, i64 0), %48 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0), %44 ]
%51 = tail call i32 @puts(i8* dereferenceable(1) %50)
ret i32 0
}