#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 dbinom(unsigned int, unsigned int, double);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned int,
                           unsigned int);
scalar_t__ isnan(double);
scalar_t__ log(double);
int /*<<< orphan*/ stdout;
double logL2(const float arg[], unsigned int count, unsigned int tulem2[],
             unsigned int katvus2[]) {
  double p1 = arg[0];
  double p2 = arg[1];
  double p3 = p2;
  double x = arg[2];
  double z = arg[3];
  double logL;
  unsigned int i;
  logL = 0;
  for (i = 0; i < count; i++) {
    double v;
    v = p1 * dbinom(tulem2[i], katvus2[i], z / 2);
    v += p1 * dbinom(tulem2[i], katvus2[i], 1 - z / 2);
    v += p2 * dbinom(tulem2[i], katvus2[i], (1 - x / 2) * (1 - z) + z / 2);
    v += p2 * dbinom(tulem2[i], katvus2[i], (x / 2) * (1 - z) + z / 2);
    v += 2 * p3 * dbinom(tulem2[i], katvus2[i], 0.5 * (1 - z) + z / 2);
    v += (0.5 - p1 - p2 - p3) *
         dbinom(tulem2[i], katvus2[i], (0.5 + x / 2) * (1 - z) + z / 2);
    v += (0.5 - p1 - p2 - p3) *
         dbinom(tulem2[i], katvus2[i], (0.5 - x / 2) * (1 - z) + z / 2);
    if (isnan(v)) {
      fprintf(stdout, "NaN %u %u\n", tulem2[i], katvus2[i]);
    }
    if (v <= 0) {
      logL += 1000000;
    } else {
      logL -= log(v);
    }
  }
  return logL;
}


