#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 fabs(double);
double log(double);
double alnrel(double a) {
  static double p1 = -1.29418923021993;
  static double p2 = .405303492862024;
  static double p3 = -.0178874546012214;
  static double q1 = -1.62752256355323;
  static double q2 = .747811014037616;
  static double q3 = -.0845104217945565;
  double ret_val;
  double t, w, x, t2;
  if (fabs(a) > .375f) {
    goto L10;
  }
  t = a / (a + 2.0);
  t2 = t * t;
  w = (((p3 * t2 + p2) * t2 + p1) * t2 + 1.0) /
      (((q3 * t2 + q2) * t2 + q1) * t2 + 1.0);
  ret_val = t * 2.0 * w;
  return ret_val;
L10:
  x = a + 1.;
  ret_val = log(x);
  return ret_val;
}


x86 assembly (clang, -O0):
<alnrel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <fabs@plt>
movss  0xec1(%rip),%xmm1
ucomiss %xmm1,%xmm0
jbe    114d <alnrel+0x2d>
jmp    1234 <alnrel+0x114>
movsd  -0x10(%rbp),%xmm0
movsd  0xeae(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0x2ec1(%rip),%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  0x2eac(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x38(%rbp),%xmm2
movsd  0x2e8f(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x38(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe56(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0x2e92(%rip),%xmm1
movsd  -0x38(%rbp),%xmm3
movsd  0x2e7d(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x38(%rbp),%xmm3
movsd  0x2e60(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x38(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xe0f(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xdf2(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    125f <alnrel+0x13f>
movsd  0xdd4(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alnrel>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <fabs@plt>
ucomiss 0xece(%rip),%xmm0
jbe    1147 <alnrel+0x27>
movsd  (%rsp),%xmm0
addsd  0xecf(%rip),%xmm0
pop    %rax
jmp    1040 <log@plt>
movsd  0xeb9(%rip),%xmm1
movsd  (%rsp),%xmm0
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
unpcklpd %xmm2,%xmm2
movapd 0xeb0(%rip),%xmm1
mulpd  %xmm2,%xmm1
addpd  0xeb4(%rip),%xmm1
mulpd  %xmm2,%xmm1
addpd  0xeb8(%rip),%xmm1
mulpd  %xmm2,%xmm1
addpd  0xebc(%rip),%xmm1
movapd %xmm1,%xmm2
unpckhpd %xmm1,%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm0,%xmm0
mulsd  %xmm1,%xmm0
pop    %rax
ret

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

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