#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 */
float bessk1(float);
float cos(float);
float cosh(float);
double exp(int);
int log(float);
float pow(float, double);
int sin(float);
float sinh(float);
float sqrt(float);
void mk_bs_cumdist(int nrads, float rads[], float maxrad, float cdist[],
                   float z, float bs, float R, float L, int nalpha,
                   float alpha[]) {
  int loop, i, j, k;
  float T, a1, a2, beta, fraction, incr, psi;
  T = 1.0 - R;
  a1 = bs / L;
  a2 = (bs - z) / L;
  beta = bs * T / (L * R);
  fraction = (R * cosh(a2) + T * sinh(a2)) / (R * cosh(a1) + T * sinh(a1));
  rads[0] = 0.0;
  cdist[0] = 0.0;
  for (i = 1; i < nrads; i++) {
    rads[i] = 0.5 * exp((i - 1) * log(maxrad / 0.5) / (float)(nrads - 1.0));
    cdist[i] = fraction;
    loop = 1;
    psi = sqrt(pow(alpha[loop], 2.0) + pow(bs / L, 2.0));
    while ((incr = bessk1(rads[i] / bs * psi)) > 1.e-8 && loop < nalpha) {
      incr *= 2 * alpha[loop] * beta * sin(alpha[loop] * z / bs) /
              (beta + pow(cos(alpha[loop]), 2.0)) * rads[i] / (psi * bs);
      cdist[i] -= incr;
      loop++;
      psi = sqrt(pow(alpha[loop], 2.0) + pow(bs / L, 2.0));
    }
  }
}


