#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 */
char *ft_strrev(char *);
int /*<<< orphan*/ printf(char *);
int main(void) {
  char str[] = "w0l0l0";
  char strrev[] = "0l0l0w";
  char *test;
  int i;
  test = ft_strrev(str);
  i = 0;
  while (strrev[i] != '\0') {
    if (strrev[i] != test[i]) {
      printf("FAKE AND GAY\n");
      return (0);
    }
    ++i;
  }
  printf("CORRECT\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0xb(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x7(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x5(%rbp)
mov    0xeb5(%rip),%eax
mov    %eax,-0x12(%rbp)
mov    0xeaf(%rip),%ax
mov    %ax,-0xe(%rbp)
mov    0xea7(%rip),%al
mov    %al,-0xc(%rbp)
lea    -0xb(%rbp),%rdi
call   1030 <ft_strrev@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
movsbl -0x12(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     11d2 <main+0xb2>
movslq -0x24(%rbp),%rax
movsbl -0x12(%rbp,%rax,1),%eax
mov    -0x20(%rbp),%rcx
movslq -0x24(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
je     11c4 <main+0xa4>
lea    0xe5b(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    11e5 <main+0xc5>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    117d <main+0x5d>
lea    0xe43(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x306c30,0x3(%rsp)
movl   $0x306c3077,(%rsp)
mov    %rsp,%rdi
call   1040 <ft_strrev@plt>
cmpb   $0x30,(%rax)
jne    1164 <main+0x44>
cmpb   $0x6c,0x1(%rax)
jne    1164 <main+0x44>
cmpb   $0x30,0x2(%rax)
jne    1164 <main+0x44>
cmpb   $0x6c,0x3(%rax)
jne    1164 <main+0x44>
cmpb   $0x30,0x4(%rax)
jne    1164 <main+0x44>
cmpb   $0x77,0x5(%rax)
jne    1164 <main+0x44>
lea    0xea5(%rip),%rdi
jmp    116b <main+0x4b>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.main.str = [7 x i8] c"w0l0l0\00"
@__const.main.strrev = [7 x i8] c"0l0l0w\00"
@.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 [7 x i8]
%3 = alloca [7 x i8]
%4 = alloca i8*
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [7 x i8]* %2 to i8*
%7 = bitcast [7 x i8]* %3 to i8*
%8 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%9 = call i8* @ft_strrev(i8* %8)
store i8* %9, i8** %4
store i32 0, i32* %5
br label %10
10: ; preds = %32, %0
%11 = load i32, i32* %5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %35
17: ; preds = %10
%18 = load i32, i32* %5
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [7 x i8], [7 x i8]* %3, i64 0, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = load i8*, i8** %4
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %23, i64 %25
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = icmp ne i32 %22, %28
br i1 %29, label %30, label %32
30: ; preds = %17
%31 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %37
32: ; preds = %17
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
store i32 %34, i32* %5
br label %10
35: ; preds = %10
%36 = 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 %37
37: ; preds = %35, %30
%38 = load i32, i32* %1
ret i32 %38
}

LLVM IR (-O2):
@__const.main.str = [7 x i8] c"w0l0l0\00"
@str = [8 x i8] c"CORRECT\00"
@str.2 = [13 x i8] c"FAKE AND GAY\00"
define i32 @main() {
%1 = alloca [7 x i8]
%2 = getelementptr inbounds [7 x i8], [7 x i8]* %1, i64 0, i64 0
%3 = call i8* @ft_strrev(i8* %2)
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 48
br i1 %5, label %6, label %26
6: ; preds = %0
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = load i8, i8* %7
%9 = icmp eq i8 %8, 108
br i1 %9, label %10, label %26
10: ; preds = %6
%11 = getelementptr inbounds i8, i8* %3, i64 2
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 48
br i1 %13, label %14, label %26
14: ; preds = %10
%15 = getelementptr inbounds i8, i8* %3, i64 3
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 108
br i1 %17, label %18, label %26
18: ; preds = %14
%19 = getelementptr inbounds i8, i8* %3, i64 4
%20 = load i8, i8* %19
%21 = icmp eq i8 %20, 48
br i1 %21, label %22, label %26
22: ; preds = %18
%23 = getelementptr inbounds i8, i8* %3, i64 5
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, 119
br i1 %25, label %27, label %26
26: ; preds = %22, %18, %14, %10, %6, %0
br label %27
27: ; preds = %22, %26
%28 = phi i8* [ getelementptr inbounds ([13 x i8], [13 x i8]* @str.2, i64 0, i64 0), %26 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0), %22 ]
%29 = call i32 @puts(i8* dereferenceable(1) %28)
ret i32 0
}