#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 alnrel(double);
double log(double);
double algdiv(double a, double b) {
  static double c0 = .0833333333333333;
  static double c1 = -.00277777777760991;
  static double c2 = 7.9365066682539e-4;
  static double c3 = -5.9520293135187e-4;
  static double c4 = 8.37308034031215e-4;
  static double c5 = -.00165322962780713;
  double ret_val, r__1;
  double c__, d__, h__, t, u, v, w, x, s3, s5, x2, s7, s9, s11;
  if (a <= b) {
    goto L10;
  }
  h__ = b / a;
  c__ = 1.0 / (h__ + 1.0);
  x = h__ / (h__ + 1.0);
  d__ = a + (b - 0.5);
  goto L20;
L10:
  h__ = a / b;
  c__ = h__ / (h__ + 1.0);
  x = 1.0 / (h__ + 1.0);
  d__ = b + (a - 0.5);
L20:
  x2 = x * x;
  s3 = x + x2 + 1.0;
  s5 = x + x2 * s3 + 1.0;
  s7 = x + x2 * s5 + 1.0;
  s9 = x + x2 * s7 + 1.0;
  s11 = x + x2 * s9 + 1.0;
  r__1 = 1.0 / b;
  t = r__1 * r__1;
  w = ((((c5 * s11 * t + c4 * s9) * t + c3 * s7) * t + c2 * s5) * t + c1 * s3) *
          t +
      c0;
  w *= c__ / b;
  r__1 = a / b;
  u = d__ * alnrel(r__1);
  v = a * (log(b) - 1.0);
  if (u <= v) {
    goto L30;
  }
  ret_val = w - v - u;
  return ret_val;
L30:
  ret_val = w - u - v;
  return ret_val;
}


