#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 cdflib_alnrel(double *);
double log(double const);
double pow(double, double);
double cdflib_algdiv(const double *a, const double *b) {
  double algdiv;
  double c;
  static const double c0 = 0.833333333333333e-01;
  static const double c1 = -0.277777777760991e-02;
  static const double c2 = 0.793650666825390e-03;
  static const double c3 = -0.595202931351870e-03;
  static const double c4 = 0.837308034031215e-03;
  static const double c5 = -0.165322962780713e-02;
  double d;
  double h;
  double s11;
  double s3;
  double s5;
  double s7;
  double s9;
  double t;
  double T1;
  double u;
  double v;
  double w;
  double x;
  double x2;
  if (*b <= *a) {
    h = *b / *a;
    c = 1.0e0 / (1.0e0 + h);
    x = h / (1.0e0 + h);
    d = *a + (*b - 0.5e0);
  } else {
    h = *a / *b;
    c = h / (1.0e0 + h);
    x = 1.0e0 / (1.0e0 + h);
    d = *b + (*a - 0.5e0);
  }
  x2 = x * x;
  s3 = 1.0e0 + (x + x2);
  s5 = 1.0e0 + (x + x2 * s3);
  s7 = 1.0e0 + (x + x2 * s5);
  s9 = 1.0e0 + (x + x2 * s7);
  s11 = 1.0e0 + (x + x2 * s9);
  t = pow(1.0e0 / *b, 2.0);
  w = ((((c5 * s11 * t + c4 * s9) * t + c3 * s7) * t + c2 * s5) * t + c1 * s3) *
          t +
      c0;
  w *= (c / *b);
  T1 = *a / *b;
  u = d * cdflib_alnrel(&T1);
  v = *a * (log(*b) - 1.0e0);
  if (v < u) {
    algdiv = w - v - u;
  } else {
    algdiv = w - u - v;
  }
  return algdiv;
}


