#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_s(char *, int *);
int /*<<< orphan*/ system(char *);
main() {
  int number, kalan;
  int cift = 0, tek = 0;
  while (1) {
    printf("Sayi giriniz: ");
    scanf_s("%d", &number);
    if (number == -1)
      break;
    kalan = number % 2;
    if (kalan == 0)
      cift++;
    if (kalan == 1)
      tek++;
  }
  printf("Ciftlerin sayisi: %d\n\n", cift);
  printf("Teklerin sayisi: %d\n\n", tek);
  system("pause");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xead(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf_s@plt>
cmpl   $0xffffffff,-0x8(%rbp)
jne    117a <main+0x4a>
jmp    11b3 <main+0x83>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    119b <main+0x6b>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    11ae <main+0x7e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114d <main+0x1d>
mov    -0x10(%rbp),%esi
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe63(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xebd(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebc(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf_s@plt>
mov    0xc(%rsp),%eax
mov    $0x0,%ebp
cmp    $0xffffffff,%eax
je     11ca <main+0x9a>
lea    0xe8e(%rip),%r14
lea    0xe96(%rip),%r15
lea    0xc(%rsp),%r12
xor    %ebp,%ebp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
and    $0xfffffffe,%ecx
sub    %ecx,%eax
cmp    $0x1,%eax
adc    $0x0,%ebx
xor    %ecx,%ecx
cmp    $0x1,%eax
sete   %cl
add    %ecx,%ebp
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <scanf_s@plt>
mov    0xc(%rsp),%eax
cmp    $0xffffffff,%eax
jne    1190 <main+0x60>
lea    0xe41(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe48(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe4e(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
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 = [23 x i8] c"Ciftlerin sayisi: %d\0A\0A\00"
@.str.3 = [22 x i8] c"Teklerin sayisi: %d\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 0, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %0, %26
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %12
11: ; preds = %6
br label %27
12: ; preds = %6
%13 = load i32, i32* %2
%14 = srem i32 %13, 2
store i32 %14, i32* %3
%15 = load i32, i32* %3
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %20
20: ; preds = %17, %12
%21 = load i32, i32* %3
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %26
23: ; preds = %20
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %26
26: ; preds = %23, %20
br label %6
27: ; preds = %11
%28 = load i32, i32* %4
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %28)
%30 = load i32, i32* %5
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %30)
%32 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
@.str = [15 x i8] c"Sayi giriniz: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [23 x i8] c"Ciftlerin sayisi: %d\0A\0A\00"
@.str.3 = [22 x i8] c"Teklerin sayisi: %d\0A\0A\00"
@.str.4 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, -1
br i1 %6, label %22, label %7
7: ; preds = %0, %7
%8 = phi i32 [ %20, %7 ], [ %5, %0 ]
%9 = phi i32 [ %17, %7 ], [ 0, %0 ]
%10 = phi i32 [ %14, %7 ], [ 0, %0 ]
%11 = srem i32 %8, 2
%12 = icmp eq i32 %11, 0
%13 = zext i1 %12 to i32
%14 = add nuw nsw i32 %10, %13
%15 = icmp eq i32 %11, 1
%16 = zext i1 %15 to i32
%17 = add nuw nsw i32 %9, %16
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @scanf_s(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%20 = load i32, i32* %1
%21 = icmp eq i32 %20, -1
br i1 %21, label %22, label %7
22: ; preds = %7, %0
%23 = phi i32 [ 0, %0 ], [ %14, %7 ]
%24 = phi i32 [ 0, %0 ], [ %17, %7 ]
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), i32 %23)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0), i32 %24)
%27 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}