#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*/ ft_sort_integer_table(int *, int);
int /*<<< orphan*/ printf(char *);
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  int tab[100];
  int i;
  int t;
  srand(time(NULL));
  t = 0;
  while (t < 10) {
    i = 0;
    while (i < 100) {
      tab[i] = rand() % 200 - 100;
      ++i;
    }
    ft_sort_integer_table(tab, 100);
    i = 1;
    while (i < 100) {
      if (tab[i - 1] > tab[i]) {
        printf("FAKE AND GAY\n");
        return (0);
      }
      ++i;
    }
    ++t;
  }
  printf("CORRECT\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1b0,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movl   $0x0,-0x1a8(%rbp)
cmpl   $0xa,-0x1a8(%rbp)
jge    1262 <main+0x112>
movl   $0x0,-0x1a4(%rbp)
cmpl   $0x64,-0x1a4(%rbp)
jge    11d4 <main+0x84>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0xc8,%ecx
cltd
idiv   %ecx
sub    $0x64,%edx
movslq -0x1a4(%rbp),%rax
mov    %edx,-0x1a0(%rbp,%rax,4)
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    1193 <main+0x43>
lea    -0x1a0(%rbp),%rdi
mov    $0x64,%esi
call   1060 <ft_sort_integer_table@plt>
movl   $0x1,-0x1a4(%rbp)
cmpl   $0x64,-0x1a4(%rbp)
jge    124e <main+0xfe>
mov    -0x1a4(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x1a0(%rbp,%rax,4),%eax
movslq -0x1a4(%rbp),%rcx
cmp    -0x1a0(%rbp,%rcx,4),%eax
jle    123a <main+0xea>
lea    0xdd7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1275 <main+0x125>
mov    -0x1a4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a4(%rbp)
jmp    11ef <main+0x9f>
mov    -0x1a8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1a8(%rbp)
jmp    117c <main+0x2c>
lea    0xda5(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x190,%rsp
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    %rsp,%r14
lea    0xe91(%rip),%r12
lea    0xe82(%rip),%r15
xor    %ebp,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %eax,%eax
call   1070 <rand@plt>
cltq
imul   $0x51eb851f,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0xc8,%ecx,%ecx
neg    %ecx
add    %ecx,%eax
add    $0xffffff9c,%eax
mov    %eax,(%rsp,%rbx,4)
add    $0x1,%rbx
cmp    $0x64,%rbx
jne    1190 <main+0x40>
mov    %r14,%rdi
mov    $0x64,%esi
call   1060 <ft_sort_integer_table@plt>
mov    $0x3,%eax
mov    (%rsp),%ecx
nopl   0x0(%rax)
mov    -0x8(%rsp,%rax,4),%esi
cmp    %esi,%ecx
jg     1210 <main+0xc0>
mov    -0x4(%rsp,%rax,4),%edx
cmp    %edx,%esi
jg     1210 <main+0xc0>
mov    (%rsp,%rax,4),%ecx
cmp    %ecx,%edx
jg     1210 <main+0xc0>
add    $0x3,%rax
cmp    $0x66,%rax
jne    11e0 <main+0x90>
add    $0x1,%ebp
cmp    $0xa,%ebp
jne    1180 <main+0x30>
mov    %r15,%r12
mov    %r12,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x190,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [14 x i8] c"FAKE AND GAY\0A\00"
@.str.1 = [9 x i8] c"CORRECT\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i32]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @time(i32* null)
%6 = call i32 @srand(i32 %5)
store i32 0, i32* %4
br label %7
7: ; preds = %45, %0
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %48
10: ; preds = %7
store i32 0, i32* %3
br label %11
11: ; preds = %14, %10
%12 = load i32, i32* %3
%13 = icmp slt i32 %12, 100
br i1 %13, label %14, label %23
14: ; preds = %11
%15 = call i32 (...) @rand()
%16 = srem i32 %15, 200
%17 = sub nsw i32 %16, 100
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %19
store i32 %17, i32* %20
%21 = load i32, i32* %3
%22 = add nsw i32 %21, 1
store i32 %22, i32* %3
br label %11
23: ; preds = %11
%24 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 0
%25 = call i32 @ft_sort_integer_table(i32* %24, i32 100)
store i32 1, i32* %3
br label %26
26: ; preds = %42, %23
%27 = load i32, i32* %3
%28 = icmp slt i32 %27, 100
br i1 %28, label %29, label %45
29: ; preds = %26
%30 = load i32, i32* %3
%31 = sub nsw i32 %30, 1
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %32
%34 = load i32, i32* %33
%35 = load i32, i32* %3
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds [100 x i32], [100 x i32]* %2, i64 0, i64 %36
%38 = load i32, i32* %37
%39 = icmp sgt i32 %34, %38
br i1 %39, label %40, label %42
40: ; preds = %29
%41 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %50
42: ; preds = %29
%43 = load i32, i32* %3
%44 = add nsw i32 %43, 1
store i32 %44, i32* %3
br label %26
45: ; preds = %26
%46 = load i32, i32* %4
%47 = add nsw i32 %46, 1
store i32 %47, i32* %4
br label %7
48: ; preds = %7
%49 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %1
br label %50
50: ; preds = %48, %40
%51 = load i32, i32* %1
ret i32 %51
}

LLVM IR (-O2):
@str = [8 x i8] c"CORRECT\00"
@str.2 = [13 x i8] c"FAKE AND GAY\00"
define i32 @main() {
%1 = alloca [100 x i32]
%2 = bitcast [100 x i32]* %1 to i8*
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
%5 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 0
br label %6
6: ; preds = %0, %38
%7 = phi i32 [ 0, %0 ], [ %39, %38 ]
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %14, %8 ]
%10 = call i32 (...) @rand()
%11 = srem i32 %10, 200
%12 = add nsw i32 %11, -100
%13 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %9
store i32 %12, i32* %13
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, 100
br i1 %15, label %16, label %8
16: ; preds = %8
%17 = call i32 @ft_sort_integer_table(i32* %5, i32 100)
%18 = load i32, i32* %5
br label %32
19: ; preds = %32
%20 = add nuw nsw i64 %34, 1
%21 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %20
%22 = load i32, i32* %21
%23 = icmp sgt i32 %36, %22
br i1 %23, label %41, label %24
24: ; preds = %19
%25 = add nuw nsw i64 %34, 2
%26 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = icmp sgt i32 %22, %27
br i1 %28, label %41, label %29
29: ; preds = %24
%30 = add nuw nsw i64 %34, 3
%31 = icmp eq i64 %30, 100
br i1 %31, label %38, label %32
32: ; preds = %29, %16
%33 = phi i32 [ %18, %16 ], [ %27, %29 ]
%34 = phi i64 [ 1, %16 ], [ %30, %29 ]
%35 = getelementptr inbounds [100 x i32], [100 x i32]* %1, i64 0, i64 %34
%36 = load i32, i32* %35
%37 = icmp sgt i32 %33, %36
br i1 %37, label %41, label %19
38: ; preds = %29
%39 = add nuw nsw i32 %7, 1
%40 = icmp eq i32 %39, 10
br i1 %40, label %41, label %6
41: ; preds = %38, %32, %19, %24
%42 = phi i8* [ getelementptr inbounds ([13 x i8], [13 x i8]* @str.2, i64 0, i64 0), %24 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @str.2, i64 0, i64 0), %19 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @str.2, i64 0, i64 0), %32 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0), %38 ]
%43 = call i32 @puts(i8* dereferenceable(1) %42)
ret i32 0
}