#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 smoothedDirac(double, double);
double smoothedHeaviside(double, double);
double sqrt(double);
void redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate(
    int nPoints, int nSpace, double eps, double lambda_penalty,
    double *u_levelSet, double *u, double *grad_u, double *m, double *dm,
    double *H, double *dH, double *r, double *dr) {
  int i, I;
  double Si, normGradU;
  for (i = 0; i < nPoints; i++) {
    m[i] = u[i];
    dm[i] = 1.0;
    H[i] = 0.0;
    Si = -1.0 + 2.0 * smoothedHeaviside(eps, u_levelSet[i]);
    ;
    r[i] = -Si;
    normGradU = 0.0;
    for (I = 0; I < nSpace; I++)
      normGradU += grad_u[i * nSpace + I] * grad_u[i * nSpace + I];
    normGradU = sqrt(normGradU);
    H[i] = Si * normGradU;
    for (I = 0; I < nSpace; I++) {
      dH[i * nSpace + I] = Si * grad_u[i * nSpace + I] / (normGradU + 1.0e-12);
    }
    r[i] += (u[i] - u_levelSet[i]) * lambda_penalty *
            smoothedDirac(eps, u_levelSet[i]);
    dr[i] = lambda_penalty * smoothedDirac(eps, u_levelSet[i]);
  }
}


