#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 */
typedef int /*<<< orphan*/ input;

/* Variables and functions */
int /*<<< orphan*/ read_line(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ stdin;
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strtolower(char *);
unsigned char input_and_verify() {
  char input[4];
  int i;
  if (!read_line(stdin, input, sizeof(input))) {
    return 0;
  }
  strtolower(input);
  if (strcmp(input, "yes") == 0 || strcmp(input, "y") == 0) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<input_and_verify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
lea    -0x5(%rbp),%rsi
mov    $0x4,%edx
call   1050 <read_line@plt>
cmp    $0x0,%eax
jne    1161 <input_and_verify+0x31>
movb   $0x0,-0x1(%rbp)
jmp    11ab <input_and_verify+0x7b>
lea    -0x5(%rbp),%rdi
call   1030 <strtolower@plt>
lea    -0x5(%rbp),%rdi
lea    0xe8b(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     119e <input_and_verify+0x6e>
lea    -0x5(%rbp),%rdi
lea    0xe75(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    11a7 <input_and_verify+0x77>
movb   $0x1,-0x1(%rbp)
jmp    11ab <input_and_verify+0x7b>
movb   $0x0,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_and_verify>:
push   %rbx
sub    $0x10,%rsp
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xc(%rsp),%rsi
mov    $0x4,%edx
call   1050 <read_line@plt>
test   %eax,%eax
je     118b <input_and_verify+0x5b>
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strtolower@plt>
lea    0xe9b(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     118f <input_and_verify+0x5f>
lea    0xe8b(%rip),%rsi
lea    0xc(%rsp),%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
sete   %al
jmp    1191 <input_and_verify+0x61>
xor    %eax,%eax
jmp    1191 <input_and_verify+0x61>
mov    $0x1,%al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@stdin = global i32 0
@.str = [4 x i8] c"yes\00"
@.str.1 = [2 x i8] c"y\00"
define zeroext i8 @input_and_verify() {
%1 = alloca i8
%2 = alloca [4 x i8]
%3 = alloca i32
%4 = load i32, i32* @stdin
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%6 = call i32 @read_line(i32 %4, i8* %5, i32 4)
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %0
store i8 0, i8* %1
br label %21
9: ; preds = %0
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%11 = call i32 @strtolower(i8* %10)
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%13 = call i64 @strcmp(i8* %12, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%14 = icmp eq i64 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %9
%16 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%17 = call i64 @strcmp(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %15, %9
store i8 1, i8* %1
br label %21
20: ; preds = %15
store i8 0, i8* %1
br label %21
21: ; preds = %20, %19, %8
%22 = load i8, i8* %1
ret i8 %22
}

LLVM IR (-O2):
@stdin = global i32 0
@.str = [4 x i8] c"yes\00"
@.str.1 = [2 x i8] c"y\00"
define zeroext i8 @input_and_verify() {
%1 = alloca [4 x i8]
%2 = getelementptr inbounds [4 x i8], [4 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @stdin
%4 = call i32 @read_line(i32 %3, i8* %2, i32 4)
%5 = icmp eq i32 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %0
%7 = call i32 @strtolower(i8* %2)
%8 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
%13 = zext i1 %12 to i8
br label %14
14: ; preds = %10, %6, %0
%15 = phi i8 [ 0, %0 ], [ 1, %6 ], [ %13, %10 ]
ret i8 %15
}