#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);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  int i, num, cpar = 0, cimp = 0;
  for (i = 0; i <= 9; i++) {
    printf("Digite o %d numero\n", i + 1);
    scanf("%d", &num);
    if (num % 2 == 0) {
      cpar++;
    } else {
      cimp++;
    }
  }
  printf("Quantidade de numeros pares: %d\n", cpar);
  printf("Quantidade de numeros impares: %d\n", cimp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x9,-0x14(%rbp)
jg     11b5 <main+0x95>
mov    -0x14(%rbp),%esi
add    $0x1,%esi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
lea    0xea6(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1199 <main+0x79>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11a2 <main+0x82>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11a7 <main+0x87>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114b <main+0x2b>
mov    -0x1c(%rbp),%esi
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%esi
lea    0xe6a(%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   %r13
push   %r12
push   %rbx
push   %rax
lea    0xece(%rip),%r15
mov    %r15,%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
lea    0xece(%rip),%r12
lea    0x4(%rsp),%rbx
mov    %r12,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebp
and    $0x1,%ebp
mov    %ebp,%r13d
xor    $0x1,%r13d
mov    %r15,%rdi
mov    $0x2,%esi
call   1030 <printf@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
mov    %rbx,%r12
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
and    $0x1,%ebx
mov    %ebx,%r14d
xor    $0x1,%r14d
add    %r13d,%r14d
add    %ebp,%ebx
mov    %r15,%rdi
mov    $0x3,%esi
call   1030 <printf@plt>
lea    0xe6e(%rip),%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebp
and    $0x1,%ebp
mov    %ebp,%r13d
xor    $0x1,%r13d
add    %r14d,%r13d
add    %ebx,%ebp
mov    %r15,%rdi
mov    %r15,%r12
mov    $0x4,%esi
call   1030 <printf@plt>
lea    0xe3c(%rip),%rdi
mov    %rdi,%r15
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
and    $0x1,%ebx
mov    %ebx,%r14d
xor    $0x1,%r14d
add    %r13d,%r14d
add    %ebp,%ebx
mov    %r12,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebp
and    $0x1,%ebp
mov    %ebp,%r13d
xor    $0x1,%r13d
add    %r14d,%r13d
add    %ebx,%ebp
mov    %r12,%rdi
mov    $0x6,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
and    $0x1,%ebx
mov    %ebx,%r14d
xor    $0x1,%r14d
add    %r13d,%r14d
add    %ebp,%ebx
mov    %r12,%rdi
mov    $0x7,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebp
and    $0x1,%ebp
mov    %ebp,%r13d
xor    $0x1,%r13d
add    %r14d,%r13d
add    %ebx,%ebp
mov    %r12,%rdi
mov    $0x8,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
and    $0x1,%ebx
mov    %ebx,%r14d
xor    $0x1,%r14d
add    %r13d,%r14d
add    %ebp,%ebx
mov    %r12,%rdi
mov    $0x9,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebp
and    $0x1,%ebp
mov    %ebp,%r13d
xor    $0x1,%r13d
add    %r14d,%r13d
add    %ebx,%ebp
mov    %r12,%rdi
mov    $0xa,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%ebx
and    $0x1,%ebx
mov    %ebx,%esi
xor    $0x1,%esi
add    %r13d,%esi
add    %ebp,%ebx
lea    0xd0c(%rip),%rdi
call   1030 <printf@plt>
lea    0xd21(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Digite o %d numero\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [33 x i8] c"Quantidade de numeros pares: %d\0A\00"
@.str.3 = [35 x i8] c"Quantidade de numeros impares: %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %6
br label %10
10: ; preds = %28, %2
%11 = load i32, i32* %6
%12 = icmp sle i32 %11, 9
br i1 %12, label %13, label %31
13: ; preds = %10
%14 = load i32, i32* %6
%15 = add nsw i32 %14, 1
%16 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%18 = load i32, i32* %7
%19 = srem i32 %18, 2
%20 = icmp eq i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %13
%22 = load i32, i32* %8
%23 = add nsw i32 %22, 1
store i32 %23, i32* %8
br label %27
24: ; preds = %13
%25 = load i32, i32* %9
%26 = add nsw i32 %25, 1
store i32 %26, i32* %9
br label %27
27: ; preds = %24, %21
br label %28
28: ; preds = %27
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 1
store i32 %30, i32* %6
br label %10
31: ; preds = %10
%32 = load i32, i32* %8
%33 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %32)
%34 = load i32, i32* %9
%35 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %34)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Digite o %d numero\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [33 x i8] c"Quantidade de numeros pares: %d\0A\00"
@.str.3 = [35 x i8] c"Quantidade de numeros impares: %d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%7 = load i32, i32* %3
%8 = and i32 %7, 1
%9 = xor i32 %8, 1
%10 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 2)
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %3
%13 = and i32 %12, 1
%14 = xor i32 %13, 1
%15 = add nuw nsw i32 %14, %9
%16 = add nuw nsw i32 %13, %8
%17 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 3)
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%19 = load i32, i32* %3
%20 = and i32 %19, 1
%21 = xor i32 %20, 1
%22 = add nuw nsw i32 %21, %15
%23 = add nuw nsw i32 %20, %16
%24 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 4)
%25 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%26 = load i32, i32* %3
%27 = and i32 %26, 1
%28 = xor i32 %27, 1
%29 = add nuw nsw i32 %28, %22
%30 = add nuw nsw i32 %27, %23
%31 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 5)
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%33 = load i32, i32* %3
%34 = and i32 %33, 1
%35 = xor i32 %34, 1
%36 = add nuw nsw i32 %35, %29
%37 = add nuw nsw i32 %34, %30
%38 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 6)
%39 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%40 = load i32, i32* %3
%41 = and i32 %40, 1
%42 = xor i32 %41, 1
%43 = add nuw nsw i32 %42, %36
%44 = add nuw nsw i32 %41, %37
%45 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 7)
%46 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%47 = load i32, i32* %3
%48 = and i32 %47, 1
%49 = xor i32 %48, 1
%50 = add nuw nsw i32 %49, %43
%51 = add nuw nsw i32 %48, %44
%52 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 8)
%53 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%54 = load i32, i32* %3
%55 = and i32 %54, 1
%56 = xor i32 %55, 1
%57 = add nuw nsw i32 %56, %50
%58 = add nuw nsw i32 %55, %51
%59 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 9)
%60 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%61 = load i32, i32* %3
%62 = and i32 %61, 1
%63 = xor i32 %62, 1
%64 = add nuw nsw i32 %63, %57
%65 = add nuw nsw i32 %62, %58
%66 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 10)
%67 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%68 = load i32, i32* %3
%69 = and i32 %68, 1
%70 = xor i32 %69, 1
%71 = add nuw nsw i32 %70, %64
%72 = add nuw nsw i32 %69, %65
%73 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %71)
%74 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i32 %72)
ret i32 0
}