#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*/ dev_mode();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ system(char *);
int ana_menu() {
  char ana_menu_secim = '\0';
  while (ana_menu_secim != 'Q') {
    system("clear");
    printf("ANA MENU\n--------\n");
    printf("[A] Hatirlatmalar\n");
    printf("\n[Q] EXIT\n");
    ana_menu_secim = '\0';
    printf("\n");
    printf("Seciminiz: ");
    scanf(" %c", &ana_menu_secim);
    switch (ana_menu_secim) {
    case 'A':;
      break;
    case 'Q': {
      printf("DUYURU: Cikis yapiyorum");
      fflush(stdout);
      system("sleep 1");
      return 0;
    } break;
    case '.':
      dev_mode();
      break;
    default: {
      printf("DUYURU: HATALI SECIM!!!\n");
      fflush(stdout);
      system("sleep 2");
    }
    }
  }
}


x86 assembly (clang, -O0):
<ana_menu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x51,%eax
je     126a <ana_menu+0x11a>
lea    0xe90(%rip),%rdi
call   1030 <system@plt>
lea    0xe8a(%rip),%rdi
call   1040 <printf@plt>
lea    0xe91(%rip),%rdi
call   1040 <printf@plt>
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
movb   $0x0,-0x5(%rbp)
lea    0xeda(%rip),%rdi
call   1040 <printf@plt>
lea    0xe87(%rip),%rdi
call   1040 <printf@plt>
lea    0xe87(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1060 <scanf@plt>
movsbl -0x5(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x2e,%eax
je     1233 <ana_menu+0xe3>
jmp    11da <ana_menu+0x8a>
mov    -0xc(%rbp),%eax
sub    $0x41,%eax
je     11fc <ana_menu+0xac>
jmp    11eb <ana_menu+0x9b>
mov    -0xc(%rbp),%eax
sub    $0x51,%eax
je     1201 <ana_menu+0xb1>
jmp    123f <ana_menu+0xef>
jmp    1265 <ana_menu+0x115>
lea    0xe3f(%rip),%rdi
call   1040 <printf@plt>
mov    0x2dcc(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xe3d(%rip),%rdi
call   1030 <system@plt>
movl   $0x0,-0x4(%rbp)
jmp    126a <ana_menu+0x11a>
mov    $0x0,%al
call   1070 <dev_mode@plt>
jmp    1265 <ana_menu+0x115>
lea    0xe21(%rip),%rdi
call   1040 <printf@plt>
mov    0x2d8e(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    0xe20(%rip),%rdi
call   1030 <system@plt>
jmp    115c <ana_menu+0xc>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ana_menu>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movb   $0x0,0x7(%rsp)
lea    0xeb7(%rip),%r15
lea    0xec2(%rip),%r12
lea    0xecd(%rip),%r13
lea    0xe6a(%rip),%rbx
lea    0xe6f(%rip),%rbp
lea    0x7(%rsp),%r14
jmp    11c4 <ana_menu+0x54>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1090 <dev_mode@plt>
movzbl 0x7(%rsp),%eax
cmp    $0x51,%al
je     1272 <ana_menu+0x102>
lea    0xe35(%rip),%rdi
call   1050 <system@plt>
mov    %r15,%rdi
call   1040 <puts@plt>
mov    %r12,%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
call   1040 <puts@plt>
movb   $0x0,0x7(%rsp)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
call   1060 <printf@plt>
mov    %rbp,%rdi
mov    %r14,%rsi
call   1080 <scanf@plt>
movzbl 0x7(%rsp),%eax
movsbl %al,%ecx
cmp    $0x2e,%ecx
je     11b0 <ana_menu+0x40>
cmp    $0x41,%ecx
je     11bc <ana_menu+0x4c>
cmp    $0x51,%ecx
je     124c <ana_menu+0xdc>
lea    0xe44(%rip),%rdi
call   1040 <puts@plt>
mov    0x2dac(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
lea    0xdf4(%rip),%rdi
call   1050 <system@plt>
jmp    11b7 <ana_menu+0x47>
lea    0xdc3(%rip),%rdi
call   1060 <printf@plt>
mov    0x2d81(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
lea    0xdc1(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"clear\00"
@.str.1 = [19 x i8] c"ANA MENU\0A--------\0A\00"
@.str.2 = [19 x i8] c"[A] Hatirlatmalar\0A\00"
@.str.3 = [11 x i8] c"\0A[Q] EXIT\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [12 x i8] c"Seciminiz: \00"
@.str.6 = [4 x i8] c" %c\00"
@.str.7 = [24 x i8] c"DUYURU: Cikis yapiyorum\00"
@stdout = global i32 0
@.str.8 = [8 x i8] c"sleep 1\00"
@.str.9 = [25 x i8] c"DUYURU: HATALI SECIM!!!\0A\00"
@.str.10 = [8 x i8] c"sleep 2\00"
define i32 @ana_menu() {
%1 = alloca i32
%2 = alloca i8
store i8 0, i8* %2
br label %3
3: ; preds = %30, %0
%4 = load i8, i8* %2
%5 = sext i8 %4 to i32
%6 = icmp ne i32 %5, 81
br i1 %6, label %7, label %31
7: ; preds = %3
%8 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
store i8 0, i8* %2
%12 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %2)
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
switch i32 %16, label %25 [
i32 65, label %17
i32 81, label %18
i32 46, label %23
]
17: ; preds = %7
br label %30
18: ; preds = %7
%19 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%20 = load i32, i32* @stdout
%21 = call i32 @fflush(i32 %20)
%22 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %1
br label %31
23: ; preds = %7
%24 = call i32 (...) @dev_mode()
br label %30
25: ; preds = %7
%26 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0))
%27 = load i32, i32* @stdout
%28 = call i32 @fflush(i32 %27)
%29 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
br label %30
30: ; preds = %25, %23, %17
br label %3
31: ; preds = %18, %3
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
@.str = [6 x i8] c"clear\00"
@.str.5 = [12 x i8] c"Seciminiz: \00"
@.str.6 = [4 x i8] c" %c\00"
@.str.7 = [24 x i8] c"DUYURU: Cikis yapiyorum\00"
@stdout = global i32 0
@.str.8 = [8 x i8] c"sleep 1\00"
@.str.10 = [8 x i8] c"sleep 2\00"
@str = [18 x i8] c"ANA MENU\0A--------\00"
@str.11 = [18 x i8] c"[A] Hatirlatmalar\00"
@str.12 = [10 x i8] c"\0A[Q] EXIT\00"
@str.13 = [24 x i8] c"DUYURU: HATALI SECIM!!!\00"
define i32 @ana_menu() {
%1 = alloca i8
store i8 0, i8* %1
br label %2
2: ; preds = %0, %26
%3 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%5 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.11, i64 0, i64 0))
%6 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.12, i64 0, i64 0))
store i8 0, i8* %1
%7 = call i32 @putchar(i32 10)
%8 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %1)
%10 = load i8, i8* %1
%11 = sext i8 %10 to i32
switch i32 %11, label %19 [
i32 65, label %26
i32 81, label %12
i32 46, label %17
]
12: ; preds = %2
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%14 = load i32, i32* @stdout
%15 = call i32 @fflush(i32 %14)
%16 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
br label %29
17: ; preds = %2
%18 = call i32 (...) @dev_mode()
br label %24
19: ; preds = %2
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.13, i64 0, i64 0))
%21 = load i32, i32* @stdout
%22 = call i32 @fflush(i32 %21)
%23 = call i32 @system(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.10, i64 0, i64 0))
br label %24
24: ; preds = %17, %19
%25 = load i8, i8* %1
br label %26
26: ; preds = %24, %2
%27 = phi i8 [ %25, %24 ], [ %10, %2 ]
%28 = icmp eq i8 %27, 81
br i1 %28, label %29, label %2
29: ; preds = %26, %12
ret i32 0
}