x86 assembly (clang, -O0):
<logL2>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movl   $0x0,-0x54(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1594 <logL2+0x454>
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x18(%rbp),%rax
mov    -0x54(%rbp),%ecx
mov    (%rax,%rcx,4),%edi
mov    -0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
mov    (%rax,%rcx,4),%esi
movsd  -0x48(%rbp),%xmm0
movsd  0xe0c(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <dbinom@plt>
movaps %xmm0,%xmm1
movsd  -0x98(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
mov    -0x18(%rbp),%rax
mov    -0x54(%rbp),%ecx
mov    (%rax,%rcx,4),%edi
mov    -0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
mov    (%rax,%rcx,4),%esi
movsd  -0x48(%rbp),%xmm1
movsd  0xdc1(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xdbd(%rip),%xmm0
subsd  %xmm1,%xmm0
call   1030 <dbinom@plt>
movaps %xmm0,%xmm2
movsd  -0x90(%rbp),%xmm0
ff
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x18(%rbp),%rax
mov    -0x54(%rbp),%ecx
mov    (%rax,%rcx,4),%edi
mov    -0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
mov    (%rax,%rcx,4),%esi
movsd  -0x40(%rbp),%xmm1
movsd  0xd61(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xd5d(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  0xd51(%rip),%xmm2
subsd  -0x48(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
movsd  0xd37(%rip),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <dbinom@plt>
movaps %xmm0,%xmm2
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x54(%rbp),%ecx
mov    (%rax,%rcx,4),%edi
mov    -0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
mov    (%rax,%rcx,4),%esi
movsd  -0x40(%rbp),%xmm0
movsd  0xcde(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xcda(%rip),%xmm2
subsd  -0x48(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
movsd  0xcc0(%rip),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <dbinom@plt>
movaps %xmm0,%xmm2
movsd  -0x80(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xc8d(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x54(%rbp),%ecx
mov    (%rax,%rcx,4),%edi
mov    -0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
mov    (%rax,%rcx,4),%esi
movsd  0xc6f(%rip),%xmm0
subsd  -0x48(%rbp),%xmm0
movsd  -0x48(%rbp),%xmm1
movsd  0xc55(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xc59(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <dbinom@plt>
movaps %xmm0,%xmm2
movsd  -0x78(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xc2a(%rip),%xmm0
subsd  -0x28(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x54(%rbp),%ecx
mov    (%rax,%rcx,4),%edi
mov    -0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
mov    (%rax,%rcx,4),%esi
movsd  -0x40(%rbp),%xmm1
movsd  0xbe5(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xbe9(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  0xbd5(%rip),%xmm2
subsd  -0x48(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
movsd  0xbbb(%rip),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <dbinom@plt>
movaps %xmm0,%xmm2
movsd  -0x70(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  0xb98(%rip),%xmm0
subsd  -0x28(%rbp),%xmm0
subsd  -0x30(%rbp),%xmm0
subsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x54(%rbp),%ecx
mov    (%rax,%rcx,4),%edi
mov    -0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
mov    (%rax,%rcx,4),%esi
movsd  -0x40(%rbp),%xmm1
movsd  0xb53(%rip),%xmm0
divsd  %xmm0,%xmm1
movsd  0xb57(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  0xb43(%rip),%xmm2
subsd  -0x48(%rbp),%xmm2
movsd  -0x48(%rbp),%xmm1
movsd  0xb29(%rip),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <dbinom@plt>
movaps %xmm0,%xmm2
movsd  -0x68(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
call   1050 <isnan@plt>
cmp    $0x0,%rax
je     153f <logL2+0x3ff>
mov    0x2ac3(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    -0x54(%rbp),%ecx
mov    (%rax,%rcx,4),%edx
mov    -0x20(%rbp),%rax
mov    -0x54(%rbp),%ecx
mov    (%rax,%rcx,4),%ecx
lea    0xae6(%rip),%rsi
call   1040 <fprintf@plt>
xorps  %xmm0,%xmm0
ucomisd -0x60(%rbp),%xmm0
jb     1564 <logL2+0x424>
movsd  0xac3(%rip),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1581 <logL2+0x441>
movsd  -0x60(%rbp),%xmm0
call   1060 <log@plt>
cvtsi2sd %rax,%xmm1
movsd  -0x50(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    1586 <logL2+0x446>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    11ba <logL2+0x7a>
movsd  -0x50(%rbp),%xmm0
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logL2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
test   %esi,%esi
je     13cd <logL2+0x28d>
mov    %rcx,%r14
mov    %rdx,%r13
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
cvtss2sd %xmm0,%xmm8
cvtss2sd %xmm1,%xmm4
movss  0xc(%rdi),%xmm0
cvtss2sd %xmm0,%xmm2
movss  0x8(%rdi),%xmm0
cvtss2sd %xmm0,%xmm3
movsd  0xe78(%rip),%xmm5
movsd  0xe78(%rip),%xmm0
movapd %xmm0,%xmm6
movapd %xmm0,%xmm7
subsd  %xmm2,%xmm0
mulsd  %xmm5,%xmm2
subsd  %xmm2,%xmm6
movsd  %xmm6,0x58(%rsp)
mulsd  %xmm5,%xmm3
subsd  %xmm3,%xmm7
mulsd  %xmm0,%xmm7
addsd  %xmm2,%xmm7
movsd  %xmm7,0x50(%rsp)
movapd %xmm0,%xmm6
mulsd  %xmm5,%xmm6
movapd %xmm5,%xmm7
movapd %xmm3,%xmm1
addsd  %xmm5,%xmm1
subsd  %xmm3,%xmm5
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
movsd  %xmm3,0x30(%rsp)
movaps %xmm4,%xmm3
addsd  %xmm4,%xmm3
movsd  %xmm3,0x28(%rsp)
addsd  %xmm2,%xmm6
movsd  %xmm6,0x40(%rsp)
movsd  %xmm8,0x20(%rsp)
subsd  %xmm8,%xmm7
subsd  %xmm4,%xmm7
movsd  %xmm4,0x18(%rsp)
subsd  %xmm4,%xmm7
movsd  %xmm7,0x10(%rsp)
mulsd  %xmm0,%xmm1
addsd  %xmm2,%xmm1
movsd  %xmm1,0x38(%rsp)
mulsd  %xmm0,%xmm5
movsd  %xmm2,0x48(%rsp)
addsd  %xmm2,%xmm5
movsd  %xmm5,0x60(%rsp)
mov    %esi,%r12d
xor    %ebx,%ebx
mov    0x2d95(%rip),%rbp
lea    0xdce(%rip),%r15
xorpd  %xmm0,%xmm0
jmp    128c <logL2+0x14c>
nopl   0x0(%rax,%rax,1)
movapd %xmm1,%xmm0
call   1060 <log@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x1,%rbx
cmp    %rbx,%r12
je     13d1 <logL2+0x291>
movsd  %xmm0,0x8(%rsp)
mov    0x0(%r13,%rbx,4),%edi
mov    (%r14,%rbx,4),%esi
movsd  0x48(%rsp),%xmm0
call   1030 <dbinom@plt>
mulsd  0x20(%rsp),%xmm0
movsd  %xmm0,(%rsp)
mov    0x0(%r13,%rbx,4),%edi
mov    (%r14,%rbx,4),%esi
movsd  0x58(%rsp),%xmm0
call   1030 <dbinom@plt>
mulsd  0x20(%rsp),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
mov    0x0(%r13,%rbx,4),%edi
mov    (%r14,%rbx,4),%esi
movsd  0x50(%rsp),%xmm0
call   1030 <dbinom@plt>
mulsd  0x18(%rsp),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
mov    0x0(%r13,%rbx,4),%edi
mov    (%r14,%rbx,4),%esi
movsd  0x30(%rsp),%xmm0
call   1030 <dbinom@plt>
mulsd  0x18(%rsp),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
mov    0x0(%r13,%rbx,4),%edi
mov    (%r14,%rbx,4),%esi
movsd  0x40(%rsp),%xmm0
call   1030 <dbinom@plt>
mulsd  0x28(%rsp),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
mov    0x0(%r13,%rbx,4),%edi
mov    (%r14,%rbx,4),%esi
movsd  0x38(%rsp),%xmm0
call   1030 <dbinom@plt>
mulsd  0x10(%rsp),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
mov    0x0(%r13,%rbx,4),%edi
mov    (%r14,%rbx,4),%esi
movsd  0x60(%rsp),%xmm0
call   1030 <dbinom@plt>
mulsd  0x10(%rsp),%xmm0
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
call   1050 <isnan@plt>
test   %rax,%rax
je     13a7 <logL2+0x267>
mov    0x0(%rbp),%edi
mov    0x0(%r13,%rbx,4),%edx
mov    (%r14,%rbx,4),%ecx
mov    %r15,%rsi
call   1040 <fprintf@plt>
xorpd  %xmm0,%xmm0
movsd  (%rsp),%xmm1
ucomisd %xmm1,%xmm0
jb     1260 <logL2+0x120>
movsd  0x8(%rsp),%xmm0
addsd  0xc48(%rip),%xmm0
jmp    127f <logL2+0x13f>
xorpd  %xmm0,%xmm0
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@stdout = global i32 0
@.str = [11 x i8] c"NaN %u %u\0A\00"
define double @logL2(float* nocapture %0, i32 %1, i32* nocapture %2, i32* nocapture %3) {
%5 = load float, float* %0
%6 = fpext float %5 to double
%7 = getelementptr inbounds float, float* %0, i64 1
%8 = load float, float* %7
%9 = fpext float %8 to double
%10 = getelementptr inbounds float, float* %0, i64 3
%11 = load float, float* %10
%12 = fpext float %11 to double
%13 = icmp eq i32 %1, 0
br i1 %13, label %87, label %14
14: ; preds = %4
%15 = getelementptr inbounds float, float* %0, i64 2
%16 = load float, float* %15
%17 = fpext float %16 to double
%18 = fmul double %12, 5.000000e-01
%19 = fsub double 1.000000e+00, %18
%20 = fmul double %17, 5.000000e-01
%21 = fsub double 1.000000e+00, %20
%22 = fsub double 1.000000e+00, %12
%23 = tail call double @llvm.fmuladd.f64(double %21, double %22, double %18)
%24 = tail call double @llvm.fmuladd.f64(double %20, double %22, double %18)
%25 = fmul double %9, 2.000000e+00
%26 = tail call double @llvm.fmuladd.f64(double %22, double 5.000000e-01, double %18)
%27 = fsub double 5.000000e-01, %6
%28 = fsub double %27, %9
%29 = fsub double %28, %9
%30 = fadd double %20, 5.000000e-01
%31 = tail call double @llvm.fmuladd.f64(double %30, double %22, double %18)
%32 = fsub double 5.000000e-01, %20
%33 = tail call double @llvm.fmuladd.f64(double %32, double %22, double %18)
%34 = zext i32 %1 to i64
br label %35
35: ; preds = %14, %83
%36 = phi i64 [ 0, %14 ], [ %85, %83 ]
%37 = phi double [ 0.000000e+00, %14 ], [ %84, %83 ]
%38 = getelementptr inbounds i32, i32* %2, i64 %36
%39 = load i32, i32* %38
%40 = getelementptr inbounds i32, i32* %3, i64 %36
%41 = load i32, i32* %40
%42 = tail call double @dbinom(i32 %39, i32 %41, double %18)
%43 = fmul double %42, %6
%44 = load i32, i32* %38
%45 = load i32, i32* %40
%46 = tail call double @dbinom(i32 %44, i32 %45, double %19)
%47 = tail call double @llvm.fmuladd.f64(double %6, double %46, double %43)
%48 = load i32, i32* %38
%49 = load i32, i32* %40
%50 = tail call double @dbinom(i32 %48, i32 %49, double %23)
%51 = tail call double @llvm.fmuladd.f64(double %9, double %50, double %47)
%52 = load i32, i32* %38
%53 = load i32, i32* %40
%54 = tail call double @dbinom(i32 %52, i32 %53, double %24)
%55 = tail call double @llvm.fmuladd.f64(double %9, double %54, double %51)
%56 = load i32, i32* %38
%57 = load i32, i32* %40
%58 = tail call double @dbinom(i32 %56, i32 %57, double %26)
%59 = tail call double @llvm.fmuladd.f64(double %25, double %58, double %55)
%60 = load i32, i32* %38
%61 = load i32, i32* %40
%62 = tail call double @dbinom(i32 %60, i32 %61, double %31)
%63 = tail call double @llvm.fmuladd.f64(double %29, double %62, double %59)
%64 = load i32, i32* %38
%65 = load i32, i32* %40
%66 = tail call double @dbinom(i32 %64, i32 %65, double %33)
%67 = tail call double @llvm.fmuladd.f64(double %29, double %66, double %63)
%68 = tail call i64 @isnan(double %67)
%69 = icmp eq i64 %68, 0
br i1 %69, label %75, label %70
70: ; preds = %35
%71 = load i32, i32* @stdout
%72 = load i32, i32* %38
%73 = load i32, i32* %40
%74 = tail call i32 @fprintf(i32 %71, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %72, i32 %73)
br label %75
75: ; preds = %70, %35
%76 = fcmp ugt double %67, 0.000000e+00
br i1 %76, label %79, label %77
77: ; preds = %75
%78 = fadd double %37, 1.000000e+06
br label %83
79: ; preds = %75
%80 = tail call i64 @log(double %67)
%81 = sitofp i64 %80 to double
%82 = fsub double %37, %81
br label %83
83: ; preds = %79, %77
%84 = phi double [ %78, %77 ], [ %82, %79 ]
%85 = add nuw nsw i64 %36, 1
%86 = icmp eq i64 %85, %34
br i1 %86, label %87, label %35
87: ; preds = %83, %4
%88 = phi double [ 0.000000e+00, %4 ], [ %84, %83 ]
ret double %88
}