#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 ft_strlen(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  char str[] = "w0l0l0";
  int len;
  len = ft_strlen(str);
  printf("Your function says that '%s' has length %i, and that is...\n", str,
         len);
  if (len == 6)
    printf("CORRECT\n");
  else
    printf("FAKE AND GAY\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%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)
lea    -0xb(%rbp),%rdi
call   1030 <ft_strlen@plt>
mov    %eax,-0x10(%rbp)
lea    -0xb(%rbp),%rsi
mov    -0x10(%rbp),%edx
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x6,-0x10(%rbp)
jne    118a <main+0x6a>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1198 <main+0x78>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
movl   $0x306c30,0x3(%rsp)
movl   $0x306c3077,(%rsp)
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <ft_strlen@plt>
mov    %eax,%ebp
lea    0xeb1(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
cmp    $0x6,%ebp
lea    0xee4(%rip),%rax
lea    0xed0(%rip),%rdi
cmove  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.str = [7 x i8] c"w0l0l0\00"
@.str = [60 x i8] c"Your function says that '%s' has length %i, and that is...\0A\00"
@.str.1 = [9 x i8] c"CORRECT\0A\00"
@.str.2 = [14 x i8] c"FAKE AND GAY\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [7 x i8]* %2 to i8*
%5 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%6 = call i32 @ft_strlen(i8* %5)
store i32 %6, i32* %3
%7 = getelementptr inbounds [7 x i8], [7 x i8]* %2, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8)
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 6
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %16
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
ret i32 0
}

LLVM IR (-O2):
@__const.main.str = [7 x i8] c"w0l0l0\00"
@.str = [60 x i8] c"Your function says that '%s' has length %i, and that is...\0A\00"
@str = [13 x i8] c"FAKE AND GAY\00"
@str.3 = [8 x i8] c"CORRECT\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 i32 @ft_strlen(i8* %2)
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3)
%5 = icmp eq i32 %3, 6
%6 = select i1 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @str.3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0)
%7 = call i32 @puts(i8* dereferenceable(1) %6)
ret i32 0
}