x86 assembly (clang, -O0):
<mk_bs_cumdist>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movss  %xmm0,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movss  %xmm1,-0x24(%rbp)
movss  %xmm2,-0x28(%rbp)
movss  %xmm3,-0x2c(%rbp)
movss  %xmm4,-0x30(%rbp)
mov    %ecx,-0x34(%rbp)
mov    %r8,-0x40(%rbp)
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe29(%rip),%xmm0
subsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x54(%rbp)
movss  -0x28(%rbp),%xmm0
divss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x58(%rbp)
movss  -0x28(%rbp),%xmm0
subss  -0x24(%rbp),%xmm0
divss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x5c(%rbp)
movss  -0x28(%rbp),%xmm0
mulss  -0x54(%rbp),%xmm0
movss  -0x30(%rbp),%xmm1
mulss  -0x2c(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x60(%rbp)
movss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x80(%rbp)
movss  -0x5c(%rbp),%xmm0
call   1040 <cosh@plt>
movss  %xmm0,-0x84(%rbp)
ff
movss  -0x54(%rbp),%xmm0
movss  %xmm0,-0x88(%rbp)
ff
movss  -0x5c(%rbp),%xmm0
call   1030 <sinh@plt>
movss  -0x88(%rbp),%xmm1
ff
movss  -0x84(%rbp),%xmm2
ff
movaps %xmm0,%xmm3
movss  -0x80(%rbp),%xmm0
mulss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x70(%rbp)
movss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x78(%rbp)
movss  -0x58(%rbp),%xmm0
call   1040 <cosh@plt>
movss  %xmm0,-0x74(%rbp)
movss  -0x54(%rbp),%xmm0
movss  %xmm0,-0x7c(%rbp)
movss  -0x58(%rbp),%xmm0
call   1030 <sinh@plt>
movss  -0x7c(%rbp),%xmm2
movss  -0x78(%rbp),%xmm1
movss  -0x74(%rbp),%xmm3
movaps %xmm0,%xmm4
movss  -0x70(%rbp),%xmm0
mulss  %xmm4,%xmm2
mulss  %xmm3,%xmm1
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x64(%rbp)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x20(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
movl   $0x1,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1599 <mk_bs_cumdist+0x409>
mov    -0x48(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x90(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcf1(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1080 <log@plt>
mov    %eax,%ecx
mov    -0x90(%rbp),%eax
imul   %ecx,%eax
cvtsi2ss %eax,%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xcb8(%rip),%xmm2
subsd  %xmm2,%xmm1
cvtsd2ss %xmm1,%xmm1
divss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
call   1060 <exp@plt>
movaps %xmm0,%xmm1
movsd  0xca8(%rip),%xmm0
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x48(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x64(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x48(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movl   $0x1,-0x44(%rbp)
mov    -0x40(%rbp),%rax
movslq -0x44(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movsd  0xc5d(%rip),%xmm1
call   1090 <pow@plt>
movss  %xmm0,-0x8c(%rbp)
ff
movss  -0x28(%rbp),%xmm0
divss  -0x30(%rbp),%xmm0
movsd  0xc3e(%rip),%xmm1
call   1090 <pow@plt>
movaps %xmm0,%xmm1
movss  -0x8c(%rbp),%xmm0
ff
addss  %xmm1,%xmm0
call   10a0 <sqrt@plt>
movss  %xmm0,-0x6c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x48(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
divss  -0x28(%rbp),%xmm0
mulss  -0x6c(%rbp),%xmm0
call   10b0 <bessk1@plt>
movss  %xmm0,-0x68(%rbp)
cvtss2sd %xmm0,%xmm0
xor    %eax,%eax
movsd  0xc01(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x91(%rbp)
jbe    1436 <mk_bs_cumdist+0x2a6>
mov    -0x44(%rbp),%eax
cmp    -0x34(%rbp),%eax
setl   %al
mov    %al,-0x91(%rbp)
mov    -0x91(%rbp),%al
test   $0x1,%al
jne    1449 <mk_bs_cumdist+0x2b9>
jmp    1586 <mk_bs_cumdist+0x3f6>
mov    -0x40(%rbp),%rax
movslq -0x44(%rbp),%rcx
movss  0xbc7(%rip),%xmm0
mulss  (%rax,%rcx,4),%xmm0
mulss  -0x60(%rbp),%xmm0
movss  %xmm0,-0xa4(%rbp)
ff
mov    -0x40(%rbp),%rax
movslq -0x44(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mulss  -0x24(%rbp),%xmm0
divss  -0x28(%rbp),%xmm0
call   1050 <sin@plt>
movss  -0xa4(%rbp),%xmm0
ff
cvtsi2ss %eax,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x9c(%rbp)
ff
movss  -0x60(%rbp),%xmm0
movss  %xmm0,-0xa0(%rbp)
ff
mov    -0x40(%rbp),%rax
movslq -0x44(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
call   1070 <cos@plt>
movsd  0xb42(%rip),%xmm1
call   1090 <pow@plt>
movss  -0xa0(%rbp),%xmm1
ff
movaps %xmm0,%xmm2
movss  -0x9c(%rbp),%xmm0
ff
addss  %xmm2,%xmm1
divss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x48(%rbp),%rcx
mulss  (%rax,%rcx,4),%xmm0
movss  -0x6c(%rbp),%xmm1
mulss  -0x28(%rbp),%xmm1
divss  %xmm1,%xmm0
mulss  -0x68(%rbp),%xmm0
movss  %xmm0,-0x68(%rbp)
movss  -0x68(%rbp),%xmm1
mov    -0x20(%rbp),%rax
movslq -0x48(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
mov    -0x40(%rbp),%rax
movslq -0x44(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movsd  0xac4(%rip),%xmm1
call   1090 <pow@plt>
movss  %xmm0,-0x98(%rbp)
ff
movss  -0x28(%rbp),%xmm0
divss  -0x30(%rbp),%xmm0
movsd  0xaa5(%rip),%xmm1
call   1090 <pow@plt>
movaps %xmm0,%xmm1
movss  -0x98(%rbp),%xmm0
ff
addss  %xmm1,%xmm0
call   10a0 <sqrt@plt>
movss  %xmm0,-0x6c(%rbp)
jmp    13e8 <mk_bs_cumdist+0x258>
jmp    158b <mk_bs_cumdist+0x3fb>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    12f6 <mk_bs_cumdist+0x166>
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk_bs_cumdist>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r8,%rbx
mov    %ecx,0x24(%rsp)
movss  %xmm3,0x20(%rsp)
mov    %rdx,%r15
movss  %xmm0,0x1c(%rsp)
mov    %rsi,%rbp
mov    %edi,%r12d
movaps %xmm2,%xmm0
divss  %xmm4,%xmm0
movss  %xmm0,0x10(%rsp)
movss  %xmm2,0xc(%rsp)
movaps %xmm2,%xmm0
movss  %xmm1,0x2c(%rsp)
subss  %xmm1,%xmm0
movss  %xmm4,0x14(%rsp)
divss  %xmm4,%xmm0
movss  %xmm0,0x4(%rsp)
call   1040 <cosh@plt>
movss  %xmm0,0x18(%rsp)
movss  0x4(%rsp),%xmm0
call   1030 <sinh@plt>
movss  %xmm0,0x8(%rsp)
movss  0x10(%rsp),%xmm0
call   1040 <cosh@plt>
movss  %xmm0,0x4(%rsp)
movss  0x10(%rsp),%xmm0
call   1030 <sinh@plt>
movl   $0x0,0x0(%rbp)
movl   $0x0,(%r15)
cmp    $0x2,%r12d
jl     14ff <mk_bs_cumdist+0x36f>
movss  0xdbe(%rip),%xmm1
movss  0x20(%rsp),%xmm3
subss  %xmm3,%xmm1
movaps %xmm1,%xmm2
mulss  0xc(%rsp),%xmm2
movss  0x14(%rsp),%xmm4
mulss  %xmm3,%xmm4
divss  %xmm4,%xmm2
movss  %xmm2,0x14(%rsp)
movss  0x8(%rsp),%xmm4
mulss  %xmm1,%xmm4
movss  0x18(%rsp),%xmm2
mulss  %xmm3,%xmm2
addss  %xmm4,%xmm2
mulss  %xmm0,%xmm1
movss  0x4(%rsp),%xmm0
mulss  %xmm3,%xmm0
addss  %xmm1,%xmm0
divss  %xmm0,%xmm2
movss  %xmm2,0x18(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
addsd  0xd5b(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x28(%rsp)
movss  0x1c(%rsp),%xmm0
addss  %xmm0,%xmm0
movss  %xmm0,0x1c(%rsp)
movslq 0x24(%rsp),%r13
mov    %r12d,%eax
mov    %rax,0x30(%rsp)
mov    $0x1,%r14d
jmp    12ef <mk_bs_cumdist+0x15f>
nopl   0x0(%rax)
add    $0x1,%r14
cmp    0x30(%rsp),%r14
je     14ff <mk_bs_cumdist+0x36f>
movss  0x1c(%rsp),%xmm0
call   1080 <log@plt>
lea    -0x1(%r14),%ecx
imul   %eax,%ecx
xorps  %xmm0,%xmm0
cvtsi2ss %ecx,%xmm0
divss  0x28(%rsp),%xmm0
cvttss2si %xmm0,%edi
call   1060 <exp@plt>
mulsd  0xcf1(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x0(%rbp,%r14,4)
movss  0x18(%rsp),%xmm0
movss  %xmm0,(%r15,%r14,4)
movss  0x4(%rbx),%xmm0
movsd  0xcd5(%rip),%xmm1
call   1090 <pow@plt>
movss  %xmm0,0x4(%rsp)
movss  0x10(%rsp),%xmm0
movsd  0xcbc(%rip),%xmm1
call   1090 <pow@plt>
addss  0x4(%rsp),%xmm0
ucomiss 0xc96(%rip),%xmm0
jb     1380 <mk_bs_cumdist+0x1f0>
xorps  %xmm1,%xmm1
sqrtss %xmm0,%xmm1
jmp    1388 <mk_bs_cumdist+0x1f8>
nopl   0x0(%rax)
call   10a0 <sqrt@plt>
movaps %xmm0,%xmm1
movss  0x0(%rbp,%r14,4),%xmm0
divss  0xc(%rsp),%xmm0
movss  %xmm1,0x4(%rsp)
mulss  %xmm1,%xmm0
call   10b0 <bessk1@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
ucomisd 0xc6d(%rip),%xmm1
jbe    12e0 <mk_bs_cumdist+0x150>
cmpl   $0x2,0x24(%rsp)
jl     12e0 <mk_bs_cumdist+0x150>
mov    $0x2,%r12d
nopw   0x0(%rax,%rax,1)
movss  %xmm0,0x20(%rsp)
movss  -0x4(%rbx,%r12,4),%xmm0
movaps %xmm0,%xmm1
addss  %xmm0,%xmm1
mulss  0x14(%rsp),%xmm1
movss  %xmm1,0x8(%rsp)
mulss  0x2c(%rsp),%xmm0
divss  0xc(%rsp),%xmm0
call   1050 <sin@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0x8(%rsp),%xmm0
movss  %xmm0,0x8(%rsp)
movss  -0x4(%rbx,%r12,4),%xmm0
call   1070 <cos@plt>
movsd  0xbf0(%rip),%xmm1
call   1090 <pow@plt>
addss  0x14(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
divss  %xmm0,%xmm1
mulss  0x0(%rbp,%r14,4),%xmm1
movss  0x4(%rsp),%xmm0
mulss  0xc(%rsp),%xmm0
divss  %xmm0,%xmm1
mulss  0x20(%rsp),%xmm1
movss  (%r15,%r14,4),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,(%r15,%r14,4)
movss  (%rbx,%r12,4),%xmm0
movsd  0xba0(%rip),%xmm1
call   1090 <pow@plt>
movss  %xmm0,0x4(%rsp)
movss  0x10(%rsp),%xmm0
movsd  0xb87(%rip),%xmm1
call   1090 <pow@plt>
addss  0x4(%rsp),%xmm0
ucomiss 0xb61(%rip),%xmm0
jb     14b0 <mk_bs_cumdist+0x320>
xorps  %xmm1,%xmm1
sqrtss %xmm0,%xmm1
jmp    14b8 <mk_bs_cumdist+0x328>
xchg   %ax,%ax
call   10a0 <sqrt@plt>
movaps %xmm0,%xmm1
movss  0x0(%rbp,%r14,4),%xmm0
divss  0xc(%rsp),%xmm0
movss  %xmm1,0x4(%rsp)
mulss  %xmm1,%xmm0
call   10b0 <bessk1@plt>
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
ucomisd 0xb3d(%rip),%xmm1
jbe    12e0 <mk_bs_cumdist+0x150>
lea    0x1(%r12),%rax
cmp    %r13,%r12
mov    %rax,%r12
jl     13d0 <mk_bs_cumdist+0x240>
jmp    12e0 <mk_bs_cumdist+0x150>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @mk_bs_cumdist(i32 %0, float* nocapture %1, float %2, float* nocapture %3, float %4, float %5, float %6, float %7, i32 %8, float* nocapture %9) {
%11 = fsub float 1.000000e+00, %6
%12 = fdiv float %5, %7
%13 = fsub float %5, %4
%14 = fdiv float %13, %7
%15 = fmul float %11, %5
%16 = fmul float %6, %7
%17 = fdiv float %15, %16
%18 = tail call float @cosh(float %14)
%19 = tail call float @sinh(float %14)
%20 = fmul float %11, %19
%21 = tail call float @llvm.fmuladd.f32(float %6, float %18, float %20)
%22 = tail call float @cosh(float %12)
%23 = tail call float @sinh(float %12)
%24 = fmul float %11, %23
%25 = tail call float @llvm.fmuladd.f32(float %6, float %22, float %24)
%26 = fdiv float %21, %25
store float 0.000000e+00, float* %1
store float 0.000000e+00, float* %3
%27 = icmp sgt i32 %0, 1
br i1 %27, label %28, label %106
28: ; preds = %10
%29 = fmul float %2, 2.000000e+00
%30 = sitofp i32 %0 to double
%31 = fadd double %30, -1.000000e+00
%32 = fptrunc double %31 to float
%33 = getelementptr inbounds float, float* %9, i64 1
%34 = icmp sgt i32 %8, 1
%35 = sext i32 %8 to i64
%36 = zext i32 %0 to i64
br label %37
37: ; preds = %28, %103
%38 = phi i64 [ 1, %28 ], [ %104, %103 ]
%39 = tail call i32 @log(float %29)
%40 = trunc i64 %38 to i32
%41 = add i32 %40, -1
%42 = mul nsw i32 %39, %41
%43 = sitofp i32 %42 to float
%44 = fdiv float %43, %32
%45 = fptosi float %44 to i32
%46 = tail call double @exp(i32 %45)
%47 = fmul double %46, 5.000000e-01
%48 = fptrunc double %47 to float
%49 = getelementptr inbounds float, float* %1, i64 %38
store float %48, float* %49
%50 = getelementptr inbounds float, float* %3, i64 %38
store float %26, float* %50
%51 = load float, float* %33
%52 = tail call float @pow(float %51, double 2.000000e+00)
%53 = tail call float @pow(float %12, double 2.000000e+00)
%54 = fadd float %52, %53
%55 = tail call float @sqrt(float %54)
%56 = load float, float* %49
%57 = fdiv float %56, %5
%58 = fmul float %55, %57
%59 = tail call float @bessk1(float %58)
%60 = fpext float %59 to double
%61 = fcmp ogt double %60, 1.000000e-08
%62 = and i1 %61, %34
br i1 %62, label %63, label %103
63: ; preds = %37, %63
%64 = phi i64 [ %88, %63 ], [ 1, %37 ]
%65 = phi float [ %98, %63 ], [ %59, %37 ]
%66 = phi float [ %94, %63 ], [ %55, %37 ]
%67 = getelementptr inbounds float, float* %9, i64 %64
%68 = load float, float* %67
%69 = fmul float %68, 2.000000e+00
%70 = fmul float %17, %69
%71 = fmul float %68, %4
%72 = fdiv float %71, %5
%73 = tail call i32 @sin(float %72)
%74 = sitofp i32 %73 to float
%75 = fmul float %70, %74
%76 = load float, float* %67
%77 = tail call float @cos(float %76)
%78 = tail call float @pow(float %77, double 2.000000e+00)
%79 = fadd float %17, %78
%80 = fdiv float %75, %79
%81 = load float, float* %49
%82 = fmul float %81, %80
%83 = fmul float %66, %5
%84 = fdiv float %82, %83
%85 = fmul float %65, %84
%86 = load float, float* %50
%87 = fsub float %86, %85
store float %87, float* %50
%88 = add nuw nsw i64 %64, 1
%89 = getelementptr inbounds float, float* %9, i64 %88
%90 = load float, float* %89
%91 = tail call float @pow(float %90, double 2.000000e+00)
%92 = tail call float @pow(float %12, double 2.000000e+00)
%93 = fadd float %91, %92
%94 = tail call float @sqrt(float %93)
%95 = load float, float* %49
%96 = fdiv float %95, %5
%97 = fmul float %94, %96
%98 = tail call float @bessk1(float %97)
%99 = fpext float %98 to double
%100 = fcmp ogt double %99, 1.000000e-08
%101 = icmp slt i64 %88, %35
%102 = select i1 %100, i1 %101, i1 false
br i1 %102, label %63, label %103
103: ; preds = %63, %37
%104 = add nuw nsw i64 %38, 1
%105 = icmp eq i64 %104, %36
br i1 %105, label %106, label %37
106: ; preds = %103, %10
ret void
}