x86 assembly (clang, -O0):
<redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    13a8 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x278>
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x38(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    0x10(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  0xe5f(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x10(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
call   1050 <smoothedHeaviside@plt>
addsd  %xmm0,%xmm0
movsd  0xe1f(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x48(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    127a <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x14a>
mov    -0x30(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x40(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x40(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm2
movsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1222 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0xf2>
movsd  -0x50(%rbp),%xmm0
call   1030 <sqrt@plt>
movsd  %xmm0,-0x50(%rbp)
movsd  -0x48(%rbp),%xmm0
mulsd  -0x50(%rbp),%xmm0
mov    0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x0,-0x40(%rbp)
mov    -0x40(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1303 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x1d3>
movsd  -0x48(%rbp),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x40(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  0xd3a(%rip),%xmm1
addsd  -0x50(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    0x20(%rbp),%rax
mov    -0x3c(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x40(%rbp),%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    12a7 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x177>
mov    -0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
call   1040 <smoothedDirac@plt>
movaps %xmm0,%xmm2
movsd  -0x60(%rbp),%xmm0
mov    0x28(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
call   1040 <smoothedDirac@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    0x30(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1173 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x43>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xa8,%rsp
mov    %r9,0xa0(%rsp)
mov    %r8,0x20(%rsp)
movsd  %xmm1,0x30(%rsp)
mov    %esi,0x4(%rsp)
test   %edi,%edi
jle    15c1 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x491>
movapd %xmm0,%xmm2
mov    0xf8(%rsp),%rbx
mov    0xf0(%rsp),%r8
mov    0xe8(%rsp),%rsi
movslq 0x4(%rsp),%r9
mov    %edi,%edi
mov    %rdi,0x98(%rsp)
mov    %r9d,%eax
mov    %eax,%edi
and    $0xfffffffe,%edi
mov    %rdi,0x68(%rsp)
add    $0xfffffffffffffffe,%rdi
mov    %rdi,0x60(%rsp)
mov    %rdi,%rbp
shr    %rbp
add    $0x1,%rbp
mov    %eax,%r15d
and    $0x3,%r15d
mov    %eax,%edi
and    $0xfffffffc,%edi
mov    %rdi,0x70(%rsp)
mov    %rbp,%rdi
mov    %rbp,0x58(%rsp)
and    $0xfffffffffffffffe,%rbp
mov    %rbp,0x50(%rsp)
mov    %rax,%rdi
neg    %rdi
mov    %rdi,0x78(%rsp)
mov    %rax,0x28(%rsp)
add    $0xffffffffffffffff,%rax
mov    %rax,0x88(%rsp)
mov    0x20(%rsp),%r14
lea    0x18(%r14),%r12
mov    %r9,0x80(%rsp)
lea    0x0(,%r9,8),%rax
mov    %rax,0x90(%rsp)
lea    0x10(%r8),%rdi
lea    0x8(%r8),%rbp
xor    %r13d,%r13d
mov    %rcx,0x18(%rsp)
mov    %rdx,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
jmp    1302 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x1d2>
nopw   0x0(%rax,%rax,1)
mulsd  0xdd8(%rip),%xmm5
mov    0xe8(%rsp),%rax
movsd  %xmm5,(%rax,%r13,8)
mov    0x18(%rsp),%r9
mov    0x10(%rsp),%rdi
movsd  0x8(%rsp),%xmm4
movsd  (%r9,%r13,8),%xmm0
movsd  (%rdi,%r13,8),%xmm1
subsd  %xmm1,%xmm0
mulsd  0x30(%rsp),%xmm0
movsd  %xmm0,0x40(%rsp)
movapd %xmm4,%xmm0
call   1040 <smoothedDirac@plt>
mulsd  0x40(%rsp),%xmm0
mov    0xf8(%rsp),%rbx
addsd  (%rbx,%r13,8),%xmm0
movsd  %xmm0,(%rbx,%r13,8)
mov    0x10(%rsp),%rax
movsd  (%rax,%r13,8),%xmm1
movsd  0x8(%rsp),%xmm0
call   1040 <smoothedDirac@plt>
movsd  0x8(%rsp),%xmm2
mov    0x10(%rsp),%rdx
mov    0x18(%rsp),%rcx
mulsd  0x30(%rsp),%xmm0
mov    0x100(%rsp),%rax
movsd  %xmm0,(%rax,%r13,8)
add    $0x1,%r13
mov    0x90(%rsp),%rax
add    %rax,%r12
add    %rax,%r14
mov    0x38(%rsp),%rdi
add    %rax,%rdi
add    %rax,%rbp
cmp    0x98(%rsp),%r13
mov    0xe8(%rsp),%rsi
je     15c1 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x491>
mov    %rdi,0x38(%rsp)
movsd  (%rcx,%r13,8),%xmm0
mov    0xa0(%rsp),%rax
movsd  %xmm0,(%rax,%r13,8)
mov    0xe0(%rsp),%rax
movabs $0x3ff0000000000000,%rcx
mov    %rcx,(%rax,%r13,8)
movq   $0x0,(%rsi,%r13,8)
movsd  (%rdx,%r13,8),%xmm1
movapd %xmm2,%xmm0
call   1050 <smoothedHeaviside@plt>
movapd %xmm0,%xmm5
addsd  %xmm0,%xmm5
addsd  0xca8(%rip),%xmm5
movapd %xmm5,%xmm0
xorpd  0xcbc(%rip),%xmm0
movlpd %xmm0,(%rbx,%r13,8)
cmpl   $0x0,0x4(%rsp)
jle    1230 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x100>
cmpq   $0x3,0x88(%rsp)
jae    1390 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x260>
xorpd  %xmm0,%xmm0
xor    %eax,%eax
jmp    13e4 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x2b4>
nopl   0x0(%rax,%rax,1)
xorpd  %xmm0,%xmm0
xor    %eax,%eax
mov    0x70(%rsp),%rcx
nopl   0x0(%rax,%rax,1)
movsd  -0x18(%r12,%rax,8),%xmm1
movsd  -0x10(%r12,%rax,8),%xmm2
mulsd  %xmm1,%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x8(%r12,%rax,8),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm2,%xmm1
movsd  (%r12,%rax,8),%xmm0
mulsd  %xmm0,%xmm0
addsd  %xmm1,%xmm0
add    $0x4,%rax
cmp    %rax,%rcx
jne    13a0 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x270>
test   %r15,%r15
je     1406 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x2d6>
lea    (%r14,%rax,8),%rax
xor    %ecx,%ecx
nop
movsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
add    $0x1,%rcx
cmp    %rcx,%r15
jne    13f0 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x2c0>
ucomisd 0xc02(%rip),%xmm0
jb     1420 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x2f0>
sqrtsd %xmm0,%xmm0
jmp    1431 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x301>
cs nopw 0x0(%rax,%rax,1)
movapd %xmm5,0x40(%rsp)
call   1030 <sqrt@plt>
movapd 0x40(%rsp),%xmm5
mov    0x20(%rsp),%r8
mov    0x18(%rsp),%r9
mov    0x10(%rsp),%rdi
movsd  0x8(%rsp),%xmm4
mov    0xf0(%rsp),%r10
mov    0x28(%rsp),%rbx
movapd %xmm5,%xmm1
mulsd  %xmm0,%xmm1
mov    0xe8(%rsp),%rax
movsd  %xmm1,(%rax,%r13,8)
cmpl   $0x0,0x4(%rsp)
jle    1256 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x126>
mov    %r13,%rax
imul   0x80(%rsp),%rax
addsd  0xb80(%rip),%xmm0
cmpl   $0x1,0x4(%rsp)
je     14b1 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x381>
lea    (%rax,%rbx,1),%rcx
lea    (%r10,%rax,8),%rdx
lea    (%r8,%rcx,8),%rsi
cmp    %rsi,%rdx
jae    1527 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x3f7>
lea    (%r10,%rcx,8),%rcx
lea    (%r8,%rax,8),%rdx
cmp    %rcx,%rdx
jae    1527 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x3f7>
xor    %edx,%edx
mov    %rdx,%rcx
test   $0x1,%bl
je     14d9 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x3a9>
add    %rdx,%rax
movsd  (%r8,%rax,8),%xmm1
mulsd  %xmm5,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,(%r10,%rax,8)
mov    %rdx,%rcx
or     $0x1,%rcx
not    %rdx
cmp    0x78(%rsp),%rdx
je     1256 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x126>
nopw   0x0(%rax,%rax,1)
movsd  (%r14,%rcx,8),%xmm1
mulsd  %xmm5,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,-0x8(%rbp,%rcx,8)
movsd  0x8(%r14,%rcx,8),%xmm1
mulsd  %xmm5,%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x0(%rbp,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%rbx
jne    14f0 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x3c0>
jmp    1256 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x126>
movapd %xmm5,%xmm1
unpcklpd %xmm5,%xmm1
movapd %xmm0,%xmm2
unpcklpd %xmm0,%xmm2
cmpq   $0x0,0x60(%rsp)
je     15b6 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x486>
mov    0x50(%rsp),%rdx
xor    %ecx,%ecx
mov    0x38(%rsp),%rsi
nopl   0x0(%rax,%rax,1)
movupd (%r14,%rcx,8),%xmm3
mulpd  %xmm1,%xmm3
divpd  %xmm2,%xmm3
movupd %xmm3,-0x10(%rsi,%rcx,8)
movupd 0x10(%r14,%rcx,8),%xmm3
mulpd  %xmm1,%xmm3
divpd  %xmm2,%xmm3
movupd %xmm3,(%rsi,%rcx,8)
add    $0x4,%rcx
add    $0xfffffffffffffffe,%rdx
jne    1550 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x420>
testb  $0x1,0x58(%rsp)
je     15a0 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x470>
add    %rax,%rcx
movupd (%r8,%rcx,8),%xmm3
mulpd  %xmm3,%xmm1
divpd  %xmm2,%xmm1
movupd %xmm1,(%r10,%rcx,8)
mov    0x68(%rsp),%rcx
mov    %rcx,%rdx
cmp    %rbx,%rcx
je     1256 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x126>
jmp    14b3 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x383>
xor    %ecx,%ecx
testb  $0x1,0x58(%rsp)
jne    1589 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x459>
jmp    15a0 <redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate+0x470>
add    $0xa8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate(i32 %0, i32 %1, double %2, double %3, double* %4, double* %5, double* %6, double* %7, double* %8, double* %9, double* %10, double* %11, double* %12) {
%14 = alloca i32
%15 = alloca i32
%16 = alloca double
%17 = alloca double
%18 = alloca double*
%19 = alloca double*
%20 = alloca double*
%21 = alloca double*
%22 = alloca double*
%23 = alloca double*
%24 = alloca double*
%25 = alloca double*
%26 = alloca double*
%27 = alloca i32
%28 = alloca i32
%29 = alloca double
%30 = alloca double
store i32 %0, i32* %14
store i32 %1, i32* %15
store double %2, double* %16
store double %3, double* %17
store double* %4, double** %18
store double* %5, double** %19
store double* %6, double** %20
store double* %7, double** %21
store double* %8, double** %22
store double* %9, double** %23
store double* %10, double** %24
store double* %11, double** %25
store double* %12, double** %26
store i32 0, i32* %27
br label %31
31: ; preds = %175, %13
%32 = load i32, i32* %27
%33 = load i32, i32* %14
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %178
35: ; preds = %31
%36 = load double*, double** %19
%37 = load i32, i32* %27
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds double, double* %36, i64 %38
%40 = load double, double* %39
%41 = load double*, double** %21
%42 = load i32, i32* %27
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds double, double* %41, i64 %43
store double %40, double* %44
%45 = load double*, double** %22
%46 = load i32, i32* %27
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds double, double* %45, i64 %47
store double 1.000000e+00, double* %48
%49 = load double*, double** %23
%50 = load i32, i32* %27
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds double, double* %49, i64 %51
store double 0.000000e+00, double* %52
%53 = load double, double* %16
%54 = load double*, double** %18
%55 = load i32, i32* %27
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %54, i64 %56
%58 = load double, double* %57
%59 = call double @smoothedHeaviside(double %53, double %58)
%60 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %59, double -1.000000e+00)
store double %60, double* %29
%61 = load double, double* %29
%62 = fneg double %61
%63 = load double*, double** %25
%64 = load i32, i32* %27
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds double, double* %63, i64 %65
store double %62, double* %66
store double 0.000000e+00, double* %30
store i32 0, i32* %28
br label %67
67: ; preds = %92, %35
%68 = load i32, i32* %28
%69 = load i32, i32* %15
%70 = icmp slt i32 %68, %69
br i1 %70, label %71, label %95
71: ; preds = %67
%72 = load double*, double** %20
%73 = load i32, i32* %27
%74 = load i32, i32* %15
%75 = mul nsw i32 %73, %74
%76 = load i32, i32* %28
%77 = add nsw i32 %75, %76
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double, double* %72, i64 %78
%80 = load double, double* %79
%81 = load double*, double** %20
%82 = load i32, i32* %27
%83 = load i32, i32* %15
%84 = mul nsw i32 %82, %83
%85 = load i32, i32* %28
%86 = add nsw i32 %84, %85
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds double, double* %81, i64 %87
%89 = load double, double* %88
%90 = load double, double* %30
%91 = call double @llvm.fmuladd.f64(double %80, double %89, double %90)
store double %91, double* %30
br label %92
92: ; preds = %71
%93 = load i32, i32* %28
%94 = add nsw i32 %93, 1
store i32 %94, i32* %28
br label %67
95: ; preds = %67
%96 = load double, double* %30
%97 = call double @sqrt(double %96)
store double %97, double* %30
%98 = load double, double* %29
%99 = load double, double* %30
%100 = fmul double %98, %99
%101 = load double*, double** %23
%102 = load i32, i32* %27
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds double, double* %101, i64 %103
store double %100, double* %104
store i32 0, i32* %28
br label %105
105: ; preds = %132, %95
%106 = load i32, i32* %28
%107 = load i32, i32* %15
%108 = icmp slt i32 %106, %107
br i1 %108, label %109, label %135
109: ; preds = %105
%110 = load double, double* %29
%111 = load double*, double** %20
%112 = load i32, i32* %27
%113 = load i32, i32* %15
%114 = mul nsw i32 %112, %113
%115 = load i32, i32* %28
%116 = add nsw i32 %114, %115
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds double, double* %111, i64 %117
%119 = load double, double* %118
%120 = fmul double %110, %119
%121 = load double, double* %30
%122 = fadd double %121, 0x3D719799812DEA11
%123 = fdiv double %120, %122
%124 = load double*, double** %24
%125 = load i32, i32* %27
%126 = load i32, i32* %15
%127 = mul nsw i32 %125, %126
%128 = load i32, i32* %28
%129 = add nsw i32 %127, %128
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds double, double* %124, i64 %130
store double %123, double* %131
br label %132
132: ; preds = %109
%133 = load i32, i32* %28
%134 = add nsw i32 %133, 1
store i32 %134, i32* %28
br label %105
135: ; preds = %105
%136 = load double*, double** %19
%137 = load i32, i32* %27
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds double, double* %136, i64 %138
%140 = load double, double* %139
%141 = load double*, double** %18
%142 = load i32, i32* %27
%143 = sext i32 %142 to i64
%144 = getelementptr inbounds double, double* %141, i64 %143
%145 = load double, double* %144
%146 = fsub double %140, %145
%147 = load double, double* %17
%148 = fmul double %146, %147
%149 = load double, double* %16
%150 = load double*, double** %18
%151 = load i32, i32* %27
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds double, double* %150, i64 %152
%154 = load double, double* %153
%155 = call double @smoothedDirac(double %149, double %154)
%156 = load double*, double** %25
%157 = load i32, i32* %27
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds double, double* %156, i64 %158
%160 = load double, double* %159
%161 = call double @llvm.fmuladd.f64(double %148, double %155, double %160)
store double %161, double* %159
%162 = load double, double* %17
%163 = load double, double* %16
%164 = load double*, double** %18
%165 = load i32, i32* %27
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds double, double* %164, i64 %166
%168 = load double, double* %167
%169 = call double @smoothedDirac(double %163, double %168)
%170 = fmul double %162, %169
%171 = load double*, double** %26
%172 = load i32, i32* %27
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds double, double* %171, i64 %173
store double %170, double* %174
br label %175
175: ; preds = %135
%176 = load i32, i32* %27
%177 = add nsw i32 %176, 1
store i32 %177, i32* %27
br label %31
178: ; preds = %31
ret void
}

LLVM IR (-O2):
define void @redistanceLevelSetCoefficientsWithWeakPenaltyEvaluate(i32 %0, i32 %1, double %2, double %3, double* nocapture %4, double* nocapture %5, double* nocapture %6, double* nocapture writeonly %7, double* nocapture writeonly %8, double* nocapture writeonly %9, double* nocapture writeonly %10, double* nocapture %11, double* nocapture writeonly %12) {
%14 = icmp sgt i32 %0, 0
br i1 %14, label %15, label %200
15: ; preds = %13
%16 = icmp sgt i32 %1, 0
%17 = sext i32 %1 to i64
%18 = zext i32 %0 to i64
%19 = zext i32 %1 to i64
%20 = zext i32 %1 to i64
%21 = add nsw i64 %19, -1
%22 = and i64 %19, 4294967294
%23 = add nsw i64 %22, -2
%24 = lshr exact i64 %23, 1
%25 = add nuw i64 %24, 1
%26 = and i64 %19, 3
%27 = icmp ult i64 %21, 3
%28 = and i64 %19, 4294967292
%29 = icmp eq i64 %26, 0
%30 = icmp eq i32 %1, 1
%31 = and i64 %19, 4294967294
%32 = and i64 %25, 1
%33 = icmp eq i64 %23, 0
%34 = and i64 %25, -2
%35 = icmp eq i64 %32, 0
%36 = icmp eq i64 %31, %19
%37 = and i64 %19, 1
%38 = icmp eq i64 %37, 0
%39 = sub nsw i64 0, %19
br label %40
40: ; preds = %15, %186
%41 = phi i64 [ 0, %15 ], [ %198, %186 ]
%42 = mul i64 %41, %17
%43 = getelementptr double, double* %10, i64 %42
%44 = add i64 %42, %19
%45 = getelementptr double, double* %10, i64 %44
%46 = getelementptr double, double* %6, i64 %42
%47 = getelementptr double, double* %6, i64 %44
%48 = getelementptr inbounds double, double* %5, i64 %41
%49 = load double, double* %48
%50 = getelementptr inbounds double, double* %7, i64 %41
store double %49, double* %50
%51 = getelementptr inbounds double, double* %8, i64 %41
store double 1.000000e+00, double* %51
%52 = getelementptr inbounds double, double* %9, i64 %41
store double 0.000000e+00, double* %52
%53 = getelementptr inbounds double, double* %4, i64 %41
%54 = load double, double* %53
%55 = tail call double @smoothedHeaviside(double %2, double %54)
%56 = tail call double @llvm.fmuladd.f64(double %55, double 2.000000e+00, double -1.000000e+00)
%57 = fneg double %56
%58 = getelementptr inbounds double, double* %11, i64 %41
store double %57, double* %58
br i1 %16, label %61, label %59
59: ; preds = %40
%60 = fmul double %56, 0.000000e+00
store double %60, double* %52
br label %186
61: ; preds = %40
%62 = mul nsw i64 %41, %17
br i1 %27, label %89, label %63
63: ; preds = %61, %63
%64 = phi i64 [ %86, %63 ], [ 0, %61 ]
%65 = phi double [ %85, %63 ], [ 0.000000e+00, %61 ]
%66 = phi i64 [ %87, %63 ], [ 0, %61 ]
%67 = add nsw i64 %64, %62
%68 = getelementptr inbounds double, double* %6, i64 %67
%69 = load double, double* %68
%70 = tail call double @llvm.fmuladd.f64(double %69, double %69, double %65)
%71 = or i64 %64, 1
%72 = add nsw i64 %71, %62
%73 = getelementptr inbounds double, double* %6, i64 %72
%74 = load double, double* %73
%75 = tail call double @llvm.fmuladd.f64(double %74, double %74, double %70)
%76 = or i64 %64, 2
%77 = add nsw i64 %76, %62
%78 = getelementptr inbounds double, double* %6, i64 %77
%79 = load double, double* %78
%80 = tail call double @llvm.fmuladd.f64(double %79, double %79, double %75)
%81 = or i64 %64, 3
%82 = add nsw i64 %81, %62
%83 = getelementptr inbounds double, double* %6, i64 %82
%84 = load double, double* %83
%85 = tail call double @llvm.fmuladd.f64(double %84, double %84, double %80)
%86 = add nuw nsw i64 %64, 4
%87 = add i64 %66, 4
%88 = icmp eq i64 %87, %28
br i1 %88, label %89, label %63
89: ; preds = %63, %61
%90 = phi double [ undef, %61 ], [ %85, %63 ]
%91 = phi i64 [ 0, %61 ], [ %86, %63 ]
%92 = phi double [ 0.000000e+00, %61 ], [ %85, %63 ]
br i1 %29, label %104, label %93
93: ; preds = %89, %93
%94 = phi i64 [ %101, %93 ], [ %91, %89 ]
%95 = phi double [ %100, %93 ], [ %92, %89 ]
%96 = phi i64 [ %102, %93 ], [ 0, %89 ]
%97 = add nsw i64 %94, %62
%98 = getelementptr inbounds double, double* %6, i64 %97
%99 = load double, double* %98
%100 = tail call double @llvm.fmuladd.f64(double %99, double %99, double %95)
%101 = add nuw nsw i64 %94, 1
%102 = add i64 %96, 1
%103 = icmp eq i64 %102, %26
br i1 %103, label %104, label %93
104: ; preds = %93, %89
%105 = phi double [ %90, %89 ], [ %100, %93 ]
%106 = tail call double @sqrt(double %105)
%107 = fmul double %56, %106
store double %107, double* %52
br i1 %16, label %108, label %186
108: ; preds = %104
%109 = mul nsw i64 %41, %17
%110 = fadd double %106, 0x3D719799812DEA11
br i1 %30, label %155, label %111
111: ; preds = %108
%112 = icmp ult double* %43, %47
%113 = icmp ult double* %46, %45
%114 = and i1 %112, %113
br i1 %114, label %155, label %115
115: ; preds = %111
%116 = insertelement <2 x double> poison, double %56, i64 0
%117 = shufflevector <2 x double> %116, <2 x double> poison, <2 x i32> zeroinitializer
%118 = insertelement <2 x double> poison, double %110, i64 0
%119 = shufflevector <2 x double> %118, <2 x double> poison, <2 x i32> zeroinitializer
br i1 %33, label %143, label %120
120: ; preds = %115, %120
%121 = phi i64 [ %140, %120 ], [ 0, %115 ]
%122 = phi i64 [ %141, %120 ], [ 0, %115 ]
%123 = add nsw i64 %121, %109
%124 = getelementptr inbounds double, double* %6, i64 %123
%125 = bitcast double* %124 to <2 x double>*
%126 = load <2 x double>, <2 x double>* %125
%127 = fmul <2 x double> %117, %126
%128 = fdiv <2 x double> %127, %119
%129 = getelementptr inbounds double, double* %10, i64 %123
%130 = bitcast double* %129 to <2 x double>*
store <2 x double> %128, <2 x double>* %130
%131 = or i64 %121, 2
%132 = add nsw i64 %131, %109
%133 = getelementptr inbounds double, double* %6, i64 %132
%134 = bitcast double* %133 to <2 x double>*
%135 = load <2 x double>, <2 x double>* %134
%136 = fmul <2 x double> %117, %135
%137 = fdiv <2 x double> %136, %119
%138 = getelementptr inbounds double, double* %10, i64 %132
%139 = bitcast double* %138 to <2 x double>*
store <2 x double> %137, <2 x double>* %139
%140 = add nuw i64 %121, 4
%141 = add nuw i64 %122, 2
%142 = icmp eq i64 %141, %34
br i1 %142, label %143, label %120
143: ; preds = %120, %115
%144 = phi i64 [ 0, %115 ], [ %140, %120 ]
br i1 %35, label %154, label %145
145: ; preds = %143
%146 = add nsw i64 %144, %109
%147 = getelementptr inbounds double, double* %6, i64 %146
%148 = bitcast double* %147 to <2 x double>*
%149 = load <2 x double>, <2 x double>* %148
%150 = fmul <2 x double> %117, %149
%151 = fdiv <2 x double> %150, %119
%152 = getelementptr inbounds double, double* %10, i64 %146
%153 = bitcast double* %152 to <2 x double>*
store <2 x double> %151, <2 x double>* %153
br label %154
154: ; preds = %143, %145
br i1 %36, label %186, label %155
155: ; preds = %111, %108, %154
%156 = phi i64 [ 0, %111 ], [ 0, %108 ], [ %31, %154 ]
%157 = xor i64 %156, -1
br i1 %38, label %166, label %158
158: ; preds = %155
%159 = add nsw i64 %156, %109
%160 = getelementptr inbounds double, double* %6, i64 %159
%161 = load double, double* %160
%162 = fmul double %56, %161
%163 = fdiv double %162, %110
%164 = getelementptr inbounds double, double* %10, i64 %159
store double %163, double* %164
%165 = or i64 %156, 1
br label %166
166: ; preds = %158, %155
%167 = phi i64 [ %156, %155 ], [ %165, %158 ]
%168 = icmp eq i64 %157, %39
br i1 %168, label %186, label %169
169: ; preds = %166, %169
%170 = phi i64 [ %184, %169 ], [ %167, %166 ]
%171 = add nsw i64 %170, %109
%172 = getelementptr inbounds double, double* %6, i64 %171
%173 = load double, double* %172
%174 = fmul double %56, %173
%175 = fdiv double %174, %110
%176 = getelementptr inbounds double, double* %10, i64 %171
store double %175, double* %176
%177 = add nuw nsw i64 %170, 1
%178 = add nsw i64 %177, %109
%179 = getelementptr inbounds double, double* %6, i64 %178
%180 = load double, double* %179
%181 = fmul double %56, %180
%182 = fdiv double %181, %110
%183 = getelementptr inbounds double, double* %10, i64 %178
store double %182, double* %183
%184 = add nuw nsw i64 %170, 2
%185 = icmp eq i64 %184, %20
br i1 %185, label %186, label %169
186: ; preds = %166, %169, %154, %59, %104
%187 = load double, double* %48
%188 = load double, double* %53
%189 = fsub double %187, %188
%190 = fmul double %189, %3
%191 = tail call double @smoothedDirac(double %2, double %188)
%192 = load double, double* %58
%193 = tail call double @llvm.fmuladd.f64(double %190, double %191, double %192)
store double %193, double* %58
%194 = load double, double* %53
%195 = tail call double @smoothedDirac(double %2, double %194)
%196 = fmul double %195, %3
%197 = getelementptr inbounds double, double* %12, i64 %41
store double %196, double* %197
%198 = add nuw nsw i64 %41, 1
%199 = icmp eq i64 %198, %18
br i1 %199, label %200, label %40
200: ; preds = %186, %13
ret void
}