#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 */
typedef scalar_t__ int64_t;

/* Variables and functions */
double sqrt(double);
int /*<<< orphan*/ stdlib_strided_dmeanvarpn(scalar_t__ const, double const,
                                             double const *, scalar_t__ const,
                                             double *, scalar_t__ const);
void stdlib_strided_dmeanstdevpn(const int64_t N, const double correction,
                                 const double *X, const int64_t strideX,
                                 double *Out, const int64_t strideOut) {
  int64_t io;
  stdlib_strided_dmeanvarpn(N, correction, X, strideX, Out, strideOut);
  if (strideOut < 0) {
    io = 0;
  } else {
    io = strideOut;
  }
  Out[io] = sqrt(Out[io]);
  return;
}


x86 assembly (clang, -O0):
<stdlib_strided_dmeanstdevpn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    -0x30(%rbp),%r8
call   1030 <stdlib_strided_dmeanvarpn@plt>
cmpq   $0x0,-0x30(%rbp)
jge    1177 <stdlib_strided_dmeanstdevpn+0x57>
movq   $0x0,-0x38(%rbp)
jmp    117f <stdlib_strided_dmeanstdevpn+0x5f>
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
call   1040 <sqrt@plt>
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdlib_strided_dmeanstdevpn>:
push   %r15
push   %r14
push   %rbx
mov    %r8,%r15
mov    %rcx,%r14
call   1030 <stdlib_strided_dmeanvarpn@plt>
xor    %ebx,%ebx
test   %r15,%r15
cmovns %r15,%rbx
movsd  (%r14,%rbx,8),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     114f <stdlib_strided_dmeanstdevpn+0x2f>
sqrtsd %xmm0,%xmm0
jmp    1154 <stdlib_strided_dmeanstdevpn+0x34>
call   1040 <sqrt@plt>
movsd  %xmm0,(%r14,%rbx,8)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @stdlib_strided_dmeanstdevpn(i64 %0, double %1, double* %2, i64 %3, double* %4, i64 %5) {
%7 = alloca i64
%8 = alloca double
%9 = alloca double*
%10 = alloca i64
%11 = alloca double*
%12 = alloca i64
%13 = alloca i64
store i64 %0, i64* %7
store double %1, double* %8
store double* %2, double** %9
store i64 %3, i64* %10
store double* %4, double** %11
store i64 %5, i64* %12
%14 = load i64, i64* %7
%15 = load double, double* %8
%16 = load double*, double** %9
%17 = load i64, i64* %10
%18 = load double*, double** %11
%19 = load i64, i64* %12
%20 = call i32 @stdlib_strided_dmeanvarpn(i64 %14, double %15, double* %16, i64 %17, double* %18, i64 %19)
%21 = load i64, i64* %12
%22 = icmp slt i64 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %6
store i64 0, i64* %13
br label %26
24: ; preds = %6
%25 = load i64, i64* %12
store i64 %25, i64* %13
br label %26
26: ; preds = %24, %23
%27 = load double*, double** %11
%28 = load i64, i64* %13
%29 = getelementptr inbounds double, double* %27, i64 %28
%30 = load double, double* %29
%31 = call double @sqrt(double %30)
%32 = load double*, double** %11
%33 = load i64, i64* %13
%34 = getelementptr inbounds double, double* %32, i64 %33
store double %31, double* %34
ret void
}

LLVM IR (-O2):
define void @stdlib_strided_dmeanstdevpn(i64 %0, double %1, double* %2, i64 %3, double* %4, i64 %5) {
%7 = tail call i32 @stdlib_strided_dmeanvarpn(i64 %0, double %1, double* %2, i64 %3, double* %4, i64 %5)
%8 = icmp sgt i64 %5, 0
%9 = select i1 %8, i64 %5, i64 0
%10 = getelementptr inbounds double, double* %4, i64 %9
%11 = load double, double* %10
%12 = tail call double @sqrt(double %11)
store double %12, double* %10
ret void
}