#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*/ LNProduct(double *, int, int, int, int, double *, int,
                             int /*<<< orphan*/, int, int /*<<< orphan*/, int,
                             int, double, double *, int, int, int, int, int,
                             int, int);
int ceil(double);
void InversionLNProducts(double *matrix, int r, int c, int ro, int co, int n,
                         int nCores, int posIni, int deep, int numTh,
                         double *memaux, int blockSize) {
  int size1 = ceil(0.5 * n);
  int size2 = n - size1;
  if (deep == 1) {
    double *C1 = &memaux[posIni * blockSize];
    LNProduct(matrix, r, ro + size1, c, co + size1, C1, size2, 0, size1, 0,
              size2, size1, 1.0, matrix, r, ro + size1, c, co, nCores, posIni,
              numTh);
  } else {
    if (numTh < posIni + nCores / 2)
      InversionLNProducts(matrix, r, c, ro, co, size1, nCores / 2, posIni,
                          deep - 1, numTh, memaux, blockSize);
    else
      InversionLNProducts(matrix, r, c, ro + size1, co + size1, size2,
                          nCores / 2, posIni + nCores / 2, deep - 1, numTh,
                          memaux, blockSize);
  }
}


x86 assembly (clang, -O0):
<InversionLNProducts>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x30(%rbp)
mov    %esi,-0x34(%rbp)
mov    %edx,-0x38(%rbp)
mov    %ecx,-0x3c(%rbp)
mov    %r8d,-0x40(%rbp)
mov    %r9d,-0x44(%rbp)
cvtsi2sdl -0x44(%rbp),%xmm1
movsd  0xe87(%rip),%xmm0
mulsd  %xmm1,%xmm0
call   1030 <ceil@plt>
mov    %eax,-0x48(%rbp)
mov    -0x44(%rbp),%eax
sub    -0x48(%rbp),%eax
mov    %eax,-0x4c(%rbp)
cmpl   $0x1,0x20(%rbp)
jne    1272 <InversionLNProducts+0x142>
mov    0x30(%rbp),%rax
mov    0x18(%rbp),%ecx
imul   0x38(%rbp),%ecx
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x58(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x3c(%rbp),%edx
add    -0x48(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x40(%rbp),%r8d
add    -0x48(%rbp),%r8d
mov    -0x58(%rbp),%r9
mov    -0x4c(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x48(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x4c(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x48(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x30(%rbp),%r13
mov    -0x34(%rbp),%r12d
mov    -0x3c(%rbp),%r15d
add    -0x48(%rbp),%r15d
mov    -0x38(%rbp),%r14d
mov    -0x40(%rbp),%ebx
mov    0x10(%rbp),%r11d
mov    0x18(%rbp),%r10d
mov    0x28(%rbp),%eax
mov    %eax,-0x5c(%rbp)
xor    %eax,%eax
mov    -0x6c(%rbp),%eax
movsd  0xdf1(%rip),%xmm0
mov    %eax,(%rsp)
mov    -0x68(%rbp),%eax
movl   $0x0,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    -0x64(%rbp),%eax
movl   $0x0,0x18(%rsp)
mov    %eax,0x20(%rsp)
mov    -0x60(%rbp),%eax
mov    %eax,0x28(%rsp)
mov    -0x5c(%rbp),%eax
mov    %r13,0x30(%rsp)
mov    %r12d,0x38(%rsp)
mov    %r15d,0x40(%rsp)
mov    %r14d,0x48(%rsp)
mov    %ebx,0x50(%rsp)
mov    %r11d,0x58(%rsp)
mov    %r10d,0x60(%rsp)
mov    %eax,0x68(%rsp)
call   1050 <LNProduct@plt>
jmp    1376 <InversionLNProducts+0x246>
mov    0x28(%rbp),%eax
mov    %eax,-0x70(%rbp)
mov    0x18(%rbp),%ecx
mov    0x10(%rbp),%eax
mov    $0x2,%esi
cltd
idiv   %esi
mov    %eax,%edx
mov    -0x70(%rbp),%eax
add    %edx,%ecx
cmp    %ecx,%eax
jge    12fa <InversionLNProducts+0x1ca>
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0x3c(%rbp),%ecx
mov    -0x40(%rbp),%r8d
mov    -0x48(%rbp),%r9d
mov    0x10(%rbp),%eax
mov    $0x2,%r10d
cltd
idiv   %r10d
mov    -0x74(%rbp),%edx
mov    %eax,%r15d
mov    0x18(%rbp),%r14d
mov    0x20(%rbp),%ebx
sub    $0x1,%ebx
mov    0x28(%rbp),%r11d
mov    0x30(%rbp),%r10
mov    0x38(%rbp),%eax
mov    %r15d,(%rsp)
mov    %r14d,0x8(%rsp)
mov    %ebx,0x10(%rsp)
mov    %r11d,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %eax,0x28(%rsp)
call   1040 <InversionLNProducts@plt>
jmp    1371 <InversionLNProducts+0x241>
mov    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%eax
mov    %eax,-0x78(%rbp)
mov    -0x3c(%rbp),%ecx
add    -0x48(%rbp),%ecx
mov    -0x40(%rbp),%r8d
add    -0x48(%rbp),%r8d
mov    -0x4c(%rbp),%r9d
mov    0x10(%rbp),%eax
mov    $0x2,%r10d
cltd
idiv   %r10d
mov    %eax,%r15d
mov    0x18(%rbp),%r14d
mov    0x10(%rbp),%eax
mov    $0x2,%r10d
cltd
idiv   %r10d
mov    -0x78(%rbp),%edx
add    %eax,%r14d
mov    0x20(%rbp),%ebx
sub    $0x1,%ebx
mov    0x28(%rbp),%r11d
mov    0x30(%rbp),%r10
mov    0x38(%rbp),%eax
mov    %r15d,(%rsp)
mov    %r14d,0x8(%rsp)
mov    %ebx,0x10(%rsp)
mov    %r11d,0x18(%rsp)
mov    %r10,0x20(%rsp)
mov    %eax,0x28(%rsp)
call   1040 <InversionLNProducts@plt>
jmp    1376 <InversionLNProducts+0x246>
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<InversionLNProducts>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9d,%ebx
mov    %r8,(%rsp)
mov    %rcx,0x8(%rsp)
mov    %rdx,0x10(%rsp)
mov    %esi,%r13d
mov    %rdi,%r14
mov    0x70(%rsp),%r15d
mov    0x68(%rsp),%ebp
mov    0x60(%rsp),%r12d
cvtsi2sd %r9d,%xmm0
mulsd  0xea0(%rip),%xmm0
call   1030 <ceil@plt>
cmp    $0x1,%r15d
mov    %r14,0x20(%rsp)
mov    %r13,0x18(%rsp)
jne    11bc <InversionLNProducts+0x9c>
mov    %ebp,%r14d
mov    %r12d,%r13d
jmp    121f <InversionLNProducts+0xff>
sub    %eax,%ebx
mov    0x8(%rsp),%rcx
add    %eax,%ecx
mov    %rcx,0x8(%rsp)
mov    (%rsp),%rcx
add    %eax,%ecx
mov    %rcx,(%rsp)
add    $0xffffffff,%r15d
xorps  %xmm0,%xmm0
cvtsi2sd %ebx,%xmm0
mulsd  0xe55(%rip),%xmm0
call   1030 <ceil@plt>
mov    %r14d,%ebp
mov    %r13d,%r12d
cmp    $0x1,%r15d
je     121f <InversionLNProducts+0xff>
mov    %r12d,%r13d
shr    $0x1f,%r13d
add    %r12d,%r13d
sar    %r13d
lea    0x0(%r13,%rbp,1),%r14d
mov    0x78(%rsp),%r12d
cmp    %r12d,%r14d
jle    1180 <InversionLNProducts+0x60>
nopl   0x0(%rax,%rax,1)
mov    %eax,%ebx
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
mulsd  0xe0f(%rip),%xmm0
call   1030 <ceil@plt>
cmp    $0x2,%r15d
je     121c <InversionLNProducts+0xfc>
mov    %r13d,%ecx
shr    $0x1f,%ecx
add    %r13d,%ecx
sar    %ecx
lea    (%rcx,%rbp,1),%r14d
add    $0xffffffff,%r15d
mov    %ecx,%r13d
cmp    %r12d,%r14d
jg     11e0 <InversionLNProducts+0xc0>
jmp    1180 <InversionLNProducts+0x60>
mov    %ebp,%r14d
sub    %eax,%ebx
mov    0x88(%rsp),%ecx
imul   %r14d,%ecx
movslq %ecx,%rcx
mov    0x80(%rsp),%rdx
lea    (%rdx,%rcx,8),%r9
mov    0x8(%rsp),%rdx
add    %eax,%edx
mov    (%rsp),%r10
lea    (%rax,%r10,1),%r8d
movsd  0xdb6(%rip),%xmm0
mov    0x20(%rsp),%rdi
mov    0x18(%rsp),%rsi
mov    0x10(%rsp),%rcx
mov    0x78(%rsp),%ebp
push   %rbp
push   %r14
push   %r13
push   %r10
push   %rcx
push   %rdx
push   %rsi
push   %rdi
push   %rax
push   %rbx
push   $0x0
push   %rax
push   $0x0
push   %rbx
call   1040 <LNProduct@plt>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @InversionLNProducts(double* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, double* %10, i32 %11) {
%13 = alloca double*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca double*
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca double*
store double* %0, double** %13
store i32 %1, i32* %14
store i32 %2, i32* %15
store i32 %3, i32* %16
store i32 %4, i32* %17
store i32 %5, i32* %18
store i32 %6, i32* %19
store i32 %7, i32* %20
store i32 %8, i32* %21
store i32 %9, i32* %22
store double* %10, double** %23
store i32 %11, i32* %24
%28 = load i32, i32* %18
%29 = sitofp i32 %28 to double
%30 = fmul double 5.000000e-01, %29
%31 = call i32 @ceil(double %30)
store i32 %31, i32* %25
%32 = load i32, i32* %18
%33 = load i32, i32* %25
%34 = sub nsw i32 %32, %33
store i32 %34, i32* %26
%35 = load i32, i32* %21
%36 = icmp eq i32 %35, 1
br i1 %36, label %37, label %69
37: ; preds = %12
%38 = load double*, double** %23
%39 = load i32, i32* %20
%40 = load i32, i32* %24
%41 = mul nsw i32 %39, %40
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds double, double* %38, i64 %42
store double* %43, double** %27
%44 = load double*, double** %13
%45 = load i32, i32* %14
%46 = load i32, i32* %16
%47 = load i32, i32* %25
%48 = add nsw i32 %46, %47
%49 = load i32, i32* %15
%50 = load i32, i32* %17
%51 = load i32, i32* %25
%52 = add nsw i32 %50, %51
%53 = load double*, double** %27
%54 = load i32, i32* %26
%55 = load i32, i32* %25
%56 = load i32, i32* %26
%57 = load i32, i32* %25
%58 = load double*, double** %13
%59 = load i32, i32* %14
%60 = load i32, i32* %16
%61 = load i32, i32* %25
%62 = add nsw i32 %60, %61
%63 = load i32, i32* %15
%64 = load i32, i32* %17
%65 = load i32, i32* %19
%66 = load i32, i32* %20
%67 = load i32, i32* %22
%68 = call i32 @LNProduct(double* %44, i32 %45, i32 %48, i32 %49, i32 %52, double* %53, i32 %54, i32 0, i32 %55, i32 0, i32 %56, i32 %57, double 1.000000e+00, double* %58, i32 %59, i32 %62, i32 %63, i32 %64, i32 %65, i32 %66, i32 %67)
br label %114
69: ; preds = %12
%70 = load i32, i32* %22
%71 = load i32, i32* %20
%72 = load i32, i32* %19
%73 = sdiv i32 %72, 2
%74 = add nsw i32 %71, %73
%75 = icmp slt i32 %70, %74
br i1 %75, label %76, label %91
76: ; preds = %69
%77 = load double*, double** %13
%78 = load i32, i32* %14
%79 = load i32, i32* %15
%80 = load i32, i32* %16
%81 = load i32, i32* %17
%82 = load i32, i32* %25
%83 = load i32, i32* %19
%84 = sdiv i32 %83, 2
%85 = load i32, i32* %20
%86 = load i32, i32* %21
%87 = sub nsw i32 %86, 1
%88 = load i32, i32* %22
%89 = load double*, double** %23
%90 = load i32, i32* %24
br label %113
91: ; preds = %69
%92 = load double*, double** %13
%93 = load i32, i32* %14
%94 = load i32, i32* %15
%95 = load i32, i32* %16
%96 = load i32, i32* %25
%97 = add nsw i32 %95, %96
%98 = load i32, i32* %17
%99 = load i32, i32* %25
%100 = add nsw i32 %98, %99
%101 = load i32, i32* %26
%102 = load i32, i32* %19
%103 = sdiv i32 %102, 2
%104 = load i32, i32* %20
%105 = load i32, i32* %19
%106 = sdiv i32 %105, 2
%107 = add nsw i32 %104, %106
%108 = load i32, i32* %21
%109 = sub nsw i32 %108, 1
%110 = load i32, i32* %22
%111 = load double*, double** %23
%112 = load i32, i32* %24
br label %113
113: ; preds = %91, %76
br label %114
114: ; preds = %113, %37
ret void
}

LLVM IR (-O2):
define void @InversionLNProducts(double* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, double* %10, i32 %11) {
%13 = sitofp i32 %5 to double
%14 = fmul double %13, 5.000000e-01
%15 = tail call i32 @ceil(double %14)
%16 = icmp eq i32 %8, 1
br i1 %16, label %28, label %17
17: ; preds = %12, %55
%18 = phi i32 [ %67, %55 ], [ %15, %12 ]
%19 = phi i32 [ %64, %55 ], [ %8, %12 ]
%20 = phi i32 [ %60, %55 ], [ %7, %12 ]
%21 = phi i32 [ %59, %55 ], [ %6, %12 ]
%22 = phi i32 [ %61, %55 ], [ %5, %12 ]
%23 = phi i32 [ %63, %55 ], [ %4, %12 ]
%24 = phi i32 [ %62, %55 ], [ %3, %12 ]
%25 = sdiv i32 %21, 2
%26 = add nsw i32 %25, %20
%27 = icmp sgt i32 %26, %9
br i1 %27, label %46, label %55
28: ; preds = %55, %46, %12
%29 = phi i32 [ %15, %12 ], [ %53, %46 ], [ %67, %55 ]
%30 = phi i32 [ %5, %12 ], [ %49, %46 ], [ %61, %55 ]
%31 = phi i32 [ %3, %12 ], [ %24, %46 ], [ %62, %55 ]
%32 = phi i32 [ %4, %12 ], [ %23, %46 ], [ %63, %55 ]
%33 = phi i32 [ %7, %12 ], [ %20, %46 ], [ %60, %55 ]
%34 = phi i32 [ %6, %12 ], [ %47, %46 ], [ %59, %55 ]
%35 = sub nsw i32 %30, %29
%36 = mul nsw i32 %33, %11
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds double, double* %10, i64 %37
%39 = add nsw i32 %29, %31
%40 = add nsw i32 %29, %32
%41 = tail call i32 @LNProduct(double* %0, i32 %1, i32 %39, i32 %2, i32 %40, double* %38, i32 %35, i32 0, i32 %29, i32 0, i32 %35, i32 %29, double 1.000000e+00, double* %0, i32 %1, i32 %39, i32 %2, i32 %32, i32 %34, i32 %33, i32 %9)
ret void
42: ; preds = %46
%43 = sdiv i32 %47, 2
%44 = add nsw i32 %43, %20
%45 = icmp sgt i32 %44, %9
br i1 %45, label %46, label %55
46: ; preds = %17, %42
%47 = phi i32 [ %43, %42 ], [ %25, %17 ]
%48 = phi i32 [ %50, %42 ], [ %19, %17 ]
%49 = phi i32 [ %53, %42 ], [ %18, %17 ]
%50 = add nsw i32 %48, -1
%51 = sitofp i32 %49 to double
%52 = fmul double %51, 5.000000e-01
%53 = tail call i32 @ceil(double %52)
%54 = icmp eq i32 %50, 1
br i1 %54, label %28, label %42
55: ; preds = %42, %17
%56 = phi i32 [ %18, %17 ], [ %53, %42 ]
%57 = phi i32 [ %19, %17 ], [ %50, %42 ]
%58 = phi i32 [ %22, %17 ], [ %49, %42 ]
%59 = phi i32 [ %25, %17 ], [ %43, %42 ]
%60 = phi i32 [ %26, %17 ], [ %44, %42 ]
%61 = sub nsw i32 %58, %56
%62 = add nsw i32 %56, %24
%63 = add nsw i32 %56, %23
%64 = add nsw i32 %57, -1
%65 = sitofp i32 %61 to double
%66 = fmul double %65, 5.000000e-01
%67 = tail call i32 @ceil(double %66)
%68 = icmp eq i32 %64, 1
br i1 %68, label %28, label %17
}