#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*/ fpurge(int /*<<< orphan*/);
char getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdin;
int main() {
  char ch;
  printf("Would you like me to send your password to the bad guys?\n");
  for (;;) {
    puts("\nEnter Yes or No: (Y/N)");
    ch = getchar();
    if (ch == 'N') {
      printf("Well, then:your password is safe ! \n");
    } else if (ch == 'n') {
      printf("Well, then:your password is safe ! \n ");
    } else if (ch == 'Y') {
      printf("Okay.Sending your password ! \n ");
    } else if (ch == 'y') {
      printf("Okay.Sending your password ! \n ");
    } else {
      printf("You must enter Y or N ! \n");
    }
    fpurge(stdin);
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x4e,%eax
jne    118f <main+0x4f>
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
jmp    1204 <main+0xc4>
movsbl -0x5(%rbp),%eax
cmp    $0x6e,%eax
jne    11ad <main+0x6d>
lea    0xed4(%rip),%rdi
call   1040 <printf@plt>
jmp    11ff <main+0xbf>
movsbl -0x5(%rbp),%eax
cmp    $0x59,%eax
jne    11cb <main+0x8b>
lea    0xedc(%rip),%rdi
call   1040 <printf@plt>
jmp    11fa <main+0xba>
movsbl -0x5(%rbp),%eax
cmp    $0x79,%eax
jne    11e9 <main+0xa9>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
jmp    11f5 <main+0xb5>
lea    0xecd(%rip),%rdi
call   1040 <printf@plt>
jmp    11fa <main+0xba>
jmp    11ff <main+0xbf>
jmp    1204 <main+0xc4>
mov    0x2ddd(%rip),%rax
mov    (%rax),%edi
call   1060 <fpurge@plt>
jmp    115b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xf0c(%rip),%rdi
call   1030 <puts@plt>
lea    0xea2(%rip),%rbx
lea    0xf4b(%rip),%r14
lea    0xed2(%rip),%r15
mov    0x2e75(%rip),%rbp
lea    0xf1d(%rip),%r12
lea    0xe97(%rip),%r13
jmp    11a0 <main+0x60>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15,%rdi
call   1040 <printf@plt>
mov    0x0(%rbp),%edi
call   1060 <fpurge@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
cmp    $0x6d,%al
jg     11c0 <main+0x80>
cmp    $0x4e,%al
je     11e0 <main+0xa0>
cmp    $0x59,%al
je     1190 <main+0x50>
jmp    11c8 <main+0x88>
nopl   (%rax)
cmp    $0x6e,%al
je     11f0 <main+0xb0>
cmp    $0x79,%al
je     1190 <main+0x50>
mov    %r12,%rdi
call   1030 <puts@plt>
jmp    1198 <main+0x58>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <puts@plt>
jmp    1198 <main+0x58>
nopw   0x0(%rax,%rax,1)
mov    %r13,%rdi
jmp    1193 <main+0x53>

LLVM IR (-O0):
@.str = [58 x i8] c"Would you like me to send your password to the bad guys?\0A\00"
@.str.1 = [24 x i8] c"\0AEnter Yes or No: (Y/N)\00"
@.str.2 = [37 x i8] c"Well, then:your password is safe ! \0A\00"
@.str.3 = [38 x i8] c"Well, then:your password is safe ! \0A \00"
@.str.4 = [32 x i8] c"Okay.Sending your password ! \0A \00"
@.str.5 = [26 x i8] c"You must enter Y or N ! \0A\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
br label %4
4: ; preds = %35, %0
%5 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%6 = call signext i8 (...) @getchar()
store i8 %6, i8* %2
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 78
br i1 %9, label %10, label %12
10: ; preds = %4
%11 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %35
12: ; preds = %4
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 110
br i1 %15, label %16, label %18
16: ; preds = %12
%17 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
br label %34
18: ; preds = %12
%19 = load i8, i8* %2
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %20, 89
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
br label %33
24: ; preds = %18
%25 = load i8, i8* %2
%26 = sext i8 %25 to i32
%27 = icmp eq i32 %26, 121
br i1 %27, label %28, label %30
28: ; preds = %24
%29 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
br label %32
30: ; preds = %24
%31 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
br label %32
32: ; preds = %30, %28
br label %33
33: ; preds = %32, %22
br label %34
34: ; preds = %33, %16
br label %35
35: ; preds = %34, %10
%36 = load i32, i32* @stdin
%37 = call i32 @fpurge(i32 %36)
br label %4
}

LLVM IR (-O2):
@.str.1 = [24 x i8] c"\0AEnter Yes or No: (Y/N)\00"
@.str.3 = [38 x i8] c"Well, then:your password is safe ! \0A \00"
@.str.4 = [32 x i8] c"Okay.Sending your password ! \0A \00"
@stdin = global i32 0
@str = [57 x i8] c"Would you like me to send your password to the bad guys?\00"
@str.6 = [25 x i8] c"You must enter Y or N ! \00"
@str.7 = [36 x i8] c"Well, then:your password is safe ! \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %15, %0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call signext i8 (...) @getchar()
switch i8 %4, label %13 [
i8 78, label %5
i8 110, label %7
i8 89, label %9
i8 121, label %11
]
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.7, i64 0, i64 0))
br label %15
7: ; preds = %2
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
br label %15
9: ; preds = %2
%10 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
br label %15
11: ; preds = %2
%12 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
br label %15
13: ; preds = %2
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.6, i64 0, i64 0))
br label %15
15: ; preds = %7, %11, %13, %9, %5
%16 = load i32, i32* @stdin
%17 = tail call i32 @fpurge(i32 %16)
br label %2
}