#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*/ read(int /*<<< orphan*/, char *, int);
confirm() {
  char c, t;
  read(0, &c, 1);
  t = c;
  do
    read(0, &t, 1);
  while (t != '\n' && t != -1);
  return (c == 'y' || c == 'Y');
}


x86 assembly (clang, -O0):
<confirm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
mov    -0x1(%rbp),%al
mov    %al,-0x2(%rbp)
xor    %edi,%edi
lea    -0x2(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
movsbl -0x2(%rbp),%ecx
xor    %eax,%eax
cmp    $0xa,%ecx
mov    %al,-0x3(%rbp)
je     115d <confirm+0x4d>
movsbl -0x2(%rbp),%eax
cmp    $0xffffffff,%eax
setne  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
test   $0x1,%al
jne    112e <confirm+0x1e>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x79,%ecx
mov    %al,-0x4(%rbp)
je     1187 <confirm+0x77>
movsbl -0x1(%rbp),%eax
cmp    $0x59,%eax
sete   %al
mov    %al,-0x4(%rbp)
mov    -0x4(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<confirm>:
push   %rbp
push   %rbx
push   %rax
lea    0x7(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <read@plt>
mov    0x7(%rsp),%bpl
mov    %bpl,0x6(%rsp)
lea    0x6(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <read@plt>
movzbl 0x6(%rsp),%eax
cmp    $0xa,%al
je     115c <confirm+0x4c>
cmp    $0xff,%al
jne    1140 <confirm+0x30>
and    $0xdf,%bpl
xor    %eax,%eax
cmp    $0x59,%bpl
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @confirm() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 @read(i32 0, i8* %1, i32 1)
%4 = load i8, i8* %1
store i8 %4, i8* %2
br label %5
5: ; preds = %15, %0
%6 = call i32 @read(i32 0, i8* %2, i32 1)
br label %7
7: ; preds = %5
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 10
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, -1
br label %15
15: ; preds = %11, %7
%16 = phi i1 [ false, %7 ], [ %14, %11 ]
br i1 %16, label %5, label %17
17: ; preds = %15
%18 = load i8, i8* %1
%19 = sext i8 %18 to i32
%20 = icmp eq i32 %19, 121
br i1 %20, label %25, label %21
21: ; preds = %17
%22 = load i8, i8* %1
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 89
br label %25
25: ; preds = %21, %17
%26 = phi i1 [ true, %17 ], [ %24, %21 ]
%27 = zext i1 %26 to i32
ret i32 %27
}

LLVM IR (-O2):
define i32 @confirm() {
%1 = alloca i8
%2 = alloca i8
%3 = call i32 @read(i32 0, i8* %1, i32 1)
%4 = load i8, i8* %1
store i8 %4, i8* %2
br label %5
5: ; preds = %5, %0
%6 = call i32 @read(i32 0, i8* %2, i32 1)
%7 = load i8, i8* %2
switch i8 %7, label %5 [
i8 -1, label %8
i8 10, label %8
]
8: ; preds = %5, %5
%9 = and i8 %4, -33
%10 = icmp eq i8 %9, 89
%11 = zext i1 %10 to i32
ret i32 %11
}