#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 exp(double);
void compute_delj(double *dx, double *MInt, double *VInt, int N, double *delj,
                  int use_delj_trick) {
  int ii;
  double wj, epsj;
  if (!use_delj_trick) {
    for (ii = 0; ii < N - 1; ii++)
      delj[ii] = 0.5;
    return;
  }
  for (ii = 0; ii < N - 1; ii++) {
    wj = 2 * MInt[ii] * dx[ii];
    epsj = exp(wj / VInt[ii]);
    if ((epsj != 1.0) && (wj != 0))
      delj[ii] = (-epsj * wj + epsj * VInt[ii] - VInt[ii]) / (wj - epsj * wj);
    else
      delj[ii] = 0.5;
  }
}


x86 assembly (clang, -O0):
<compute_delj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    1179 <compute_delj+0x69>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1174 <compute_delj+0x64>
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  0xe9f(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1140 <compute_delj+0x30>
jmp    12c7 <compute_delj+0x1b7>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12c7 <compute_delj+0x1b7>
mov    -0x10(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  0xe6f(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x30(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
divsd  (%rax,%rcx,8),%xmm0
call   1030 <exp@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  0xe27(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    11f6 <compute_delj+0xe6>
jp     11f6 <compute_delj+0xe6>
jmp    129f <compute_delj+0x18f>
movsd  -0x38(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1213 <compute_delj+0x103>
jp     1213 <compute_delj+0x103>
jmp    129f <compute_delj+0x18f>
movsd  -0x40(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
mulsd  (%rax,%rcx,8),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x30(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  -0x40(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm3
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    12b4 <compute_delj+0x1a4>
mov    -0x28(%rbp),%rax
movslq -0x30(%rbp),%rcx
movsd  0xd51(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    12b9 <compute_delj+0x1a9>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1180 <compute_delj+0x70>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_delj>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8,%rbx
mov    %ecx,%r14d
test   %r9d,%r9d
je     11e3 <compute_delj+0xd3>
cmp    $0x2,%r14d
jl     131d <compute_delj+0x20d>
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r13
add    $0xffffffff,%r14d
xor    %ebp,%ebp
jmp    1162 <compute_delj+0x52>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  %xmm1,(%rbx,%rbp,8)
add    $0x1,%rbp
cmp    %rbp,%r14
je     131d <compute_delj+0x20d>
movsd  (%r12,%rbp,8),%xmm0
addsd  %xmm0,%xmm0
mulsd  0x0(%r13,%rbp,8),%xmm0
movsd  %xmm0,(%rsp)
divsd  (%r15,%rbp,8),%xmm0
call   1030 <exp@plt>
movsd  (%rsp),%xmm3
ucomisd 0xe70(%rip),%xmm0
movsd  0xe70(%rip),%xmm1
jne    119c <compute_delj+0x8c>
jnp    1150 <compute_delj+0x40>
ucomisd 0xe6c(%rip),%xmm3
movsd  0xe5c(%rip),%xmm1
jne    11b0 <compute_delj+0xa0>
jnp    1150 <compute_delj+0x40>
movapd %xmm0,%xmm1
xorpd  0xe64(%rip),%xmm1
movsd  (%r15,%rbp,8),%xmm2
mulsd  %xmm2,%xmm0
mulsd  %xmm3,%xmm1
addsd  %xmm1,%xmm0
subsd  %xmm2,%xmm0
addsd  %xmm3,%xmm1
divsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
jmp    1150 <compute_delj+0x40>
cmp    $0x2,%r14d
jl     131d <compute_delj+0x20d>
add    $0xffffffff,%r14d
cmp    $0x4,%r14d
jae    11fe <compute_delj+0xee>
xor    %eax,%eax
jmp    12f9 <compute_delj+0x1e9>
mov    %r14d,%eax
and    $0xfffffffc,%eax
lea    -0x4(%rax),%rsi
mov    %rsi,%rdx
shr    $0x2,%rdx
add    $0x1,%rdx
mov    %edx,%ecx
and    $0x7,%ecx
cmp    $0x1c,%rsi
jae    1225 <compute_delj+0x115>
xor    %esi,%esi
jmp    12c5 <compute_delj+0x1b5>
and    $0xfffffffffffffff8,%rdx
xor    %esi,%esi
movapd 0xdfd(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movupd %xmm0,(%rbx,%rsi,8)
movupd %xmm0,0x10(%rbx,%rsi,8)
movupd %xmm0,0x20(%rbx,%rsi,8)
movupd %xmm0,0x30(%rbx,%rsi,8)
movupd %xmm0,0x40(%rbx,%rsi,8)
movupd %xmm0,0x50(%rbx,%rsi,8)
movupd %xmm0,0x60(%rbx,%rsi,8)
movupd %xmm0,0x70(%rbx,%rsi,8)
movupd %xmm0,0x80(%rbx,%rsi,8)
movupd %xmm0,0x90(%rbx,%rsi,8)
movupd %xmm0,0xa0(%rbx,%rsi,8)
movupd %xmm0,0xb0(%rbx,%rsi,8)
movupd %xmm0,0xc0(%rbx,%rsi,8)
movupd %xmm0,0xd0(%rbx,%rsi,8)
movupd %xmm0,0xe0(%rbx,%rsi,8)
movupd %xmm0,0xf0(%rbx,%rsi,8)
add    $0x20,%rsi
add    $0xfffffffffffffff8,%rdx
jne    1240 <compute_delj+0x130>
test   %rcx,%rcx
je     12f4 <compute_delj+0x1e4>
lea    (%rbx,%rsi,8),%rdx
add    $0x10,%rdx
shl    $0x5,%rcx
xor    %esi,%esi
movapd 0xd50(%rip),%xmm0
movupd %xmm0,-0x10(%rdx,%rsi,1)
movupd %xmm0,(%rdx,%rsi,1)
add    $0x20,%rsi
cmp    %rsi,%rcx
jne    12e0 <compute_delj+0x1d0>
cmp    %r14,%rax
je     131d <compute_delj+0x20d>
movabs $0x3fe0000000000000,%rcx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rcx,(%rbx,%rax,8)
add    $0x1,%rax
cmp    %rax,%r14
jne    1310 <compute_delj+0x200>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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