#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 exp(double);
double log(double);
double sqrt(double);
double K0(double x) {
  double x1, x2;
  double s1, s2;
  if (x >= 60.0)
    return (0.0);
  else if (x >= 2.0) {
    x1 = 2.0 / x;
    s1 = (((((0.00053208 * x1 - 0.00251540) * x1 + 0.00587872) * x1 -
            0.01062446) *
               x1 +
           0.02189568) *
              x1 -
          0.07832358) *
             x1 +
         1.25331414;
    return (s1 * exp(-x) / sqrt(x));
  } else {
    x1 = x * x / 4.0;
    x2 = x * x / 14.0625;
    s1 = (((((0.00000740 * x1 + 0.00010750) * x1 + 0.00262698) * x1 +
            0.03488590) *
               x1 +
           0.23069756) *
              x1 +
          0.42278420) *
             x1 -
         0.57721566;
    s2 = (((((0.0045813 * x2 + 0.0360768) * x2 + 0.2659732) * x2 + 1.2067492) *
               x2 +
           3.0899424) *
              x2 +
          3.5156229) *
             x2 +
         1.0;
    return (-log(0.5 * x) * s2 + s1);
  }
}


x86 assembly (clang, -O0):
<K0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xeb6(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1161 <K0+0x31>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13fd <K0+0x2cd>
movsd  -0x10(%rbp),%xmm0
movsd  0xe9a(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1271 <K0+0x141>
movsd  0xe88(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xf29(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xf25(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xf00(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee3(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec6(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea9(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe8c(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x10(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
call   1030 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1050 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    13fd <K0+0x2cd>
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xe0d(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
movsd  0xdea(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xdc4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdc0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd9b(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd7e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd61(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd44(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xd27(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  0xd01(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcfd(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcd8(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcbb(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc9e(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc81(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xc64(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xc4b(%rip),%xmm0
mulsd  -0x10(%rbp),%xmm0
call   1040 <log@plt>
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  -0x30(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<K0>:
sub    $0x28,%rsp
xorpd  %xmm3,%xmm3
ucomisd 0xec0(%rip),%xmm0
jae    12ff <K0+0x1cf>
movapd %xmm0,%xmm2
ucomisd 0xeb6(%rip),%xmm0
jae    124a <K0+0x11a>
movapd %xmm2,%xmm0
mulsd  %xmm2,%xmm0
movsd  0xee0(%rip),%xmm1
mulsd  %xmm0,%xmm1
divsd  0xedc(%rip),%xmm0
movsd  0xedc(%rip),%xmm3
mulsd  %xmm1,%xmm3
addsd  0xed8(%rip),%xmm3
mulsd  %xmm1,%xmm3
addsd  0xed4(%rip),%xmm3
mulsd  %xmm1,%xmm3
addsd  0xed0(%rip),%xmm3
mulsd  %xmm1,%xmm3
addsd  0xecc(%rip),%xmm3
mulsd  %xmm1,%xmm3
addsd  0xec8(%rip),%xmm3
mulsd  %xmm1,%xmm3
addsd  0xec4(%rip),%xmm3
movsd  %xmm3,0x10(%rsp)
movsd  0xebe(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeba(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeb6(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeb2(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeae(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeaa(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xea6(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
mulsd  0xea0(%rip),%xmm2
movapd %xmm2,%xmm0
call   1040 <log@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
add    $0x28,%rsp
ret
movsd  0xdb6(%rip),%xmm0
divsd  %xmm2,%xmm0
movsd  0xdb2(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xdae(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xdaa(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xda6(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xda2(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xd9e(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xd9a(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
movapd 0xe1c(%rip),%xmm0
xorpd  %xmm2,%xmm0
movapd %xmm2,0x10(%rsp)
call   1030 <exp@plt>
movapd 0x10(%rsp),%xmm1
movapd %xmm0,%xmm3
mulsd  0x8(%rsp),%xmm3
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jb     12e6 <K0+0x1b6>
xorps  %xmm0,%xmm0
sqrtsd %xmm1,%xmm0
jmp    12fb <K0+0x1cb>
movapd %xmm1,%xmm0
movsd  %xmm3,0x10(%rsp)
call   1050 <sqrt@plt>
movsd  0x10(%rsp),%xmm3
divsd  %xmm0,%xmm3
movapd %xmm3,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @K0(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %3
%8 = load double, double* %3
%9 = fcmp oge double %8, 6.000000e+01
br i1 %9, label %10, label %11
10: ; preds = %1
store double 0.000000e+00, double* %2
br label %77
11: ; preds = %1
%12 = load double, double* %3
%13 = fcmp oge double %12, 2.000000e+00
br i1 %13, label %14, label %37
14: ; preds = %11
%15 = load double, double* %3
%16 = fdiv double 2.000000e+00, %15
store double %16, double* %4
%17 = load double, double* %4
%18 = call double @llvm.fmuladd.f64(double 5.320800e-04, double %17, double -2.515400e-03)
%19 = load double, double* %4
%20 = call double @llvm.fmuladd.f64(double %18, double %19, double 5.878720e-03)
%21 = load double, double* %4
%22 = call double @llvm.fmuladd.f64(double %20, double %21, double 0xBF85C246E1E6BA5F)
%23 = load double, double* %4
%24 = call double @llvm.fmuladd.f64(double %22, double %23, double 0x3F966BD236183FE8)
%25 = load double, double* %4
%26 = call double @llvm.fmuladd.f64(double %24, double %25, double 0xBFB40D039E9B0B34)
%27 = load double, double* %4
%28 = call double @llvm.fmuladd.f64(double %26, double %27, double 0x3FF40D9320AEA13E)
store double %28, double* %6
%29 = load double, double* %6
%30 = load double, double* %3
%31 = fneg double %30
%32 = call double @exp(double %31)
%33 = fmul double %29, %32
%34 = load double, double* %3
%35 = call double @sqrt(double %34)
%36 = fdiv double %33, %35
store double %36, double* %2
br label %77
37: ; preds = %11
%38 = load double, double* %3
%39 = load double, double* %3
%40 = fmul double %38, %39
%41 = fdiv double %40, 4.000000e+00
store double %41, double* %4
%42 = load double, double* %3
%43 = load double, double* %3
%44 = fmul double %42, %43
%45 = fdiv double %44, 1.406250e+01
store double %45, double* %5
%46 = load double, double* %4
%47 = call double @llvm.fmuladd.f64(double 7.400000e-06, double %46, double 1.075000e-04)
%48 = load double, double* %4
%49 = call double @llvm.fmuladd.f64(double %47, double %48, double 2.626980e-03)
%50 = load double, double* %4
%51 = call double @llvm.fmuladd.f64(double %49, double %50, double 3.488590e-02)
%52 = load double, double* %4
%53 = call double @llvm.fmuladd.f64(double %51, double %52, double 0x3FCD877F65BBC695)
%54 = load double, double* %4
%55 = call double @llvm.fmuladd.f64(double %53, double %54, double 0x3FDB0EE57610FE55)
%56 = load double, double* %4
%57 = call double @llvm.fmuladd.f64(double %55, double %56, double 0xBFE2788CF9CE0CBE)
store double %57, double* %6
%58 = load double, double* %5
%59 = call double @llvm.fmuladd.f64(double 4.581300e-03, double %58, double 3.607680e-02)
%60 = load double, double* %5
%61 = call double @llvm.fmuladd.f64(double %59, double %60, double 0x3FD105B474E732AA)
%62 = load double, double* %5
%63 = call double @llvm.fmuladd.f64(double %61, double %62, double 0x3FF34ED83FC7962C)
%64 = load double, double* %5
%65 = call double @llvm.fmuladd.f64(double %63, double %64, double 0x4008B833B89430A4)
%66 = load double, double* %5
%67 = call double @llvm.fmuladd.f64(double %65, double %66, double 0x400C1FFEE6248CA7)
%68 = load double, double* %5
%69 = call double @llvm.fmuladd.f64(double %67, double %68, double 1.000000e+00)
store double %69, double* %7
%70 = load double, double* %3
%71 = fmul double 5.000000e-01, %70
%72 = call double @log(double %71)
%73 = fneg double %72
%74 = load double, double* %7
%75 = load double, double* %6
%76 = call double @llvm.fmuladd.f64(double %73, double %74, double %75)
store double %76, double* %2
br label %77
77: ; preds = %37, %14, %10
%78 = load double, double* %2
ret double %78
}

LLVM IR (-O2):
define double @K0(double %0) {
%2 = fcmp ult double %0, 6.000000e+01
br i1 %2, label %3, label %38
3: ; preds = %1
%4 = fcmp ult double %0, 2.000000e+00
br i1 %4, label %18, label %5
5: ; preds = %3
%6 = fdiv double 2.000000e+00, %0
%7 = tail call double @llvm.fmuladd.f64(double %6, double 5.320800e-04, double -2.515400e-03)
%8 = tail call double @llvm.fmuladd.f64(double %7, double %6, double 5.878720e-03)
%9 = tail call double @llvm.fmuladd.f64(double %8, double %6, double 0xBF85C246E1E6BA5F)
%10 = tail call double @llvm.fmuladd.f64(double %9, double %6, double 0x3F966BD236183FE8)
%11 = tail call double @llvm.fmuladd.f64(double %10, double %6, double 0xBFB40D039E9B0B34)
%12 = tail call double @llvm.fmuladd.f64(double %11, double %6, double 0x3FF40D9320AEA13E)
%13 = fneg double %0
%14 = tail call double @exp(double %13)
%15 = fmul double %12, %14
%16 = tail call double @sqrt(double %0)
%17 = fdiv double %15, %16
br label %38
18: ; preds = %3
%19 = fmul double %0, %0
%20 = fmul double %19, 2.500000e-01
%21 = fdiv double %19, 1.406250e+01
%22 = tail call double @llvm.fmuladd.f64(double %20, double 7.400000e-06, double 1.075000e-04)
%23 = tail call double @llvm.fmuladd.f64(double %22, double %20, double 2.626980e-03)
%24 = tail call double @llvm.fmuladd.f64(double %23, double %20, double 3.488590e-02)
%25 = tail call double @llvm.fmuladd.f64(double %24, double %20, double 0x3FCD877F65BBC695)
%26 = tail call double @llvm.fmuladd.f64(double %25, double %20, double 0x3FDB0EE57610FE55)
%27 = tail call double @llvm.fmuladd.f64(double %26, double %20, double 0xBFE2788CF9CE0CBE)
%28 = tail call double @llvm.fmuladd.f64(double %21, double 4.581300e-03, double 3.607680e-02)
%29 = tail call double @llvm.fmuladd.f64(double %28, double %21, double 0x3FD105B474E732AA)
%30 = tail call double @llvm.fmuladd.f64(double %29, double %21, double 0x3FF34ED83FC7962C)
%31 = tail call double @llvm.fmuladd.f64(double %30, double %21, double 0x4008B833B89430A4)
%32 = tail call double @llvm.fmuladd.f64(double %31, double %21, double 0x400C1FFEE6248CA7)
%33 = tail call double @llvm.fmuladd.f64(double %32, double %21, double 1.000000e+00)
%34 = fmul double %0, 5.000000e-01
%35 = tail call double @log(double %34)
%36 = fneg double %35
%37 = tail call double @llvm.fmuladd.f64(double %36, double %33, double %27)
br label %38
38: ; preds = %1, %18, %5
%39 = phi double [ %17, %5 ], [ %37, %18 ], [ 0.000000e+00, %1 ]
ret double %39
}