#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);
double log(double);
double alnrel(double *a) {
  static double p1 = -.129418923021993e+01;
  static double p2 = .405303492862024e+00;
  static double p3 = -.178874546012214e-01;
  static double q1 = -.162752256355323e+01;
  static double q2 = .747811014037616e+00;
  static double q3 = -.845104217945565e-01;
  static double alnrel, t, t2, w, x;
  if (fabs(*a) > 0.375e0)
    goto S10;
  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;
  return alnrel;
S10:
  x = 1.e0 + *a;
  alnrel = log(x);
  return alnrel;
}


x86 assembly (clang, -O0):
<alnrel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movaps 0xef5(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  0xec9(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1146 <alnrel+0x36>
jmp    1260 <alnrel+0x150>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movsd  0xeae(%rip),%xmm1
addsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x2efe(%rip)
movsd  0x2ef6(%rip),%xmm0
mulsd  0x2eee(%rip),%xmm0
movsd  %xmm0,0x2eee(%rip)
movsd  0x2eae(%rip),%xmm0
movsd  0x2ede(%rip),%xmm2
movsd  0x2e96(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x2ec6(%rip),%xmm2
movsd  0x2e76(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x2eae(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe42(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0x2e76(%rip),%xmm1
movsd  0x2e8e(%rip),%xmm3
movsd  0x2e5e(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  0x2e76(%rip),%xmm3
movsd  0x2e3e(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  0x2e5e(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xdf2(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x2e4a(%rip)
movsd  0xdd2(%rip),%xmm0
mulsd  0x2e2a(%rip),%xmm0
mulsd  0x2e32(%rip),%xmm0
movsd  %xmm0,0x2e12(%rip)
movsd  0x2e0a(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    129a <alnrel+0x18a>
mov    -0x10(%rbp),%rax
movsd  0xda4(%rip),%xmm0
addsd  (%rax),%xmm0
movsd  %xmm0,0x2e08(%rip)
movsd  0x2e00(%rip),%xmm0
call   1030 <log@plt>
movsd  %xmm0,0x2dd3(%rip)
movsd  0x2dcb(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<alnrel>:
movsd  (%rdi),%xmm0
movapd 0xee4(%rip),%xmm1
andpd  %xmm0,%xmm1
ucomisd 0xf28(%rip),%xmm1
jbe    1137 <alnrel+0x27>
addsd  0xf2e(%rip),%xmm0
jmp    1030 <log@plt>
movsd  0xf19(%rip),%xmm1
addsd  %xmm0,%xmm1
divsd  %xmm1,%xmm0
movapd %xmm0,%xmm1
mulsd  %xmm0,%xmm1
unpcklpd %xmm1,%xmm1
movapd 0xeb5(%rip),%xmm2
mulpd  %xmm1,%xmm2
addpd  0xeb9(%rip),%xmm2
mulpd  %xmm1,%xmm2
addpd  0xebd(%rip),%xmm2
mulpd  %xmm1,%xmm2
addpd  0xec1(%rip),%xmm2
movapd %xmm2,%xmm1
unpckhpd %xmm2,%xmm1
divsd  %xmm1,%xmm2
addsd  %xmm0,%xmm0
mulsd  %xmm2,%xmm0
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
@alnrel.alnrel = internal global double 0.000000e+00
@alnrel.t = internal global double 0.000000e+00
@alnrel.t2 = internal global double 0.000000e+00
@alnrel.w = internal global double 0.000000e+00
@alnrel.x = internal global double 0.000000e+00
define double @alnrel(double* %0) {
%2 = alloca double
%3 = alloca double*
store double* %0, double** %3
%4 = load double*, double** %3
%5 = load double, double* %4
%6 = call double @llvm.fabs.f64(double %5)
%7 = fcmp ogt double %6, 3.750000e-01
br i1 %7, label %8, label %9
8: ; preds = %1
br label %43
9: ; preds = %1
%10 = load double*, double** %3
%11 = load double, double* %10
%12 = load double*, double** %3
%13 = load double, double* %12
%14 = fadd double %13, 2.000000e+00
%15 = fdiv double %11, %14
store double %15, double* @alnrel.t
%16 = load double, double* @alnrel.t
%17 = load double, double* @alnrel.t
%18 = fmul double %16, %17
store double %18, double* @alnrel.t2
%19 = load double, double* @alnrel.p3
%20 = load double, double* @alnrel.t2
%21 = load double, double* @alnrel.p2
%22 = call double @llvm.fmuladd.f64(double %19, double %20, double %21)
%23 = load double, double* @alnrel.t2
%24 = load double, double* @alnrel.p1
%25 = call double @llvm.fmuladd.f64(double %22, double %23, double %24)
%26 = load double, double* @alnrel.t2
%27 = call double @llvm.fmuladd.f64(double %25, double %26, double 1.000000e+00)
%28 = load double, double* @alnrel.q3
%29 = load double, double* @alnrel.t2
%30 = load double, double* @alnrel.q2
%31 = call double @llvm.fmuladd.f64(double %28, double %29, double %30)
%32 = load double, double* @alnrel.t2
%33 = load double, double* @alnrel.q1
%34 = call double @llvm.fmuladd.f64(double %31, double %32, double %33)
%35 = load double, double* @alnrel.t2
%36 = call double @llvm.fmuladd.f64(double %34, double %35, double 1.000000e+00)
%37 = fdiv double %27, %36
store double %37, double* @alnrel.w
%38 = load double, double* @alnrel.t
%39 = fmul double 2.000000e+00, %38
%40 = load double, double* @alnrel.w
%41 = fmul double %39, %40
store double %41, double* @alnrel.alnrel
%42 = load double, double* @alnrel.alnrel
store double %42, double* %2
br label %50
43: ; preds = %8
%44 = load double*, double** %3
%45 = load double, double* %44
%46 = fadd double 1.000000e+00, %45
store double %46, double* @alnrel.x
%47 = load double, double* @alnrel.x
%48 = call double @log(double %47)
store double %48, double* @alnrel.alnrel
%49 = load double, double* @alnrel.alnrel
store double %49, double* %2
br label %50
50: ; preds = %43, %9
%51 = load double, double* %2
ret double %51
}

LLVM IR (-O2):
define double @alnrel(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @llvm.fabs.f64(double %2)
%4 = fcmp ogt 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 [ %21, %19 ], [ %18, %5 ]
ret double %23
}