#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 getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ prog();
int main() {
  int fir = 1;
  char c;
  while (1) {
    if (fir) {
      prog();
      fir = 0;
    } else {
      printf("\nDo you want to continue(Y/N)");
      if ((c = getchar()) == 'Y' || c == 'y') {
        getchar();
        prog();
      } else if (c == 'N' || c == 'n') {
        printf("\nGood Bye");
        break;
      } else
        printf("Don't understand that code\n");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1163 <main+0x33>
mov    $0x0,%al
call   1040 <prog@plt>
movl   $0x0,-0x8(%rbp)
jmp    11e6 <main+0xb6>
lea    0xe96(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0x59,%eax
je     1192 <main+0x62>
movsbl -0x9(%rbp),%eax
cmp    $0x79,%eax
jne    11a5 <main+0x75>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    $0x0,%al
call   1040 <prog@plt>
jmp    11e1 <main+0xb1>
movsbl -0x9(%rbp),%eax
cmp    $0x4e,%eax
je     11bf <main+0x8f>
movsbl -0x9(%rbp),%eax
cmp    $0x6e,%eax
jne    11d0 <main+0xa0>
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
jmp    11eb <main+0xbb>
lea    0xe51(%rip),%rdi
call   1030 <printf@plt>
jmp    11e1 <main+0xb1>
jmp    11e6 <main+0xb6>
jmp    1146 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1050 <prog@plt>
lea    0xeae(%rip),%rbx
lea    0xecf(%rip),%r14
jmp    116e <main+0x2e>
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
call   1050 <prog@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
and    $0xdf,%al
cmp    $0x59,%al
je     1160 <main+0x20>
cmp    $0x4e,%al
je     1191 <main+0x51>
mov    %r14,%rdi
call   1030 <puts@plt>
jmp    116e <main+0x2e>
lea    0xe86(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [30 x i8] c"\0ADo you want to continue(Y/N)\00"
@.str.1 = [10 x i8] c"\0AGood Bye\00"
@.str.2 = [28 x i8] c"Don't understand that code\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
store i32 1, i32* %2
br label %4
4: ; preds = %0, %35
%5 = load i32, i32* %2
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = call i32 (...) @prog()
store i32 0, i32* %2
br label %35
9: ; preds = %4
%10 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%11 = call signext i8 (...) @getchar()
store i8 %11, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 89
br i1 %13, label %18, label %14
14: ; preds = %9
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 121
br i1 %17, label %18, label %21
18: ; preds = %14, %9
%19 = call signext i8 (...) @getchar()
%20 = call i32 (...) @prog()
br label %34
21: ; preds = %14
%22 = load i8, i8* %3
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 78
br i1 %24, label %29, label %25
25: ; preds = %21
%26 = load i8, i8* %3
%27 = sext i8 %26 to i32
%28 = icmp eq i32 %27, 110
br i1 %28, label %29, label %31
29: ; preds = %25, %21
%30 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
br label %36
31: ; preds = %25
%32 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
br label %33
33: ; preds = %31
br label %34
34: ; preds = %33, %18
br label %35
35: ; preds = %34, %7
br label %4
36: ; preds = %29
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"\0ADo you want to continue(Y/N)\00"
@.str.1 = [10 x i8] c"\0AGood Bye\00"
@str = [27 x i8] c"Don't understand that code\00"
define i32 @main() {
%1 = tail call i32 (...) @prog()
br label %10
2: ; preds = %10
%3 = tail call signext i8 (...) @getchar()
%4 = tail call i32 (...) @prog()
br label %9
5: ; preds = %10
%6 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
7: ; preds = %10
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
br label %10
10: ; preds = %9, %0
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%12 = tail call signext i8 (...) @getchar()
%13 = and i8 %12, -33
switch i8 %13, label %7 [
i8 89, label %2
i8 78, label %5
]
}