#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 EOF;
int getchar();
int /*<<< orphan*/ printf(char *);
extern int see_more(void) {
  int c;
  printf("\033[7m more? \33[m");
  while ((c = getchar()) != EOF) {
    switch (c) {
    case 'q':
      return 0;
    case '\n':
      return 1;
    case ' ':
      return 24;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<see_more>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,-0x8(%rbp)
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%eax
je     11ac <see_more+0x8c>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0xa,%eax
je     118f <see_more+0x6f>
jmp    1161 <see_more+0x41>
mov    -0xc(%rbp),%eax
sub    $0x20,%eax
je     119b <see_more+0x7b>
jmp    1172 <see_more+0x52>
mov    -0xc(%rbp),%eax
sub    $0x71,%eax
jne    11a7 <see_more+0x87>
jmp    1183 <see_more+0x63>
movl   $0x0,-0x4(%rbp)
jmp    11b3 <see_more+0x93>
movl   $0x1,-0x4(%rbp)
jmp    11b3 <see_more+0x93>
movl   $0x18,-0x4(%rbp)
jmp    11b3 <see_more+0x93>
jmp    1134 <see_more+0x14>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<see_more>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eb1(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r14),%eax
je     1167 <see_more+0x47>
cmp    $0x71,%eax
je     1167 <see_more+0x47>
cmp    $0x20,%eax
je     1162 <see_more+0x42>
cmp    $0xa,%eax
jne    1140 <see_more+0x20>
mov    $0x1,%ebx
jmp    1167 <see_more+0x47>
mov    $0x18,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [15 x i8] c"\1B[7m more? \1B[m\00"
@EOF = global i32 0
define i32 @see_more() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %13, %0
%5 = call i32 (...) @getchar()
store i32 %5, i32* %2
%6 = load i32, i32* @EOF
%7 = icmp ne i32 %5, %6
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = load i32, i32* %2
switch i32 %9, label %13 [
i32 113, label %10
i32 10, label %11
i32 32, label %12
]
10: ; preds = %8
store i32 0, i32* %1
br label %15
11: ; preds = %8
store i32 1, i32* %1
br label %15
12: ; preds = %8
store i32 24, i32* %1
br label %15
13: ; preds = %8
br label %4
14: ; preds = %4
store i32 0, i32* %1
br label %15
15: ; preds = %14, %12, %11, %10
%16 = load i32, i32* %1
ret i32 %16
}

LLVM IR (-O2):
@.str = [15 x i8] c"\1B[7m more? \1B[m\00"
@EOF = global i32 0
define i32 @see_more() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %6, %0
%3 = tail call i32 (...) @getchar()
%4 = load i32, i32* @EOF
%5 = icmp eq i32 %3, %4
br i1 %5, label %7, label %6
6: ; preds = %2
switch i32 %3, label %2 [
i32 113, label %7
i32 10, label %8
i32 32, label %9
]
7: ; preds = %6, %2
br label %9
8: ; preds = %6
br label %9
9: ; preds = %6, %8, %7
%10 = phi i32 [ 0, %7 ], [ 1, %8 ], [ 24, %6 ]
ret i32 %10
}