#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 */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
double difftime(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ ft_add_test_case(char **, char *);
int /*<<< orphan*/ ft_get_values(char **, char **);
char *ft_strdup(char *);
int printf(char *, ...);
scalar_t__ strcmp(char *, char *);
char *strdup(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  time_t start_t, end_t;
  double diff_t;
  char *data[6];
  char *str;
  char *your_result;
  char *actual_result;
  int i;
  ft_add_test_case(&data[0], "Je Code avec le CUL");
  ft_add_test_case(&data[1], "U MAD BRO");
  ft_add_test_case(&data[2], "");
  ft_add_test_case(&data[3], "iBI^7toBO&*TYUIbb7");
  ft_add_test_case(&data[4], "aaaaaaaa");
  ft_add_test_case(&data[5], "bbbbbbbb");
  i = 0;
  while (i < 6) {
    ft_get_values(&data[i], &str);
    time(&start_t);
    your_result = ft_strdup(str);
    time(&end_t);
    actual_result = strdup(str);
    diff_t = difftime(end_t, start_t);
    printf("str: %s, your_result: %s, actual_result: %s, execution time = %f\n",
           str, your_result, actual_result, diff_t);
    if (strcmp(your_result, actual_result) != 0)
      return printf("\e[0;31mFAKE AND GAY ✗\e[0m\n");
    if (diff_t >= 2.0)
      return printf("\e[0;33mYOU ARE TOO SLOW! ✗\e[0m\n");
    ++i;
  }
  return printf("\e[0;32mGOES ✓\e[0m\n");
  ;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xe6e(%rip),%rsi
call   1080 <ft_add_test_case@plt>
lea    -0x50(%rbp),%rdi
add    $0x8,%rdi
lea    0xe6e(%rip),%rsi
call   1080 <ft_add_test_case@plt>
lea    -0x50(%rbp),%rdi
add    $0x10,%rdi
lea    0xeca(%rip),%rsi
call   1080 <ft_add_test_case@plt>
lea    -0x50(%rbp),%rdi
add    $0x18,%rdi
lea    0xe50(%rip),%rsi
call   1080 <ft_add_test_case@plt>
lea    -0x50(%rbp),%rdi
add    $0x20,%rdi
lea    0xe4f(%rip),%rsi
call   1080 <ft_add_test_case@plt>
lea    -0x50(%rbp),%rdi
add    $0x28,%rdi
lea    0xe44(%rip),%rsi
call   1080 <ft_add_test_case@plt>
movl   $0x0,-0x6c(%rbp)
cmpl   $0x6,-0x6c(%rbp)
jge    12ef <main+0x16f>
movslq -0x6c(%rbp),%rax
lea    -0x50(%rbp),%rdi
shl    $0x3,%rax
add    %rax,%rdi
lea    -0x58(%rbp),%rsi
call   1090 <ft_get_values@plt>
lea    -0x8(%rbp),%rdi
call   1060 <time@plt>
mov    -0x58(%rbp),%rdi
call   1070 <ft_strdup@plt>
mov    %rax,-0x60(%rbp)
lea    -0xc(%rbp),%rdi
call   1060 <time@plt>
mov    -0x58(%rbp),%rdi
call   10a0 <strdup@plt>
mov    %rax,-0x68(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <difftime@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x58(%rbp),%rsi
mov    -0x60(%rbp),%rdx
mov    -0x68(%rbp),%rcx
movsd  -0x18(%rbp),%xmm0
lea    0xdcb(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x60(%rbp),%rdi
mov    -0x68(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
je     12b4 <main+0x134>
lea    0xde8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x4(%rbp)
jmp    1300 <main+0x180>
movsd  -0x18(%rbp),%xmm0
movsd  0xd3f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     12e1 <main+0x161>
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x4(%rbp)
jmp    1300 <main+0x180>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
jmp    120a <main+0x8a>
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
lea    0xe73(%rip),%rsi
lea    0x20(%rsp),%rdi
call   1080 <ft_add_test_case@plt>
lea    0x28(%rsp),%rdi
lea    0xe71(%rip),%rsi
call   1080 <ft_add_test_case@plt>
lea    0x30(%rsp),%rdi
lea    0xed0(%rip),%rsi
call   1080 <ft_add_test_case@plt>
lea    0x38(%rsp),%rdi
lea    0xe59(%rip),%rsi
call   1080 <ft_add_test_case@plt>
lea    0x40(%rsp),%rdi
lea    0xe5b(%rip),%rsi
call   1080 <ft_add_test_case@plt>
lea    0x48(%rsp),%rdi
lea    0xe53(%rip),%rsi
call   1080 <ft_add_test_case@plt>
xor    %r15d,%r15d
lea    0x14(%rsp),%r12
lea    0x10(%rsp),%r13
lea    0xe43(%rip),%rbx
nopl   0x0(%rax,%rax,1)
lea    (%rsp,%r15,1),%rdi
add    $0x20,%rdi
lea    0x8(%rsp),%rsi
call   1090 <ft_get_values@plt>
mov    %r12,%rdi
call   1060 <time@plt>
mov    0x8(%rsp),%rdi
call   1070 <ft_strdup@plt>
mov    %rax,%rbp
mov    %r13,%rdi
call   1060 <time@plt>
mov    0x8(%rsp),%rdi
call   10a0 <strdup@plt>
mov    %rax,%r14
mov    0x10(%rsp),%edi
mov    0x14(%rsp),%esi
call   1040 <difftime@plt>
mov    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    %rbp,%rdx
mov    %r14,%rcx
movsd  %xmm0,0x18(%rsp)
mov    $0x1,%al
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
jne    12ab <main+0x12b>
movsd  0x18(%rsp),%xmm0
ucomisd 0xd6e(%rip),%xmm0
jae    12b4 <main+0x134>
add    $0x8,%r15
cmp    $0x30,%r15
jne    1210 <main+0x90>
lea    0xe23(%rip),%rdi
jmp    12bb <main+0x13b>
lea    0xddb(%rip),%rdi
jmp    12bb <main+0x13b>
lea    0xdef(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Je Code avec le CUL\00"
@.str.1 = [10 x i8] c"U MAD BRO\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [19 x i8] c"iBI^7toBO&*TYUIbb7\00"
@.str.4 = [9 x i8] c"aaaaaaaa\00"
@.str.5 = [9 x i8] c"bbbbbbbb\00"
@.str.6 = [66 x i8] c"str: %s, your_result: %s, actual_result: %s, execution time = %f\0A\00"
@.str.7 = [29 x i8] c"\1B[0;31mFAKE AND GAY \E2\9C\97\1B[0m\0A\00"
@.str.8 = [34 x i8] c"\1B[0;33mYOU ARE TOO SLOW! \E2\9C\97\1B[0m\0A\00"
@.str.9 = [21 x i8] c"\1B[0;32mGOES \E2\9C\93\1B[0m\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
%5 = alloca [6 x i8*]
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i32 0, i32* %1
%10 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 0
%11 = call i32 @ft_add_test_case(i8** %10, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 1
%13 = call i32 @ft_add_test_case(i8** %12, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%14 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 2
%15 = call i32 @ft_add_test_case(i8** %14, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%16 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 3
%17 = call i32 @ft_add_test_case(i8** %16, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%18 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 4
%19 = call i32 @ft_add_test_case(i8** %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%20 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 5
%21 = call i32 @ft_add_test_case(i8** %20, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %9
br label %22
22: ; preds = %55, %0
%23 = load i32, i32* %9
%24 = icmp slt i32 %23, 6
br i1 %24, label %25, label %58
25: ; preds = %22
%26 = load i32, i32* %9
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds [6 x i8*], [6 x i8*]* %5, i64 0, i64 %27
%29 = call i32 @ft_get_values(i8** %28, i8** %6)
%30 = call i32 @time(i32* %2)
%31 = load i8*, i8** %6
%32 = call i8* @ft_strdup(i8* %31)
store i8* %32, i8** %7
%33 = call i32 @time(i32* %3)
%34 = load i8*, i8** %6
%35 = call i8* @strdup(i8* %34)
store i8* %35, i8** %8
%36 = load i32, i32* %3
%37 = load i32, i32* %2
%38 = call double @difftime(i32 %36, i32 %37)
store double %38, double* %4
%39 = load i8*, i8** %6
%40 = load i8*, i8** %7
%41 = load i8*, i8** %8
%42 = load double, double* %4
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.6, i64 0, i64 0), i8* %39, i8* %40, i8* %41, double %42)
%44 = load i8*, i8** %7
%45 = load i8*, i8** %8
%46 = call i64 @strcmp(i8* %44, i8* %45)
%47 = icmp ne i64 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %25
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0))
store i32 %49, i32* %1
br label %60
50: ; preds = %25
%51 = load double, double* %4
%52 = fcmp oge double %51, 2.000000e+00
br i1 %52, label %53, label %55
53: ; preds = %50
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0))
store i32 %54, i32* %1
br label %60
55: ; preds = %50
%56 = load i32, i32* %9
%57 = add nsw i32 %56, 1
store i32 %57, i32* %9
br label %22
58: ; preds = %22
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0))
store i32 %59, i32* %1
br label %60
60: ; preds = %58, %53, %48
%61 = load i32, i32* %1
ret i32 %61
}

LLVM IR (-O2):
@.str = [20 x i8] c"Je Code avec le CUL\00"
@.str.1 = [10 x i8] c"U MAD BRO\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [19 x i8] c"iBI^7toBO&*TYUIbb7\00"
@.str.4 = [9 x i8] c"aaaaaaaa\00"
@.str.5 = [9 x i8] c"bbbbbbbb\00"
@.str.6 = [66 x i8] c"str: %s, your_result: %s, actual_result: %s, execution time = %f\0A\00"
@.str.7 = [29 x i8] c"\1B[0;31mFAKE AND GAY \E2\9C\97\1B[0m\0A\00"
@.str.8 = [34 x i8] c"\1B[0;33mYOU ARE TOO SLOW! \E2\9C\97\1B[0m\0A\00"
@.str.9 = [21 x i8] c"\1B[0;32mGOES \E2\9C\93\1B[0m\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [6 x i8*]
%4 = alloca i8*
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast [6 x i8*]* %3 to i8*
%8 = bitcast i8** %4 to i8*
%9 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 0
%10 = call i32 @ft_add_test_case(i8** %9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 1
%12 = call i32 @ft_add_test_case(i8** %11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
%13 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 2
%14 = call i32 @ft_add_test_case(i8** %13, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%15 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 3
%16 = call i32 @ft_add_test_case(i8** %15, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%17 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 4
%18 = call i32 @ft_add_test_case(i8** %17, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%19 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 5
%20 = call i32 @ft_add_test_case(i8** %19, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %24
21: ; preds = %41
%22 = add nuw nsw i64 %25, 1
%23 = icmp eq i64 %22, 6
br i1 %23, label %43, label %24
24: ; preds = %0, %21
%25 = phi i64 [ 0, %0 ], [ %22, %21 ]
%26 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 %25
%27 = call i32 @ft_get_values(i8** %26, i8** %4)
%28 = call i32 @time(i32* %1)
%29 = load i8*, i8** %4
%30 = call i8* @ft_strdup(i8* %29)
%31 = call i32 @time(i32* %2)
%32 = load i8*, i8** %4
%33 = call i8* @strdup(i8* %32)
%34 = load i32, i32* %2
%35 = load i32, i32* %1
%36 = call double @difftime(i32 %34, i32 %35)
%37 = load i8*, i8** %4
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.6, i64 0, i64 0), i8* %37, i8* %30, i8* %33, double %36)
%39 = call i64 @strcmp(i8* %30, i8* %33)
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %43
41: ; preds = %24
%42 = fcmp ult double %36, 2.000000e+00
br i1 %42, label %21, label %43
43: ; preds = %21, %41, %24
%44 = phi i8* [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), %24 ], [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0), %41 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), %21 ]
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %44)
ret i32 %45
}