#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(scalar_t__);
scalar_t__ gammaLn(double);
double sqrt(double);
void pearsonIIIFit(double L[], double pearsonIIIParams[]) {
  double lMomentRatio, pi, sqrtPi, t, t2, t3;
  pi = 3.14159265358979;
  sqrtPi = sqrt(pi);
  lMomentRatio = L[3] / L[2];
  if (lMomentRatio > 0.0 && lMomentRatio < 0.333333) {
    t = 3 * pi * lMomentRatio * lMomentRatio;
    t2 = t * t;
    t3 = t2 * t;
    pearsonIIIParams[2] = (1 + 0.2906 * t) / (t + 0.1882 * t2 + 0.0442 * t3);
  } else if (lMomentRatio >= 0.333333 && lMomentRatio < 1) {
    t = 1 - lMomentRatio;
    t2 = t * t;
    t3 = t2 * t;
    pearsonIIIParams[2] = (0.36067 * t - 0.5967 * t2 + 0.25361 * t3) /
                          (1 - 2.78861 * t + 2.56096 * t2 - 0.77045 * t3);
  }
  pearsonIIIParams[1] =
      sqrtPi * L[2] *
      exp(gammaLn(pearsonIIIParams[2]) - gammaLn(pearsonIIIParams[2] + 0.5));
  pearsonIIIParams[0] = L[1] - pearsonIIIParams[1] * pearsonIIIParams[2];
}


