#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 *, int *);
int main() {
  int sayi = 0;
  int secim = 1;
  while (secim == 1) {
    printf("Sayi giriniz: ");
    scanf("%d", &sayi);
    if (sayi % 2 == 0) {
      printf("Sayi cifttir\n");
    } else {
      printf("Sayi tektir\n");
    }
    printf("Tekrar calishsin mi? 1:evet ");
    scanf("%d", &secim);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    11b5 <main+0x95>
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
lea    0xeb5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1188 <main+0x68>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
jmp    1194 <main+0x74>
lea    0xe91(%rip),%rdi
call   1030 <printf@plt>
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
lea    0xe68(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
movl   $0x1,(%rsp)
lea    0xebe(%rip),%rbx
lea    0x4(%rsp),%r15
lea    0xede(%rip),%rbp
lea    0xecb(%rip),%r14
lea    0xea7(%rip),%r12
mov    %rsp,%r13
xchg   %ax,%ax
lea    0xe89(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
testb  $0x1,0x4(%rsp)
mov    %r14,%rdi
cmove  %rbp,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
call   1050 <scanf@plt>
cmpl   $0x1,(%rsp)
je     1170 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Sayi giriniz: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [14 x i8] c"Sayi cifttir\0A\00"
@.str.3 = [13 x i8] c"Sayi tektir\0A\00"
@.str.4 = [29 x i8] c"Tekrar calishsin mi? 1:evet \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 1, i32* %3
br label %4
4: ; preds = %17, %0
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 1
br i1 %6, label %7, label %20
7: ; preds = %4
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %2
%11 = srem i32 %10, 2
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %7
%14 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %17
15: ; preds = %7
%16 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %15, %13
%18 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
br label %4
20: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"Sayi giriniz: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.4 = [29 x i8] c"Tekrar calishsin mi? 1:evet \00"
@str = [12 x i8] c"Sayi tektir\00"
@str.5 = [13 x i8] c"Sayi cifttir\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%4 = bitcast i32* %2 to i8*
store i32 1, i32* %2
br label %5
5: ; preds = %0, %5
%6 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%8 = load i32, i32* %1
%9 = and i32 %8, 1
%10 = icmp eq i32 %9, 0
%11 = select i1 %10, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @str.5, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0)
%12 = call i32 @puts(i8* dereferenceable(1) %11)
%13 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%15 = load i32, i32* %2
%16 = icmp eq i32 %15, 1
br i1 %16, label %5, label %17
17: ; preds = %5
ret i32 0
}