#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 fun(int, void *, void *, int, void *, void *);
int /*<<< orphan*/ printf(char *, int);
int main(int argc, const char *argv[]) {
  int ret = 0;
  long nr_of_reductions = 1;
  ret = fun(1, (void *)1, (void *)1, 1, (void *)1, (void *)1);
  printf("RETURNED %d\n", ret);
  if (ret != fun(1, (void *)1, (void *)1, 1, (void *)1, (void *)1)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x1,-0x20(%rbp)
mov    $0x1,%ecx
mov    $0x1,%r9d
mov    %ecx,%edi
mov    %r9,%rsi
mov    %r9,%rdx
mov    %r9,%r8
call   1030 <fun@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe93(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    $0x1,%ecx
mov    $0x1,%r9d
mov    %ecx,%edi
mov    %r9,%rsi
mov    %r9,%rdx
mov    %r9,%r8
call   1030 <fun@plt>
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
cmp    %ecx,%eax
je     11ac <main+0x8c>
movl   $0x1,-0x4(%rbp)
jmp    11b3 <main+0x93>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%r8d
mov    $0x1,%r9d
mov    $0x1,%edi
mov    $0x1,%ecx
call   1030 <fun@plt>
mov    %eax,%ebx
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x1,%r8d
mov    $0x1,%r9d
mov    $0x1,%edi
mov    $0x1,%ecx
call   1030 <fun@plt>
xor    %ecx,%ecx
cmp    %eax,%ebx
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"RETURNED %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i64 1, i64* %7
%8 = call i32 @fun(i32 1, i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i32 1, i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*))
store i32 %8, i32* %6
%9 = load i32, i32* %6
%10 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %6
%12 = call i32 @fun(i32 1, i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i32 1, i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*))
%13 = icmp ne i32 %11, %12
br i1 %13, label %14, label %15
14: ; preds = %2
store i32 1, i32* %3
br label %16
15: ; preds = %2
store i32 0, i32* %3
br label %16
16: ; preds = %15, %14
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
@.str = [13 x i8] c"RETURNED %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @fun(i32 1, i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i32 1, i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @fun(i32 1, i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*), i32 1, i8* inttoptr (i64 1 to i8*), i8* inttoptr (i64 1 to i8*))
%6 = icmp ne i32 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}