#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 */
double pcapack_sdev(int const, double *);
int pcapack_colsdev(const int m, const int n, double *x, double *colsdev) {
  int i, j;
  for (j = 0; j < n; j++)
    colsdev[j] = pcapack_sdev(m, x + (m * j));
  return 0;
}


x86 assembly (clang, -O0):
<pcapack_colsdev>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1170 <pcapack_colsdev+0x60>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x4(%rbp),%eax
imul   -0x20(%rbp),%eax
cltq
shl    $0x3,%rax
add    %rax,%rsi
call   1030 <pcapack_sdev@plt>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    112d <pcapack_colsdev+0x1d>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcapack_colsdev>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    115d <pcapack_colsdev+0x4d>
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %edi,%r15d
movslq %edi,%r13
mov    %esi,%r12d
shl    $0x3,%r13
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15d,%edi
mov    %rbx,%rsi
call   1030 <pcapack_sdev@plt>
movsd  %xmm0,(%r14,%rbp,8)
add    $0x1,%rbp
add    %r13,%rbx
cmp    %rbp,%r12
jne    1140 <pcapack_colsdev+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @pcapack_colsdev(i32 %0, i32 %1, double* %2, double* nocapture writeonly %3) {
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %17
6: ; preds = %4
%7 = sext i32 %0 to i64
%8 = zext i32 %1 to i64
br label %9
9: ; preds = %6, %9
%10 = phi i64 [ 0, %6 ], [ %15, %9 ]
%11 = mul nsw i64 %10, %7
%12 = getelementptr inbounds double, double* %2, i64 %11
%13 = tail call double @pcapack_sdev(i32 %0, double* %12)
%14 = getelementptr inbounds double, double* %3, i64 %10
store double %13, double* %14
%15 = add nuw nsw i64 %10, 1
%16 = icmp eq i64 %15, %8
br i1 %16, label %17, label %9
17: ; preds = %9, %4
ret i32 0
}