#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);
int /*<<< orphan*/ usleep(int);
int /*<<< orphan*/ write(int, char *, int);
int main() {
  char buffer[1];
  write(1, "Gob's Program:  Y/N?\n? ", 23);
  read(0, buffer, 1);
  if (buffer[0] != 'Y' && buffer[0] != 'y') {
    goto end;
  }
  while (1) {
    write(1, "PENUS ", 6);
    usleep(25000);
  }
end:
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    0xeb5(%rip),%rsi
mov    $0x17,%edx
call   1030 <write@plt>
lea    -0x5(%rbp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1040 <read@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x59,%eax
je     1184 <main+0x54>
movsbl -0x5(%rbp),%eax
cmp    $0x79,%eax
je     1184 <main+0x54>
jmp    11ae <main+0x7e>
jmp    1189 <main+0x59>
mov    $0x1,%edi
lea    0xe83(%rip),%rsi
mov    $0x6,%edx
call   1030 <write@plt>
mov    $0x61a8,%edi
call   1050 <usleep@plt>
jmp    1189 <main+0x59>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rsi
mov    $0x1,%edi
mov    $0x17,%edx
call   1030 <write@plt>
lea    0xf(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1040 <read@plt>
mov    0xf(%rsp),%al
and    $0xdf,%al
cmp    $0x59,%al
jne    118e <main+0x5e>
lea    0xeab(%rip),%rbx
nopl   (%rax)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x6,%edx
call   1030 <write@plt>
mov    $0x61a8,%edi
call   1050 <usleep@plt>
jmp    1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Gob's Program: Y/N?\0A? \00"
@.str.1 = [7 x i8] c"PENUS \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [1 x i8]
store i32 0, i32* %1
%3 = call i32 @write(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 23)
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%5 = call i32 @read(i32 0, i8* %4, i32 1)
%6 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 89
br i1 %9, label %10, label %16
10: ; preds = %0
%11 = getelementptr inbounds [1 x i8], [1 x i8]* %2, i64 0, i64 0
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 121
br i1 %14, label %15, label %16
15: ; preds = %10
br label %20
16: ; preds = %10, %0
br label %17
17: ; preds = %16, %17
%18 = call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 6)
%19 = call i32 @usleep(i32 25000)
br label %17
20: ; preds = %15
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Gob's Program: Y/N?\0A? \00"
@.str.1 = [7 x i8] c"PENUS \00"
define i32 @main() {
%1 = alloca [1 x i8]
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 23)
%4 = call i32 @read(i32 0, i8* %2, i32 1)
%5 = load i8, i8* %2
%6 = and i8 %5, -33
%7 = icmp eq i8 %6, 89
br i1 %7, label %8, label %11
8: ; preds = %0, %8
%9 = tail call i32 @write(i32 1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 6)
%10 = tail call i32 @usleep(i32 25000)
br label %8
11: ; preds = %0
ret i32 0
}