#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 */
char EOF;
char getchar();
int /*<<< orphan*/ guessTheNumber();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srand((time(NULL)));
  char c = 'y';
  while (c != 'n') {
    guessTheNumber();
    while ((c = getchar()) != '\n' && c != EOF)
      ;
    printf("Would you like to play again (y or n)? ");
    scanf("%c", &c);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
movb   $0x79,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x6e,%eax
je     11fe <main+0x9e>
mov    $0x0,%al
call   1040 <guessTheNumber@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x6(%rbp)
je     11c8 <main+0x68>
movsbl -0x5(%rbp),%eax
mov    0x2e2b(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
test   $0x1,%al
jne    11d8 <main+0x78>
jmp    11dd <main+0x7d>
jmp    1197 <main+0x37>
lea    0xe1c(%rip),%rdi
call   1030 <printf@plt>
lea    0xe38(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1080 <scanf@plt>
jmp    1183 <main+0x23>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
movb   $0x79,0x7(%rsp)
mov    0x2e66(%rip),%rbx
lea    0xe77(%rip),%r14
lea    0xe98(%rip),%r15
lea    0x7(%rsp),%r12
jmp    11ba <main+0x5a>
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1080 <scanf@plt>
cmpb   $0x6e,0x7(%rsp)
je     11e5 <main+0x85>
xor    %eax,%eax
call   1040 <guessTheNumber@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %al,0x7(%rsp)
cmp    $0xa,%al
je     11a0 <main+0x40>
cmp    (%rbx),%al
jne    11d0 <main+0x70>
jmp    11a0 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@EOF = global i8 0
@.str = [40 x i8] c"Would you like to play again (y or n)? \00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @time(i32* null)
%4 = call i32 @srand(i32 %3)
store i8 121, i8* %2
br label %5
5: ; preds = %24, %0
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 110
br i1 %8, label %9, label %27
9: ; preds = %5
%10 = call i32 (...) @guessTheNumber()
br label %11
11: ; preds = %23, %9
%12 = call signext i8 (...) @getchar()
store i8 %12, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 10
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = load i8, i8* @EOF
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %17, %19
br label %21
21: ; preds = %15, %11
%22 = phi i1 [ false, %11 ], [ %20, %15 ]
br i1 %22, label %23, label %24
23: ; preds = %21
br label %11
24: ; preds = %21
%25 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %5
27: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@EOF = global i8 0
@.str = [40 x i8] c"Would you like to play again (y or n)? \00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @time(i32* null)
%3 = tail call i32 @srand(i32 %2)
store i8 121, i8* %1
br label %4
4: ; preds = %0, %12
%5 = call i32 (...) @guessTheNumber()
br label %6
6: ; preds = %6, %4
%7 = call signext i8 (...) @getchar()
store i8 %7, i8* %1
%8 = icmp ne i8 %7, 10
%9 = load i8, i8* @EOF
%10 = icmp ne i8 %7, %9
%11 = select i1 %8, i1 %10, i1 false
br i1 %11, label %6, label %12
12: ; preds = %6
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%15 = load i8, i8* %1
%16 = icmp eq i8 %15, 110
br i1 %16, label %17, label %4
17: ; preds = %12
ret i32 0
}