#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 log(int);
void compute_dos_alpha_log(double *gl, double *rn, int N, double K, int live) {
  int i, j, lim;
  double Xf;
  double m;
  m = log(2. - rn[0]);
  gl[0] = log(0.5) + m + log(1 - rn[0] * rn[1]);
  if (live == 1) {
    lim = (N - K - 1);
  } else {
    lim = (N - 1);
  }
  for (i = 1; i < lim; ++i) {
    m += log(rn[i - 1]);
    gl[i] = log(0.5) + m + log(1 - (rn[i] * rn[i + 1]));
  }
  if (live == 1) {
    j = 0;
    for (i = lim; i < (N - 1); ++i) {
      m += log(rn[i - 1]);
      gl[i] = log(0.5) + m + log(1 - rn[i] * rn[i + 1]);
      ++j;
    }
    ++i;
    Xf = -rn[i];
    gl[N - 1] = log(0.5) + m + log(1 - rn[i] * Xf);
  } else {
    ++i;
    m += log(rn[i - 1]);
    Xf = -rn[i];
    gl[N - 1] = log(0.5) + m + log(1 - rn[i] * Xf);
  }
}


x86 assembly (clang, -O0):
<compute_dos_alpha_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xed1(%rip),%xmm0
subsd  (%rax),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movsd  %xmm0,-0x40(%rbp)
xor    %edi,%edi
call   1030 <log@plt>
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe72(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
cmpl   $0x1,-0x24(%rbp)
jne    11db <compute_dos_alpha_log+0xcb>
cvtsi2sdl -0x14(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  0xe35(%rip),%xmm1
subsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x30(%rbp)
jmp    11e4 <compute_dos_alpha_log+0xd4>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x30(%rbp)
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x30(%rbp),%eax
jge    129f <compute_dos_alpha_log+0x18f>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cvttsd2si (%rax,%rcx,8),%edi
call   1030 <log@plt>
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
xor    %edi,%edi
call   1030 <log@plt>
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xd95(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11eb <compute_dos_alpha_log+0xdb>
cmpl   $0x1,-0x24(%rbp)
jne    1420 <compute_dos_alpha_log+0x310>
movl   $0x0,-0x2c(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1378 <compute_dos_alpha_log+0x268>
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cvttsd2si (%rax,%rcx,8),%edi
call   1030 <log@plt>
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
xor    %edi,%edi
call   1030 <log@plt>
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xcc5(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x58(%rbp),%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12b6 <compute_dos_alpha_log+0x1a6>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x38(%rbp)
xor    %edi,%edi
call   1030 <log@plt>
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x38(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xc10(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x60(%rbp),%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
jmp    14e4 <compute_dos_alpha_log+0x3d4>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cvttsd2si (%rax,%rcx,8),%edi
call   1030 <log@plt>
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x38(%rbp)
xor    %edi,%edi
call   1030 <log@plt>
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x38(%rbp),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xb47(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
addsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_dos_alpha_log>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %ecx,%ebp
movsd  %xmm0,0x18(%rsp)
mov    %edx,%r15d
mov    %rsi,%r13
mov    %rdi,%r14
movsd  0xec9(%rip),%xmm0
subsd  (%rsi),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
movsd  %xmm0,0x8(%rsp)
xor    %edi,%edi
call   1030 <log@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x0(%r13),%xmm0
mulsd  0x8(%r13),%xmm0
movsd  0xe97(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <log@plt>
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%r14)
cmp    $0x1,%ebp
jne    11aa <compute_dos_alpha_log+0x9a>
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
subsd  0x18(%rsp),%xmm0
addsd  0xe6c(%rip),%xmm0
cvttsd2si %xmm0,%ebx
jmp    11ae <compute_dos_alpha_log+0x9e>
lea    -0x1(%r15),%ebx
mov    $0x1,%eax
cmp    $0x2,%ebx
jl     1246 <compute_dos_alpha_log+0x136>
mov    %ebp,0x24(%rsp)
mov    %r15,0x18(%rsp)
mov    %ebx,%ebp
mov    $0x1,%r12d
nopl   (%rax)
cvttsd2si -0x8(%r13,%r12,8),%edi
call   1030 <log@plt>
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %edi,%edi
call   1030 <log@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x0(%r13,%r12,8),%xmm0
mulsd  0x8(%r13,%r12,8),%xmm0
lea    0x1(%r12),%r15
movsd  0xdee(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <log@plt>
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%r14,%r12,8)
mov    %r15,%r12
cmp    %r15,%rbp
jne    11d0 <compute_dos_alpha_log+0xc0>
mov    %ebx,%eax
mov    0x18(%rsp),%r15
mov    0x24(%rsp),%ebp
cmp    $0x1,%ebp
jne    12df <compute_dos_alpha_log+0x1cf>
add    $0xffffffff,%r15d
cmp    %r15d,%ebx
jge    134a <compute_dos_alpha_log+0x23a>
movslq %ebx,%rbp
movslq %r15d,%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cvttsd2si -0x8(%r13,%rbp,8),%edi
call   1030 <log@plt>
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
xor    %edi,%edi
call   1030 <log@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x0(%r13,%rbp,8),%xmm0
mulsd  0x8(%r13,%rbp,8),%xmm0
lea    0x1(%rbp),%rbx
movsd  0xd4f(%rip),%xmm1
subsd  %xmm0,%xmm1
cvttsd2si %xmm1,%edi
call   1030 <log@plt>
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%r14,%rbp,8)
mov    %rbx,%rbp
cmp    %rbx,%r12
jne    1270 <compute_dos_alpha_log+0x160>
mov    %r15d,%ebx
jmp    134d <compute_dos_alpha_log+0x23d>
mov    %eax,%ebx
cvttsd2si 0x0(%r13,%rbx,8),%edi
call   1030 <log@plt>
movsd  0x8(%rsp),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,0x8(%rsp)
movsd  0x8(%r13,%rbx,8),%xmm0
movsd  %xmm0,0x10(%rsp)
xor    %edi,%edi
call   1030 <log@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0x8(%r13,%rbx,8),%xmm0
addsd  0xcd6(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
addsd  0x8(%rsp),%xmm0
add    $0xffffffff,%r15d
movslq %r15d,%r12
jmp    1394 <compute_dos_alpha_log+0x284>
movslq %r15d,%r12
movslq %ebx,%rbx
movsd  0x8(%r13,%rbx,8),%xmm0
movsd  %xmm0,0x10(%rsp)
xor    %edi,%edi
call   1030 <log@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
mulsd  0x8(%r13,%rbx,8),%xmm0
addsd  0xc83(%rip),%xmm0
cvttsd2si %xmm0,%edi
call   1030 <log@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14,%r12,8)
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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