#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*/ ara();
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ giris();
int /*<<< orphan*/ guncelle();
int /*<<< orphan*/ kaydet();
int /*<<< orphan*/ listele();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sahibineGoreListele();
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ yazdir();
int main() {
  while (1) {
    giris();
    int komut;
    printf("Komut numarasi: ");
    scanf("%d", &komut);
    switch (komut) {
    case 0:
      printf("Program sonlandiriliyor, iyi gunler dileriz...");
      exit(-1);
    case 1:
      kaydet();
      break;
    case 2:
      guncelle();
      break;
    case 3:
      listele();
      break;
    case 4:
      ara();
      break;
    case 5:
      sahibineGoreListele();
      break;
    case 6:
      yazdir();
      break;
    default:
      printf("Komut bulunamadi, tekrar deneyin!\n");
      break;
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
call   10a0 <giris@plt>
lea    0xe5f(%rip),%rdi
call   1040 <printf@plt>
lea    0xe64(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1070 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x6,%rax
ja     1255 <main+0xb5>
mov    -0x10(%rbp),%rax
lea    0xe12(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe32(%rip),%rdi
call   1040 <printf@plt>
mov    $0xffffffff,%edi
call   10c0 <exit@plt>
mov    $0x0,%al
call   1080 <kaydet@plt>
jmp    1261 <main+0xc1>
mov    $0x0,%al
call   1090 <guncelle@plt>
jmp    1261 <main+0xc1>
mov    $0x0,%al
call   10b0 <listele@plt>
jmp    1261 <main+0xc1>
mov    $0x0,%al
call   1060 <ara@plt>
jmp    1261 <main+0xc1>
mov    $0x0,%al
call   1050 <sahibineGoreListele@plt>
jmp    1261 <main+0xc1>
mov    $0x0,%al
call   1030 <yazdir@plt>
jmp    1261 <main+0xc1>
lea    0xe03(%rip),%rdi
call   1040 <printf@plt>
jmp    11af <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xe58(%rip),%r14
lea    0xe62(%rip),%r15
lea    0xc(%rsp),%r13
lea    0xe88(%rip),%r12
lea    0xe22(%rip),%rbx
jmp    11f0 <main+0x40>
xor    %eax,%eax
call   1030 <yazdir@plt>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   10b0 <giris@plt>
mov    %r14,%rdi
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %r13,%rsi
call   1080 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x6,%rax
ja     1226 <main+0x76>
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
jmp    *%rax
xor    %eax,%eax
call   1090 <kaydet@plt>
jmp    11f0 <main+0x40>
mov    %r12,%rdi
call   1040 <puts@plt>
jmp    11f0 <main+0x40>
xor    %eax,%eax
call   10a0 <guncelle@plt>
jmp    11f0 <main+0x40>
xor    %eax,%eax
call   10c0 <listele@plt>
jmp    11f0 <main+0x40>
xor    %eax,%eax
call   1070 <ara@plt>
jmp    11f0 <main+0x40>
xor    %eax,%eax
call   1060 <sahibineGoreListele@plt>
jmp    11f0 <main+0x40>
lea    0xdd5(%rip),%rdi
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   10d0 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"Komut numarasi: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [47 x i8] c"Program sonlandiriliyor, iyi gunler dileriz...\00"
@.str.3 = [35 x i8] c"Komut bulunamadi, tekrar deneyin!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %0, %25
%4 = call i32 (...) @giris()
%5 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
switch i32 %7, label %23 [
i32 0, label %8
i32 1, label %11
i32 2, label %13
i32 3, label %15
i32 4, label %17
i32 5, label %19
i32 6, label %21
]
8: ; preds = %3
%9 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %3
%12 = call i32 (...) @kaydet()
br label %25
13: ; preds = %3
%14 = call i32 (...) @guncelle()
br label %25
15: ; preds = %3
%16 = call i32 (...) @listele()
br label %25
17: ; preds = %3
%18 = call i32 (...) @ara()
br label %25
19: ; preds = %3
%20 = call i32 (...) @sahibineGoreListele()
br label %25
21: ; preds = %3
%22 = call i32 (...) @yazdir()
br label %25
23: ; preds = %3
%24 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %23, %21, %19, %17, %15, %13, %11
br label %3
}

LLVM IR (-O2):
@.str = [17 x i8] c"Komut numarasi: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [47 x i8] c"Program sonlandiriliyor, iyi gunler dileriz...\00"
@str = [34 x i8] c"Komut bulunamadi, tekrar deneyin!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %0, %25
%4 = call i32 (...) @giris()
%5 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
switch i32 %7, label %23 [
i32 0, label %8
i32 1, label %11
i32 2, label %13
i32 3, label %15
i32 4, label %17
i32 5, label %19
i32 6, label %21
]
8: ; preds = %3
%9 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 @exit(i32 -1)
unreachable
11: ; preds = %3
%12 = call i32 (...) @kaydet()
br label %25
13: ; preds = %3
%14 = call i32 (...) @guncelle()
br label %25
15: ; preds = %3
%16 = call i32 (...) @listele()
br label %25
17: ; preds = %3
%18 = call i32 (...) @ara()
br label %25
19: ; preds = %3
%20 = call i32 (...) @sahibineGoreListele()
br label %25
21: ; preds = %3
%22 = call i32 (...) @yazdir()
br label %25
23: ; preds = %3
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %25
25: ; preds = %23, %21, %19, %17, %15, %13, %11
br label %3
}