#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*/ fflush(int /*<<< orphan*/);
char getchar();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stdin;
int main() {
  int done;
  char ch;
  done = 0;
  printf("Would you like me to send your password to bad persons?\n");
  while (!done) {
    printf("Enter Y or N (Y/N)? : ");
    ch = getchar();
    switch (ch) {
    case 'N':
    case 'n':
      printf("Okay, then your password is safe!\n\n");
      done = !0;
      break;
    case 'Y':
    case 'y':
      printf("Okey.. if you say so...\n\t..Password sent!\n\n");
      done = !0;
      break;
    default:
      printf("You must enter Y or N!\a\n\n\v");
      fflush(stdin);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1168 <main+0x38>
jmp    1215 <main+0xe5>
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x4e,%eax
je     11c6 <main+0x96>
jmp    1193 <main+0x63>
mov    -0x10(%rbp),%eax
sub    $0x59,%eax
je     11de <main+0xae>
jmp    11a4 <main+0x74>
mov    -0x10(%rbp),%eax
sub    $0x6e,%eax
je     11c6 <main+0x96>
jmp    11b5 <main+0x85>
mov    -0x10(%rbp),%eax
sub    $0x79,%eax
je     11de <main+0xae>
jmp    11f6 <main+0xc6>
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
jmp    1210 <main+0xe0>
lea    0xe8f(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x8(%rbp)
jmp    1210 <main+0xe0>
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ddf(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
jmp    1152 <main+0x22>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rbx
lea    0xeb8(%rip),%r14
mov    0x2e82(%rip),%r15
jmp    1180 <main+0x40>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1040 <printf@plt>
mov    (%r15),%edi
call   1060 <fflush@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
movsbl %al,%eax
cmp    $0x6d,%eax
jg     11b0 <main+0x70>
cmp    $0x4e,%eax
je     11c3 <main+0x83>
cmp    $0x59,%eax
jne    1170 <main+0x30>
jmp    11ba <main+0x7a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    $0x6e,%eax
je     11c3 <main+0x83>
cmp    $0x79,%eax
jne    1170 <main+0x30>
lea    0xea9(%rip),%rdi
jmp    11ca <main+0x8a>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [57 x i8] c"Would you like me to send your password to bad persons?\0A\00"
@.str.1 = [23 x i8] c"Enter Y or N (Y/N)? : \00"
@.str.2 = [36 x i8] c"Okay, then your password is safe!\0A\0A\00"
@.str.3 = [44 x i8] c"Okey.. if you say so...\0A\09..Password sent!\0A\0A\00"
@.str.4 = [27 x i8] c"You must enter Y or N!\07\0A\0A\0B\00"
@stdin = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
store i32 0, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str, i64 0, i64 0))
br label %5
5: ; preds = %22, %0
%6 = load i32, i32* %2
%7 = icmp ne i32 %6, 0
%8 = xor i1 %7, true
br i1 %8, label %9, label %23
9: ; preds = %5
%10 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%11 = call signext i8 (...) @getchar()
store i8 %11, i8* %3
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
switch i32 %13, label %18 [
i32 78, label %14
i32 110, label %14
i32 89, label %16
i32 121, label %16
]
14: ; preds = %9, %9
%15 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
store i32 1, i32* %2
br label %22
16: ; preds = %9, %9
%17 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
store i32 1, i32* %2
br label %22
18: ; preds = %9
%19 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%20 = load i32, i32* @stdin
%21 = call i32 @fflush(i32 %20)
br label %22
22: ; preds = %18, %16, %14
br label %5
23: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [23 x i8] c"Enter Y or N (Y/N)? : \00"
@.str.4 = [27 x i8] c"You must enter Y or N!\07\0A\0A\0B\00"
@stdin = global i32 0
@str = [56 x i8] c"Would you like me to send your password to bad persons?\00"
@str.5 = [43 x i8] c"Okey.. if you say so...\0A\09..Password sent!\0A\00"
@str.6 = [35 x i8] c"Okay, then your password is safe!\0A\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %6, %0
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call signext i8 (...) @getchar()
%5 = sext i8 %4 to i32
switch i32 %5, label %6 [
i32 78, label %11
i32 110, label %11
i32 89, label %10
i32 121, label %10
]
6: ; preds = %2
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
%8 = load i32, i32* @stdin
%9 = tail call i32 @fflush(i32 %8)
br label %2
10: ; preds = %2, %2
br label %11
11: ; preds = %2, %2, %10
%12 = phi i8* [ getelementptr inbounds ([43 x i8], [43 x i8]* @str.5, i64 0, i64 0), %10 ], [ getelementptr inbounds ([35 x i8], [35 x i8]* @str.6, i64 0, i64 0), %2 ], [ getelementptr inbounds ([35 x i8], [35 x i8]* @str.6, i64 0, i64 0), %2 ]
%13 = tail call i32 @puts(i8* dereferenceable(1) %12)
ret i32 0
}