#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*/ Chol(double *, int, int, int, int, int, int, int, int,
                        int /*<<< orphan*/, double *, int);
scalar_t__ calloc(int, int);
int /*<<< orphan*/ ceil(double);
int /*<<< orphan*/ free(double *);
int pow(int /*<<< orphan*/, int);
void ParallelChol(double *matrix, int r, int c, int ro, int co, int n,
                  int nCores, int deep) {
  double *memaux = (double *)calloc(2 * pow(ceil(0.5 * n), 2), sizeof(double));
  int blockSize = pow(ceil(0.5 * n), 2) / nCores;
  int i;
#pragma omp parallel default(shared) private(i)
  {
#pragma omp for schedule(static)
    for (i = 0; i < nCores; i++) {
      Chol(matrix, r, c, ro, co, n, nCores, i, deep, 0, memaux, blockSize);
    }
  }
  free(memaux);
}


x86 assembly (clang, -O0):
<ParallelChol>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x20(%rbp)
mov    %esi,-0x24(%rbp)
mov    %edx,-0x28(%rbp)
mov    %ecx,-0x2c(%rbp)
mov    %r8d,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
cvtsi2sdl -0x34(%rbp),%xmm1
movsd  0xe7b(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <ceil@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1070 <pow@plt>
mov    %eax,%edi
shl    $0x1,%edi
mov    $0x8,%esi
call   1060 <calloc@plt>
mov    %rax,-0x40(%rbp)
cvtsi2sdl -0x34(%rbp),%xmm1
movsd  0xe46(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1050 <ceil@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1070 <pow@plt>
cltd
idivl  0x10(%rbp)
mov    %eax,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    0x10(%rbp),%eax
jge    1244 <ParallelChol+0xf4>
mov    -0x20(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    -0x2c(%rbp),%ecx
mov    -0x30(%rbp),%r8d
mov    -0x34(%rbp),%r9d
mov    0x10(%rbp),%r14d
mov    -0x48(%rbp),%ebx
mov    0x18(%rbp),%r11d
mov    -0x40(%rbp),%r10
mov    -0x44(%rbp),%eax
xor    %r15d,%r15d
mov    %r14d,(%rsp)
mov    %ebx,0x8(%rsp)
mov    %r11d,0x10(%rsp)
movl   $0x0,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %eax,0x28(%rsp)
call   1040 <Chol@plt>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    11dd <ParallelChol+0x8d>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<ParallelChol>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r8d,0x14(%rsp)
mov    %ecx,0x10(%rsp)
mov    %edx,0xc(%rsp)
mov    %esi,0x8(%rsp)
mov    %rdi,%rbp
mov    0x68(%rsp),%eax
mov    %rax,0x20(%rsp)
mov    0x60(%rsp),%r13d
mov    %r9d,%r12d
cvtsi2sd %r9d,%xmm0
mulsd  0xe70(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
call   1050 <ceil@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1070 <pow@plt>
lea    (%rax,%rax,1),%edi
mov    $0x8,%esi
call   1060 <calloc@plt>
mov    %rax,%r14
movsd  0x18(%rsp),%xmm0
call   1050 <ceil@plt>
mov    %eax,%edi
mov    $0x2,%esi
call   1070 <pow@plt>
cltd
idiv   %r13d
test   %r13d,%r13d
jle    1215 <ParallelChol+0xc5>
mov    %eax,%r15d
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %rbp,%rdi
mov    0x8(%rsp),%esi
mov    0xc(%rsp),%edx
mov    0x10(%rsp),%ecx
mov    0x14(%rsp),%r8d
mov    %r12d,%r9d
push   %r15
push   %r14
push   $0x0
push   0x38(%rsp)
push   %rbx
push   %r13
call   1040 <Chol@plt>
add    $0x30,%rsp
add    $0x1,%ebx
cmp    %ebx,%r13d
jne    11e0 <ParallelChol+0x90>
mov    %r14,%rdi
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @ParallelChol(double* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = alloca double*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca double*
%18 = alloca i32
%19 = alloca i32
store double* %0, double** %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i32 %7, i32* %16
%20 = load i32, i32* %14
%21 = sitofp i32 %20 to double
%22 = fmul double 5.000000e-01, %21
%23 = call i32 @ceil(double %22)
%24 = call i32 @pow(i32 %23, i32 2)
%25 = mul nsw i32 2, %24
%26 = call i64 @calloc(i32 %25, i32 8)
%27 = inttoptr i64 %26 to double*
store double* %27, double** %17
%28 = load i32, i32* %14
%29 = sitofp i32 %28 to double
%30 = fmul double 5.000000e-01, %29
%31 = call i32 @ceil(double %30)
%32 = call i32 @pow(i32 %31, i32 2)
%33 = load i32, i32* %15
%34 = sdiv i32 %32, %33
store i32 %34, i32* %18
store i32 0, i32* %19
br label %35
35: ; preds = %52, %8
%36 = load i32, i32* %19
%37 = load i32, i32* %15
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %55
39: ; preds = %35
%40 = load double*, double** %9
%41 = load i32, i32* %10
%42 = load i32, i32* %11
%43 = load i32, i32* %12
%44 = load i32, i32* %13
%45 = load i32, i32* %14
%46 = load i32, i32* %15
%47 = load i32, i32* %19
%48 = load i32, i32* %16
%49 = load double*, double** %17
%50 = load i32, i32* %18
%51 = call i32 @Chol(double* %40, i32 %41, i32 %42, i32 %43, i32 %44, i32 %45, i32 %46, i32 %47, i32 %48, i32 0, double* %49, i32 %50)
br label %52
52: ; preds = %39
%53 = load i32, i32* %19
%54 = add nsw i32 %53, 1
store i32 %54, i32* %19
br label %35
55: ; preds = %35
%56 = load double*, double** %17
%57 = call i32 @free(double* %56)
ret void
}

LLVM IR (-O2):
define void @ParallelChol(double* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7) {
%9 = sitofp i32 %5 to double
%10 = fmul double %9, 5.000000e-01
%11 = tail call i32 @ceil(double %10)
%12 = tail call i32 @pow(i32 %11, i32 2)
%13 = shl nsw i32 %12, 1
%14 = tail call i64 @calloc(i32 %13, i32 8)
%15 = inttoptr i64 %14 to double*
%16 = tail call i32 @ceil(double %10)
%17 = tail call i32 @pow(i32 %16, i32 2)
%18 = sdiv i32 %17, %6
%19 = icmp sgt i32 %6, 0
br i1 %19, label %20, label %25
20: ; preds = %8, %20
%21 = phi i32 [ %23, %20 ], [ 0, %8 ]
%22 = tail call i32 @Chol(double* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %21, i32 %7, i32 0, double* %15, i32 %18)
%23 = add nuw nsw i32 %21, 1
%24 = icmp eq i32 %23, %6
br i1 %24, label %25, label %20
25: ; preds = %20, %8
%26 = tail call i32 @free(double* %15)
ret void
}