x86 assembly (clang, -O0):
<cdflib_algdiv>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jb     11d8 <cdflib_algdiv+0xa8>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe8e(%rip),%xmm1
addsd  -0x30(%rbp),%xmm1
movsd  0xe81(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xe6b(%rip),%xmm1
addsd  -0x30(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
movsd  0xe3a(%rip),%xmm2
subsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
jmp    124e <cdflib_algdiv+0x11e>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xe0e(%rip),%xmm1
addsd  -0x30(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xdf8(%rip),%xmm1
addsd  -0x30(%rbp),%xmm1
movsd  0xdeb(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movsd  0xdbf(%rip),%xmm2
subsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
mulsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x88(%rbp),%xmm1
ff
addsd  -0x90(%rbp),%xmm1
ff
movsd  0xd8a(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm1
ff
movsd  -0x40(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xd5c(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm1
ff
movsd  -0x48(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xd2e(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm1
ff
movsd  -0x50(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xd00(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x88(%rbp),%xmm0
ff
movsd  -0x90(%rbp),%xmm1
ff
movsd  -0x58(%rbp),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0xcd2(%rip),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
movsd  0xcbd(%rip),%xmm0
divsd  (%rax),%xmm0
movsd  0xce9(%rip),%xmm1
call   1050 <pow@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  0xccf(%rip),%xmm0
mulsd  -0x38(%rbp),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  0xcb5(%rip),%xmm1
mulsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  0xc93(%rip),%xmm1
mulsd  -0x50(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  0xc71(%rip),%xmm1
mulsd  -0x48(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  0xc4f(%rip),%xmm1
mulsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x60(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc29(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
divsd  (%rax),%xmm0
mulsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
lea    -0x68(%rbp),%rdi
call   1030 <cdflib_alnrel@plt>
movaps %xmm0,%xmm1
movsd  -0xa0(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x98(%rbp),%xmm0
ff
movsd  0xb92(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm1
movsd  -0x70(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    14b0 <cdflib_algdiv+0x380>
movsd  -0x80(%rbp),%xmm0
subsd  -0x78(%rbp),%xmm0
subsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    14c4 <cdflib_algdiv+0x394>
movsd  -0x80(%rbp),%xmm0
subsd  -0x70(%rbp),%xmm0
subsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdflib_algdiv>:
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  (%rsi),%xmm8
movsd  (%rdi),%xmm9
ucomisd %xmm8,%xmm9
jae    1180 <cdflib_algdiv+0x60>
movapd %xmm9,%xmm3
divsd  %xmm8,%xmm3
movsd  0xeb0(%rip),%xmm2
movapd %xmm3,%xmm1
addsd  0xeab(%rip),%xmm9
movapd %xmm9,%xmm0
movapd %xmm3,%xmm9
addsd  %xmm2,%xmm3
divsd  %xmm3,%xmm1
divsd  %xmm3,%xmm2
addsd  %xmm8,%xmm0
movsd  %xmm0,0x8(%rsp)
jmp    11bf <cdflib_algdiv+0x9f>
movapd %xmm8,%xmm2
divsd  %xmm9,%xmm2
movsd  0xe6e(%rip),%xmm1
movapd %xmm2,%xmm3
addsd  %xmm1,%xmm3
divsd  %xmm3,%xmm1
divsd  %xmm3,%xmm2
movsd  0xe5e(%rip),%xmm0
addsd  %xmm8,%xmm0
addsd  %xmm9,%xmm0
movsd  %xmm0,0x8(%rsp)
divsd  %xmm8,%xmm9
movapd %xmm2,%xmm3
mulsd  %xmm2,%xmm3
movapd %xmm2,%xmm4
addsd  %xmm3,%xmm4
movsd  0xe29(%rip),%xmm5
addsd  %xmm5,%xmm4
movapd %xmm3,%xmm6
mulsd  %xmm4,%xmm6
addsd  %xmm2,%xmm6
addsd  %xmm5,%xmm6
movapd %xmm3,%xmm7
mulsd  %xmm6,%xmm7
addsd  %xmm2,%xmm7
addsd  %xmm5,%xmm7
movapd %xmm3,%xmm0
mulsd  %xmm7,%xmm0
addsd  %xmm2,%xmm0
addsd  %xmm5,%xmm0
mulsd  %xmm0,%xmm3
addsd  %xmm2,%xmm3
addsd  %xmm5,%xmm3
divsd  %xmm8,%xmm5
mulsd  0xdec(%rip),%xmm3
mulsd  %xmm5,%xmm5
mulsd  0xde8(%rip),%xmm0
mulsd  %xmm5,%xmm3
addsd  %xmm0,%xmm3
mulsd  0xde0(%rip),%xmm7
mulsd  %xmm5,%xmm3
addsd  %xmm7,%xmm3
mulsd  0xdd8(%rip),%xmm6
mulsd  %xmm5,%xmm3
addsd  %xmm6,%xmm3
mulsd  0xdd0(%rip),%xmm4
mulsd  %xmm5,%xmm3
addsd  %xmm4,%xmm3
mulsd  %xmm5,%xmm3
addsd  0xdc4(%rip),%xmm3
divsd  %xmm8,%xmm1
mulsd  %xmm3,%xmm1
movapd %xmm1,0x20(%rsp)
movsd  %xmm9,0x18(%rsp)
lea    0x18(%rsp),%rdi
call   1030 <cdflib_alnrel@plt>
mulsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rbx),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  (%r14),%xmm0
call   1040 <log@plt>
addsd  0xd84(%rip),%xmm0
mulsd  0x10(%rsp),%xmm0
movapd 0x20(%rsp),%xmm2
movapd %xmm2,%xmm1
subsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm3
subsd  %xmm3,%xmm1
subsd  %xmm3,%xmm2
subsd  %xmm0,%xmm2
cmpltsd %xmm3,%xmm0
andpd  %xmm0,%xmm1
andnpd %xmm2,%xmm0
orpd   %xmm1,%xmm0
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@cdflib_algdiv.c0 = internal constant double 0x3FB5555555555553
@cdflib_algdiv.c1 = internal constant double 0xBF66C16C16BB8412
@cdflib_algdiv.c2 = internal constant double 0x3F4A019FD4488960
@cdflib_algdiv.c3 = internal constant double 0xBF4380EC8FF430DF
@cdflib_algdiv.c4 = internal constant double 0x3F4B6FD94FB94A6B
@cdflib_algdiv.c5 = internal constant double 0xBF5B1625CBCA1838
define double @cdflib_algdiv(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
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%21 = load double*, double** %4
%22 = load double, double* %21
%23 = load double*, double** %3
%24 = load double, double* %23
%25 = fcmp ole double %22, %24
br i1 %25, label %26, label %45
26: ; preds = %2
%27 = load double*, double** %4
%28 = load double, double* %27
%29 = load double*, double** %3
%30 = load double, double* %29
%31 = fdiv double %28, %30
store double %31, double* %8
%32 = load double, double* %8
%33 = fadd double 1.000000e+00, %32
%34 = fdiv double 1.000000e+00, %33
store double %34, double* %6
%35 = load double, double* %8
%36 = load double, double* %8
%37 = fadd double 1.000000e+00, %36
%38 = fdiv double %35, %37
store double %38, double* %19
%39 = load double*, double** %3
%40 = load double, double* %39
%41 = load double*, double** %4
%42 = load double, double* %41
%43 = fsub double %42, 5.000000e-01
%44 = fadd double %40, %43
store double %44, double* %7
br label %64
45: ; preds = %2
%46 = load double*, double** %3
%47 = load double, double* %46
%48 = load double*, double** %4
%49 = load double, double* %48
%50 = fdiv double %47, %49
store double %50, double* %8
%51 = load double, double* %8
%52 = load double, double* %8
%53 = fadd double 1.000000e+00, %52
%54 = fdiv double %51, %53
store double %54, double* %6
%55 = load double, double* %8
%56 = fadd double 1.000000e+00, %55
%57 = fdiv double 1.000000e+00, %56
store double %57, double* %19
%58 = load double*, double** %4
%59 = load double, double* %58
%60 = load double*, double** %3
%61 = load double, double* %60
%62 = fsub double %61, 5.000000e-01
%63 = fadd double %59, %62
store double %63, double* %7
br label %64
64: ; preds = %45, %26
%65 = load double, double* %19
%66 = load double, double* %19
%67 = fmul double %65, %66
store double %67, double* %20
%68 = load double, double* %19
%69 = load double, double* %20
%70 = fadd double %68, %69
%71 = fadd double 1.000000e+00, %70
store double %71, double* %10
%72 = load double, double* %19
%73 = load double, double* %20
%74 = load double, double* %10
%75 = call double @llvm.fmuladd.f64(double %73, double %74, double %72)
%76 = fadd double 1.000000e+00, %75
store double %76, double* %11
%77 = load double, double* %19
%78 = load double, double* %20
%79 = load double, double* %11
%80 = call double @llvm.fmuladd.f64(double %78, double %79, double %77)
%81 = fadd double 1.000000e+00, %80
store double %81, double* %12
%82 = load double, double* %19
%83 = load double, double* %20
%84 = load double, double* %12
%85 = call double @llvm.fmuladd.f64(double %83, double %84, double %82)
%86 = fadd double 1.000000e+00, %85
store double %86, double* %13
%87 = load double, double* %19
%88 = load double, double* %20
%89 = load double, double* %13
%90 = call double @llvm.fmuladd.f64(double %88, double %89, double %87)
%91 = fadd double 1.000000e+00, %90
store double %91, double* %9
%92 = load double*, double** %4
%93 = load double, double* %92
%94 = fdiv double 1.000000e+00, %93
%95 = call double @pow(double %94, double 2.000000e+00)
store double %95, double* %14
%96 = load double, double* %9
%97 = fmul double 0xBF5B1625CBCA1838, %96
%98 = load double, double* %14
%99 = load double, double* %13
%100 = fmul double 0x3F4B6FD94FB94A6B, %99
%101 = call double @llvm.fmuladd.f64(double %97, double %98, double %100)
%102 = load double, double* %14
%103 = load double, double* %12
%104 = fmul double 0xBF4380EC8FF430DF, %103
%105 = call double @llvm.fmuladd.f64(double %101, double %102, double %104)
%106 = load double, double* %14
%107 = load double, double* %11
%108 = fmul double 0x3F4A019FD4488960, %107
%109 = call double @llvm.fmuladd.f64(double %105, double %106, double %108)
%110 = load double, double* %14
%111 = load double, double* %10
%112 = fmul double 0xBF66C16C16BB8412, %111
%113 = call double @llvm.fmuladd.f64(double %109, double %110, double %112)
%114 = load double, double* %14
%115 = call double @llvm.fmuladd.f64(double %113, double %114, double 0x3FB5555555555553)
store double %115, double* %18
%116 = load double, double* %6
%117 = load double*, double** %4
%118 = load double, double* %117
%119 = fdiv double %116, %118
%120 = load double, double* %18
%121 = fmul double %120, %119
store double %121, double* %18
%122 = load double*, double** %3
%123 = load double, double* %122
%124 = load double*, double** %4
%125 = load double, double* %124
%126 = fdiv double %123, %125
store double %126, double* %15
%127 = load double, double* %7
%128 = call double @cdflib_alnrel(double* %15)
%129 = fmul double %127, %128
store double %129, double* %16
%130 = load double*, double** %3
%131 = load double, double* %130
%132 = load double*, double** %4
%133 = load double, double* %132
%134 = call double @log(double %133)
%135 = fsub double %134, 1.000000e+00
%136 = fmul double %131, %135
store double %136, double* %17
%137 = load double, double* %17
%138 = load double, double* %16
%139 = fcmp olt double %137, %138
br i1 %139, label %140, label %146
140: ; preds = %64
%141 = load double, double* %18
%142 = load double, double* %17
%143 = fsub double %141, %142
%144 = load double, double* %16
%145 = fsub double %143, %144
store double %145, double* %5
br label %152
146: ; preds = %64
%147 = load double, double* %18
%148 = load double, double* %16
%149 = fsub double %147, %148
%150 = load double, double* %17
%151 = fsub double %149, %150
store double %151, double* %5
br label %152
152: ; preds = %146, %140
%153 = load double, double* %5
ret double %153
}

LLVM IR (-O2):
define double @cdflib_algdiv(double* nocapture %0, double* nocapture %1) {
%3 = alloca double
%4 = bitcast double* %3 to i8*
%5 = load double, double* %1
%6 = load double, double* %0
%7 = fcmp ugt double %5, %6
br i1 %7, label %16, label %8
8: ; preds = %2
%9 = fdiv double %5, %6
%10 = fadd double %9, 1.000000e+00
%11 = fdiv double 1.000000e+00, %10
%12 = fdiv double %9, %10
%13 = fadd double %5, -5.000000e-01
%14 = fadd double %6, %13
%15 = fdiv double %6, %5
br label %23
16: ; preds = %2
%17 = fdiv double %6, %5
%18 = fadd double %17, 1.000000e+00
%19 = fdiv double %17, %18
%20 = fdiv double 1.000000e+00, %18
%21 = fadd double %6, -5.000000e-01
%22 = fadd double %5, %21
br label %23
23: ; preds = %16, %8
%24 = phi double [ %17, %16 ], [ %15, %8 ]
%25 = phi double [ %22, %16 ], [ %14, %8 ]
%26 = phi double [ %19, %16 ], [ %11, %8 ]
%27 = phi double [ %20, %16 ], [ %12, %8 ]
%28 = fmul double %27, %27
%29 = fadd double %27, %28
%30 = fadd double %29, 1.000000e+00
%31 = tail call double @llvm.fmuladd.f64(double %28, double %30, double %27)
%32 = fadd double %31, 1.000000e+00
%33 = tail call double @llvm.fmuladd.f64(double %28, double %32, double %27)
%34 = fadd double %33, 1.000000e+00
%35 = tail call double @llvm.fmuladd.f64(double %28, double %34, double %27)
%36 = fadd double %35, 1.000000e+00
%37 = tail call double @llvm.fmuladd.f64(double %28, double %36, double %27)
%38 = fadd double %37, 1.000000e+00
%39 = fdiv double 1.000000e+00, %5
%40 = fmul double %39, %39
%41 = fmul double %38, 0xBF5B1625CBCA1838
%42 = fmul double %36, 0x3F4B6FD94FB94A6B
%43 = tail call double @llvm.fmuladd.f64(double %41, double %40, double %42)
%44 = fmul double %34, 0xBF4380EC8FF430DF
%45 = tail call double @llvm.fmuladd.f64(double %43, double %40, double %44)
%46 = fmul double %32, 0x3F4A019FD4488960
%47 = tail call double @llvm.fmuladd.f64(double %45, double %40, double %46)
%48 = fmul double %30, 0xBF66C16C16BB8412
%49 = tail call double @llvm.fmuladd.f64(double %47, double %40, double %48)
%50 = tail call double @llvm.fmuladd.f64(double %49, double %40, double 0x3FB5555555555553)
%51 = fdiv double %26, %5
%52 = fmul double %51, %50
store double %24, double* %3
%53 = call double @cdflib_alnrel(double* %3)
%54 = fmul double %25, %53
%55 = load double, double* %0
%56 = load double, double* %1
%57 = call double @log(double %56)
%58 = fadd double %57, -1.000000e+00
%59 = fmul double %55, %58
%60 = fcmp olt double %59, %54
%61 = fsub double %52, %59
%62 = fsub double %61, %54
%63 = fsub double %52, %54
%64 = fsub double %63, %59
%65 = select i1 %60, double %62, double %64
ret double %65
}