#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*/ DisplayEnd();
int /*<<< orphan*/ Message(int);
int /*<<< orphan*/ NewGame();
int /*<<< orphan*/ OutCaps();
int /*<<< orphan*/ OutChar(char);
int /*<<< orphan*/ OutFlush();
char WaitCharacter();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void QuitGame(void) {
  char c;
  OutCaps();
  Message(18);
  OutChar(' ');
  OutFlush();
  do {
    c = WaitCharacter();
    if (c == 'n' || c == 'N') {
      OutChar('N');
      OutChar('\n');
      OutFlush();
      DisplayEnd();
      exit(0);
    }
    if (c == 'y' || c == 'Y') {
      OutChar('Y');
      OutChar('\n');
      NewGame();
      return;
    }
  } while (1);
}


x86 assembly (clang, -O0):
<QuitGame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1080 <OutCaps@plt>
mov    $0x12,%edi
call   1050 <Message@plt>
mov    $0x20,%edi
call   1030 <OutChar@plt>
mov    $0x0,%al
call   1060 <OutFlush@plt>
mov    $0x0,%al
call   1070 <WaitCharacter@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x6e,%eax
je     11ce <QuitGame+0x4e>
movsbl -0x1(%rbp),%eax
cmp    $0x4e,%eax
jne    11f7 <QuitGame+0x77>
mov    $0x4e,%edi
call   1030 <OutChar@plt>
mov    $0xa,%edi
call   1030 <OutChar@plt>
mov    $0x0,%al
call   1060 <OutFlush@plt>
mov    $0x0,%al
call   1090 <DisplayEnd@plt>
xor    %edi,%edi
call   10a0 <exit@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x79,%eax
je     1211 <QuitGame+0x91>
movsbl -0x1(%rbp),%eax
cmp    $0x59,%eax
jne    1231 <QuitGame+0xb1>
mov    $0x59,%edi
call   1030 <OutChar@plt>
mov    $0xa,%edi
call   1030 <OutChar@plt>
mov    $0x0,%al
call   1040 <NewGame@plt>
jmp    1245 <QuitGame+0xc5>
jmp    1236 <QuitGame+0xb6>
mov    $0x1,%al
test   $0x1,%al
jne    11aa <QuitGame+0x2a>
jmp    1245 <QuitGame+0xc5>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuitGame>:
push   %rax
xor    %eax,%eax
call   1080 <OutCaps@plt>
mov    $0x12,%edi
call   1050 <Message@plt>
mov    $0x20,%edi
call   1030 <OutChar@plt>
xor    %eax,%eax
call   1060 <OutFlush@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %eax,%eax
call   1070 <WaitCharacter@plt>
and    $0xdf,%al
cmp    $0x59,%al
je     11ea <QuitGame+0x6a>
cmp    $0x4e,%al
jne    11b0 <QuitGame+0x30>
mov    $0x4e,%edi
call   1030 <OutChar@plt>
mov    $0xa,%edi
call   1030 <OutChar@plt>
xor    %eax,%eax
call   1060 <OutFlush@plt>
xor    %eax,%eax
call   1090 <DisplayEnd@plt>
xor    %edi,%edi
call   10a0 <exit@plt>
mov    $0x59,%edi
call   1030 <OutChar@plt>
mov    $0xa,%edi
call   1030 <OutChar@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <NewGame@plt>

LLVM IR (-O0):
define void @QuitGame() {
%1 = alloca i8
%2 = call i32 (...) @OutCaps()
%3 = call i32 @Message(i32 18)
%4 = call i32 @OutChar(i8 signext 32)
%5 = call i32 (...) @OutFlush()
br label %6
6: ; preds = %34, %0
%7 = call signext i8 (...) @WaitCharacter()
store i8 %7, i8* %1
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 110
br i1 %10, label %15, label %11
11: ; preds = %6
%12 = load i8, i8* %1
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 78
br i1 %14, label %15, label %21
15: ; preds = %11, %6
%16 = call i32 @OutChar(i8 signext 78)
%17 = call i32 @OutChar(i8 signext 10)
%18 = call i32 (...) @OutFlush()
%19 = call i32 (...) @DisplayEnd()
%20 = call i32 @exit(i32 0)
unreachable
21: ; preds = %11
%22 = load i8, i8* %1
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 121
br i1 %24, label %29, label %25
25: ; preds = %21
%26 = load i8, i8* %1
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 89
br i1 %28, label %29, label %33
29: ; preds = %25, %21
%30 = call i32 @OutChar(i8 signext 89)
%31 = call i32 @OutChar(i8 signext 10)
%32 = call i32 (...) @NewGame()
br label %35
33: ; preds = %25
br label %34
34: ; preds = %33
br i1 true, label %6, label %35
35: ; preds = %29, %34
ret void
}

LLVM IR (-O2):
define void @QuitGame() {
%1 = tail call i32 (...) @OutCaps()
%2 = tail call i32 @Message(i32 18)
%3 = tail call i32 @OutChar(i8 signext 32)
%4 = tail call i32 (...) @OutFlush()
br label %5
5: ; preds = %5, %0
%6 = tail call signext i8 (...) @WaitCharacter()
%7 = and i8 %6, -33
switch i8 %7, label %5 [
i8 78, label %8
i8 89, label %14
]
8: ; preds = %5
%9 = tail call i32 @OutChar(i8 signext 78)
%10 = tail call i32 @OutChar(i8 signext 10)
%11 = tail call i32 (...) @OutFlush()
%12 = tail call i32 (...) @DisplayEnd()
%13 = tail call i32 @exit(i32 0)
unreachable
14: ; preds = %5
%15 = tail call i32 @OutChar(i8 signext 89)
%16 = tail call i32 @OutChar(i8 signext 10)
%17 = tail call i32 (...) @NewGame()
ret void
}