#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_new_secret_number();
int /*<<< orphan*/ initialize_number_generator();
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\n", 100);
  initialize_number_generator();
  do {
    choose_new_secret_number();
    printf("A new number has been chosen.\n");
    read_guesses();
    printf("Play again? (Y/N) ");
    scanf(" %c", &command);
    printf("\n");
  } 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   1030 <initialize_number_generator@plt>
mov    $0x0,%al
call   1050 <choose_new_secret_number@plt>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <read_guesses@plt>
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1060 <scanf@plt>
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x5(%rbp),%ecx
mov    $0x1,%al
cmp    $0x79,%ecx
mov    %al,-0x6(%rbp)
je     11e0 <main+0x90>
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    0xe81(%rip),%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
call   1050 <initialize_number_generator@plt>
lea    0xeaa(%rip),%r14
lea    0xe8c(%rip),%r15
lea    0xe98(%rip),%r12
lea    0x7(%rsp),%rbx
nopl   0x0(%rax)
xor    %eax,%eax
call   1070 <choose_new_secret_number@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1090 <read_guesses@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1080 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
movzbl 0x7(%rsp),%eax
and    $0xdf,%al
cmp    $0x59,%al
je     11b0 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [44 x i8] c"Guess the secret number between 1 and %d.\0A\0A\00"
@.str.2 = [19 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 ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i32 100)
%3 = tail call i32 (...) @initialize_number_generator()
br label %4
4: ; preds = %4, %0
%5 = call i32 (...) @choose_new_secret_number()
%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 ([19 x i8], [19 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 = call i32 @putchar(i32 10)
%11 = load i8, i8* %1
%12 = and i8 %11, -33
%13 = icmp eq i8 %12, 89
br i1 %13, label %4, label %14
14: ; preds = %4
ret i32 0
}