#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 */
char EOF;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ stderr;
char tolower(int /*<<< orphan*/);
int proceed(void) {
  char c;
  fprintf(stderr, "Continue? [y/n] ");
  do
    c = tolower(getchar());
  while (c != 'y' && c != 'n' && c != EOF);
  return c == 'y' ? 1 : 0;
}


x86 assembly (clang, -O0):
<proceed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xeb8(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,%edi
call   1050 <tolower@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x79,%ecx
mov    %al,-0x2(%rbp)
je     1198 <proceed+0x68>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x6e,%ecx
mov    %al,-0x2(%rbp)
je     1198 <proceed+0x68>
movsbl -0x1(%rbp),%eax
mov    0x2e5b(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
setne  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    114d <proceed+0x1d>
movsbl -0x1(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x79,%edx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<proceed>:
push   %rbx
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e9b(%rip),%rbx
nopl   (%rax)
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,%edi
call   1050 <tolower@plt>
cmp    $0x6e,%al
je     116a <proceed+0x3a>
cmp    $0x79,%al
je     116a <proceed+0x3a>
cmp    (%rbx),%al
jne    1150 <proceed+0x20>
xor    %ecx,%ecx
cmp    $0x79,%al
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [17 x i8] c"Continue? [y/n] \00"
@EOF = global i8 0
define i32 @proceed() {
%1 = alloca i8
%2 = load i32, i32* @stderr
%3 = call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %21, %0
%5 = call i32 (...) @getchar()
%6 = call signext i8 @tolower(i32 %5)
store i8 %6, i8* %1
br label %7
7: ; preds = %4
%8 = load i8, i8* %1
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 121
br i1 %10, label %11, label %21
11: ; preds = %7
%12 = load i8, i8* %1
%13 = sext i8 %12 to i32
%14 = icmp ne i32 %13, 110
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load i8, i8* %1
%17 = sext i8 %16 to i32
%18 = load i8, i8* @EOF
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %17, %19
br label %21
21: ; preds = %15, %11, %7
%22 = phi i1 [ false, %11 ], [ false, %7 ], [ %20, %15 ]
br i1 %22, label %4, label %23
23: ; preds = %21
%24 = load i8, i8* %1
%25 = sext i8 %24 to i32
%26 = icmp eq i32 %25, 121
%27 = zext i1 %26 to i64
%28 = select i1 %26, i32 1, i32 0
ret i32 %28
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [17 x i8] c"Continue? [y/n] \00"
@EOF = global i8 0
define i32 @proceed() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %6, %0
%4 = tail call i32 (...) @getchar()
%5 = tail call signext i8 @tolower(i32 %4)
switch i8 %5, label %6 [
i8 121, label %9
i8 110, label %9
]
6: ; preds = %3
%7 = load i8, i8* @EOF
%8 = icmp eq i8 %5, %7
br i1 %8, label %9, label %3
9: ; preds = %3, %3, %6
%10 = icmp eq i8 %5, 121
%11 = zext i1 %10 to i32
ret i32 %11
}