#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);
void applyContactLineSlipJacobian(int nExteriorElementBoundaries_global,
                                  int nQuadraturePoints_elementBoundary,
                                  int nDOF_trial_element, double eps,
                                  int *isDOFBoundary, double *phi,
                                  double *fluxJacobian) {
  int ebNE, k, j;
  double weight;
  for (ebNE = 0; ebNE < nExteriorElementBoundaries_global; ebNE++) {
    for (k = 0; k < nQuadraturePoints_elementBoundary; k++) {
      if (isDOFBoundary[ebNE * nQuadraturePoints_elementBoundary + k] == 1) {
        weight = (smoothedDirac(eps, 0) -
                  smoothedDirac(
                      eps, phi[ebNE * nQuadraturePoints_elementBoundary + k])) /
                 smoothedDirac(eps, 0);
        for (j = 0; j < nDOF_trial_element; j++) {
          fluxJacobian[ebNE * nQuadraturePoints_elementBoundary *
                           nDOF_trial_element +
                       k * nDOF_trial_element + j] *= weight;
        }
      }
    }
  }
}


x86 assembly (clang, -O0):
<applyContactLineSlipJacobian>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    124d <applyContactLineSlipJacobian+0x13d>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    123a <applyContactLineSlipJacobian+0x12a>
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
cmpl   $0x1,(%rax,%rcx,4)
jne    1227 <applyContactLineSlipJacobian+0x117>
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
call   1030 <smoothedDirac@plt>
movsd  %xmm0,-0x58(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x8(%rbp),%ecx
add    -0x38(%rbp),%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
call   1030 <smoothedDirac@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
call   1030 <smoothedDirac@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1222 <applyContactLineSlipJacobian+0x112>
movsd  -0x48(%rbp),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x34(%rbp),%ecx
imul   -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
mov    -0x38(%rbp),%edx
imul   -0xc(%rbp),%edx
add    %edx,%ecx
add    -0x3c(%rbp),%ecx
movslq %ecx,%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11db <applyContactLineSlipJacobian+0xcb>
jmp    1227 <applyContactLineSlipJacobian+0x117>
jmp    122c <applyContactLineSlipJacobian+0x11c>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    114c <applyContactLineSlipJacobian+0x3c>
jmp    123f <applyContactLineSlipJacobian+0x12f>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1139 <applyContactLineSlipJacobian+0x29>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<applyContactLineSlipJacobian>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %r9,0x18(%rsp)
mov    %r8,0x70(%rsp)
movsd  %xmm0,0x20(%rsp)
mov    %esi,0x4(%rsp)
test   %edi,%edi
jle    1387 <applyContactLineSlipJacobian+0x277>
mov    %edx,%r8d
mov    0x4(%rsp),%edx
movslq %edx,%rax
mov    %edi,%esi
mov    %rsi,0x38(%rsp)
mov    %rax,0x30(%rsp)
mov    %eax,%ebp
mov    %r8d,%r12d
mov    %r12d,%eax
and    $0xfffffffc,%eax
mov    %rax,0x60(%rsp)
add    $0xfffffffffffffffc,%rax
mov    %rax,0x58(%rsp)
mov    %rax,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
mov    %rsi,%rax
mov    %rsi,0x50(%rsp)
and    $0xfffffffffffffffe,%rsi
mov    %rsi,0x48(%rsp)
mov    0x18(%rsp),%rax
add    $0x30,%rax
mov    %rax,0x40(%rsp)
mov    %r8d,%eax
imul   %edx,%eax
mov    %eax,0x28(%rsp)
xor    %eax,%eax
mov    %rax,0x10(%rsp)
xor    %eax,%eax
mov    %rax,0x8(%rsp)
mov    %rcx,0x68(%rsp)
mov    %r8d,0x2c(%rsp)
jmp    11ea <applyContactLineSlipJacobian+0xda>
nopw   0x0(%rax,%rax,1)
mov    0x8(%rsp),%rdx
add    $0x1,%rdx
mov    0x10(%rsp),%rax
add    0x28(%rsp),%eax
mov    %rax,0x10(%rsp)
mov    %rdx,%rax
mov    %rdx,0x8(%rsp)
cmp    0x38(%rsp),%rdx
je     1387 <applyContactLineSlipJacobian+0x277>
cmpl   $0x0,0x4(%rsp)
jle    11c0 <applyContactLineSlipJacobian+0xb0>
mov    0x8(%rsp),%r14
imul   0x30(%rsp),%r14
mov    0x10(%rsp),%rax
mov    %eax,%r15d
xor    %ebx,%ebx
jmp    121c <applyContactLineSlipJacobian+0x10c>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
add    %r8d,%r15d
cmp    %rbp,%rbx
je     11c0 <applyContactLineSlipJacobian+0xb0>
lea    (%rbx,%r14,1),%r13
cmpl   $0x1,(%rcx,%r13,4)
jne    1210 <applyContactLineSlipJacobian+0x100>
xorps  %xmm1,%xmm1
movsd  0x20(%rsp),%xmm0
call   1030 <smoothedDirac@plt>
movaps %xmm0,0x80(%rsp)
mov    0x70(%rsp),%rax
movsd  (%rax,%r13,8),%xmm1
movsd  0x20(%rsp),%xmm0
call   1030 <smoothedDirac@plt>
movsd  %xmm0,0x78(%rsp)
xorpd  %xmm1,%xmm1
movsd  0x20(%rsp),%xmm0
call   1030 <smoothedDirac@plt>
movapd 0x80(%rsp),%xmm5
mov    0x2c(%rsp),%r8d
mov    0x68(%rsp),%rcx
test   %r8d,%r8d
jle    1210 <applyContactLineSlipJacobian+0x100>
movslq %r15d,%r10
subsd  0x78(%rsp),%xmm5
divsd  %xmm0,%xmm5
cmp    $0x4,%r8d
jae    129a <applyContactLineSlipJacobian+0x18a>
xor    %esi,%esi
jmp    134d <applyContactLineSlipJacobian+0x23d>
movapd %xmm5,%xmm0
unpcklpd %xmm5,%xmm0
cmpq   $0x0,0x58(%rsp)
je     137c <applyContactLineSlipJacobian+0x26c>
mov    0x40(%rsp),%rdx
lea    (%rdx,%r10,8),%rdx
mov    0x48(%rsp),%rsi
xor    %edi,%edi
xchg   %ax,%ax
movupd -0x30(%rdx,%rdi,8),%xmm1
movupd -0x20(%rdx,%rdi,8),%xmm2
movupd -0x10(%rdx,%rdi,8),%xmm3
movupd (%rdx,%rdi,8),%xmm4
mulpd  %xmm0,%xmm1
mulpd  %xmm0,%xmm2
movupd %xmm1,-0x30(%rdx,%rdi,8)
movupd %xmm2,-0x20(%rdx,%rdi,8)
mulpd  %xmm0,%xmm3
mulpd  %xmm0,%xmm4
movupd %xmm3,-0x10(%rdx,%rdi,8)
movupd %xmm4,(%rdx,%rdi,8)
add    $0x8,%rdi
add    $0xfffffffffffffffe,%rsi
jne    12c0 <applyContactLineSlipJacobian+0x1b0>
testb  $0x1,0x50(%rsp)
je     133c <applyContactLineSlipJacobian+0x22c>
imul   %r8d,%r13d
movslq %r13d,%rdx
add    %rdx,%rdi
mov    0x18(%rsp),%rdx
movupd (%rdx,%rdi,8),%xmm1
movupd 0x10(%rdx,%rdi,8),%xmm2
mulpd  %xmm0,%xmm1
mulpd  %xmm0,%xmm2
movupd %xmm1,(%rdx,%rdi,8)
movupd %xmm2,0x10(%rdx,%rdi,8)
mov    0x60(%rsp),%rdx
mov    %rdx,%rsi
cmp    %r12,%rdx
je     1210 <applyContactLineSlipJacobian+0x100>
mov    0x18(%rsp),%rdx
lea    (%rdx,%r10,8),%rax
cs nopw 0x0(%rax,%rax,1)
movsd  (%rax,%rsi,8),%xmm0
mulsd  %xmm5,%xmm0
movsd  %xmm0,(%rax,%rsi,8)
add    $0x1,%rsi
cmp    %rsi,%r12
jne    1360 <applyContactLineSlipJacobian+0x250>
jmp    1210 <applyContactLineSlipJacobian+0x100>
xor    %edi,%edi
testb  $0x1,0x50(%rsp)
jne    130f <applyContactLineSlipJacobian+0x1ff>
jmp    133c <applyContactLineSlipJacobian+0x22c>
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @applyContactLineSlipJacobian(i32 %0, i32 %1, i32 %2, double %3, i32* %4, double* %5, double* %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca double
%12 = alloca i32*
%13 = alloca double*
%14 = alloca double*
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca double
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store double %3, double* %11
store i32* %4, i32** %12
store double* %5, double** %13
store double* %6, double** %14
store i32 0, i32* %15
br label %19
19: ; preds = %88, %7
%20 = load i32, i32* %15
%21 = load i32, i32* %8
%22 = icmp slt i32 %20, %21
br i1 %22, label %23, label %91
23: ; preds = %19
store i32 0, i32* %16
br label %24
24: ; preds = %84, %23
%25 = load i32, i32* %16
%26 = load i32, i32* %9
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %87
28: ; preds = %24
%29 = load i32*, i32** %12
%30 = load i32, i32* %15
%31 = load i32, i32* %9
%32 = mul nsw i32 %30, %31
%33 = load i32, i32* %16
%34 = add nsw i32 %32, %33
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i32, i32* %29, i64 %35
%37 = load i32, i32* %36
%38 = icmp eq i32 %37, 1
br i1 %38, label %39, label %83
39: ; preds = %28
%40 = load double, double* %11
%41 = call double @smoothedDirac(double %40, double 0.000000e+00)
%42 = load double, double* %11
%43 = load double*, double** %13
%44 = load i32, i32* %15
%45 = load i32, i32* %9
%46 = mul nsw i32 %44, %45
%47 = load i32, i32* %16
%48 = add nsw i32 %46, %47
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds double, double* %43, i64 %49
%51 = load double, double* %50
%52 = call double @smoothedDirac(double %42, double %51)
%53 = fsub double %41, %52
%54 = load double, double* %11
%55 = call double @smoothedDirac(double %54, double 0.000000e+00)
%56 = fdiv double %53, %55
store double %56, double* %18
store i32 0, i32* %17
br label %57
57: ; preds = %79, %39
%58 = load i32, i32* %17
%59 = load i32, i32* %10
%60 = icmp slt i32 %58, %59
br i1 %60, label %61, label %82
61: ; preds = %57
%62 = load double, double* %18
%63 = load double*, double** %14
%64 = load i32, i32* %15
%65 = load i32, i32* %9
%66 = mul nsw i32 %64, %65
%67 = load i32, i32* %10
%68 = mul nsw i32 %66, %67
%69 = load i32, i32* %16
%70 = load i32, i32* %10
%71 = mul nsw i32 %69, %70
%72 = add nsw i32 %68, %71
%73 = load i32, i32* %17
%74 = add nsw i32 %72, %73
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %63, i64 %75
%77 = load double, double* %76
%78 = fmul double %77, %62
store double %78, double* %76
br label %79
79: ; preds = %61
%80 = load i32, i32* %17
%81 = add nsw i32 %80, 1
store i32 %81, i32* %17
br label %57
82: ; preds = %57
br label %83
83: ; preds = %82, %28
br label %84
84: ; preds = %83
%85 = load i32, i32* %16
%86 = add nsw i32 %85, 1
store i32 %86, i32* %16
br label %24
87: ; preds = %24
br label %88
88: ; preds = %87
%89 = load i32, i32* %15
%90 = add nsw i32 %89, 1
store i32 %90, i32* %15
br label %19
91: ; preds = %19
ret void
}

LLVM IR (-O2):
define void @applyContactLineSlipJacobian(i32 %0, i32 %1, i32 %2, double %3, i32* nocapture %4, double* nocapture %5, double* nocapture %6) {
%8 = icmp sgt i32 %0, 0
br i1 %8, label %9, label %114
9: ; preds = %7
%10 = icmp sgt i32 %1, 0
%11 = icmp sgt i32 %2, 0
%12 = sext i32 %1 to i64
%13 = zext i32 %0 to i64
%14 = zext i32 %1 to i64
%15 = zext i32 %2 to i64
%16 = and i64 %15, 4294967292
%17 = add nsw i64 %16, -4
%18 = lshr exact i64 %17, 2
%19 = add nuw nsw i64 %18, 1
%20 = icmp ult i32 %2, 4
%21 = and i64 %15, 4294967292
%22 = and i64 %19, 1
%23 = icmp eq i64 %17, 0
%24 = and i64 %19, 9223372036854775806
%25 = icmp eq i64 %22, 0
%26 = icmp eq i64 %21, %15
br label %27
27: ; preds = %9, %111
%28 = phi i64 [ 0, %9 ], [ %112, %111 ]
br i1 %10, label %29, label %111
29: ; preds = %27
%30 = mul nsw i64 %28, %12
br label %31
31: ; preds = %29, %108
%32 = phi i64 [ 0, %29 ], [ %109, %108 ]
%33 = add nsw i64 %32, %30
%34 = getelementptr inbounds i32, i32* %4, i64 %33
%35 = load i32, i32* %34
%36 = icmp eq i32 %35, 1
br i1 %36, label %37, label %108
37: ; preds = %31
%38 = tail call double @smoothedDirac(double %3, double 0.000000e+00)
%39 = getelementptr inbounds double, double* %5, i64 %33
%40 = load double, double* %39
%41 = tail call double @smoothedDirac(double %3, double %40)
%42 = fsub double %38, %41
%43 = tail call double @smoothedDirac(double %3, double 0.000000e+00)
%44 = fdiv double %42, %43
br i1 %11, label %45, label %108
45: ; preds = %37
%46 = trunc i64 %33 to i32
%47 = mul i32 %46, %2
%48 = sext i32 %47 to i64
br i1 %20, label %98, label %49
49: ; preds = %45
%50 = insertelement <2 x double> poison, double %44, i64 0
%51 = shufflevector <2 x double> %50, <2 x double> poison, <2 x i32> zeroinitializer
%52 = insertelement <2 x double> poison, double %44, i64 0
%53 = shufflevector <2 x double> %52, <2 x double> poison, <2 x i32> zeroinitializer
br i1 %23, label %83, label %54
54: ; preds = %49, %54
%55 = phi i64 [ %80, %54 ], [ 0, %49 ]
%56 = phi i64 [ %81, %54 ], [ 0, %49 ]
%57 = add nsw i64 %55, %48
%58 = getelementptr inbounds double, double* %6, i64 %57
%59 = bitcast double* %58 to <2 x double>*
%60 = load <2 x double>, <2 x double>* %59
%61 = getelementptr inbounds double, double* %58, i64 2
%62 = bitcast double* %61 to <2 x double>*
%63 = load <2 x double>, <2 x double>* %62
%64 = fmul <2 x double> %51, %60
%65 = fmul <2 x double> %53, %63
%66 = bitcast double* %58 to <2 x double>*
store <2 x double> %64, <2 x double>* %66
%67 = bitcast double* %61 to <2 x double>*
store <2 x double> %65, <2 x double>* %67
%68 = or i64 %55, 4
%69 = add nsw i64 %68, %48
%70 = getelementptr inbounds double, double* %6, i64 %69
%71 = bitcast double* %70 to <2 x double>*
%72 = load <2 x double>, <2 x double>* %71
%73 = getelementptr inbounds double, double* %70, i64 2
%74 = bitcast double* %73 to <2 x double>*
%75 = load <2 x double>, <2 x double>* %74
%76 = fmul <2 x double> %51, %72
%77 = fmul <2 x double> %53, %75
%78 = bitcast double* %70 to <2 x double>*
store <2 x double> %76, <2 x double>* %78
%79 = bitcast double* %73 to <2 x double>*
store <2 x double> %77, <2 x double>* %79
%80 = add nuw i64 %55, 8
%81 = add i64 %56, 2
%82 = icmp eq i64 %81, %24
br i1 %82, label %83, label %54
83: ; preds = %54, %49
%84 = phi i64 [ 0, %49 ], [ %80, %54 ]
br i1 %25, label %97, label %85
85: ; preds = %83
%86 = add nsw i64 %84, %48
%87 = getelementptr inbounds double, double* %6, i64 %86
%88 = bitcast double* %87 to <2 x double>*
%89 = load <2 x double>, <2 x double>* %88
%90 = getelementptr inbounds double, double* %87, i64 2
%91 = bitcast double* %90 to <2 x double>*
%92 = load <2 x double>, <2 x double>* %91
%93 = fmul <2 x double> %51, %89
%94 = fmul <2 x double> %53, %92
%95 = bitcast double* %87 to <2 x double>*
store <2 x double> %93, <2 x double>* %95
%96 = bitcast double* %90 to <2 x double>*
store <2 x double> %94, <2 x double>* %96
br label %97
97: ; preds = %83, %85
br i1 %26, label %108, label %98
98: ; preds = %45, %97
%99 = phi i64 [ 0, %45 ], [ %21, %97 ]
br label %100
100: ; preds = %98, %100
%101 = phi i64 [ %106, %100 ], [ %99, %98 ]
%102 = add nsw i64 %101, %48
%103 = getelementptr inbounds double, double* %6, i64 %102
%104 = load double, double* %103
%105 = fmul double %44, %104
store double %105, double* %103
%106 = add nuw nsw i64 %101, 1
%107 = icmp eq i64 %106, %15
br i1 %107, label %108, label %100
108: ; preds = %100, %97, %37, %31
%109 = add nuw nsw i64 %32, 1
%110 = icmp eq i64 %109, %14
br i1 %110, label %111, label %31
111: ; preds = %108, %27
%112 = add nuw nsw i64 %28, 1
%113 = icmp eq i64 %112, %13
br i1 %113, label %114, label %27
114: ; preds = %111, %7
ret void
}