#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*/ NPdsymm_sum(int, double *, double *, int);
void NPdsymm_021_sum(int *shape, double *a, double *out, int hermi) {
#pragma omp parallel default(none) shared(shape, a, out, hermi)
  {
    int ic;
    size_t nn = shape[1] * shape[1];
#pragma omp for schedule(static)
    for (ic = 0; ic < shape[0]; ic++) {
      NPdsymm_sum(shape[1], a + ic * nn, out + ic * nn, hermi);
    }
  }
}


x86 assembly (clang, -O0):
<NPdsymm_021_sum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x8(%rbp),%rcx
imul   0x4(%rcx),%eax
cltq
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    (%rcx),%eax
jge    1197 <NPdsymm_021_sum+0x87>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
mov    -0x10(%rbp),%rsi
movslq -0x20(%rbp),%rax
imul   -0x28(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rsi
mov    -0x18(%rbp),%rdx
movslq -0x20(%rbp),%rax
imul   -0x28(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <NPdsymm_sum@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1143 <NPdsymm_021_sum+0x33>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NPdsymm_021_sum>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
cmpl   $0x0,(%rdi)
jle    1184 <NPdsymm_021_sum+0x74>
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %rsi,%rbp
mov    %rdi,%r15
mov    0x4(%rdi),%r12d
mov    %r12d,%edi
call   1030 <NPdsymm_sum@plt>
cmpl   $0x2,(%r15)
jl     1184 <NPdsymm_021_sum+0x74>
imul   %r12d,%r12d
lea    (%rbx,%r12,8),%r13
lea    0x0(%rbp,%r12,8),%rbp
shl    $0x3,%r12
mov    $0x1,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x4(%r15),%edi
mov    %rbp,%rsi
mov    %r13,%rdx
mov    %r14d,%ecx
call   1030 <NPdsymm_sum@plt>
add    $0x1,%rbx
movslq (%r15),%rax
add    %r12,%r13
add    %r12,%rbp
cmp    %rax,%rbx
jl     1160 <NPdsymm_021_sum+0x50>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @NPdsymm_021_sum(i32* %0, double* %1, double* %2, i32 %3) {
%5 = alloca i32*
%6 = alloca double*
%7 = alloca double*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i64
store i32* %0, i32** %5
store double* %1, double** %6
store double* %2, double** %7
store i32 %3, i32* %8
%11 = load i32*, i32** %5
%12 = getelementptr inbounds i32, i32* %11, i64 1
%13 = load i32, i32* %12
%14 = load i32*, i32** %5
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = mul nsw i32 %13, %16
%18 = sext i32 %17 to i64
store i64 %18, i64* %10
store i32 0, i32* %9
br label %19
19: ; preds = %43, %4
%20 = load i32, i32* %9
%21 = load i32*, i32** %5
%22 = getelementptr inbounds i32, i32* %21, i64 0
%23 = load i32, i32* %22
%24 = icmp slt i32 %20, %23
br i1 %24, label %25, label %46
25: ; preds = %19
%26 = load i32*, i32** %5
%27 = getelementptr inbounds i32, i32* %26, i64 1
%28 = load i32, i32* %27
%29 = load double*, double** %6
%30 = load i32, i32* %9
%31 = sext i32 %30 to i64
%32 = load i64, i64* %10
%33 = mul i64 %31, %32
%34 = getelementptr inbounds double, double* %29, i64 %33
%35 = load double*, double** %7
%36 = load i32, i32* %9
%37 = sext i32 %36 to i64
%38 = load i64, i64* %10
%39 = mul i64 %37, %38
%40 = getelementptr inbounds double, double* %35, i64 %39
%41 = load i32, i32* %8
%42 = call i32 @NPdsymm_sum(i32 %28, double* %34, double* %40, i32 %41)
br label %43
43: ; preds = %25
%44 = load i32, i32* %9
%45 = add nsw i32 %44, 1
store i32 %45, i32* %9
br label %19
46: ; preds = %19
ret void
}

LLVM IR (-O2):
define void @NPdsymm_021_sum(i32* nocapture %0, double* %1, double* %2, i32 %3) {
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, %6
%8 = zext i32 %7 to i64
%9 = load i32, i32* %0
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %26
11: ; preds = %4
%12 = tail call i32 @NPdsymm_sum(i32 %6, double* %1, double* %2, i32 %3)
%13 = load i32, i32* %0
%14 = icmp sgt i32 %13, 1
br i1 %14, label %15, label %26
15: ; preds = %11, %15
%16 = phi i64 [ %22, %15 ], [ 1, %11 ]
%17 = load i32, i32* %5
%18 = mul nuw nsw i64 %16, %8
%19 = getelementptr inbounds double, double* %1, i64 %18
%20 = getelementptr inbounds double, double* %2, i64 %18
%21 = tail call i32 @NPdsymm_sum(i32 %17, double* %19, double* %20, i32 %3)
%22 = add nuw nsw i64 %16, 1
%23 = load i32, i32* %0
%24 = sext i32 %23 to i64
%25 = icmp slt i64 %22, %24
br i1 %25, label %15, label %26
26: ; preds = %15, %11, %4
ret void
}