#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(int *, int, int);
int /*<<< orphan*/ ft_get_values(int *, int *, int *);
int *ft_range(int, int);
int printf(char *, ...);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  time_t start_t, end_t;
  double diff_t;
  int data[6][2];
  int *tab;
  int min;
  int max;
  int i;
  int j;
  ft_add_test_case(&data[0][0], 10, 100);
  ft_add_test_case(&data[1][0], 50, 49);
  ft_add_test_case(&data[2][0], 14, 374);
  ft_add_test_case(&data[3][0], 0, 0);
  ft_add_test_case(&data[4][0], 32, 8);
  ft_add_test_case(&data[5][0], 3, 45);
  i = 0;
  while (i < 6) {
    ft_get_values(&data[i][0], &min, &max);
    time(&start_t);
    tab = ft_range(min, max);
    time(&end_t);
    diff_t = difftime(end_t, start_t);
    printf("min: %i, max: %i, tab_pointer: %p, execution time = %f\n", min, max,
           tab, diff_t);
    if (min >= max && tab != 0) {
      printf("Pointer to tab is not NULL when min >= max !\n");
      return printf("\e[0;31mFAKE AND GAY ✗\e[0m\n");
    }
    j = -1;
    while (min < max)
      if (tab[++j] != min++)
        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
mov    $0xa,%esi
mov    $0x64,%edx
call   1070 <ft_add_test_case@plt>
lea    -0x50(%rbp),%rdi
add    $0x8,%rdi
mov    $0x32,%esi
mov    $0x31,%edx
call   1070 <ft_add_test_case@plt>
lea    -0x50(%rbp),%rdi
add    $0x10,%rdi
mov    $0xe,%esi
mov    $0x176,%edx
call   1070 <ft_add_test_case@plt>
lea    -0x50(%rbp),%rdi
add    $0x18,%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1070 <ft_add_test_case@plt>
lea    -0x50(%rbp),%rdi
add    $0x20,%rdi
mov    $0x20,%esi
mov    $0x8,%edx
call   1070 <ft_add_test_case@plt>
lea    -0x50(%rbp),%rdi
add    $0x28,%rdi
mov    $0x3,%esi
mov    $0x2d,%edx
call   1070 <ft_add_test_case@plt>
movl   $0x0,-0x64(%rbp)
cmpl   $0x6,-0x64(%rbp)
jge    1334 <main+0x1d4>
movslq -0x64(%rbp),%rax
lea    -0x50(%rbp),%rdi
shl    $0x3,%rax
add    %rax,%rdi
lea    -0x5c(%rbp),%rsi
lea    -0x60(%rbp),%rdx
call   1080 <ft_get_values@plt>
lea    -0x8(%rbp),%rdi
call   1060 <time@plt>
mov    -0x5c(%rbp),%edi
mov    -0x60(%rbp),%esi
call   1050 <ft_range@plt>
mov    %rax,-0x58(%rbp)
lea    -0xc(%rbp),%rdi
call   1060 <time@plt>
mov    -0xc(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1040 <difftime@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x5c(%rbp),%esi
mov    -0x60(%rbp),%edx
mov    -0x58(%rbp),%rcx
movsd  -0x18(%rbp),%xmm0
lea    0xda5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x5c(%rbp),%eax
cmp    -0x60(%rbp),%eax
jl     12a5 <main+0x145>
cmpq   $0x0,-0x58(%rbp)
je     12a5 <main+0x145>
lea    0xdb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x4(%rbp)
jmp    1345 <main+0x1e5>
movl   $0xffffffff,-0x68(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x60(%rbp),%eax
jge    12f9 <main+0x199>
mov    -0x58(%rbp),%rax
mov    -0x68(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x68(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x5c(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x5c(%rbp)
cmp    %ecx,%eax
je     12f4 <main+0x194>
lea    0xd89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x4(%rbp)
jmp    1345 <main+0x1e5>
jmp    12ac <main+0x14c>
movsd  -0x18(%rbp),%xmm0
movsd  0xcfa(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1326 <main+0x1c6>
lea    0xd74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    %eax,-0x4(%rbp)
jmp    1345 <main+0x1e5>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    11f6 <main+0x96>
lea    0xd72(%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    0x20(%rsp),%rdi
mov    $0xa,%esi
mov    $0x64,%edx
call   1080 <ft_add_test_case@plt>
lea    0x28(%rsp),%rdi
mov    $0x32,%esi
mov    $0x31,%edx
call   1080 <ft_add_test_case@plt>
lea    0x30(%rsp),%rdi
mov    $0xe,%esi
mov    $0x176,%edx
call   1080 <ft_add_test_case@plt>
lea    0x38(%rsp),%rdi
xor    %r15d,%r15d
xor    %esi,%esi
xor    %edx,%edx
call   1080 <ft_add_test_case@plt>
lea    0x40(%rsp),%rdi
mov    $0x20,%esi
mov    $0x8,%edx
call   1080 <ft_add_test_case@plt>
lea    0x48(%rsp),%rdi
mov    $0x3,%esi
mov    $0x2d,%edx
call   1080 <ft_add_test_case@plt>
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x14(%rsp),%rbp
lea    0x10(%rsp),%r12
lea    0xdfa(%rip),%r13
lea    (%rsp,%r15,8),%rdi
add    $0x20,%rdi
call   1090 <ft_get_values@plt>
mov    %rbp,%rbx
mov    %rbp,%rdi
call   1070 <time@plt>
mov    0x8(%rsp),%edi
mov    0xc(%rsp),%esi
call   1060 <ft_range@plt>
mov    %rax,%r14
mov    %r12,%rdi
call   1070 <time@plt>
mov    0x10(%rsp),%edi
mov    0x14(%rsp),%esi
call   1050 <difftime@plt>
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
mov    %r13,%rdi
mov    %r14,%rcx
movsd  %xmm0,0x18(%rsp)
mov    $0x1,%al
call   1040 <printf@plt>
mov    0x8(%rsp),%ecx
mov    0xc(%rsp),%eax
cmp    %eax,%ecx
jl     1280 <main+0x110>
test   %r14,%r14
jne    12d4 <main+0x164>
nopw   0x0(%rax,%rax,1)
cmp    %eax,%ecx
jge    12a0 <main+0x130>
mov    (%r14),%edx
lea    0x1(%rcx),%esi
mov    %esi,0x8(%rsp)
add    $0x4,%r14
cmp    %ecx,%edx
mov    %esi,%ecx
je     1280 <main+0x110>
jmp    12e0 <main+0x170>
nopw   0x0(%rax,%rax,1)
movsd  0x18(%rsp),%xmm0
ucomisd 0xd52(%rip),%xmm0
jae    12fd <main+0x18d>
add    $0x1,%r15
cmp    $0x6,%r15
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %rbx,%rbp
jne    120e <main+0x9e>
lea    0xdad(%rip),%rdi
jmp    12e7 <main+0x177>
lea    0xdb9(%rip),%rdi
call   1030 <puts@plt>
lea    0xd59(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd59(%rip),%rdi
jmp    12e7 <main+0x177>

LLVM IR (-O0):
@.str = [56 x i8] c"min: %i, max: %i, tab_pointer: %p, execution time = %f\0A\00"
@.str.1 = [46 x i8] c"Pointer to tab is not NULL when min >= max !\0A\00"
@.str.2 = [29 x i8] c"\1B[0;31mFAKE AND GAY \E2\9C\97\1B[0m\0A\00"
@.str.3 = [34 x i8] c"\1B[0;33mYOU ARE TOO SLOW! \E2\9C\97\1B[0m\0A\00"
@.str.4 = [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 [2 x i32]]
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
%11 = getelementptr inbounds [6 x [2 x i32]], [6 x [2 x i32]]* %5, i64 0, i64 0
%12 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 0
%13 = call i32 @ft_add_test_case(i32* %12, i32 10, i32 100)
%14 = getelementptr inbounds [6 x [2 x i32]], [6 x [2 x i32]]* %5, i64 0, i64 1
%15 = getelementptr inbounds [2 x i32], [2 x i32]* %14, i64 0, i64 0
%16 = call i32 @ft_add_test_case(i32* %15, i32 50, i32 49)
%17 = getelementptr inbounds [6 x [2 x i32]], [6 x [2 x i32]]* %5, i64 0, i64 2
%18 = getelementptr inbounds [2 x i32], [2 x i32]* %17, i64 0, i64 0
%19 = call i32 @ft_add_test_case(i32* %18, i32 14, i32 374)
%20 = getelementptr inbounds [6 x [2 x i32]], [6 x [2 x i32]]* %5, i64 0, i64 3
%21 = getelementptr inbounds [2 x i32], [2 x i32]* %20, i64 0, i64 0
%22 = call i32 @ft_add_test_case(i32* %21, i32 0, i32 0)
%23 = getelementptr inbounds [6 x [2 x i32]], [6 x [2 x i32]]* %5, i64 0, i64 4
%24 = getelementptr inbounds [2 x i32], [2 x i32]* %23, i64 0, i64 0
%25 = call i32 @ft_add_test_case(i32* %24, i32 32, i32 8)
%26 = getelementptr inbounds [6 x [2 x i32]], [6 x [2 x i32]]* %5, i64 0, i64 5
%27 = getelementptr inbounds [2 x i32], [2 x i32]* %26, i64 0, i64 0
%28 = call i32 @ft_add_test_case(i32* %27, i32 3, i32 45)
store i32 0, i32* %9
br label %29
29: ; preds = %83, %0
%30 = load i32, i32* %9
%31 = icmp slt i32 %30, 6
br i1 %31, label %32, label %86
32: ; preds = %29
%33 = load i32, i32* %9
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [6 x [2 x i32]], [6 x [2 x i32]]* %5, i64 0, i64 %34
%36 = getelementptr inbounds [2 x i32], [2 x i32]* %35, i64 0, i64 0
%37 = call i32 @ft_get_values(i32* %36, i32* %7, i32* %8)
%38 = call i32 @time(i32* %2)
%39 = load i32, i32* %7
%40 = load i32, i32* %8
%41 = call i32* @ft_range(i32 %39, i32 %40)
store i32* %41, i32** %6
%42 = call i32 @time(i32* %3)
%43 = load i32, i32* %3
%44 = load i32, i32* %2
%45 = call double @difftime(i32 %43, i32 %44)
store double %45, double* %4
%46 = load i32, i32* %7
%47 = load i32, i32* %8
%48 = load i32*, i32** %6
%49 = load double, double* %4
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %46, i32 %47, i32* %48, double %49)
%51 = load i32, i32* %7
%52 = load i32, i32* %8
%53 = icmp sge i32 %51, %52
br i1 %53, label %54, label %60
54: ; preds = %32
%55 = load i32*, i32** %6
%56 = icmp ne i32* %55, null
br i1 %56, label %57, label %60
57: ; preds = %54
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
store i32 %59, i32* %1
br label %88
60: ; preds = %54, %32
store i32 -1, i32* %10
br label %61
61: ; preds = %77, %60
%62 = load i32, i32* %7
%63 = load i32, i32* %8
%64 = icmp slt i32 %62, %63
br i1 %64, label %65, label %78
65: ; preds = %61
%66 = load i32*, i32** %6
%67 = load i32, i32* %10
%68 = add nsw i32 %67, 1
store i32 %68, i32* %10
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i32, i32* %66, i64 %69
%71 = load i32, i32* %70
%72 = load i32, i32* %7
%73 = add nsw i32 %72, 1
store i32 %73, i32* %7
%74 = icmp ne i32 %71, %72
br i1 %74, label %75, label %77
75: ; preds = %65
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
store i32 %76, i32* %1
br label %88
77: ; preds = %65
br label %61
78: ; preds = %61
%79 = load double, double* %4
%80 = fcmp oge double %79, 2.000000e+00
br i1 %80, label %81, label %83
81: ; preds = %78
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
store i32 %82, i32* %1
br label %88
83: ; preds = %78
%84 = load i32, i32* %9
%85 = add nsw i32 %84, 1
store i32 %85, i32* %9
br label %29
86: ; preds = %29
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0))
store i32 %87, i32* %1
br label %88
88: ; preds = %86, %81, %75, %57
%89 = load i32, i32* %1
ret i32 %89
}

LLVM IR (-O2):
@.str = [56 x i8] c"min: %i, max: %i, tab_pointer: %p, execution time = %f\0A\00"
@.str.2 = [29 x i8] c"\1B[0;31mFAKE AND GAY \E2\9C\97\1B[0m\0A\00"
@.str.3 = [34 x i8] c"\1B[0;33mYOU ARE TOO SLOW! \E2\9C\97\1B[0m\0A\00"
@.str.4 = [21 x i8] c"\1B[0;32mGOES \E2\9C\93\1B[0m\0A\00"
@str = [45 x i8] c"Pointer to tab is not NULL when min >= max !\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [6 x [2 x i32]]
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %1 to i8*
%7 = bitcast i32* %2 to i8*
%8 = bitcast [6 x [2 x i32]]* %3 to i8*
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = getelementptr inbounds [6 x [2 x i32]], [6 x [2 x i32]]* %3, i64 0, i64 0, i64 0
%12 = call i32 @ft_add_test_case(i32* %11, i32 10, i32 100)
%13 = getelementptr inbounds [6 x [2 x i32]], [6 x [2 x i32]]* %3, i64 0, i64 1, i64 0
%14 = call i32 @ft_add_test_case(i32* %13, i32 50, i32 49)
%15 = getelementptr inbounds [6 x [2 x i32]], [6 x [2 x i32]]* %3, i64 0, i64 2, i64 0
%16 = call i32 @ft_add_test_case(i32* %15, i32 14, i32 374)
%17 = getelementptr inbounds [6 x [2 x i32]], [6 x [2 x i32]]* %3, i64 0, i64 3, i64 0
%18 = call i32 @ft_add_test_case(i32* %17, i32 0, i32 0)
%19 = getelementptr inbounds [6 x [2 x i32]], [6 x [2 x i32]]* %3, i64 0, i64 4, i64 0
%20 = call i32 @ft_add_test_case(i32* %19, i32 32, i32 8)
%21 = getelementptr inbounds [6 x [2 x i32]], [6 x [2 x i32]]* %3, i64 0, i64 5, i64 0
%22 = call i32 @ft_add_test_case(i32* %21, i32 3, i32 45)
br label %26
23: ; preds = %58
%24 = add nuw nsw i64 %27, 1
%25 = icmp eq i64 %24, 6
br i1 %25, label %60, label %26
26: ; preds = %0, %23
%27 = phi i64 [ 0, %0 ], [ %24, %23 ]
%28 = getelementptr inbounds [6 x [2 x i32]], [6 x [2 x i32]]* %3, i64 0, i64 %27, i64 0
%29 = call i32 @ft_get_values(i32* %28, i32* %4, i32* %5)
%30 = call i32 @time(i32* %1)
%31 = load i32, i32* %4
%32 = load i32, i32* %5
%33 = call i32* @ft_range(i32 %31, i32 %32)
%34 = call i32 @time(i32* %2)
%35 = load i32, i32* %2
%36 = load i32, i32* %1
%37 = call double @difftime(i32 %35, i32 %36)
%38 = load i32, i32* %4
%39 = load i32, i32* %5
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0), i32 %38, i32 %39, i32* %33, double %37)
%41 = load i32, i32* %4
%42 = load i32, i32* %5
%43 = icmp sge i32 %41, %42
%44 = icmp ne i32* %33, null
%45 = select i1 %43, i1 %44, i1 false
br i1 %45, label %46, label %48
46: ; preds = %26
%47 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
br label %60
48: ; preds = %26, %52
%49 = phi i32 [ %56, %52 ], [ %41, %26 ]
%50 = phi i64 [ %53, %52 ], [ -1, %26 ]
%51 = icmp slt i32 %49, %42
br i1 %51, label %52, label %58
52: ; preds = %48
%53 = add i64 %50, 1
%54 = getelementptr inbounds i32, i32* %33, i64 %53
%55 = load i32, i32* %54
%56 = add nsw i32 %49, 1
store i32 %56, i32* %4
%57 = icmp eq i32 %55, %49
br i1 %57, label %48, label %60
58: ; preds = %48
%59 = fcmp ult double %37, 2.000000e+00
br i1 %59, label %23, label %60
60: ; preds = %23, %58, %52, %46
%61 = phi i8* [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), %46 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), %52 ], [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), %58 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), %23 ]
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %61)
ret i32 %62
}