#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 fabs(double const);
double log(double);
double cdflib_alnrel(const double *a) {
  double alnrel;
  static const double p1 = -0.129418923021993e+01;
  static const double p2 = 0.405303492862024e+00;
  static const double p3 = -0.178874546012214e-01;
  static const double q1 = -0.162752256355323e+01;
  static const double q2 = 0.747811014037616e+00;
  static const double q3 = -0.845104217945565e-01;
  double t;
  double t2;
  double w;
  double x;
  if (fabs(*a) <= 0.375e0) {
    t = *a / (*a + 2.0e0);
    t2 = t * t;
    w = (((p3 * t2 + p2) * t2 + p1) * t2 + 1.0e0) /
        (((q3 * t2 + q2) * t2 + q1) * t2 + 1.0e0);
    alnrel = 2.0e0 * t * w;
  } else {
    x = 1.0e0 + *a;
    alnrel = log(x);
  }
  return alnrel;
}


x86 assembly (clang, -O0):
<cdflib_alnrel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm1
movaps 0xf25(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xec9(%rip),%xmm0
ucomisd %xmm1,%xmm0
jb     1224 <cdflib_alnrel+0x114>
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  0xebb(%rip),%xmm1
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xeba(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xeb6(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe91(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe54(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xe5b(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe57(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe32(%rip),%xmm2
addsd  %xmm2,%xmm1
movsd  -0x20(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe0d(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe00(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1248 <cdflib_alnrel+0x138>
mov    -0x8(%rbp),%rax
movsd  0xdd8(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <log@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdflib_alnrel>:
movsd  (%rdi),%xmm0
movapd 0xee4(%rip),%xmm1
andpd  %xmm0,%xmm1
movsd  0xf28(%rip),%xmm2
ucomisd %xmm1,%xmm2
jae    113b <cdflib_alnrel+0x2b>
addsd  0xf2a(%rip),%xmm0
jmp    1030 <log@plt>
movsd  0xf15(%rip),%xmm1
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
unpcklpd %xmm1,%xmm1
movapd 0xeb1(%rip),%xmm2
mulpd  %xmm1,%xmm2
addpd  0xeb5(%rip),%xmm2
mulpd  %xmm1,%xmm2
addpd  0xeb9(%rip),%xmm2
mulpd  %xmm1,%xmm2
addpd  0xebd(%rip),%xmm2
movapd %xmm2,%xmm1
unpckhpd %xmm2,%xmm1
divsd  %xmm1,%xmm2
addsd  %xmm0,%xmm0
mulsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
@cdflib_alnrel.p1 = internal constant double 0xBFF4B4FFC42A148A
@cdflib_alnrel.p2 = internal constant double 0x3FD9F07E0FB3016F
@cdflib_alnrel.p3 = internal constant double 0xBF925116C2156ED7
@cdflib_alnrel.q1 = internal constant double 0xBFFA0A55197F6949
@cdflib_alnrel.q2 = internal constant double 0x3FE7EE115D1C2A40
@cdflib_alnrel.q3 = internal constant double 0xBFB5A27999C75E82
define double @cdflib_alnrel(double* %0) {
%2 = alloca double*
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double* %0, double** %2
%8 = load double*, double** %2
%9 = load double, double* %8
%10 = call double @llvm.fabs.f64(double %9)
%11 = fcmp ole double %10, 3.750000e-01
br i1 %11, label %12, label %39
12: ; preds = %1
%13 = load double*, double** %2
%14 = load double, double* %13
%15 = load double*, double** %2
%16 = load double, double* %15
%17 = fadd double %16, 2.000000e+00
%18 = fdiv double %14, %17
store double %18, double* %4
%19 = load double, double* %4
%20 = load double, double* %4
%21 = fmul double %19, %20
store double %21, double* %5
%22 = load double, double* %5
%23 = call double @llvm.fmuladd.f64(double 0xBF925116C2156ED7, double %22, double 0x3FD9F07E0FB3016F)
%24 = load double, double* %5
%25 = call double @llvm.fmuladd.f64(double %23, double %24, double 0xBFF4B4FFC42A148A)
%26 = load double, double* %5
%27 = call double @llvm.fmuladd.f64(double %25, double %26, double 1.000000e+00)
%28 = load double, double* %5
%29 = call double @llvm.fmuladd.f64(double 0xBFB5A27999C75E82, double %28, double 0x3FE7EE115D1C2A40)
%30 = load double, double* %5
%31 = call double @llvm.fmuladd.f64(double %29, double %30, double 0xBFFA0A55197F6949)
%32 = load double, double* %5
%33 = call double @llvm.fmuladd.f64(double %31, double %32, double 1.000000e+00)
%34 = fdiv double %27, %33
store double %34, double* %6
%35 = load double, double* %4
%36 = fmul double 2.000000e+00, %35
%37 = load double, double* %6
%38 = fmul double %36, %37
store double %38, double* %3
br label %45
39: ; preds = %1
%40 = load double*, double** %2
%41 = load double, double* %40
%42 = fadd double 1.000000e+00, %41
store double %42, double* %7
%43 = load double, double* %7
%44 = call double @log(double %43)
store double %44, double* %3
br label %45
45: ; preds = %39, %12
%46 = load double, double* %3
ret double %46
}

LLVM IR (-O2):
define double @cdflib_alnrel(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @llvm.fabs.f64(double %2)
%4 = fcmp ugt double %3, 3.750000e-01
br i1 %4, label %19, label %5
5: ; preds = %1
%6 = fadd double %2, 2.000000e+00
%7 = fdiv double %2, %6
%8 = fmul double %7, %7
%9 = insertelement <2 x double> poison, double %8, i64 0
%10 = shufflevector <2 x double> %9, <2 x double> poison, <2 x i32> zeroinitializer
%11 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %10, <2 x double> <double 0xBF925116C2156ED7, double 0xBFB5A27999C75E82>, <2 x double> <double 0x3FD9F07E0FB3016F, double 0x3FE7EE115D1C2A40>)
%12 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %11, <2 x double> %10, <2 x double> <double 0xBFF4B4FFC42A148A, double 0xBFFA0A55197F6949>)
%13 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %12, <2 x double> %10, <2 x double> <double 1.000000e+00, double 1.000000e+00>)
%14 = extractelement <2 x double> %13, i64 0
%15 = extractelement <2 x double> %13, i64 1
%16 = fdiv double %14, %15
%17 = fmul double %7, 2.000000e+00
%18 = fmul double %17, %16
br label %22
19: ; preds = %1
%20 = fadd double %2, 1.000000e+00
%21 = tail call double @log(double %20)
br label %22
22: ; preds = %19, %5
%23 = phi double [ %18, %5 ], [ %21, %19 ]
ret double %23
}