#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*/ choose_rand_num();
int /*<<< orphan*/ initialize_rng();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read_guesses();
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char command;
  printf("Guess the secret number between 1 and %d\n", 100);
  initialize_rng();
  do {
    choose_rand_num();
    printf("A New number has been chosen.\n");
    read_guesses();
    printf("Play again? (Y/N): ");
    scanf(" %c", &command);
  } while (command == 'y' || command == 'Y');
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
mov    $0x64,%esi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <initialize_rng@plt>
mov    $0x0,%al
call   1030 <choose_rand_num@plt>
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <read_guesses@plt>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb3(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1050 <scanf@plt>
movsbl -0x5(%rbp),%ecx
mov    $0x1,%al
cmp    $0x79,%ecx
mov    %al,-0x6(%rbp)
je     11d2 <main+0x82>
movsbl -0x5(%rbp),%eax
cmp    $0x59,%eax
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
test   $0x1,%al
jne    1179 <main+0x29>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
lea    0xe91(%rip),%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1080 <initialize_rng@plt>
lea    0xeb9(%rip),%r14
lea    0xe9a(%rip),%r15
lea    0xea7(%rip),%r12
lea    0x7(%rsp),%rbx
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <choose_rand_num@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1070 <read_guesses@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1060 <scanf@plt>
movzbl 0x7(%rsp),%eax
and    $0xdf,%al
cmp    $0x59,%al
je     11a0 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [42 x i8] c"Guess the secret number between 1 and %d\0A\00"
@.str.1 = [31 x i8] c"A New number has been chosen.\0A\00"
@.str.2 = [20 x i8] c"Play again? (Y/N): \00"
@.str.3 = [4 x i8] c" %c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 100)
%4 = call i32 (...) @initialize_rng()
br label %5
5: ; preds = %19, %0
%6 = call i32 (...) @choose_rand_num()
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (...) @read_guesses()
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %2)
br label %11
11: ; preds = %5
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 121
br i1 %14, label %19, label %15
15: ; preds = %11
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 89
br label %19
19: ; preds = %15, %11
%20 = phi i1 [ true, %11 ], [ %18, %15 ]
br i1 %20, label %5, label %21
21: ; preds = %19
ret i32 0
}

LLVM IR (-O2):
@.str = [42 x i8] c"Guess the secret number between 1 and %d\0A\00"
@.str.2 = [20 x i8] c"Play again? (Y/N): \00"
@.str.3 = [4 x i8] c" %c\00"
@str = [30 x i8] c"A New number has been chosen.\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 100)
%3 = tail call i32 (...) @initialize_rng()
br label %4
4: ; preds = %4, %0
%5 = call i32 (...) @choose_rand_num()
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%7 = call i32 (...) @read_guesses()
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* %1)
%10 = load i8, i8* %1
%11 = and i8 %10, -33
%12 = icmp eq i8 %11, 89
br i1 %12, label %4, label %13
13: ; preds = %4
ret i32 0
}