#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*/ printf(char *, int, int);
int recurr(int);
int main() {
  int max = 0;
  int index = 0;
  for (int i = 2; i < 1000; i++) {
    int temp = recurr(i);
    if (temp > max) {
      max = temp;
      index = i;
    }
  }
  printf("If you can trust me, the number you are looking for is %d(%d)\n",
         index, max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
cmpl   $0x3e8,-0x10(%rbp)
jge    1187 <main+0x67>
mov    -0x10(%rbp),%edi
call   1040 <recurr@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1174 <main+0x54>
mov    -0x14(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1179 <main+0x59>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1144 <main+0x24>
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    $0x2,%ebp
xor    %ebx,%ebx
xor    %r14d,%r14d
xchg   %ax,%ax
mov    %ebp,%edi
call   1040 <recurr@plt>
cmp    %ebx,%eax
cmovg  %ebp,%r14d
cmovg  %eax,%ebx
add    $0x1,%ebp
cmp    $0x3e8,%ebp
jne    1130 <main+0x10>
lea    0xeae(%rip),%rdi
mov    %r14d,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [63 x i8] c"If you can trust me, the number you are looking for is %d(%d)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 2, i32* %4
br label %6
6: ; preds = %19, %0
%7 = load i32, i32* %4
%8 = icmp slt i32 %7, 1000
br i1 %8, label %9, label %22
9: ; preds = %6
%10 = load i32, i32* %4
%11 = call i32 @recurr(i32 %10)
store i32 %11, i32* %5
%12 = load i32, i32* %5
%13 = load i32, i32* %2
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %18
15: ; preds = %9
%16 = load i32, i32* %5
store i32 %16, i32* %2
%17 = load i32, i32* %4
store i32 %17, i32* %3
br label %18
18: ; preds = %15, %9
br label %19
19: ; preds = %18
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %6
22: ; preds = %6
%23 = load i32, i32* %3
%24 = load i32, i32* %2
%25 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %23, i32 %24)
ret i32 0
}

LLVM IR (-O2):
@.str = [63 x i8] c"If you can trust me, the number you are looking for is %d(%d)\0A\00"
define i32 @main() {
br label %3
1: ; preds = %3
%2 = tail call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10)
ret i32 0
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %10, %3 ]
%5 = phi i32 [ 2, %0 ], [ %11, %3 ]
%6 = phi i32 [ 0, %0 ], [ %9, %3 ]
%7 = tail call i32 @recurr(i32 %5)
%8 = icmp sgt i32 %7, %4
%9 = select i1 %8, i32 %5, i32 %6
%10 = select i1 %8, i32 %7, i32 %4
%11 = add nuw nsw i32 %5, 1
%12 = icmp eq i32 %11, 1000
br i1 %12, label %1, label %3
}