#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 para_at();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  srand(time(NULL));
  int atis_sayisi;
  int yazi_atilma_sayisi = 0;
  int tura_atilma_sayisi = 0;
  int atis_sonucu;
  for (atis_sayisi = 1; atis_sayisi <= 100; atis_sayisi++) {
    atis_sonucu = para_at();
    switch (atis_sonucu) {
    case 0: {
      printf("Yazi\n");
      yazi_atilma_sayisi++;
      break;
    }
    case 1: {
      printf("Tura\n");
      tura_atilma_sayisi++;
      break;
    }
    }
  }
  printf("%d sayisi kadar Yazi %d sayisi kadar Tura atilmistir.",
         yazi_atilma_sayisi, tura_atilma_sayisi);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0x64,-0x8(%rbp)
jg     11f2 <main+0xb2>
xor    %eax,%eax
call   1060 <para_at@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
test   %eax,%eax
je     11ac <main+0x6c>
jmp    119b <main+0x5b>
mov    -0x18(%rbp),%eax
sub    $0x1,%eax
je     11c8 <main+0x88>
jmp    11df <main+0x9f>
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11df <main+0x9f>
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11e4 <main+0xa4>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1174 <main+0x34>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0x64,%ebx
lea    0xec4(%rip),%r14
lea    0xec2(%rip),%r15
xor    %r12d,%r12d
xor    %ebp,%ebp
jmp    1191 <main+0x41>
mov    %r14,%rdi
call   1030 <puts@plt>
add    $0x1,%r12d
add    $0xffffffff,%ebx
je     11ae <main+0x5e>
xor    %eax,%eax
call   1070 <para_at@plt>
cmp    $0x1,%eax
je     1180 <main+0x30>
test   %eax,%eax
jne    118c <main+0x3c>
mov    %r15,%rdi
call   1030 <puts@plt>
add    $0x1,%ebp
jmp    118c <main+0x3c>
lea    0xe4b(%rip),%rdi
mov    %ebp,%esi
mov    %r12d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"Yazi\0A\00"
@.str.1 = [6 x i8] c"Tura\0A\00"
@.str.2 = [54 x i8] c"%d sayisi kadar Yazi %d sayisi kadar Tura atilmistir.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @time(i32* null)
%7 = call i32 @srand(i32 %6)
store i32 0, i32* %3
store i32 0, i32* %4
store i32 1, i32* %2
br label %8
8: ; preds = %23, %0
%9 = load i32, i32* %2
%10 = icmp sle i32 %9, 100
br i1 %10, label %11, label %26
11: ; preds = %8
%12 = call i32 (...) @para_at()
store i32 %12, i32* %5
%13 = load i32, i32* %5
switch i32 %13, label %22 [
i32 0, label %14
i32 1, label %18
]
14: ; preds = %11
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* %3
%17 = add nsw i32 %16, 1
store i32 %17, i32* %3
br label %22
18: ; preds = %11
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %22
22: ; preds = %11, %18, %14
br label %23
23: ; preds = %22
%24 = load i32, i32* %2
%25 = add nsw i32 %24, 1
store i32 %25, i32* %2
br label %8
26: ; preds = %8
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), i32 %27, i32 %28)
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [54 x i8] c"%d sayisi kadar Yazi %d sayisi kadar Tura atilmistir.\00"
@str = [5 x i8] c"Tura\00"
@str.3 = [5 x i8] c"Yazi\00"
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
br label %3
3: ; preds = %0, %14
%4 = phi i32 [ 1, %0 ], [ %17, %14 ]
%5 = phi i32 [ 0, %0 ], [ %16, %14 ]
%6 = phi i32 [ 0, %0 ], [ %15, %14 ]
%7 = tail call i32 (...) @para_at()
switch i32 %7, label %14 [
i32 0, label %8
i32 1, label %11
]
8: ; preds = %3
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.3, i64 0, i64 0))
%10 = add nsw i32 %6, 1
br label %14
11: ; preds = %3
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%13 = add nsw i32 %5, 1
br label %14
14: ; preds = %8, %11, %3
%15 = phi i32 [ %6, %3 ], [ %6, %11 ], [ %10, %8 ]
%16 = phi i32 [ %5, %3 ], [ %13, %11 ], [ %5, %8 ]
%17 = add nuw nsw i32 %4, 1
%18 = icmp eq i32 %17, 101
br i1 %18, label %19, label %3
19: ; preds = %14
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), i32 %15, i32 %16)
ret i32 0
}