#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 getc(int /*<<< orphan*/);
int /*<<< orphan*/ putc(int, int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ stdout;
char tolower(int);
int main(int argc, char *argv[]) {
  int i;
  puts("\n");
  for (i = 1; i < argc; i++) {
    if (i > 1)
      putc(' ', stdout);
    puts(argv[i]);
  }
  puts("? [y/n] ");
  for (;;) {
    i = getc(stdin);
    if ((tolower(i) == 'y') || (tolower(i) == 'n')) {
      putc(i, stdout);
      puts("\n\n");
      return (tolower(i) == 'y') ? 0 : 1;
    } else
      putc(7, stdout);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xead(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11b1 <main+0x71>
cmpl   $0x1,-0x14(%rbp)
jle    1192 <main+0x52>
mov    0x2e52(%rip),%rax
mov    (%rax),%esi
mov    $0x20,%edi
call   1040 <putc@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1030 <puts@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1169 <main+0x29>
lea    0xe48(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e24(%rip),%rax
mov    (%rax),%edi
call   1060 <getc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1050 <tolower@plt>
movsbl %al,%eax
cmp    $0x79,%eax
je     11f6 <main+0xb6>
mov    -0x14(%rbp),%edi
call   1050 <tolower@plt>
movsbl %al,%eax
cmp    $0x6e,%eax
jne    1231 <main+0xf1>
mov    -0x14(%rbp),%edi
mov    0x2dd8(%rip),%rax
mov    (%rax),%esi
call   1040 <putc@plt>
lea    0xdfb(%rip),%rdi
call   1030 <puts@plt>
mov    -0x14(%rbp),%edi
call   1050 <tolower@plt>
movsbl %al,%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x79,%edx
cmove  %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret
mov    0x2da0(%rip),%rax
mov    (%rax),%esi
mov    $0x7,%edi
call   1040 <putc@plt>
jmp    11bd <main+0x7d>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebp
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x2,%ebp
jl     119f <main+0x5f>
mov    0x8(%r14),%rdi
call   1030 <puts@plt>
cmp    $0x2,%ebp
je     119f <main+0x5f>
mov    %ebp,%ebp
mov    $0x2,%ebx
mov    0x2e5f(%rip),%r15
nopl   0x0(%rax)
mov    (%r15),%esi
mov    $0x20,%edi
call   1040 <putc@plt>
mov    (%r14,%rbx,8),%rdi
call   1030 <puts@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1180 <main+0x40>
lea    0xe5a(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e36(%rip),%r14
mov    (%r14),%edi
call   1060 <getc@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <tolower@plt>
cmp    $0x79,%al
je     11fd <main+0xbd>
mov    0x2e0a(%rip),%rbp
xchg   %ax,%ax
mov    %ebx,%edi
call   1050 <tolower@plt>
cmp    $0x6e,%al
je     11fd <main+0xbd>
mov    0x0(%rbp),%esi
mov    $0x7,%edi
call   1040 <putc@plt>
mov    (%r14),%edi
call   1060 <getc@plt>
mov    %eax,%ebx
mov    %eax,%edi
call   1050 <tolower@plt>
cmp    $0x79,%al
jne    11d0 <main+0x90>
mov    0x2dd4(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1040 <putc@plt>
lea    0xdf5(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1050 <tolower@plt>
xor    %ecx,%ecx
cmp    $0x79,%al
setne  %cl
mov    %ecx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
@stdout = global i32 0
@.str.1 = [9 x i8] c"? [y/n] \00"
@stdin = global i32 0
@.str.2 = [3 x i8] c"\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @puts(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %6
br label %8
8: ; preds = %25, %2
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %28
12: ; preds = %8
%13 = load i32, i32* %6
%14 = icmp sgt i32 %13, 1
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* @stdout
%17 = call i32 @putc(i32 32, i32 %16)
br label %18
18: ; preds = %15, %12
%19 = load i8**, i8*** %5
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = load i8*, i8** %22
%24 = call i32 @puts(i8* %23)
br label %25
25: ; preds = %18
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %8
28: ; preds = %8
%29 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
br label %30
30: ; preds = %56, %28
%31 = load i32, i32* @stdin
%32 = call i32 @getc(i32 %31)
store i32 %32, i32* %6
%33 = load i32, i32* %6
%34 = call signext i8 @tolower(i32 %33)
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 121
br i1 %36, label %42, label %37
37: ; preds = %30
%38 = load i32, i32* %6
%39 = call signext i8 @tolower(i32 %38)
%40 = sext i8 %39 to i32
%41 = icmp eq i32 %40, 110
br i1 %41, label %42, label %53
42: ; preds = %37, %30
%43 = load i32, i32* %6
%44 = load i32, i32* @stdout
%45 = call i32 @putc(i32 %43, i32 %44)
%46 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%47 = load i32, i32* %6
%48 = call signext i8 @tolower(i32 %47)
%49 = sext i8 %48 to i32
%50 = icmp eq i32 %49, 121
%51 = zext i1 %50 to i64
%52 = select i1 %50, i32 0, i32 1
ret i32 %52
53: ; preds = %37
%54 = load i32, i32* @stdout
%55 = call i32 @putc(i32 7, i32 %54)
br label %56
56: ; preds = %53
br label %30
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
@stdout = global i32 0
@.str.1 = [9 x i8] c"? [y/n] \00"
@stdin = global i32 0
@.str.2 = [3 x i8] c"\0A\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %20
5: ; preds = %2
%6 = zext i32 %0 to i64
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = tail call i32 @puts(i8* dereferenceable(1) %8)
%10 = icmp eq i32 %0, 2
br i1 %10, label %20, label %11
11: ; preds = %5, %11
%12 = phi i64 [ %18, %11 ], [ 2, %5 ]
%13 = load i32, i32* @stdout
%14 = tail call i32 @putc(i32 32, i32 %13)
%15 = getelementptr inbounds i8*, i8** %1, i64 %12
%16 = load i8*, i8** %15
%17 = tail call i32 @puts(i8* dereferenceable(1) %16)
%18 = add nuw nsw i64 %12, 1
%19 = icmp eq i64 %18, %6
br i1 %19, label %20, label %11
20: ; preds = %11, %5, %2
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%22 = load i32, i32* @stdin
%23 = tail call i32 @getc(i32 %22)
%24 = tail call signext i8 @tolower(i32 %23)
%25 = icmp eq i8 %24, 121
br i1 %25, label %30, label %26
26: ; preds = %20, %38
%27 = phi i32 [ %42, %38 ], [ %23, %20 ]
%28 = tail call signext i8 @tolower(i32 %27)
%29 = icmp eq i8 %28, 110
br i1 %29, label %30, label %38
30: ; preds = %38, %26, %20
%31 = phi i32 [ %23, %20 ], [ %27, %26 ], [ %42, %38 ]
%32 = load i32, i32* @stdout
%33 = tail call i32 @putc(i32 %31, i32 %32)
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%35 = tail call signext i8 @tolower(i32 %31)
%36 = icmp ne i8 %35, 121
%37 = zext i1 %36 to i32
ret i32 %37
38: ; preds = %26
%39 = load i32, i32* @stdout
%40 = tail call i32 @putc(i32 7, i32 %39)
%41 = load i32, i32* @stdin
%42 = tail call i32 @getc(i32 %41)
%43 = tail call signext i8 @tolower(i32 %42)
%44 = icmp eq i8 %43, 121
br i1 %44, label %30, label %26
}