#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 myrandom();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int number, input;
  number = myrandom();
  do {
    printf("\nGuess the number(0 to 10): ");
    scanf("%d", &input);
    if (input < number) {
      printf("Higher!\n");
    }
    if (input > number) {
      printf("Lower\n");
    }
  } while (number != input);
  printf("Correct number!\n");
  scanf("%d", input);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <myrandom@plt>
mov    %eax,-0x8(%rbp)
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    117f <main+0x4f>
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    1197 <main+0x67>
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
jmp    119c <main+0x6c>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    1149 <main+0x19>
lea    0xe81(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <myrandom@plt>
mov    %eax,%ebx
lea    0xea5(%rip),%r14
lea    0xebb(%rip),%r15
lea    0x4(%rsp),%r12
lea    0xec8(%rip),%r13
lea    0xebb(%rip),%rbp
jmp    1184 <main+0x44>
nopw   0x0(%rax,%rax,1)
cmp    %eax,%ebx
je     11ce <main+0x8e>
mov    %r14,%rdi
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    0x4(%rsp),%eax
cmp    %ebx,%eax
jl     11b0 <main+0x70>
cmp    %ebx,%eax
jle    1180 <main+0x40>
jmp    11c0 <main+0x80>
nopw   0x0(%rax,%rax,1)
mov    %r13,%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%eax
cmp    %ebx,%eax
jle    1180 <main+0x40>
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%eax
jmp    1180 <main+0x40>
lea    0xe4b(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%esi
lea    0xe38(%rip),%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [29 x i8] c"\0AGuess the number(0 to 10): \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [9 x i8] c"Higher!\0A\00"
@.str.3 = [7 x i8] c"Lower\0A\00"
@.str.4 = [17 x i8] c"Correct number!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (...) @myrandom()
store i32 %4, i32* %2
br label %5
5: ; preds = %20, %0
%6 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %3
%9 = load i32, i32* %2
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %13
11: ; preds = %5
%12 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %5
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = icmp sgt i32 %14, %15
br i1 %16, label %17, label %19
17: ; preds = %13
%18 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %19
19: ; preds = %17, %13
br label %20
20: ; preds = %19
%21 = load i32, i32* %2
%22 = load i32, i32* %3
%23 = icmp ne i32 %21, %22
br i1 %23, label %5, label %24
24: ; preds = %20
%25 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0))
%26 = load i32, i32* %3
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"\0AGuess the number(0 to 10): \00"
@.str.1 = [3 x i8] c"%d\00"
@str = [16 x i8] c"Correct number!\00"
@str.5 = [6 x i8] c"Lower\00"
@str.6 = [8 x i8] c"Higher!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (...) @myrandom()
br label %4
4: ; preds = %18, %0
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = icmp slt i32 %7, %3
br i1 %8, label %9, label %12
9: ; preds = %4
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.6, i64 0, i64 0))
%11 = load i32, i32* %1
br label %12
12: ; preds = %9, %4
%13 = phi i32 [ %11, %9 ], [ %7, %4 ]
%14 = icmp sgt i32 %13, %3
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.5, i64 0, i64 0))
%17 = load i32, i32* %1
br label %18
18: ; preds = %12, %15
%19 = phi i32 [ %13, %12 ], [ %17, %15 ]
%20 = icmp eq i32 %3, %19
br i1 %20, label %21, label %4
21: ; preds = %18
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%23 = load i32, i32* %1
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %23)
ret i32 0
}