#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, mod;
  printf("Tek sayi mi cift sayimi anlamak icin bir tamsayi giriniz:");
  scanf("%d", &sayi);
  mod = sayi % 2;
  if (mod == 1) {
    printf("Girdiginiz sayi bir tek sayidir.");
  }
  if (mod == 0) {
    printf("Girdiginiz sayi bir cift sayidir.");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
lea    0xef8(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    116f <main+0x4f>
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
jne    1185 <main+0x65>
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
lea    0xf06(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
cmp    $0x1,%eax
je     1160 <main+0x40>
test   %eax,%eax
jne    116c <main+0x4c>
lea    0xf00(%rip),%rdi
jmp    1167 <main+0x47>
lea    0xed6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [58 x i8] c"Tek sayi mi cift sayimi anlamak icin bir tamsayi giriniz:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [33 x i8] c"Girdiginiz sayi bir tek sayidir.\00"
@.str.3 = [34 x i8] c"Girdiginiz sayi bir cift sayidir.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = load i32, i32* %2
%7 = srem i32 %6, 2
store i32 %7, i32* %3
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %0
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [58 x i8] c"Tek sayi mi cift sayimi anlamak icin bir tamsayi giriniz:\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [33 x i8] c"Girdiginiz sayi bir tek sayidir.\00"
@.str.3 = [34 x i8] c"Girdiginiz sayi bir cift sayidir.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = srem i32 %5, 2
switch i32 %6, label %11 [
i32 1, label %8
i32 0, label %7
]
7: ; preds = %0
br label %8
8: ; preds = %0, %7
%9 = phi i8* [ getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), %7 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), %0 ]
%10 = call i32 @printf(i8* dereferenceable(1) %9)
br label %11
11: ; preds = %8, %0
ret i32 0
}