#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__ arithmeticAvg(int *, int);
scalar_t__ pow(scalar_t__, int);
float sqrt(float);
float standartDeviation(int numbers[], int numbersCount) {
  int i;
  float total = 0;
  for (i = 0; i < numbersCount; i++) {
    total += pow(((float)numbers[i] - arithmeticAvg(numbers, numbersCount)), 2);
  }
  return sqrt(total / 10);
}


x86 assembly (clang, -O0):
<standartDeviation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11b2 <standartDeviation+0x82>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
cvtsi2ssl (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <arithmeticAvg@plt>
movss  -0x18(%rbp),%xmm0
cvtsi2ss %rax,%xmm1
subss  %xmm1,%xmm0
cvttss2si %xmm0,%rdi
mov    $0x2,%esi
call   1040 <pow@plt>
cvtsi2ss %rax,%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114e <standartDeviation+0x1e>
movss  -0x14(%rbp),%xmm0
movss  0xe41(%rip),%xmm1
divss  %xmm1,%xmm0
call   1050 <sqrt@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<standartDeviation>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xorps  %xmm0,%xmm0
test   %esi,%esi
jle    11b3 <standartDeviation+0x83>
mov    %esi,%r14d
mov    %rdi,%rbx
mov    %esi,%r15d
xorps  %xmm0,%xmm0
xor    %ebp,%ebp
nopl   0x0(%rax)
movss  %xmm0,(%rsp)
xorps  %xmm0,%xmm0
cvtsi2ssl (%rbx,%rbp,4),%xmm0
movss  %xmm0,0x4(%rsp)
mov    %rbx,%rdi
mov    %r14d,%esi
call   1030 <arithmeticAvg@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  0x4(%rsp),%xmm1
subss  %xmm0,%xmm1
cvttss2si %xmm1,%rdi
mov    $0x2,%esi
call   1040 <pow@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  (%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
movss  (%rsp),%xmm0
add    $0x1,%rbp
cmp    %rbp,%r15
jne    1150 <standartDeviation+0x20>
divss  0xe45(%rip),%xmm0
ucomiss 0xe42(%rip),%xmm0
jb     11d3 <standartDeviation+0xa3>
sqrtss %xmm0,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <sqrt@plt>

LLVM IR (-O0):
define float @standartDeviation(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
store i32* %0, i32** %3
store i32 %1, i32* %4
store float 0.000000e+00, float* %6
store i32 0, i32* %5
br label %7
7: ; preds = %28, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %31
11: ; preds = %7
%12 = load i32*, i32** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
%16 = load i32, i32* %15
%17 = sitofp i32 %16 to float
%18 = load i32*, i32** %3
%19 = load i32, i32* %4
%20 = call i64 @arithmeticAvg(i32* %18, i32 %19)
%21 = sitofp i64 %20 to float
%22 = fsub float %17, %21
%23 = fptosi float %22 to i64
%24 = call i64 @pow(i64 %23, i32 2)
%25 = sitofp i64 %24 to float
%26 = load float, float* %6
%27 = fadd float %26, %25
store float %27, float* %6
br label %28
28: ; preds = %11
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 1
store i32 %30, i32* %5
br label %7
31: ; preds = %7
%32 = load float, float* %6
%33 = fdiv float %32, 1.000000e+01
%34 = call float @sqrt(float %33)
ret float %34
}

LLVM IR (-O2):
define float @standartDeviation(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %21
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %19, %6 ]
%8 = phi float [ 0.000000e+00, %4 ], [ %18, %6 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %7
%10 = load i32, i32* %9
%11 = sitofp i32 %10 to float
%12 = tail call i64 @arithmeticAvg(i32* %0, i32 %1)
%13 = sitofp i64 %12 to float
%14 = fsub float %11, %13
%15 = fptosi float %14 to i64
%16 = tail call i64 @pow(i64 %15, i32 2)
%17 = sitofp i64 %16 to float
%18 = fadd float %8, %17
%19 = add nuw nsw i64 %7, 1
%20 = icmp eq i64 %19, %5
br i1 %20, label %21, label %6
21: ; preds = %6, %2
%22 = phi float [ 0.000000e+00, %2 ], [ %18, %6 ]
%23 = fdiv float %22, 1.000000e+01
%24 = tail call float @sqrt(float %23)
ret float %24
}