#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 rand();
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  int guess, numrange, random;
  char goAgain;
  int counter = 0;
  srand(time(NULL));
  do {
    printf("Welcome to the Guessing game \n");
    printf("Please enter the range greater than 99: ");
    scanf("%d", &numrange);
    random = rand() % numrange + 1;
    if (numrange >= 99) {
      do {
        printf("Please enter a guess between 1 and the number");
        printf(" you entered:\n");
        scanf("%d", &guess);
        if (guess > random) {
          counter++;
          printf("\nToo high\n");
        } else if (guess < random) {
          counter++;
          printf("\nToo Low\n");
        } else {
          counter++;
          printf("\nYou got it\n");
          printf("\nIt only took you %d tries!\n", counter);
        }
      } while (random != guess);
      printf("\nWould you like to try again?");
      scanf("%s", &goAgain);
    } else if (numrange < 99) {
      printf("Error your value was not that of over the value of 99");
      printf("\nPlease enter your value again: ");
      scanf("%d", &numrange);
    }
  } while (goAgain == 'y' || goAgain == 'Y');
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaf(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    $0x0,%al
call   1070 <rand@plt>
cltd
idivl  -0xc(%rbp)
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
cmpl   $0x63,-0xc(%rbp)
jl     12a5 <main+0x155>
jmp    11c4 <main+0x74>
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe61(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    121a <main+0xca>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    126f <main+0x11f>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1242 <main+0xf2>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    126a <main+0x11a>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
lea    0xe4b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%esi
lea    0xe47(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    126f <main+0x11f>
jmp    1274 <main+0x124>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    11c4 <main+0x74>
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe50(%rip),%rdi
lea    -0x11(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
jmp    12e2 <main+0x192>
cmpl   $0x63,-0xc(%rbp)
jge    12dd <main+0x18d>
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd76(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
jmp    12e2 <main+0x192>
jmp    12e7 <main+0x197>
movsbl -0x11(%rbp),%ecx
mov    $0x1,%al
cmp    $0x79,%ecx
mov    %al,-0x19(%rbp)
je     1306 <main+0x1b6>
movsbl -0x11(%rbp),%eax
cmp    $0x59,%eax
sete   %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1176 <main+0x26>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
lea    0xf6c(%rip),%r13
lea    0xe9f(%rip),%rbx
lea    0x10(%rsp),%rbp
lea    0x14(%rsp),%r14
xor    %r12d,%r12d
jmp    11d7 <main+0x77>
nopl   0x0(%rax)
lea    0xef1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf19(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    0xf(%rsp),%al
and    $0xdf,%al
cmp    $0x59,%al
jne    12d2 <main+0x172>
mov    %r13,%rdi
call   1030 <puts@plt>
lea    0xe1a(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
xor    %eax,%eax
call   1080 <rand@plt>
mov    0x10(%rsp),%ecx
cltd
idiv   %ecx
cmp    $0x63,%ecx
jl     11a0 <main+0x40>
mov    %edx,%r15d
lea    0x1(%r15),%r13d
lea    0xe11(%rip),%rbp
jmp    1233 <main+0xd3>
nopl   (%rax)
lea    0xf09(%rip),%rdi
call   1030 <puts@plt>
cmp    0x14(%rsp),%r13d
je     12a0 <main+0x140>
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
mov    0x14(%rsp),%eax
add    $0x1,%r12d
cmp    %r13d,%eax
jg     1220 <main+0xc0>
cmp    %r15d,%eax
jle    1290 <main+0x130>
lea    0xeac(%rip),%rdi
call   1030 <puts@plt>
lea    0xddf(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    0x14(%rsp),%r13d
jne    1233 <main+0xd3>
jmp    12a0 <main+0x140>
xchg   %ax,%ax
lea    0xe90(%rip),%rdi
jmp    1227 <main+0xc7>
nopl   0x0(%rax)
lea    0xdd0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xde0(%rip),%rdi
lea    0xf(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0xe27(%rip),%r13
lea    0x10(%rsp),%rbp
jmp    11c9 <main+0x69>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Welcome to the Guessing game \0A\00"
@.str.1 = [41 x i8] c"Please enter the range greater than 99: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [46 x i8] c"Please enter a guess between 1 and the number\00"
@.str.4 = [15 x i8] c" you entered:\0A\00"
@.str.5 = [11 x i8] c"\0AToo high\0A\00"
@.str.6 = [10 x i8] c"\0AToo Low\0A\00"
@.str.7 = [13 x i8] c"\0AYou got it\0A\00"
@.str.8 = [29 x i8] c"\0AIt only took you %d tries!\0A\00"
@.str.9 = [30 x i8] c"\0AWould you like to try again?\00"
@.str.10 = [3 x i8] c"%s\00"
@.str.11 = [54 x i8] c"Error your value was not that of over the value of 99\00"
@.str.12 = [33 x i8] c"\0APlease enter your value again: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %6
%7 = call i32 @time(i32* null)
%8 = call i32 @srand(i32 %7)
br label %9
9: ; preds = %71, %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%13 = call i32 (...) @rand()
%14 = load i32, i32* %3
%15 = srem i32 %13, %14
%16 = add nsw i32 %15, 1
store i32 %16, i32* %4
%17 = load i32, i32* %3
%18 = icmp sge i32 %17, 99
br i1 %18, label %19, label %54
19: ; preds = %9
br label %20
20: ; preds = %47, %19
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%24 = load i32, i32* %2
%25 = load i32, i32* %4
%26 = icmp sgt i32 %24, %25
br i1 %26, label %27, label %31
27: ; preds = %20
%28 = load i32, i32* %6
%29 = add nsw i32 %28, 1
store i32 %29, i32* %6
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
br label %46
31: ; preds = %20
%32 = load i32, i32* %2
%33 = load i32, i32* %4
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %39
35: ; preds = %31
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
store i32 %37, i32* %6
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
br label %45
39: ; preds = %31
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%43 = load i32, i32* %6
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 %43)
br label %45
45: ; preds = %39, %35
br label %46
46: ; preds = %45, %27
br label %47
47: ; preds = %46
%48 = load i32, i32* %4
%49 = load i32, i32* %2
%50 = icmp ne i32 %48, %49
br i1 %50, label %20, label %51
51: ; preds = %47
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0))
%53 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %5)
br label %62
54: ; preds = %9
%55 = load i32, i32* %3
%56 = icmp slt i32 %55, 99
br i1 %56, label %57, label %61
57: ; preds = %54
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.11, i64 0, i64 0))
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0))
%60 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
br label %61
61: ; preds = %57, %54
br label %62
62: ; preds = %61, %51
br label %63
63: ; preds = %62
%64 = load i8, i8* %5
%65 = sext i8 %64 to i32
%66 = icmp eq i32 %65, 121
br i1 %66, label %71, label %67
67: ; preds = %63
%68 = load i8, i8* %5
%69 = sext i8 %68 to i32
%70 = icmp eq i32 %69, 89
br label %71
71: ; preds = %67, %63
%72 = phi i1 [ true, %63 ], [ %70, %67 ]
br i1 %72, label %9, label %73
73: ; preds = %71
%74 = load i32, i32* %1
ret i32 %74
}

