#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 */
scalar_t__ EOF;
int /*<<< orphan*/ printf(char *, int, int);
scalar_t__ scanf(char *, int *);
int main() {
  int x;
  int odd = 0, even = 0;
  while (scanf("%d", &x) != EOF && x != -1) {
    if (x % 2 == 1) {
      odd++;
    } else {
      even++;
    }
  }
  printf("%d %d", odd, even);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    %rax,%rcx
xor    %eax,%eax
mov    0x2e8f(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x11(%rbp)
je     116f <main+0x4f>
cmpl   $0xffffffff,-0x8(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    117f <main+0x5f>
jmp    11af <main+0x8f>
mov    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    11a1 <main+0x81>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11aa <main+0x8a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113d <main+0x1d>
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe44(%rip),%rdi
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
sub    $0x10,%rsp
lea    0xed0(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2ea4(%rip),%r12
xor    %ebx,%ebx
cmp    (%r12),%rax
je     11ae <main+0x8e>
mov    0xc(%rsp),%eax
mov    $0x0,%ebp
cmp    $0xffffffff,%eax
je     11b0 <main+0x90>
xor    %ebp,%ebp
lea    0xea0(%rip),%r14
lea    0xc(%rsp),%r15
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebx,%ecx
mov    %ebp,%edx
mov    %eax,%esi
shr    $0x1f,%esi
add    %eax,%esi
and    $0xfffffffe,%esi
sub    %esi,%eax
xor    %ebp,%ebp
xor    %ebx,%ebx
cmp    $0x1,%eax
setne  %bpl
sete   %bl
add    %ecx,%ebx
add    %edx,%ebp
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
je     11b0 <main+0x90>
mov    0xc(%rsp),%eax
cmp    $0xffffffff,%eax
jne    1170 <main+0x50>
jmp    11b0 <main+0x90>
xor    %ebp,%ebp
lea    0xe49(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %24, %0
%6 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i64, i64* @EOF
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = load i32, i32* %2
%11 = icmp ne i32 %10, -1
br label %12
12: ; preds = %9, %5
%13 = phi i1 [ false, %5 ], [ %11, %9 ]
br i1 %13, label %14, label %25
14: ; preds = %12
%15 = load i32, i32* %2
%16 = srem i32 %15, 2
%17 = icmp eq i32 %16, 1
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %24
21: ; preds = %14
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %24
24: ; preds = %21, %18
br label %5
25: ; preds = %12
%26 = load i32, i32* %3
%27 = load i32, i32* %4
%28 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %26, i32 %27)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [6 x i8] c"%d %d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i64, i64* @EOF
%5 = icmp ne i64 %3, %4
%6 = load i32, i32* %1
%7 = icmp ne i32 %6, -1
%8 = select i1 %5, i1 %7, i1 false
br i1 %8, label %9, label %26
9: ; preds = %0, %9
%10 = phi i32 [ %23, %9 ], [ %6, %0 ]
%11 = phi i32 [ %19, %9 ], [ 0, %0 ]
%12 = phi i32 [ %16, %9 ], [ 0, %0 ]
%13 = srem i32 %10, 2
%14 = icmp eq i32 %13, 1
%15 = zext i1 %14 to i32
%16 = add nuw nsw i32 %12, %15
%17 = xor i1 %14, true
%18 = zext i1 %17 to i32
%19 = add nuw nsw i32 %11, %18
%20 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%21 = load i64, i64* @EOF
%22 = icmp ne i64 %20, %21
%23 = load i32, i32* %1
%24 = icmp ne i32 %23, -1
%25 = select i1 %22, i1 %24, i1 false
br i1 %25, label %9, label %26
26: ; preds = %9, %0
%27 = phi i32 [ 0, %0 ], [ %16, %9 ]
%28 = phi i32 [ 0, %0 ], [ %19, %9 ]
%29 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %27, i32 %28)
ret i32 0
}