#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 /*<<< orphan*/ fflush(int /*<<< orphan*/);
int getchar();
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int affirmative(void) {
  int c;
  int ok;
  fflush(stdout);
  fflush(stderr);
  while ((c = getchar()) == ' ') {
  }
  ok = (c == 'y' || c == 'Y');
  while (c != EOF && c != '\n')
    c = getchar();
  return ok;
}


x86 assembly (clang, -O0):
<affirmative>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea1(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
cmp    $0x20,%eax
jne    115c <affirmative+0x3c>
jmp    1144 <affirmative+0x24>
mov    $0x1,%al
cmpl   $0x79,-0x4(%rbp)
mov    %al,-0x9(%rbp)
je     1175 <affirmative+0x55>
cmpl   $0x59,-0x4(%rbp)
sete   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%ecx
xor    %eax,%eax
mov    0x2e5c(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0xa(%rbp)
je     11a1 <affirmative+0x81>
cmpl   $0xa,-0x4(%rbp)
setne  %al
mov    %al,-0xa(%rbp)
mov    -0xa(%rbp),%al
test   $0x1,%al
jne    11b1 <affirmative+0x91>
jmp    11c0 <affirmative+0xa0>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0x4(%rbp)
jmp    1180 <affirmative+0x60>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<affirmative>:
push   %r14
push   %rbx
push   %rax
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0x20,%eax
je     1140 <affirmative+0x20>
mov    %eax,%ebx
cmp    $0xa,%eax
je     1171 <affirmative+0x51>
mov    0x2e8e(%rip),%r14
cmp    (%r14),%ebx
je     1171 <affirmative+0x51>
nop
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0xa,%eax
je     1171 <affirmative+0x51>
cmp    (%r14),%eax
jne    1160 <affirmative+0x40>
and    $0xffffffdf,%ebx
xor    %eax,%eax
cmp    $0x59,%ebx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stdout = global i32 0
@stderr = global i32 0
@EOF = global i32 0
define i32 @affirmative() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* @stdout
%4 = call i32 @fflush(i32 %3)
%5 = load i32, i32* @stderr
%6 = call i32 @fflush(i32 %5)
br label %7
7: ; preds = %10, %0
%8 = call i32 (...) @getchar()
store i32 %8, i32* %1
%9 = icmp eq i32 %8, 32
br i1 %9, label %10, label %11
10: ; preds = %7
br label %7
11: ; preds = %7
%12 = load i32, i32* %1
%13 = icmp eq i32 %12, 121
br i1 %13, label %17, label %14
14: ; preds = %11
%15 = load i32, i32* %1
%16 = icmp eq i32 %15, 89
br label %17
17: ; preds = %14, %11
%18 = phi i1 [ true, %11 ], [ %16, %14 ]
%19 = zext i1 %18 to i32
store i32 %19, i32* %2
br label %20
20: ; preds = %29, %17
%21 = load i32, i32* %1
%22 = load i32, i32* @EOF
%23 = icmp ne i32 %21, %22
br i1 %23, label %24, label %27
24: ; preds = %20
%25 = load i32, i32* %1
%26 = icmp ne i32 %25, 10
br label %27
27: ; preds = %24, %20
%28 = phi i1 [ false, %20 ], [ %26, %24 ]
br i1 %28, label %29, label %31
29: ; preds = %27
%30 = call i32 (...) @getchar()
store i32 %30, i32* %1
br label %20
31: ; preds = %27
%32 = load i32, i32* %2
ret i32 %32
}

LLVM IR (-O2):
@stdout = global i32 0
@stderr = global i32 0
@EOF = global i32 0
define i32 @affirmative() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fflush(i32 %1)
%3 = load i32, i32* @stderr
%4 = tail call i32 @fflush(i32 %3)
br label %5
5: ; preds = %5, %0
%6 = tail call i32 (...) @getchar()
%7 = icmp eq i32 %6, 32
br i1 %7, label %5, label %8
8: ; preds = %5
%9 = load i32, i32* @EOF
%10 = icmp ne i32 %6, %9
%11 = icmp ne i32 %6, 10
%12 = and i1 %11, %10
br i1 %12, label %13, label %19
13: ; preds = %8, %13
%14 = tail call i32 (...) @getchar()
%15 = load i32, i32* @EOF
%16 = icmp ne i32 %14, %15
%17 = icmp ne i32 %14, 10
%18 = and i1 %17, %16
br i1 %18, label %13, label %19
19: ; preds = %13, %8
%20 = and i32 %6, -33
%21 = icmp eq i32 %20, 89
%22 = zext i1 %21 to i32
ret i32 %22
}