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


x86 assembly (clang, -O0):
<InversionNLProducts>:
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    126a <InversionNLProducts+0x13a>
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
mov    -0x38(%rbp),%ecx
mov    -0x40(%rbp),%r8d
mov    -0x30(%rbp),%r9
mov    -0x34(%rbp),%eax
mov    %eax,-0x6c(%rbp)
mov    -0x3c(%rbp),%eax
add    -0x48(%rbp),%eax
mov    %eax,-0x68(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x40(%rbp),%eax
mov    %eax,-0x60(%rbp)
mov    -0x48(%rbp),%r13d
mov    -0x4c(%rbp),%r12d
mov    -0x58(%rbp),%r15
mov    -0x4c(%rbp),%r14d
mov    -0x48(%rbp),%ebx
mov    0x10(%rbp),%r11d
mov    0x18(%rbp),%r10d
mov    0x28(%rbp),%eax
mov    %eax,-0x5c(%rbp)
movsd  0xdfe(%rip),%xmm0
xor    %eax,%eax
mov    -0x6c(%rbp),%eax
mov    %eax,(%rsp)
mov    -0x68(%rbp),%eax
mov    %eax,0x8(%rsp)
mov    -0x64(%rbp),%eax
mov    %eax,0x10(%rsp)
mov    -0x60(%rbp),%eax
mov    %eax,0x18(%rsp)
mov    -0x5c(%rbp),%eax
mov    %r13d,0x20(%rsp)
mov    %r12d,0x28(%rsp)
mov    %r15,0x30(%rsp)
mov    %r14d,0x38(%rsp)
movl   $0x0,0x40(%rsp)
mov    %ebx,0x48(%rsp)
movl   $0x0,0x50(%rsp)
mov    %r11d,0x58(%rsp)
mov    %r10d,0x60(%rsp)
mov    %eax,0x68(%rsp)
call   1050 <NLProduct@plt>
jmp    136e <InversionNLProducts+0x23e>
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    12f2 <InversionNLProducts+0x1c2>
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 <InversionNLProducts@plt>
jmp    1369 <InversionNLProducts+0x239>
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 <InversionNLProducts@plt>
jmp    136e <InversionNLProducts+0x23e>
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O0):
define void @InversionNLProducts(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 %65
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* %15
%48 = load i32, i32* %17
%49 = load double*, double** %13
%50 = load i32, i32* %14
%51 = load i32, i32* %16
%52 = load i32, i32* %25
%53 = add nsw i32 %51, %52
%54 = load i32, i32* %15
%55 = load i32, i32* %17
%56 = load i32, i32* %25
%57 = load i32, i32* %26
%58 = load double*, double** %27
%59 = load i32, i32* %26
%60 = load i32, i32* %25
%61 = load i32, i32* %19
%62 = load i32, i32* %20
%63 = load i32, i32* %22
%64 = call i32 @NLProduct(double* %44, i32 %45, i32 %46, i32 %47, i32 %48, double* %49, i32 %50, i32 %53, i32 %54, i32 %55, i32 %56, i32 %57, double -1.000000e+00, double* %58, i32 %59, i32 0, i32 %60, i32 0, i32 %61, i32 %62, i32 %63)
br label %110
65: ; preds = %12
%66 = load i32, i32* %22
%67 = load i32, i32* %20
%68 = load i32, i32* %19
%69 = sdiv i32 %68, 2
%70 = add nsw i32 %67, %69
%71 = icmp slt i32 %66, %70
br i1 %71, label %72, label %87
72: ; preds = %65
%73 = load double*, double** %13
%74 = load i32, i32* %14
%75 = load i32, i32* %15
%76 = load i32, i32* %16
%77 = load i32, i32* %17
%78 = load i32, i32* %25
%79 = load i32, i32* %19
%80 = sdiv i32 %79, 2
%81 = load i32, i32* %20
%82 = load i32, i32* %21
%83 = sub nsw i32 %82, 1
%84 = load i32, i32* %22
%85 = load double*, double** %23
%86 = load i32, i32* %24
br label %109
87: ; preds = %65
%88 = load double*, double** %13
%89 = load i32, i32* %14
%90 = load i32, i32* %15
%91 = load i32, i32* %16
%92 = load i32, i32* %25
%93 = add nsw i32 %91, %92
%94 = load i32, i32* %17
%95 = load i32, i32* %25
%96 = add nsw i32 %94, %95
%97 = load i32, i32* %26
%98 = load i32, i32* %19
%99 = sdiv i32 %98, 2
%100 = load i32, i32* %20
%101 = load i32, i32* %19
%102 = sdiv i32 %101, 2
%103 = add nsw i32 %100, %102
%104 = load i32, i32* %21
%105 = sub nsw i32 %104, 1
%106 = load i32, i32* %22
%107 = load double*, double** %23
%108 = load i32, i32* %24
br label %109
109: ; preds = %87, %72
br label %110
110: ; preds = %109, %37
ret void
}

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