x86 assembly (clang, -O0):
<pearsonIIIFit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xeb8(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1050 <sqrt@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
mov    -0x8(%rbp),%rax
divsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1230 <pearsonIIIFit+0x100>
movsd  0xe7b(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    1230 <pearsonIIIFit+0x100>
movsd  0xec0(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xe79(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe25(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  0xe4f(%rip),%xmm3
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x40(%rbp),%xmm1
movsd  0xe32(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
jmp    1331 <pearsonIIIFit+0x201>
movsd  -0x18(%rbp),%xmm0
movsd  0xdcb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     132c <pearsonIIIFit+0x1fc>
movsd  0xdc1(%rip),%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    132c <pearsonIIIFit+0x1fc>
movsd  0xdae(%rip),%xmm0
subsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x30(%rbp),%xmm1
movsd  0xda9(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xd7d(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
movsd  0xd60(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
movsd  0xd43(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd1f(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x38(%rbp),%xmm2
movsd  0xd1e(%rip),%xmm3
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x40(%rbp),%xmm1
movsd  0xd01(%rip),%xmm3
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x10(%rax)
jmp    1331 <pearsonIIIFit+0x201>
movsd  -0x28(%rbp),%xmm0
mov    -0x8(%rbp),%rax
mulsd  0x10(%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm0
call   1030 <gammaLn@plt>
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xd06(%rip),%xmm0
addsd  0x10(%rax),%xmm0
call   1030 <gammaLn@plt>
mov    -0x50(%rbp),%rdi
sub    %rax,%rdi
call   1040 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm1
mov    -0x10(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0x10(%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pearsonIIIFit>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%r14
movsd  0x18(%rdi),%xmm1
divsd  0x10(%rdi),%xmm1
mov    %rsi,%r15
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jbe    119b <pearsonIIIFit+0x7b>
movsd  0xeb5(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    119b <pearsonIIIFit+0x7b>
movsd  0xec7(%rip),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movapd %xmm0,%xmm2
mulsd  %xmm1,%xmm2
mulsd  0xeaf(%rip),%xmm1
addsd  %xmm0,%xmm1
unpcklpd %xmm2,%xmm0
movapd 0xed7(%rip),%xmm2
unpcklpd %xmm1,%xmm2
mulpd  0xedb(%rip),%xmm0
addpd  %xmm2,%xmm0
jmp    120b <pearsonIIIFit+0xeb>
ucomisd 0xe5d(%rip),%xmm1
jb     121f <pearsonIIIFit+0xff>
movsd  0xe5b(%rip),%xmm2
ucomisd %xmm1,%xmm2
jbe    121f <pearsonIIIFit+0xff>
movapd %xmm2,%xmm3
subsd  %xmm1,%xmm3
movapd %xmm3,%xmm1
mulsd  %xmm3,%xmm1
movapd %xmm3,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xe3d(%rip),%xmm4
mulsd  %xmm1,%xmm4
movsd  0xe39(%rip),%xmm5
mulsd  %xmm3,%xmm5
addsd  %xmm2,%xmm5
unpcklpd %xmm5,%xmm4
unpcklpd %xmm1,%xmm3
mulpd  0xe49(%rip),%xmm3
addpd  %xmm4,%xmm3
unpcklpd %xmm0,%xmm0
mulpd  0xe49(%rip),%xmm0
addpd  %xmm3,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x10(%r15)
jmp    1225 <pearsonIIIFit+0x105>
movsd  0x10(%r15),%xmm0
movsd  0x10(%r14),%xmm1
mulsd  0xdfd(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
call   1030 <gammaLn@plt>
mov    %rax,%rbx
movsd  0x10(%r15),%xmm0
addsd  0xde9(%rip),%xmm0
call   1030 <gammaLn@plt>
sub    %rax,%rbx
mov    %rbx,%rdi
call   1040 <exp@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%r15)
movsd  0x8(%r14),%xmm1
mulsd  0x10(%r15),%xmm0
subsd  %xmm0,%xmm1
movsd  %xmm1,(%r15)
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @pearsonIIIFit(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
store double* %0, double** %3
store double* %1, double** %4
store double 0x400921FB54442D11, double* %6
%11 = load double, double* %6
%12 = call double @sqrt(double %11)
store double %12, double* %7
%13 = load double*, double** %3
%14 = getelementptr inbounds double, double* %13, i64 3
%15 = load double, double* %14
%16 = load double*, double** %3
%17 = getelementptr inbounds double, double* %16, i64 2
%18 = load double, double* %17
%19 = fdiv double %15, %18
store double %19, double* %5
%20 = load double, double* %5
%21 = fcmp ogt double %20, 0.000000e+00
br i1 %21, label %22, label %48
22: ; preds = %2
%23 = load double, double* %5
%24 = fcmp olt double %23, 3.333330e-01
br i1 %24, label %25, label %48
25: ; preds = %22
%26 = load double, double* %6
%27 = fmul double 3.000000e+00, %26
%28 = load double, double* %5
%29 = fmul double %27, %28
%30 = load double, double* %5
%31 = fmul double %29, %30
store double %31, double* %8
%32 = load double, double* %8
%33 = load double, double* %8
%34 = fmul double %32, %33
store double %34, double* %9
%35 = load double, double* %9
%36 = load double, double* %8
%37 = fmul double %35, %36
store double %37, double* %10
%38 = load double, double* %8
%39 = call double @llvm.fmuladd.f64(double 2.906000e-01, double %38, double 1.000000e+00)
%40 = load double, double* %8
%41 = load double, double* %9
%42 = call double @llvm.fmuladd.f64(double 1.882000e-01, double %41, double %40)
%43 = load double, double* %10
%44 = call double @llvm.fmuladd.f64(double 4.420000e-02, double %43, double %42)
%45 = fdiv double %39, %44
%46 = load double*, double** %4
%47 = getelementptr inbounds double, double* %46, i64 2
store double %45, double* %47
br label %80
48: ; preds = %22, %2
%49 = load double, double* %5
%50 = fcmp oge double %49, 3.333330e-01
br i1 %50, label %51, label %79
51: ; preds = %48
%52 = load double, double* %5
%53 = fcmp olt double %52, 1.000000e+00
br i1 %53, label %54, label %79
54: ; preds = %51
%55 = load double, double* %5
%56 = fsub double 1.000000e+00, %55
store double %56, double* %8
%57 = load double, double* %8
%58 = load double, double* %8
%59 = fmul double %57, %58
store double %59, double* %9
%60 = load double, double* %9
%61 = load double, double* %8
%62 = fmul double %60, %61
store double %62, double* %10
%63 = load double, double* %8
%64 = load double, double* %9
%65 = fmul double 5.967000e-01, %64
%66 = fneg double %65
%67 = call double @llvm.fmuladd.f64(double 3.606700e-01, double %63, double %66)
%68 = load double, double* %10
%69 = call double @llvm.fmuladd.f64(double 2.536100e-01, double %68, double %67)
%70 = load double, double* %8
%71 = call double @llvm.fmuladd.f64(double -2.788610e+00, double %70, double 1.000000e+00)
%72 = load double, double* %9
%73 = call double @llvm.fmuladd.f64(double 2.560960e+00, double %72, double %71)
%74 = load double, double* %10
%75 = call double @llvm.fmuladd.f64(double -7.704500e-01, double %74, double %73)
%76 = fdiv double %69, %75
%77 = load double*, double** %4
%78 = getelementptr inbounds double, double* %77, i64 2
store double %76, double* %78
br label %79
79: ; preds = %54, %51, %48
br label %80
80: ; preds = %79, %25
%81 = load double, double* %7
%82 = load double*, double** %3
%83 = getelementptr inbounds double, double* %82, i64 2
%84 = load double, double* %83
%85 = fmul double %81, %84
%86 = load double*, double** %4
%87 = getelementptr inbounds double, double* %86, i64 2
%88 = load double, double* %87
%89 = call i64 @gammaLn(double %88)
%90 = load double*, double** %4
%91 = getelementptr inbounds double, double* %90, i64 2
%92 = load double, double* %91
%93 = fadd double %92, 5.000000e-01
%94 = call i64 @gammaLn(double %93)
%95 = sub nsw i64 %89, %94
%96 = call double @exp(i64 %95)
%97 = fmul double %85, %96
%98 = load double*, double** %4
%99 = getelementptr inbounds double, double* %98, i64 1
store double %97, double* %99
%100 = load double*, double** %3
%101 = getelementptr inbounds double, double* %100, i64 1
%102 = load double, double* %101
%103 = load double*, double** %4
%104 = getelementptr inbounds double, double* %103, i64 1
%105 = load double, double* %104
%106 = load double*, double** %4
%107 = getelementptr inbounds double, double* %106, i64 2
%108 = load double, double* %107
%109 = fneg double %105
%110 = call double @llvm.fmuladd.f64(double %109, double %108, double %102)
%111 = load double*, double** %4
%112 = getelementptr inbounds double, double* %111, i64 0
store double %110, double* %112
ret void
}

LLVM IR (-O2):
define void @pearsonIIIFit(double* nocapture %0, double* nocapture %1) {
%3 = getelementptr inbounds double, double* %0, i64 3
%4 = load double, double* %3
%5 = getelementptr inbounds double, double* %0, i64 2
%6 = load double, double* %5
%7 = fdiv double %4, %6
%8 = fcmp ogt double %7, 0.000000e+00
%9 = fcmp olt double %7, 3.333330e-01
%10 = and i1 %8, %9
br i1 %10, label %11, label %25
11: ; preds = %2
%12 = fmul double %7, 0x4022D97C7F3321CD
%13 = fmul double %7, %12
%14 = fmul double %13, %13
%15 = fmul double %13, %14
%16 = tail call double @llvm.fmuladd.f64(double %14, double 1.882000e-01, double %13)
%17 = insertelement <2 x double> poison, double %13, i64 0
%18 = insertelement <2 x double> %17, double %15, i64 1
%19 = insertelement <2 x double> <double 1.000000e+00, double poison>, double %16, i64 1
%20 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %18, <2 x double> <double 2.906000e-01, double 4.420000e-02>, <2 x double> %19)
%21 = extractelement <2 x double> %20, i64 0
%22 = extractelement <2 x double> %20, i64 1
%23 = fdiv double %21, %22
%24 = getelementptr inbounds double, double* %1, i64 2
store double %23, double* %24
br label %50
25: ; preds = %2
%26 = fcmp oge double %7, 3.333330e-01
%27 = fcmp olt double %7, 1.000000e+00
%28 = and i1 %26, %27
br i1 %28, label %32, label %29
29: ; preds = %25
%30 = getelementptr inbounds double, double* %1, i64 2
%31 = load double, double* %30
br label %50
32: ; preds = %25
%33 = fsub double 1.000000e+00, %7
%34 = fmul double %33, %33
%35 = fmul double %33, %34
%36 = fmul double %34, -5.967000e-01
%37 = tail call double @llvm.fmuladd.f64(double %33, double -2.788610e+00, double 1.000000e+00)
%38 = insertelement <2 x double> poison, double %33, i64 0
%39 = insertelement <2 x double> %38, double %34, i64 1
%40 = insertelement <2 x double> poison, double %36, i64 0
%41 = insertelement <2 x double> %40, double %37, i64 1
%42 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %39, <2 x double> <double 3.606700e-01, double 2.560960e+00>, <2 x double> %41)
%43 = insertelement <2 x double> poison, double %35, i64 0
%44 = shufflevector <2 x double> %43, <2 x double> poison, <2 x i32> zeroinitializer
%45 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %44, <2 x double> <double 2.536100e-01, double -7.704500e-01>, <2 x double> %42)
%46 = extractelement <2 x double> %45, i64 0
%47 = extractelement <2 x double> %45, i64 1
%48 = fdiv double %46, %47
%49 = getelementptr inbounds double, double* %1, i64 2
store double %48, double* %49
br label %50
50: ; preds = %29, %32, %11
%51 = phi double [ %31, %29 ], [ %48, %32 ], [ %23, %11 ]
%52 = load double, double* %5
%53 = fmul double %52, 0x3FFC5BF891B4EF67
%54 = getelementptr inbounds double, double* %1, i64 2
%55 = tail call i64 @gammaLn(double %51)
%56 = load double, double* %54
%57 = fadd double %56, 5.000000e-01
%58 = tail call i64 @gammaLn(double %57)
%59 = sub nsw i64 %55, %58
%60 = tail call double @exp(i64 %59)
%61 = fmul double %53, %60
%62 = getelementptr inbounds double, double* %1, i64 1
store double %61, double* %62
%63 = getelementptr inbounds double, double* %0, i64 1
%64 = load double, double* %63
%65 = load double, double* %54
%66 = fneg double %61
%67 = tail call double @llvm.fmuladd.f64(double %66, double %65, double %64)
store double %67, double* %1
ret void
}