#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*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char answer;
  printf("Is SP an easy course? (Y/N): ");
  scanf("%c", &answer);
  switch (answer) {
  case 'Y':
  case 'y':
    printf("I think so too!\n");
    break;
  case 'N':
  case 'n':
    printf("Really?\n");
    break;
  default:
    printf("Is this Yes or No?\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xedc(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x4e,%eax
je     11a4 <main+0x84>
jmp    1160 <main+0x40>
mov    -0xc(%rbp),%eax
sub    $0x59,%eax
je     1193 <main+0x73>
jmp    1171 <main+0x51>
mov    -0xc(%rbp),%eax
sub    $0x6e,%eax
je     11a4 <main+0x84>
jmp    1182 <main+0x62>
mov    -0xc(%rbp),%eax
sub    $0x79,%eax
jne    11b5 <main+0x95>
jmp    1193 <main+0x73>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
jmp    11c1 <main+0xa1>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
jmp    11c1 <main+0xa1>
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
call   1040 <printf@plt>
lea    0xeda(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
movsbl 0x7(%rsp),%eax
lea    0xecf(%rip),%rdi
cmp    $0x6d,%eax
jg     116b <main+0x3b>
cmp    $0x4e,%eax
je     1175 <main+0x45>
cmp    $0x59,%eax
je     1185 <main+0x55>
jmp    117e <main+0x4e>
cmp    $0x79,%eax
je     1185 <main+0x55>
cmp    $0x6e,%eax
jne    117e <main+0x4e>
lea    0xea5(%rip),%rdi
jmp    1185 <main+0x55>
lea    0xeb4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Is SP an easy course? (Y/N): \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [17 x i8] c"I think so too!\0A\00"
@.str.3 = [9 x i8] c"Really?\0A\00"
@.str.4 = [20 x i8] c"Is this Yes or No?\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
switch i32 %6, label %11 [
i32 89, label %7
i32 121, label %7
i32 78, label %9
i32 110, label %9
]
7: ; preds = %0, %0
%8 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %13
9: ; preds = %0, %0
%10 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
br label %13
13: ; preds = %11, %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"Is SP an easy course? (Y/N): \00"
@.str.1 = [3 x i8] c"%c\00"
@str = [8 x i8] c"Really?\00"
@str.5 = [16 x i8] c"I think so too!\00"
@str.6 = [19 x i8] c"Is this Yes or No?\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
switch i32 %5, label %7 [
i32 89, label %8
i32 121, label %8
i32 78, label %6
i32 110, label %6
]
6: ; preds = %0, %0
br label %8
7: ; preds = %0
br label %8
8: ; preds = %0, %0, %7, %6
%9 = phi i8* [ getelementptr inbounds ([19 x i8], [19 x i8]* @str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0), %6 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @str.5, i64 0, i64 0), %0 ], [ getelementptr inbounds ([16 x i8], [16 x i8]* @str.5, i64 0, i64 0), %0 ]
%10 = call i32 @puts(i8* dereferenceable(1) %9)
ret i32 0
}