#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__ fmod(int /*<<< orphan*/, double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int /*<<< orphan*/ sqrt(float);
int main(int argc, char **argv) {
  float array[10] = {0};
  char name[20];
  int i;
  printf("usuario, Favor de introducir su nombre \n >>");
  scanf("%s", name);
  printf("Bien %s, Ahora porfavor introduce 10 numeros aleatorios \n", name);
  for (i = 0; i < 10; i++)
    scanf("%f", &array[i]);
  for (i = 0; i < 10; i++) {
    if (fmod(sqrt(array[i]), 1.00)) {
      printf("%s, el numero ingresado en la posicion %d no tiene raiz cuadrada "
             "perfecta\n",
             name, i + 1);
    } else {
      printf("%s, Encontre un numero cuya raiz cuadrada no tiene decimales en "
             "la posicion %d del arreglo \n>>",
             name, i + 1);
      printf("\t\t %.2f\n", array[i]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x40(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1050 <memset@plt>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x60(%rbp),%rsi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0x60(%rbp),%rsi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x64(%rbp)
cmpl   $0xa,-0x64(%rbp)
jge    11e4 <main+0x94>
movslq -0x64(%rbp),%rax
lea    -0x40(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1060 <scanf@plt>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    11af <main+0x5f>
movl   $0x0,-0x64(%rbp)
cmpl   $0xa,-0x64(%rbp)
jge    1281 <main+0x131>
movslq -0x64(%rbp),%rax
movss  -0x40(%rbp,%rax,4),%xmm0
call   1070 <sqrt@plt>
mov    %eax,%edi
movsd  0xdf2(%rip),%xmm0
call   1040 <fmod@plt>
cmp    $0x0,%rax
je     123a <main+0xea>
lea    -0x60(%rbp),%rsi
mov    -0x64(%rbp),%edx
add    $0x1,%edx
lea    0xe46(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    126e <main+0x11e>
lea    -0x60(%rbp),%rsi
mov    -0x64(%rbp),%edx
add    $0x1,%edx
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x64(%rbp),%rax
movss  -0x40(%rbp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1273 <main+0x123>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    11eb <main+0x9b>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
movq   $0x0,0x20(%rsp)
lea    0x20(%rsp),%r14
lea    0x10(%rsp),%r12
lea    0xe94(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
lea    0x30(%rsp),%r13
mov    %r13,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe9f(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec8(%rip),%r15
mov    %rsp,%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x14(%rsp),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x18(%rsp),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x1c(%rsp),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x24(%rsp),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe7f(%rip),%r14
lea    0xed7(%rip),%r15
lea    0xe26(%rip),%r12
xor    %ebp,%ebp
jmp    128b <main+0x14b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %r13,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
movss  (%rsp,%rbp,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    %rbx,%rbp
cmp    $0xa,%rbx
je     12be <main+0x17e>
movss  (%rsp,%rbp,4),%xmm0
call   1060 <sqrt@plt>
mov    %eax,%edi
movsd  0xd61(%rip),%xmm0
call   1040 <fmod@plt>
lea    0x1(%rbp),%rbx
test   %rax,%rax
je     1260 <main+0x120>
mov    %r12,%rdi
mov    %r13,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1282 <main+0x142>
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [44 x i8] c"usuario, Favor de introducir su nombre \0A >>\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [58 x i8] c"Bien %s, Ahora porfavor introduce 10 numeros aleatorios \0A\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [75 x i8] c"%s, el numero ingresado en la posicion %d no tiene raiz cuadrada perfecta\0A\00"
@.str.5 = [95 x i8] c"%s, Encontre un numero cuya raiz cuadrada no tiene decimales en la posicion %d del arreglo \0A>>\00"
@.str.6 = [9 x i8] c"\09\09 %.2f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x float]
%7 = alloca [20 x i8]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [10 x float]* %6 to i8*
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0), i8* %13)
store i32 0, i32* %8
br label %15
15: ; preds = %23, %2
%16 = load i32, i32* %8
%17 = icmp slt i32 %16, 10
br i1 %17, label %18, label %26
18: ; preds = %15
%19 = load i32, i32* %8
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [10 x float], [10 x float]* %6, i64 0, i64 %20
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %21)
br label %23
23: ; preds = %18
%24 = load i32, i32* %8
%25 = add nsw i32 %24, 1
store i32 %25, i32* %8
br label %15
26: ; preds = %15
store i32 0, i32* %8
br label %27
27: ; preds = %55, %26
%28 = load i32, i32* %8
%29 = icmp slt i32 %28, 10
br i1 %29, label %30, label %58
30: ; preds = %27
%31 = load i32, i32* %8
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [10 x float], [10 x float]* %6, i64 0, i64 %32
%34 = load float, float* %33
%35 = call i32 @sqrt(float %34)
%36 = call i64 @fmod(i32 %35, double 1.000000e+00)
%37 = icmp ne i64 %36, 0
br i1 %37, label %38, label %43
38: ; preds = %30
%39 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%40 = load i32, i32* %8
%41 = add nsw i32 %40, 1
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.4, i64 0, i64 0), i8* %39, i32 %41)
br label %54
43: ; preds = %30
%44 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%45 = load i32, i32* %8
%46 = add nsw i32 %45, 1
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([95 x i8], [95 x i8]* @.str.5, i64 0, i64 0), i8* %44, i32 %46)
%48 = load i32, i32* %8
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [10 x float], [10 x float]* %6, i64 0, i64 %49
%51 = load float, float* %50
%52 = fpext float %51 to double
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), double %52)
br label %54
54: ; preds = %43, %38
br label %55
55: ; preds = %54
%56 = load i32, i32* %8
%57 = add nsw i32 %56, 1
store i32 %57, i32* %8
br label %27
58: ; preds = %27
ret i32 0
}

LLVM IR (-O2):
@.str = [44 x i8] c"usuario, Favor de introducir su nombre \0A >>\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [58 x i8] c"Bien %s, Ahora porfavor introduce 10 numeros aleatorios \0A\00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [75 x i8] c"%s, el numero ingresado en la posicion %d no tiene raiz cuadrada perfecta\0A\00"
@.str.5 = [95 x i8] c"%s, Encontre un numero cuya raiz cuadrada no tiene decimales en la posicion %d del arreglo \0A>>\00"
@.str.6 = [9 x i8] c"\09\09 %.2f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [10 x float]
%4 = alloca [20 x i8]
%5 = bitcast [10 x float]* %3 to i8*
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.2, i64 0, i64 0), i8* %6)
%10 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 0
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %10)
%12 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 1
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %12)
%14 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 2
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %14)
%16 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 3
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %16)
%18 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 4
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %18)
%20 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 5
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %20)
%22 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 6
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %22)
%24 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 7
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %24)
%26 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 8
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %26)
%28 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 9
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %28)
br label %30
30: ; preds = %2, %46
%31 = phi i64 [ 0, %2 ], [ %37, %46 ]
%32 = getelementptr inbounds [10 x float], [10 x float]* %3, i64 0, i64 %31
%33 = load float, float* %32
%34 = call i32 @sqrt(float %33)
%35 = call i64 @fmod(i32 %34, double 1.000000e+00)
%36 = icmp eq i64 %35, 0
%37 = add nuw nsw i64 %31, 1
%38 = trunc i64 %37 to i32
br i1 %36, label %41, label %39
39: ; preds = %30
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @.str.4, i64 0, i64 0), i8* %6, i32 %38)
br label %46
41: ; preds = %30
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([95 x i8], [95 x i8]* @.str.5, i64 0, i64 0), i8* %6, i32 %38)
%43 = load float, float* %32
%44 = fpext float %43 to double
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), double %44)
br label %46
46: ; preds = %39, %41
%47 = icmp eq i64 %37, 10
br i1 %47, label %48, label %30
48: ; preds = %46
ret i32 0
}