#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 number[10];
  int i, j;
  int count = 0;
  for (i = 0; i < 9; i++) {
    printf("%d - Please, insert the integer value: ", i);
    scanf("%d", &number[i]);
    for (j = 1; j <= number[i]; j++) {
      if (number[i] % j == 0) {
        count++;
      }
    }
    if (count == 2) {
      printf("Result: is prime, position: %d", i);
    } else {
      printf("Result: is dont prime");
    }
    count = 0;
    printf("\n-----------------------------------------\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x9,-0x34(%rbp)
jge    120d <main+0xed>
mov    -0x34(%rbp),%esi
lea    0xeaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x34(%rbp),%rax
lea    -0x30(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xed6(%rip),%rdi
call   1040 <scanf@plt>
movl   $0x1,-0x38(%rbp)
mov    -0x38(%rbp),%eax
movslq -0x34(%rbp),%rcx
cmp    -0x30(%rbp,%rcx,4),%eax
jg     11bc <main+0x9c>
movslq -0x34(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%eax
cltd
idivl  -0x38(%rbp)
cmp    $0x0,%edx
jne    11a9 <main+0x89>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11ae <main+0x8e>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    117a <main+0x5a>
cmpl   $0x2,-0x3c(%rbp)
jne    11dc <main+0xbc>
mov    -0x34(%rbp),%esi
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ea <main+0xca>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x3c(%rbp)
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    113d <main+0x1d>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xebb(%rip),%r14
lea    0xef8(%rip),%r12
lea    0xef4(%rip),%rbx
lea    0xf03(%rip),%r13
xor    %r15d,%r15d
jmp    1180 <main+0x50>
nop
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r13,%rdi
call   1030 <puts@plt>
add    $0x1,%r15
cmp    $0x9,%r15
je     1222 <main+0xf2>
mov    %r14,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    (%rsp,%r15,4),%rsi
mov    %r12,%rdi
call   1050 <scanf@plt>
mov    (%rsp,%r15,4),%ecx
test   %ecx,%ecx
jle    1160 <main+0x30>
cmp    $0x1,%ecx
jne    11c0 <main+0x90>
mov    $0x1,%edi
xor    %esi,%esi
test   $0x1,%cl
jne    11f8 <main+0xc8>
jmp    1203 <main+0xd3>
cs nopw 0x0(%rax,%rax,1)
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    11d0 <main+0xa0>
mov    %r8,%rbx
test   $0x1,%cl
je     1203 <main+0xd3>
mov    %ecx,%eax
cltd
idiv   %edi
cmp    $0x1,%edx
adc    $0x0,%esi
cmp    $0x2,%esi
jne    1160 <main+0x30>
lea    0xe15(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    116a <main+0x3a>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"%d - Please, insert the integer value: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"Result: is prime, position: %d\00"
@.str.3 = [22 x i8] c"Result: is dont prime\00"
@.str.4 = [44 x i8] c"\0A-----------------------------------------\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %5
store i32 0, i32* %3
br label %6
6: ; preds = %48, %0
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 9
br i1 %8, label %9, label %51
9: ; preds = %6
%10 = load i32, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %3
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %13
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %14)
store i32 1, i32* %4
br label %16
16: ; preds = %35, %9
%17 = load i32, i32* %4
%18 = load i32, i32* %3
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %19
%21 = load i32, i32* %20
%22 = icmp sle i32 %17, %21
br i1 %22, label %23, label %38
23: ; preds = %16
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = load i32, i32* %4
%29 = srem i32 %27, %28
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %23
%32 = load i32, i32* %5
%33 = add nsw i32 %32, 1
store i32 %33, i32* %5
br label %34
34: ; preds = %31, %23
br label %35
35: ; preds = %34
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 1
store i32 %37, i32* %4
br label %16
38: ; preds = %16
%39 = load i32, i32* %5
%40 = icmp eq i32 %39, 2
br i1 %40, label %41, label %44
41: ; preds = %38
%42 = load i32, i32* %3
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %42)
br label %46
44: ; preds = %38
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %46
46: ; preds = %44, %41
store i32 0, i32* %5
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.4, i64 0, i64 0))
br label %48
48: ; preds = %46
%49 = load i32, i32* %3
%50 = add nsw i32 %49, 1
store i32 %50, i32* %3
br label %6
51: ; preds = %6
%52 = load i32, i32* %1
ret i32 %52
}

LLVM IR (-O2):
@.str = [40 x i8] c"%d - Please, insert the integer value: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [31 x i8] c"Result: is prime, position: %d\00"
@.str.3 = [22 x i8] c"Result: is dont prime\00"
@str = [43 x i8] c"\0A-----------------------------------------\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
br label %3
3: ; preds = %0, %49
%4 = phi i64 [ 0, %0 ], [ %51, %49 ]
%5 = trunc i64 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %4
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 1
br i1 %10, label %47, label %11
11: ; preds = %3
%12 = and i32 %9, 1
%13 = icmp eq i32 %9, 1
br i1 %13, label %32, label %14
14: ; preds = %11
%15 = and i32 %9, -2
br label %16
16: ; preds = %16, %14
%17 = phi i32 [ 0, %14 ], [ %28, %16 ]
%18 = phi i32 [ 1, %14 ], [ %29, %16 ]
%19 = phi i32 [ 0, %14 ], [ %30, %16 ]
%20 = srem i32 %9, %18
%21 = icmp eq i32 %20, 0
%22 = zext i1 %21 to i32
%23 = add nuw nsw i32 %17, %22
%24 = add nuw i32 %18, 1
%25 = srem i32 %9, %24
%26 = icmp eq i32 %25, 0
%27 = zext i1 %26 to i32
%28 = add nuw nsw i32 %23, %27
%29 = add nuw i32 %18, 2
%30 = add i32 %19, 2
%31 = icmp eq i32 %30, %15
br i1 %31, label %32, label %16
32: ; preds = %16, %11
%33 = phi i32 [ undef, %11 ], [ %28, %16 ]
%34 = phi i32 [ 0, %11 ], [ %28, %16 ]
%35 = phi i32 [ 1, %11 ], [ %29, %16 ]
%36 = icmp eq i32 %12, 0
br i1 %36, label %42, label %37
37: ; preds = %32
%38 = srem i32 %9, %35
%39 = icmp eq i32 %38, 0
%40 = zext i1 %39 to i32
%41 = add nuw nsw i32 %34, %40
br label %42
42: ; preds = %32, %37
%43 = phi i32 [ %33, %32 ], [ %41, %37 ]
%44 = icmp eq i32 %43, 2
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0), i32 %5)
br label %49
47: ; preds = %3, %42
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %49
49: ; preds = %47, %45
%50 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @str, i64 0, i64 0))
%51 = add nuw nsw i64 %4, 1
%52 = icmp eq i64 %51, 9
br i1 %52, label %53, label %3
53: ; preds = %49
ret i32 0
}