#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 *, char *);
void inf(int n) {
  if (n < 10) {
    printf("%s\n", "Either you know the secret or you got lucky!");
  } else if (10 == n) {
    printf("%s\n", "Ahah! You know the secret!");
  } else if (n > 10) {
    printf("%s\n", "You should be able to do better");
  }
}


x86 assembly (clang, -O0):
<inf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    113d <inf+0x2d>
lea    0xed4(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1030 <printf@plt>
jmp    118a <inf+0x7a>
mov    $0xa,%eax
cmp    -0x4(%rbp),%eax
jne    1163 <inf+0x53>
lea    0xeae(%rip),%rdi
lea    0xed8(%rip),%rsi
call   1030 <printf@plt>
jmp    1185 <inf+0x75>
cmpl   $0xa,-0x4(%rbp)
jle    1180 <inf+0x70>
lea    0xe8c(%rip),%rdi
lea    0xed1(%rip),%rsi
call   1030 <printf@plt>
jmp    1185 <inf+0x75>
jmp    118a <inf+0x7a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inf>:
cmp    $0xa,%edi
lea    0xf17(%rip),%rax
lea    0xf2b(%rip),%rcx
cmove  %rax,%rcx
lea    0xed8(%rip),%rsi
cmovge %rcx,%rsi
lea    0xec9(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [45 x i8] c"Either you know the secret or you got lucky!\00"
@.str.2 = [27 x i8] c"Ahah! You know the secret!\00"
@.str.3 = [32 x i8] c"You should be able to do better\00"
define void @inf(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0))
br label %19
7: ; preds = %1
%8 = load i32, i32* %2
%9 = icmp eq i32 10, %8
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %18
12: ; preds = %7
%13 = load i32, i32* %2
%14 = icmp sgt i32 %13, 10
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
br label %18
18: ; preds = %17, %10
br label %19
19: ; preds = %18, %5
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [45 x i8] c"Either you know the secret or you got lucky!\00"
@.str.2 = [27 x i8] c"Ahah! You know the secret!\00"
@.str.3 = [32 x i8] c"You should be able to do better\00"
define void @inf(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = icmp eq i32 %0, 10
%4 = select i1 %3, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0)
%5 = select i1 %2, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.1, i64 0, i64 0), i8* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
ret void
}