#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 /*<<< orphan*/ system(char *);
int main() {
  int num, x, primos, cont, y;
  primos = 0;
  for (y = 1; y <= 10; y++) {
    x = 1;
    cont = 0;
    printf("Digite um número: ");
    scanf("%d", &num);
    while (x <= num) {
      if ((num % x) == 0)
        cont++;
      x++;
    }
    if (cont == 2)
      primos++;
  }
  printf("A quantidade de números primos entre os números digitados é: %d.\n\n",
         primos);
  system("pause");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x18(%rbp)
cmpl   $0xa,-0x18(%rbp)
jg     11dc <main+0xac>
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe9a(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11b6 <main+0x86>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    11a8 <main+0x78>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1183 <main+0x53>
cmpl   $0x2,-0x14(%rbp)
jne    11c9 <main+0x99>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11ce <main+0x9e>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    114d <main+0x1d>
mov    -0x10(%rbp),%esi
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe69(%rip),%rdi
call   1030 <system@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
mov    $0x1,%r14d
lea    0xeb8(%rip),%rbx
lea    0xec5(%rip),%r15
lea    0x4(%rsp),%r12
xor    %r13d,%r13d
jmp    1179 <main+0x49>
nopl   0x0(%rax)
xor    %eax,%eax
cmp    $0x2,%esi
sete   %al
add    %eax,%r13d
add    $0x1,%r14d
cmp    $0xb,%r14d
je     11fc <main+0xcc>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%ecx
mov    $0x0,%esi
test   %ecx,%ecx
jle    1160 <main+0x30>
cmp    $0x1,%ecx
jne    11b0 <main+0x80>
mov    $0x1,%edi
xor    %esi,%esi
test   $0x1,%cl
je     1160 <main+0x30>
jmp    11ec <main+0xbc>
xchg   %ax,%ax
mov    %rbx,%r8
mov    %ecx,%ebx
and    $0xfffffffe,%ebx
mov    $0x1,%edi
xor    %esi,%esi
nop
mov    %ecx,%eax
cltd
idiv   %edi
cmp    $0x1,%edx
adc    $0x0,%esi
lea    0x1(%rdi),%ebp
mov    %ecx,%eax
cltd
idiv   %ebp
cmp    $0x1,%edx
adc    $0x0,%esi
add    $0x2,%edi
cmp    %ebx,%ebp
jne    11c0 <main+0x90>
mov    %r8,%rbx
test   $0x1,%cl
je     1160 <main+0x30>
mov    %ecx,%eax
cltd
idiv   %edi
cmp    $0x1,%edx
adc    $0x0,%esi
jmp    1160 <main+0x30>
lea    0xe14(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe49(%rip),%rdi
call   1030 <system@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 um n\C3\BAmero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [70 x i8] c"A quantidade de n\C3\BAmeros primos entre os n\C3\BAmeros digitados \C3\A9: %d.\0A\0A\00"
@.str.3 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
store i32 1, i32* %6
br label %7
7: ; preds = %35, %0
%8 = load i32, i32* %6
%9 = icmp sle i32 %8, 10
br i1 %9, label %10, label %38
10: ; preds = %7
store i32 1, i32* %3
store i32 0, i32* %5
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %13
13: ; preds = %25, %10
%14 = load i32, i32* %3
%15 = load i32, i32* %2
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %28
17: ; preds = %13
%18 = load i32, i32* %2
%19 = load i32, i32* %3
%20 = srem i32 %18, %19
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %17
%23 = load i32, i32* %5
%24 = add nsw i32 %23, 1
store i32 %24, i32* %5
br label %25
25: ; preds = %22, %17
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %13
28: ; preds = %13
%29 = load i32, i32* %5
%30 = icmp eq i32 %29, 2
br i1 %30, label %31, label %34
31: ; preds = %28
%32 = load i32, i32* %4
%33 = add nsw i32 %32, 1
store i32 %33, i32* %4
br label %34
34: ; preds = %31, %28
br label %35
35: ; preds = %34
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
store i32 %37, i32* %6
br label %7
38: ; preds = %7
%39 = load i32, i32* %4
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([70 x i8], [70 x i8]* @.str.2, i64 0, i64 0), i32 %39)
%41 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Digite um n\C3\BAmero: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [70 x i8] c"A quantidade de n\C3\BAmeros primos entre os n\C3\BAmeros digitados \C3\A9: %d.\0A\0A\00"
@.str.3 = [6 x i8] c"pause\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
br label %3
3: ; preds = %0, %41
%4 = phi i32 [ 1, %0 ], [ %46, %41 ]
%5 = phi i32 [ 0, %0 ], [ %45, %41 ]
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 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 = icmp slt i32 %8, 1
br i1 %9, label %41, label %10
10: ; preds = %3
%11 = and i32 %8, 1
%12 = icmp eq i32 %8, 1
br i1 %12, label %31, label %13
13: ; preds = %10
%14 = and i32 %8, -2
br label %15
15: ; preds = %15, %13
%16 = phi i32 [ 0, %13 ], [ %27, %15 ]
%17 = phi i32 [ 1, %13 ], [ %28, %15 ]
%18 = phi i32 [ 0, %13 ], [ %29, %15 ]
%19 = srem i32 %8, %17
%20 = icmp eq i32 %19, 0
%21 = zext i1 %20 to i32
%22 = add nuw nsw i32 %16, %21
%23 = add nuw i32 %17, 1
%24 = srem i32 %8, %23
%25 = icmp eq i32 %24, 0
%26 = zext i1 %25 to i32
%27 = add nuw nsw i32 %22, %26
%28 = add nuw i32 %17, 2
%29 = add i32 %18, 2
%30 = icmp eq i32 %29, %14
br i1 %30, label %31, label %15
31: ; preds = %15, %10
%32 = phi i32 [ undef, %10 ], [ %27, %15 ]
%33 = phi i32 [ 0, %10 ], [ %27, %15 ]
%34 = phi i32 [ 1, %10 ], [ %28, %15 ]
%35 = icmp eq i32 %11, 0
br i1 %35, label %41, label %36
36: ; preds = %31
%37 = srem i32 %8, %34
%38 = icmp eq i32 %37, 0
%39 = zext i1 %38 to i32
%40 = add nuw nsw i32 %33, %39
br label %41
41: ; preds = %36, %31, %3
%42 = phi i32 [ 0, %3 ], [ %32, %31 ], [ %40, %36 ]
%43 = icmp eq i32 %42, 2
%44 = zext i1 %43 to i32
%45 = add nuw nsw i32 %5, %44
%46 = add nuw nsw i32 %4, 1
%47 = icmp eq i32 %46, 11
br i1 %47, label %48, label %3
48: ; preds = %41
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([70 x i8], [70 x i8]* @.str.2, i64 0, i64 0), i32 %45)
%50 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}