#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
gamemaster_abort_option() {
  char answer[16];
  printf("*** Gamemaster safe-abort option ... type q or Q to quit: ");
  fflush(stdout);
  fgets(answer, 16, stdin);
  if (answer[0] == 'q' || answer[0] == 'Q')
    exit(0);
}


x86 assembly (clang, -O0):
<gamemaster_abort_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    -0x20(%rbp),%rdi
mov    0x2e7b(%rip),%rax
mov    (%rax),%edx
mov    $0x10,%esi
call   1040 <fgets@plt>
movsbl -0x20(%rbp),%eax
cmp    $0x71,%eax
je     1193 <gamemaster_abort_option+0x53>
movsbl -0x20(%rbp),%eax
cmp    $0x51,%eax
jne    119a <gamemaster_abort_option+0x5a>
xor    %edi,%edi
call   1060 <exit@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gamemaster_abort_option>:
sub    $0x18,%rsp
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    0x2e83(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rdi
mov    $0x10,%esi
call   1040 <fgets@plt>
mov    (%rsp),%al
and    $0xdf,%al
cmp    $0x51,%al
je     1182 <gamemaster_abort_option+0x42>
add    $0x18,%rsp
ret
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [59 x i8] c"*** Gamemaster safe-abort option ... type q or Q to quit: \00"
@stdout = global i32 0
@stdin = global i32 0
define i32 @gamemaster_abort_option() {
%1 = alloca i32
%2 = alloca [16 x i8]
%3 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = call i32 @fflush(i32 %4)
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%7 = load i32, i32* @stdin
%8 = call i32 @fgets(i8* %6, i32 16, i32 %7)
%9 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 113
br i1 %12, label %18, label %13
13: ; preds = %0
%14 = getelementptr inbounds [16 x i8], [16 x i8]* %2, i64 0, i64 0
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 81
br i1 %17, label %18, label %20
18: ; preds = %13, %0
%19 = call i32 @exit(i32 0)
unreachable
20: ; preds = %13
%21 = load i32, i32* %1
ret i32 %21
}

LLVM IR (-O2):
@.str = [59 x i8] c"*** Gamemaster safe-abort option ... type q or Q to quit: \00"
@stdout = global i32 0
@stdin = global i32 0
define i32 @gamemaster_abort_option() {
%1 = alloca [16 x i8]
%2 = getelementptr inbounds [16 x i8], [16 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stdout
%5 = tail call i32 @fflush(i32 %4)
%6 = load i32, i32* @stdin
%7 = call i32 @fgets(i8* %2, i32 16, i32 %6)
%8 = load i8, i8* %2
%9 = and i8 %8, -33
%10 = icmp eq i8 %9, 81
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 @exit(i32 0)
unreachable
13: ; preds = %0
ret i32 undef
}