LLVM IR (-O2):
@.str.1 = [41 x i8] c"Please enter the range greater than 99: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [46 x i8] c"Please enter a guess between 1 and the number\00"
@.str.8 = [29 x i8] c"\0AIt only took you %d tries!\0A\00"
@.str.9 = [30 x i8] c"\0AWould you like to try again?\00"
@.str.10 = [3 x i8] c"%s\00"
@.str.11 = [54 x i8] c"Error your value was not that of over the value of 99\00"
@.str.12 = [33 x i8] c"\0APlease enter your value again: \00"
@str = [30 x i8] c"Welcome to the Guessing game \00"
@str.13 = [14 x i8] c" you entered:\00"
@str.14 = [12 x i8] c"\0AYou got it\00"
@str.15 = [9 x i8] c"\0AToo Low\00"
@str.16 = [10 x i8] c"\0AToo high\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = tail call i32 @time(i32* null)
%7 = tail call i32 @srand(i32 %6)
br label %8
8: ; preds = %47, %0
%9 = phi i32 [ 0, %0 ], [ %48, %47 ]
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%13 = call i32 (...) @rand()
%14 = load i32, i32* %2
%15 = srem i32 %13, %14
%16 = add nsw i32 %15, 1
%17 = icmp sgt i32 %14, 98
br i1 %17, label %18, label %43
18: ; preds = %8, %36
%19 = phi i32 [ %37, %36 ], [ %9, %8 ]
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.13, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%23 = load i32, i32* %1
%24 = icmp sgt i32 %23, %16
br i1 %24, label %25, label %28
25: ; preds = %18
%26 = add nsw i32 %19, 1
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.16, i64 0, i64 0))
br label %36
28: ; preds = %18
%29 = icmp sgt i32 %23, %15
%30 = add nsw i32 %19, 1
br i1 %29, label %33, label %31
31: ; preds = %28
%32 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.15, i64 0, i64 0))
br label %36
33: ; preds = %28
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.14, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 %30)
br label %36
36: ; preds = %25, %33, %31
%37 = phi i32 [ %26, %25 ], [ %30, %31 ], [ %30, %33 ]
%38 = load i32, i32* %1
%39 = icmp eq i32 %16, %38
br i1 %39, label %40, label %18
40: ; preds = %36
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.9, i64 0, i64 0))
%42 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i8* %3)
br label %47
43: ; preds = %8
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.11, i64 0, i64 0))
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.12, i64 0, i64 0))
%46 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
br label %47
47: ; preds = %40, %43
%48 = phi i32 [ %37, %40 ], [ %9, %43 ]
%49 = load i8, i8* %3
%50 = and i8 %49, -33
%51 = icmp eq i8 %50, 89
br i1 %51, label %8, label %52
52: ; preds = %47
ret i32 0
}