#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*/ kontrolYap(int);
int koseKontrol(int);
int oyunBitis();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ system(char *);
int /*<<< orphan*/ tabloCiz();
int /*<<< orphan*/ tabloYaz();
int tasKontrol(int);
int main() {
  int secim = 1;
  while (secim == 1) {
    tabloCiz();
    tabloYaz();
    int kontrol = 1;
    int rakam;
    while (kontrol == 1) {
      printf("\nLutfen hareket ettirmek istediginiz rakami seciniz...:");
      scanf("%d", &rakam);
      int index = koseKontrol(rakam);
      if (tasKontrol(index) == 1) {
        kontrolYap(rakam);
        tabloYaz();
        if (oyunBitis() == 1) {
          tabloYaz();
          printf(
              "Tebrikler oyunu bitirdiniz.Tekrar oynamak ister misiniz(1/0)?");
          scanf("%d", &secim);
          break;
        }
      } else {
        printf("\n\n%d hareket edemez!\n\n", rakam);
      }
    }
  }
  system("PAUSE");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1272 <main+0xe2>
mov    $0x0,%al
call   1070 <tabloCiz@plt>
mov    $0x0,%al
call   1080 <tabloYaz@plt>
movl   $0x1,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    126d <main+0xdd>
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe54(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1090 <scanf@plt>
mov    -0x10(%rbp),%edi
call   1040 <koseKontrol@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   10a0 <tasKontrol@plt>
cmp    $0x1,%eax
jne    1257 <main+0xc7>
mov    -0x10(%rbp),%edi
call   1030 <kontrolYap@plt>
mov    $0x0,%al
call   1080 <tabloYaz@plt>
mov    $0x0,%al
call   10b0 <oyunBitis@plt>
cmp    $0x1,%eax
jne    1252 <main+0xc2>
mov    $0x0,%al
call   1080 <tabloYaz@plt>
lea    0xe05(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xdf4(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1090 <scanf@plt>
jmp    126d <main+0xdd>
jmp    1268 <main+0xd8>
mov    -0x10(%rbp),%esi
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    11c5 <main+0x35>
jmp    11a6 <main+0x16>
lea    0xe17(%rip),%rdi
call   1050 <system@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x1,0x4(%rsp)
lea    0xe56(%rip),%r14
lea    0xe87(%rip),%rbx
mov    %rsp,%r15
lea    0xe80(%rip),%r12
lea    0x4(%rsp),%r13
lea    0xeb2(%rip),%rbp
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <tabloCiz@plt>
xor    %eax,%eax
call   1080 <tabloYaz@plt>
jmp    11ea <main+0x5a>
mov    %rbp,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1090 <scanf@plt>
mov    (%rsp),%edi
call   1040 <koseKontrol@plt>
mov    %eax,%edi
call   10a0 <tasKontrol@plt>
mov    (%rsp),%esi
cmp    $0x1,%eax
jne    11e0 <main+0x50>
mov    %esi,%edi
call   1030 <kontrolYap@plt>
xor    %eax,%eax
call   1080 <tabloYaz@plt>
xor    %eax,%eax
call   10b0 <oyunBitis@plt>
cmp    $0x1,%eax
jne    11ea <main+0x5a>
xor    %eax,%eax
call   1080 <tabloYaz@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1090 <scanf@plt>
cmpl   $0x1,0x4(%rsp)
je     11d0 <main+0x40>
lea    0xe32(%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 = [56 x i8] c"\0ALutfen hareket ettirmek istediginiz rakami seciniz...:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [62 x i8] c"Tebrikler oyunu bitirdiniz.Tekrar oynamak ister misiniz(1/0)?\00"
@.str.3 = [23 x i8] c"\0A\0A%d hareket edemez!\0A\0A\00"
@.str.4 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %6
6: ; preds = %38, %0
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %39
9: ; preds = %6
%10 = call i32 (...) @tabloCiz()
%11 = call i32 (...) @tabloYaz()
store i32 1, i32* %3
br label %12
12: ; preds = %37, %9
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 1
br i1 %14, label %15, label %38
15: ; preds = %12
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%18 = load i32, i32* %4
%19 = call i32 @koseKontrol(i32 %18)
store i32 %19, i32* %5
%20 = load i32, i32* %5
%21 = call i32 @tasKontrol(i32 %20)
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %34
23: ; preds = %15
%24 = load i32, i32* %4
%25 = call i32 @kontrolYap(i32 %24)
%26 = call i32 (...) @tabloYaz()
%27 = call i32 (...) @oyunBitis()
%28 = icmp eq i32 %27, 1
br i1 %28, label %29, label %33
29: ; preds = %23
%30 = call i32 (...) @tabloYaz()
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %38
33: ; preds = %23
br label %37
34: ; preds = %15
%35 = load i32, i32* %4
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %35)
br label %37
37: ; preds = %34, %33
br label %12
38: ; preds = %29, %12
br label %6
39: ; preds = %6
%40 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [56 x i8] c"\0ALutfen hareket ettirmek istediginiz rakami seciniz...:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [62 x i8] c"Tebrikler oyunu bitirdiniz.Tekrar oynamak ister misiniz(1/0)?\00"
@.str.3 = [23 x i8] c"\0A\0A%d hareket edemez!\0A\0A\00"
@.str.4 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %0, %24
%6 = call i32 (...) @tabloCiz()
%7 = call i32 (...) @tabloYaz()
br label %8
8: ; preds = %23, %5
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%11 = load i32, i32* %2
%12 = call i32 @koseKontrol(i32 %11)
%13 = call i32 @tasKontrol(i32 %12)
%14 = icmp eq i32 %13, 1
%15 = load i32, i32* %2
br i1 %14, label %16, label %21
16: ; preds = %8
%17 = call i32 @kontrolYap(i32 %15)
%18 = call i32 (...) @tabloYaz()
%19 = call i32 (...) @oyunBitis()
%20 = icmp eq i32 %19, 1
br i1 %20, label %24, label %23
21: ; preds = %8
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %15)
br label %23
23: ; preds = %21, %16
br label %8
24: ; preds = %16
%25 = call i32 (...) @tabloYaz()
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.2, i64 0, i64 0))
%27 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%28 = load i32, i32* %1
%29 = icmp eq i32 %28, 1
br i1 %29, label %5, label %30
30: ; preds = %24
%31 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}