x86 assembly (clang, -O0):
<algdiv>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     114e <algdiv+0x2e>
jmp    11ba <algdiv+0x9a>
movsd  -0x18(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xea3(%rip),%xmm1
addsd  -0x40(%rbp),%xmm1
movsd  0xe96(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  0xe80(%rip),%xmm1
addsd  -0x40(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe58(%rip),%xmm2
subsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
jmp    1221 <algdiv+0x101>
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  0xe32(%rip),%xmm1
addsd  -0x40(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe1c(%rip),%xmm1
addsd  -0x40(%rbp),%xmm1
movsd  0xe0f(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xdec(%rip),%xmm2
subsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x68(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x68(%rbp),%xmm0
addsd  -0x80(%rbp),%xmm0
movsd  0xdc6(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x68(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm0
movsd  -0x70(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xd9e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x68(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm0
movsd  -0x78(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xd76(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x68(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm0
movsd  -0x88(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xd48(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x68(%rbp),%xmm1
movsd  -0x80(%rbp),%xmm0
movsd  -0x90(%rbp),%xmm2
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xd1a(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  0xd06(%rip),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0x2d35(%rip),%xmm0
mulsd  -0x98(%rbp),%xmm0
ff
movsd  -0x48(%rbp),%xmm2
movsd  0x2d18(%rip),%xmm1
mulsd  -0x90(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  0x2cf3(%rip),%xmm1
mulsd  -0x88(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  0x2cce(%rip),%xmm1
mulsd  -0x78(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  0x2cac(%rip),%xmm1
mulsd  -0x70(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  -0x48(%rbp),%xmm2
movsd  0x2c8a(%rip),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x30(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movsd  -0x10(%rbp),%xmm0
divsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x38(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x28(%rbp),%xmm0
call   1030 <alnrel@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
call   1040 <log@plt>
movaps %xmm0,%xmm1
movsd  -0xa0(%rbp),%xmm0
ff
movsd  0xbdd(%rip),%xmm2
subsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  -0x58(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1451 <algdiv+0x331>
jmp    1474 <algdiv+0x354>
movsd  -0x60(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1492 <algdiv+0x372>
movsd  -0x60(%rbp),%xmm0
subsd  -0x50(%rbp),%xmm0
subsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<algdiv>:
sub    $0x38,%rsp
movapd %xmm0,%xmm4
ucomisd %xmm0,%xmm1
movsd  %xmm0,0x18(%rsp)
jae    1176 <algdiv+0x56>
movapd %xmm1,%xmm3
divsd  %xmm4,%xmm3
movsd  0xebb(%rip),%xmm8
movapd %xmm3,%xmm0
addsd  %xmm8,%xmm0
divsd  %xmm0,%xmm8
divsd  %xmm0,%xmm3
movsd  0xea9(%rip),%xmm0
addsd  %xmm1,%xmm0
addsd  %xmm4,%xmm0
movsd  %xmm0,(%rsp)
movapd %xmm4,%xmm0
divsd  %xmm1,%xmm0
jmp    11b1 <algdiv+0x91>
movapd %xmm4,%xmm0
divsd  %xmm1,%xmm0
movsd  0xe7a(%rip),%xmm3
movapd %xmm0,%xmm2
addsd  %xmm3,%xmm2
movapd %xmm0,%xmm8
divsd  %xmm2,%xmm8
divsd  %xmm2,%xmm3
movsd  0xe64(%rip),%xmm2
addsd  %xmm4,%xmm2
addsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp)
movapd %xmm3,%xmm2
mulsd  %xmm3,%xmm2
movapd %xmm3,%xmm9
addsd  %xmm2,%xmm9
movsd  0xe35(%rip),%xmm4
addsd  %xmm4,%xmm9
movapd %xmm2,%xmm5
mulsd  %xmm9,%xmm5
addsd  %xmm3,%xmm5
addsd  %xmm4,%xmm5
movapd %xmm2,%xmm6
mulsd  %xmm5,%xmm6
addsd  %xmm3,%xmm6
addsd  %xmm4,%xmm6
movapd %xmm2,%xmm7
mulsd  %xmm6,%xmm7
addsd  %xmm3,%xmm7
addsd  %xmm4,%xmm7
mulsd  %xmm7,%xmm2
addsd  %xmm3,%xmm2
addsd  %xmm4,%xmm2
divsd  %xmm1,%xmm4
mulsd  0xdf7(%rip),%xmm2
mulsd  0xdf7(%rip),%xmm7
mulsd  %xmm4,%xmm4
mulsd  %xmm4,%xmm2
mulsd  0xdef(%rip),%xmm6
addsd  %xmm7,%xmm2
mulsd  %xmm4,%xmm2
mulsd  0xde7(%rip),%xmm5
addsd  %xmm6,%xmm2
mulsd  %xmm4,%xmm2
mulsd  0xdde(%rip),%xmm9
addsd  %xmm5,%xmm2
mulsd  %xmm4,%xmm2
addsd  %xmm9,%xmm2
mulsd  %xmm4,%xmm2
addsd  0xdcd(%rip),%xmm2
divsd  %xmm1,%xmm8
mulsd  %xmm2,%xmm8
movapd %xmm8,0x20(%rsp)
movsd  %xmm1,0x10(%rsp)
call   1030 <alnrel@plt>
mulsd  (%rsp),%xmm0
movapd %xmm0,(%rsp)
movsd  0x10(%rsp),%xmm0
call   1040 <log@plt>
addsd  0xd9c(%rip),%xmm0
mulsd  0x18(%rsp),%xmm0
movapd 0x20(%rsp),%xmm2
movapd %xmm2,%xmm1
movapd (%rsp),%xmm3
subsd  %xmm3,%xmm1
subsd  %xmm0,%xmm1
subsd  %xmm0,%xmm2
subsd  %xmm3,%xmm2
cmpnlesd %xmm0,%xmm3
andpd  %xmm3,%xmm2
andnpd %xmm1,%xmm3
orpd   %xmm2,%xmm3
movapd %xmm3,%xmm0
add    $0x38,%rsp
ret

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

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