#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 ask();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int main() {
  char key;
  printf("Would you like me to send you to the menu?");
  key = ask();
  if (key == 'Y')
    return 0;
  printf("Would you really like to see the menu? %c\n\n", 1);
  key = ask();
  if (key == 'Y') {
    puts("Someday the menu will appear here...");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <ask@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x59,%eax
jne    1170 <main+0x40>
movl   $0x0,-0x4(%rbp)
jmp    11ad <main+0x7d>
lea    0xeb4(%rip),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1040 <ask@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x59,%eax
jne    11a6 <main+0x76>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <ask@plt>
cmp    $0x59,%al
je     1174 <main+0x44>
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1040 <ask@plt>
cmp    $0x59,%al
jne    1174 <main+0x44>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"Would you like me to send you to the menu?\00"
@.str.1 = [44 x i8] c"Would you really like to see the menu? %c\0A\0A\00"
@.str.2 = [37 x i8] c"Someday the menu will appear here...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%4 = call signext i8 (...) @ask()
store i8 %4, i8* %2
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 89
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 0, i32* %1
br label %18
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 1)
%11 = call signext i8 (...) @ask()
store i8 %11, i8* %2
%12 = load i8, i8* %2
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 89
br i1 %14, label %15, label %17
15: ; preds = %9
%16 = call i32 @puts(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %17
17: ; preds = %15, %9
store i32 0, i32* %1
br label %18
18: ; preds = %17, %8
%19 = load i32, i32* %1
ret i32 %19
}

LLVM IR (-O2):
@.str = [43 x i8] c"Would you like me to send you to the menu?\00"
@.str.1 = [44 x i8] c"Would you really like to see the menu? %c\0A\0A\00"
@.str.2 = [37 x i8] c"Someday the menu will appear here...\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%2 = tail call signext i8 (...) @ask()
%3 = icmp eq i8 %2, 89
br i1 %3, label %10, label %4
4: ; preds = %0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.1, i64 0, i64 0), i32 1)
%6 = tail call signext i8 (...) @ask()
%7 = icmp eq i8 %6, 89
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.2, i64 0, i64 0))
br label %10
10: ; preds = %4, %8, %0
ret i32 0
}