#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 log(double);
double rlog1(double x) {
  static double a = .0566749439387324;
  static double b = .0456512608815524;
  static double p0 = .333333333333333;
  static double p1 = -.224696413112536;
  static double p2 = .00620886815375787;
  static double q1 = -1.27408923933623;
  static double q2 = .354508718369557;
  double ret_val;
  double h__, r__, t, w, w1;
  if (x < -.39f || x > .57f) {
    goto L100;
  }
  if (x < -.18f) {
    goto L10;
  }
  if (x > .18f) {
    goto L20;
  }
  h__ = x;
  w1 = 0.0;
  goto L30;
L10:
  h__ = x + .3;
  h__ /= .7;
  w1 = a - h__ * .3;
  goto L30;
L20:
  h__ = x * .75 - .25;
  w1 = b + h__ / 3.0;
L30:
  r__ = h__ / (h__ + 2.0);
  t = r__ * r__;
  w = ((p2 * t + p1) * t + p0) / ((q2 * t + q1) * t + 1.0);
  ret_val = t * 2.0 * (1.0 / (1.0 - r__) - r__ * w) + w1;
  return ret_val;
L100:
  w = x + 0.5 + 0.5;
  ret_val = x - log(w);
  return ret_val;
}


x86 assembly (clang, -O0):
<rlog1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xedb(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
ja     1147 <rlog1+0x37>
movsd  -0x10(%rbp),%xmm0
movsd  0xecb(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    114c <rlog1+0x3c>
jmp    1348 <rlog1+0x238>
movsd  0xebc(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1164 <rlog1+0x54>
jmp    1197 <rlog1+0x87>
movsd  -0x10(%rbp),%xmm0
movsd  0xea7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1180 <rlog1+0x70>
jmp    11fd <rlog1+0xed>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1241 <rlog1+0x131>
movsd  0xe99(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe8a(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0x2e61(%rip),%xmm1
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  0xe4d(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
jmp    1241 <rlog1+0x131>
movsd  -0x10(%rbp),%xmm0
movsd  0xe1e(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe1a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0x2e09(%rip),%xmm0
movsd  -0x20(%rbp),%xmm1
movsd  0xdec(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xe02(%rip),%xmm1
addsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0x2dd5(%rip),%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  0x2dc0(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  0x2da3(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0x2db3(%rip),%xmm1
movsd  -0x30(%rbp),%xmm3
movsd  0x2d9e(%rip),%xmm2
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xd7d(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xd70(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  0xd5b(%rip),%xmm2
subsd  -0x28(%rbp),%xmm2
movsd  0xd4e(%rip),%xmm1
divsd  %xmm2,%xmm1
movsd  -0x28(%rbp),%xmm2
movsd  -0x38(%rbp),%xmm3
movq   %xmm2,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm2
mulsd  %xmm3,%xmm2
addsd  %xmm1,%xmm2
movsd  -0x40(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1395 <rlog1+0x285>
movsd  0xd08(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  0xcfb(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x38(%rbp),%xmm0
call   1030 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rlog1>:
push   %rax
movapd %xmm0,%xmm5
movsd  0xee3(%rip),%xmm0
ucomisd %xmm5,%xmm0
ja     1161 <rlog1+0x51>
ucomisd 0xedd(%rip),%xmm5
ja     1161 <rlog1+0x51>
movsd  0xedb(%rip),%xmm0
ucomisd %xmm5,%xmm0
jbe    118e <rlog1+0x7e>
movsd  0xefd(%rip),%xmm0
addsd  %xmm0,%xmm5
divsd  0xef9(%rip),%xmm5
mulsd  %xmm5,%xmm0
movsd  0xef5(%rip),%xmm1
subsd  %xmm0,%xmm1
jmp    11c0 <rlog1+0xb0>
movsd  0xeff(%rip),%xmm1
movapd %xmm5,%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm5,(%rsp)
call   1030 <log@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret
xorpd  %xmm1,%xmm1
ucomisd 0xe7e(%rip),%xmm5
jbe    11c0 <rlog1+0xb0>
mulsd  0xe7c(%rip),%xmm5
addsd  0xe7c(%rip),%xmm5
movapd %xmm5,%xmm1
divsd  0xe78(%rip),%xmm1
addsd  0xe78(%rip),%xmm1
movsd  0xe90(%rip),%xmm0
addsd  %xmm5,%xmm0
divsd  %xmm0,%xmm5
movapd %xmm5,%xmm2
mulsd  %xmm5,%xmm2
movapd %xmm2,%xmm0
unpcklpd %xmm2,%xmm0
movapd 0xe88(%rip),%xmm3
mulpd  %xmm0,%xmm3
addpd  0xe8c(%rip),%xmm3
mulpd  %xmm0,%xmm3
addpd  0xe90(%rip),%xmm3
movapd %xmm3,%xmm0
unpckhpd %xmm3,%xmm0
divsd  %xmm0,%xmm3
addsd  %xmm2,%xmm2
movsd  0xe48(%rip),%xmm0
movapd %xmm0,%xmm4
subsd  %xmm5,%xmm4
divsd  %xmm4,%xmm0
mulsd  %xmm5,%xmm3
subsd  %xmm3,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@rlog1.a = internal global double 0x3FAD047F8D7060E0
@rlog1.b = internal global double 0x3FA75F9A2103CE16
@rlog1.p0 = internal global double 0x3FD555555555554F
@rlog1.p1 = internal global double 0xBFCCC2DA20EC6581
@rlog1.p2 = internal global double 0x3F796E785AA6287C
@rlog1.q1 = internal global double 0xBFF462AB65F2276C
@rlog1.q2 = internal global double 0x3FD6B04555E2D2E4
define double @rlog1(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
store double %0, double* %3
%10 = load double, double* %3
%11 = fcmp olt double %10, 0xBFD8F5C280000000
br i1 %11, label %15, label %12
12: ; preds = %1
%13 = load double, double* %3
%14 = fcmp ogt double %13, 0x3FE23D70A0000000
br i1 %14, label %15, label %16
15: ; preds = %12, %1
br label %76
16: ; preds = %12
%17 = load double, double* %3
%18 = fcmp olt double %17, 0xBFC70A3D80000000
br i1 %18, label %19, label %20
19: ; preds = %16
br label %26
20: ; preds = %16
%21 = load double, double* %3
%22 = fcmp ogt double %21, 0x3FC70A3D80000000
br i1 %22, label %23, label %24
23: ; preds = %20
br label %35
24: ; preds = %20
%25 = load double, double* %3
store double %25, double* %5
store double 0.000000e+00, double* %9
br label %42
26: ; preds = %19
%27 = load double, double* %3
%28 = fadd double %27, 3.000000e-01
store double %28, double* %5
%29 = load double, double* %5
%30 = fdiv double %29, 0x3FE6666666666666
store double %30, double* %5
%31 = load double, double* @rlog1.a
%32 = load double, double* %5
%33 = fneg double %32
%34 = call double @llvm.fmuladd.f64(double %33, double 3.000000e-01, double %31)
store double %34, double* %9
br label %42
35: ; preds = %23
%36 = load double, double* %3
%37 = call double @llvm.fmuladd.f64(double %36, double 7.500000e-01, double -2.500000e-01)
store double %37, double* %5
%38 = load double, double* @rlog1.b
%39 = load double, double* %5
%40 = fdiv double %39, 3.000000e+00
%41 = fadd double %38, %40
store double %41, double* %9
br label %42
42: ; preds = %35, %26, %24
%43 = load double, double* %5
%44 = load double, double* %5
%45 = fadd double %44, 2.000000e+00
%46 = fdiv double %43, %45
store double %46, double* %6
%47 = load double, double* %6
%48 = load double, double* %6
%49 = fmul double %47, %48
store double %49, double* %7
%50 = load double, double* @rlog1.p2
%51 = load double, double* %7
%52 = load double, double* @rlog1.p1
%53 = call double @llvm.fmuladd.f64(double %50, double %51, double %52)
%54 = load double, double* %7
%55 = load double, double* @rlog1.p0
%56 = call double @llvm.fmuladd.f64(double %53, double %54, double %55)
%57 = load double, double* @rlog1.q2
%58 = load double, double* %7
%59 = load double, double* @rlog1.q1
%60 = call double @llvm.fmuladd.f64(double %57, double %58, double %59)
%61 = load double, double* %7
%62 = call double @llvm.fmuladd.f64(double %60, double %61, double 1.000000e+00)
%63 = fdiv double %56, %62
store double %63, double* %8
%64 = load double, double* %7
%65 = fmul double %64, 2.000000e+00
%66 = load double, double* %6
%67 = fsub double 1.000000e+00, %66
%68 = fdiv double 1.000000e+00, %67
%69 = load double, double* %6
%70 = load double, double* %8
%71 = fneg double %69
%72 = call double @llvm.fmuladd.f64(double %71, double %70, double %68)
%73 = load double, double* %9
%74 = call double @llvm.fmuladd.f64(double %65, double %72, double %73)
store double %74, double* %4
%75 = load double, double* %4
store double %75, double* %2
br label %85
76: ; preds = %15
%77 = load double, double* %3
%78 = fadd double %77, 5.000000e-01
%79 = fadd double %78, 5.000000e-01
store double %79, double* %8
%80 = load double, double* %3
%81 = load double, double* %8
%82 = call double @log(double %81)
%83 = fsub double %80, %82
store double %83, double* %4
%84 = load double, double* %4
store double %84, double* %2
br label %85
85: ; preds = %76, %42
%86 = load double, double* %2
ret double %86
}

LLVM IR (-O2):
define double @rlog1(double %0) {
%2 = fcmp olt double %0, 0xBFD8F5C280000000
%3 = fcmp ogt double %0, 0x3FE23D70A0000000
%4 = or i1 %2, %3
br i1 %4, label %37, label %5
5: ; preds = %1
%6 = fcmp olt double %0, 0xBFC70A3D80000000
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = fcmp ogt double %0, 0x3FC70A3D80000000
br i1 %8, label %14, label %18
9: ; preds = %5
%10 = fadd double %0, 3.000000e-01
%11 = fdiv double %10, 0x3FE6666666666666
%12 = fneg double %11
%13 = tail call double @llvm.fmuladd.f64(double %12, double 3.000000e-01, double 0x3FAD047F8D7060E0)
br label %18
14: ; preds = %7
%15 = tail call double @llvm.fmuladd.f64(double %0, double 7.500000e-01, double -2.500000e-01)
%16 = fdiv double %15, 3.000000e+00
%17 = fadd double %16, 0x3FA75F9A2103CE16
br label %18
18: ; preds = %7, %14, %9
%19 = phi double [ %11, %9 ], [ %15, %14 ], [ %0, %7 ]
%20 = phi double [ %13, %9 ], [ %17, %14 ], [ 0.000000e+00, %7 ]
%21 = fadd double %19, 2.000000e+00
%22 = fdiv double %19, %21
%23 = fmul double %22, %22
%24 = insertelement <2 x double> poison, double %23, i64 0
%25 = shufflevector <2 x double> %24, <2 x double> poison, <2 x i32> zeroinitializer
%26 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %25, <2 x double> <double 0x3F796E785AA6287C, double 0x3FD6B04555E2D2E4>, <2 x double> <double 0xBFCCC2DA20EC6581, double 0xBFF462AB65F2276C>)
%27 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %26, <2 x double> %25, <2 x double> <double 0x3FD555555555554F, double 1.000000e+00>)
%28 = extractelement <2 x double> %27, i64 0
%29 = extractelement <2 x double> %27, i64 1
%30 = fdiv double %28, %29
%31 = fmul double %23, 2.000000e+00
%32 = fsub double 1.000000e+00, %22
%33 = fdiv double 1.000000e+00, %32
%34 = fneg double %22
%35 = tail call double @llvm.fmuladd.f64(double %34, double %30, double %33)
%36 = tail call double @llvm.fmuladd.f64(double %31, double %35, double %20)
br label %42
37: ; preds = %1
%38 = fadd double %0, 5.000000e-01
%39 = fadd double %38, 5.000000e-01
%40 = tail call double @log(double %39)
%41 = fsub double %0, %40
br label %42
42: ; preds = %37, %18
%43 = phi double [ %41, %37 ], [ %36, %18 ]
ret double %43
}