#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 *);
int see_more() {
  int c;
  printf("\033[7m more?\033[m");
  while ((c = getchar()) != EOF) {
    if (c == 'q')
      return 0;
    if (c == ' ')
      return 24;
    if (c == '\n')
      return 1;
  }
  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     1194 <see_more+0x74>
cmpl   $0x71,-0x8(%rbp)
jne    1163 <see_more+0x43>
movl   $0x0,-0x4(%rbp)
jmp    119b <see_more+0x7b>
cmpl   $0x20,-0x8(%rbp)
jne    1179 <see_more+0x59>
movl   $0x18,-0x4(%rbp)
jmp    119b <see_more+0x7b>
cmpl   $0xa,-0x8(%rbp)
jne    118f <see_more+0x6f>
movl   $0x1,-0x4(%rbp)
jmp    119b <see_more+0x7b>
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    $0xa,%eax
je     1162 <see_more+0x42>
cmp    $0x71,%eax
je     1167 <see_more+0x47>
cmp    $0x20,%eax
jne    1140 <see_more+0x20>
mov    $0x18,%ebx
jmp    1167 <see_more+0x47>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [14 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 ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %20, %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 %21
8: ; preds = %4
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 113
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 0, i32* %1
br label %22
12: ; preds = %8
%13 = load i32, i32* %2
%14 = icmp eq i32 %13, 32
br i1 %14, label %15, label %16
15: ; preds = %12
store i32 24, i32* %1
br label %22
16: ; preds = %12
%17 = load i32, i32* %2
%18 = icmp eq i32 %17, 10
br i1 %18, label %19, label %20
19: ; preds = %16
store i32 1, i32* %1
br label %22
20: ; preds = %16
br label %4
21: ; preds = %4
store i32 0, i32* %1
br label %22
22: ; preds = %21, %19, %15, %11
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [14 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 ([14 x i8], [14 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 32, label %8
i32 10, 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 ], [ 24, %8 ], [ 1, %6 ]
ret i32 %10
}