#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 odgovor;
  printf("Dali SP e lesen predmet? (d/n): ");
  scanf("%c", &odgovor);
  switch (odgovor) {
  case 'D':
  case 'd':
    printf("I jas mislam taka!\n");
    break;
  case 'N':
  case 'n':
    printf("Navistina?\n");
    break;
  default:
    printf("Ova e DA ili NE?\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    0xedf(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x44,%eax
je     1193 <main+0x73>
jmp    1160 <main+0x40>
mov    -0xc(%rbp),%eax
sub    $0x4e,%eax
je     11a4 <main+0x84>
jmp    1171 <main+0x51>
mov    -0xc(%rbp),%eax
sub    $0x64,%eax
je     1193 <main+0x73>
jmp    1182 <main+0x62>
mov    -0xc(%rbp),%eax
sub    $0x6e,%eax
je     11a4 <main+0x84>
jmp    11b5 <main+0x95>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
jmp    11c1 <main+0xa1>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
jmp    11c1 <main+0xa1>
lea    0xe88(%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    0xedd(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
movsbl 0x7(%rsp),%eax
lea    0xed5(%rip),%rdi
cmp    $0x63,%eax
jg     1172 <main+0x42>
cmp    $0x44,%eax
je     1183 <main+0x53>
cmp    $0x4e,%eax
je     117c <main+0x4c>
lea    0xed2(%rip),%rdi
jmp    1183 <main+0x53>
cmp    $0x64,%eax
je     1183 <main+0x53>
cmp    $0x6e,%eax
jne    1169 <main+0x39>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Dali SP e lesen predmet? (d/n): \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [20 x i8] c"I jas mislam taka!\0A\00"
@.str.3 = [12 x i8] c"Navistina?\0A\00"
@.str.4 = [18 x i8] c"Ova e DA ili NE?\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 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 68, label %7
i32 100, label %7
i32 78, label %9
i32 110, label %9
]
7: ; preds = %0, %0
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %13
9: ; preds = %0, %0
%10 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
br label %13
13: ; preds = %11, %9, %7
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"Dali SP e lesen predmet? (d/n): \00"
@.str.1 = [3 x i8] c"%c\00"
@str = [11 x i8] c"Navistina?\00"
@str.5 = [19 x i8] c"I jas mislam taka!\00"
@str.6 = [17 x i8] c"Ova e DA ili NE?\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 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 68, label %8
i32 100, 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 ([17 x i8], [17 x i8]* @str.6, i64 0, i64 0), %7 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0), %6 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0), %0 ], [ getelementptr inbounds ([19 x i8], [19 x i8]* @str.5, i64 0, i64 0), %0 ]
%10 = call i32 @puts(i8* dereferenceable(1) %9)
ret i32 0
}