#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 GetKeyPrompt(char *);
int /*<<< orphan*/ printf(char *);
char tolower(int);
int More(void) {
  int ch;
  for (;;) {
    ch = GetKeyPrompt(
        "\x1b[1;34mMore\x1b[0;36m [\x1b[35mYES\x1b[36m]? \x1b[32m");
    if (tolower(ch) == 'y') {
      printf("Yes..\n");
      return 1;
    } else if (ch == '\n') {
      printf("More!\n");
      return 1;
    } else if (ch == ' ') {
      printf("More..\n");
      return 1;
    } else if (tolower(ch) == 'n') {
      printf("No..\n");
      return 0;
    } else if (tolower(ch) == 'q') {
      printf("No, Quit!\n");
      return 0;
    } else if (tolower(ch) == 's') {
      printf("No, Stop!\n");
      return 0;
    } else
      printf("\n\x1b[0;33m '\x1b[1;33my\x1b[0;33m' = Yes, GO.\n "
             "'\x1b[1;33mn\x1b[0;33m' = No, STOP!\x1b[0m\n");
  }
  printf("\x1b[0;36m");
  return 1;
}


x86 assembly (clang, -O0):
<More>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <GetKeyPrompt@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1050 <tolower@plt>
movsbl %al,%eax
cmp    $0x79,%eax
jne    1173 <More+0x43>
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1265 <More+0x135>
cmpl   $0xa,-0x8(%rbp)
jne    1195 <More+0x65>
lea    0xead(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1265 <More+0x135>
cmpl   $0x20,-0x8(%rbp)
jne    11b7 <More+0x87>
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1265 <More+0x135>
mov    -0x8(%rbp),%edi
call   1050 <tolower@plt>
movsbl %al,%eax
cmp    $0x6e,%eax
jne    11e3 <More+0xb3>
lea    0xe6e(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1265 <More+0x135>
mov    -0x8(%rbp),%edi
call   1050 <tolower@plt>
movsbl %al,%eax
cmp    $0x71,%eax
jne    120f <More+0xdf>
lea    0xe48(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1265 <More+0x135>
mov    -0x8(%rbp),%edi
call   1050 <tolower@plt>
movsbl %al,%eax
cmp    $0x73,%eax
jne    123b <More+0x10b>
lea    0xe27(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1265 <More+0x135>
lea    0xe1a(%rip),%rdi
call   1040 <printf@plt>
jmp    124c <More+0x11c>
jmp    1251 <More+0x121>
jmp    1256 <More+0x126>
jmp    125b <More+0x12b>
jmp    1260 <More+0x130>
jmp    1138 <More+0x8>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<More>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%rdi
call   1030 <GetKeyPrompt@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1050 <tolower@plt>
mov    $0x1,%r14d
lea    0xf3c(%rip),%rbx
cmp    $0x79,%al
jne    117b <More+0x4b>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xef1(%rip),%r13
lea    0xea1(%rip),%r15
lea    0xe70(%rip),%r12
cmp    $0xa,%ebp
je     11da <More+0xaa>
cmp    $0x20,%ebp
je     11e6 <More+0xb6>
mov    %ebp,%edi
call   1050 <tolower@plt>
cmp    $0x6e,%al
je     11f2 <More+0xc2>
mov    %ebp,%edi
call   1050 <tolower@plt>
cmp    $0x71,%al
je     1201 <More+0xd1>
mov    %ebp,%edi
call   1050 <tolower@plt>
cmp    $0x73,%al
je     1210 <More+0xe0>
mov    %r15,%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
call   1030 <GetKeyPrompt@plt>
mov    %eax,%ebp
mov    %eax,%edi
call   1050 <tolower@plt>
cmp    $0x79,%al
jne    1190 <More+0x60>
jmp    1161 <More+0x31>
lea    0xeb2(%rip),%rbx
jmp    1161 <More+0x31>
lea    0xe9f(%rip),%rbx
jmp    1161 <More+0x31>
lea    0xe8e(%rip),%rbx
xor    %r14d,%r14d
jmp    1161 <More+0x31>
lea    0xe75(%rip),%rbx
xor    %r14d,%r14d
jmp    1161 <More+0x31>
mov    %r13,%rbx
xor    %r14d,%r14d
jmp    1161 <More+0x31>

LLVM IR (-O0):
@.str = [42 x i8] c"\1B[1;34mMore\1B[0;36m [\1B[35mYES\1B[36m]? \1B[32m\00"
@.str.1 = [7 x i8] c"Yes..\0A\00"
@.str.2 = [7 x i8] c"More!\0A\00"
@.str.3 = [8 x i8] c"More..\0A\00"
@.str.4 = [6 x i8] c"No..\0A\00"
@.str.5 = [11 x i8] c"No, Quit!\0A\00"
@.str.6 = [11 x i8] c"No, Stop!\0A\00"
@.str.7 = [74 x i8] c"\0A\1B[0;33m '\1B[1;33my\1B[0;33m' = Yes, GO.\0A '\1B[1;33mn\1B[0;33m' = No, STOP!\1B[0m\0A\00"
define i32 @More() {
%1 = alloca i32
%2 = alloca i32
br label %3
3: ; preds = %49, %0
%4 = call i32 @GetKeyPrompt(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call signext i8 @tolower(i32 %5)
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 121
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %1
br label %50
11: ; preds = %3
%12 = load i32, i32* %2
%13 = icmp eq i32 %12, 10
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %1
br label %50
16: ; preds = %11
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 32
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %1
br label %50
21: ; preds = %16
%22 = load i32, i32* %2
%23 = call signext i8 @tolower(i32 %22)
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %24, 110
br i1 %25, label %26, label %28
26: ; preds = %21
%27 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %1
br label %50
28: ; preds = %21
%29 = load i32, i32* %2
%30 = call signext i8 @tolower(i32 %29)
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 113
br i1 %32, label %33, label %35
33: ; preds = %28
%34 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0))
store i32 0, i32* %1
br label %50
35: ; preds = %28
%36 = load i32, i32* %2
%37 = call signext i8 @tolower(i32 %36)
%38 = sext i8 %37 to i32
%39 = icmp eq i32 %38, 115
br i1 %39, label %40, label %42
40: ; preds = %35
%41 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %1
br label %50
42: ; preds = %35
%43 = call i32 @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.7, i64 0, i64 0))
br label %44
44: ; preds = %42
br label %45
45: ; preds = %44
br label %46
46: ; preds = %45
br label %47
47: ; preds = %46
br label %48
48: ; preds = %47
br label %49
49: ; preds = %48
br label %3
50: ; preds = %40, %33, %26, %19, %14, %9
%51 = load i32, i32* %1
ret i32 %51
}

LLVM IR (-O2):
@.str = [42 x i8] c"\1B[1;34mMore\1B[0;36m [\1B[35mYES\1B[36m]? \1B[32m\00"
@str = [73 x i8] c"\0A\1B[0;33m '\1B[1;33my\1B[0;33m' = Yes, GO.\0A '\1B[1;33mn\1B[0;33m' = No, STOP!\1B[0m\00"
@str.8 = [10 x i8] c"No, Stop!\00"
@str.9 = [10 x i8] c"No, Quit!\00"
@str.10 = [5 x i8] c"No..\00"
@str.11 = [7 x i8] c"More..\00"
@str.12 = [6 x i8] c"More!\00"
@str.13 = [6 x i8] c"Yes..\00"
define i32 @More() {
%1 = tail call i32 @GetKeyPrompt(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 @tolower(i32 %1)
%3 = icmp eq i8 %2, 121
br i1 %3, label %21, label %4
4: ; preds = %0, %15
%5 = phi i32 [ %17, %15 ], [ %1, %0 ]
switch i32 %5, label %6 [
i32 10, label %21
i32 32, label %20
]
6: ; preds = %4
%7 = tail call signext i8 @tolower(i32 %5)
%8 = icmp eq i8 %7, 110
br i1 %8, label %21, label %9
9: ; preds = %6
%10 = tail call signext i8 @tolower(i32 %5)
%11 = icmp eq i8 %10, 113
br i1 %11, label %21, label %12
12: ; preds = %9
%13 = tail call signext i8 @tolower(i32 %5)
%14 = icmp eq i8 %13, 115
br i1 %14, label %21, label %15
15: ; preds = %12
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str, i64 0, i64 0))
%17 = tail call i32 @GetKeyPrompt(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%18 = tail call signext i8 @tolower(i32 %17)
%19 = icmp eq i8 %18, 121
br i1 %19, label %21, label %4
20: ; preds = %4
br label %21
21: ; preds = %12, %9, %6, %4, %15, %20, %0
%22 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @str.13, i64 0, i64 0), %0 ], [ getelementptr inbounds ([7 x i8], [7 x i8]* @str.11, i64 0, i64 0), %20 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.8, i64 0, i64 0), %12 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.9, i64 0, i64 0), %9 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.10, i64 0, i64 0), %6 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @str.12, i64 0, i64 0), %4 ], [ getelementptr inbounds ([6 x i8], [6 x i8]* @str.13, i64 0, i64 0), %15 ]
%23 = phi i32 [ 1, %0 ], [ 1, %20 ], [ 0, %12 ], [ 0, %9 ], [ 0, %6 ], [ 1, %4 ], [ 1, %15 ]
%24 = tail call i32 @puts(i8* dereferenceable(1) %22)
ret i32 %23
}