#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 getGuess();
int /*<<< orphan*/ printf(char *);
int checkGuess(int guess, int rand1) {
  if (guess < rand1) {
    printf("\tYour guess is low. Try again:\t");
    guess = getGuess();
  } else if (guess > rand1) {
    printf("\tYour guess is high. Try again:\t");
    guess = getGuess();
  }
  return guess;
}


x86 assembly (clang, -O0):
<checkGuess>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1155 <checkGuess+0x35>
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getGuess@plt>
mov    %eax,-0x4(%rbp)
jmp    117c <checkGuess+0x5c>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1177 <checkGuess+0x57>
lea    0xeb8(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getGuess@plt>
mov    %eax,-0x4(%rbp)
jmp    117c <checkGuess+0x5c>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkGuess>:
cmp    %esi,%edi
jge    112d <checkGuess+0xd>
lea    0xed5(%rip),%rdi
jmp    1136 <checkGuess+0x16>
jle    1144 <checkGuess+0x24>
lea    0xeea(%rip),%rdi
push   %rax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getGuess@plt>
mov    %edi,%eax
ret

LLVM IR (-O0):
@.str = [32 x i8] c"\09Your guess is low. Try again:\09\00"
@.str.1 = [33 x i8] c"\09Your guess is high. Try again:\09\00"
define i32 @checkGuess(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (...) @getGuess()
store i32 %10, i32* %3
br label %19
11: ; preds = %2
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = icmp sgt i32 %12, %13
br i1 %14, label %15, label %18
15: ; preds = %11
%16 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 (...) @getGuess()
store i32 %17, i32* %3
br label %18
18: ; preds = %15, %11
br label %19
19: ; preds = %18, %8
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
@.str = [32 x i8] c"\09Your guess is low. Try again:\09\00"
@.str.1 = [33 x i8] c"\09Your guess is high. Try again:\09\00"
define i32 @checkGuess(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, %1
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = icmp sgt i32 %0, %1
br i1 %5, label %6, label %10
6: ; preds = %4, %2
%7 = phi i8* [ getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), %2 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0), %4 ]
%8 = tail call i32 @printf(i8* dereferenceable(1) %7)
%9 = tail call i32 (...) @getGuess()
br label %10
10: ; preds = %6, %4
%11 = phi i32 [ %0, %4 ], [ %9, %6 ]
ret i32 %11
}