#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 get_dynamical_diff_near(double);
double get_dynamical_diff_other(double);
double get_dynamical_diff_sh1(double);
double get_dynamical_diff_sh2(double);
double get_dynamical_diff_table(double);
double ln_get_dynamical_time_diff(double JD) {
  double TD;
  if (JD < 2067314.5)
    TD = get_dynamical_diff_sh1(JD);
  else if (JD >= 2067314.5 && JD < 2305447.5)
    TD = get_dynamical_diff_sh2(JD);
  else if (JD >= 2312752.5 && JD < 2448622.5)
    TD = get_dynamical_diff_table(JD);
  else if (JD >= 2448622.5 && JD <= 2455197.5)
    TD = get_dynamical_diff_near(JD);
  else
    TD = get_dynamical_diff_other(JD);
  return TD;
}


x86 assembly (clang, -O0):
<ln_get_dynamical_time_diff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xe9b(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1184 <ln_get_dynamical_time_diff+0x34>
movsd  -0x8(%rbp),%xmm0
call   1070 <get_dynamical_diff_sh1@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    125c <ln_get_dynamical_time_diff+0x10c>
movsd  -0x8(%rbp),%xmm0
movsd  0xe6f(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11c2 <ln_get_dynamical_time_diff+0x72>
movsd  0xe65(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    11c2 <ln_get_dynamical_time_diff+0x72>
movsd  -0x8(%rbp),%xmm0
call   1050 <get_dynamical_diff_sh2@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    1257 <ln_get_dynamical_time_diff+0x107>
movsd  -0x8(%rbp),%xmm0
movsd  0xe41(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1200 <ln_get_dynamical_time_diff+0xb0>
movsd  0xe37(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1200 <ln_get_dynamical_time_diff+0xb0>
movsd  -0x8(%rbp),%xmm0
call   1060 <get_dynamical_diff_table@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    1252 <ln_get_dynamical_time_diff+0x102>
movsd  -0x8(%rbp),%xmm0
movsd  0xe0b(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     123e <ln_get_dynamical_time_diff+0xee>
movsd  0xe01(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
jb     123e <ln_get_dynamical_time_diff+0xee>
movsd  -0x8(%rbp),%xmm0
call   1040 <get_dynamical_diff_near@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    124d <ln_get_dynamical_time_diff+0xfd>
movsd  -0x8(%rbp),%xmm0
call   1030 <get_dynamical_diff_other@plt>
movsd  %xmm0,-0x10(%rbp)
jmp    1252 <ln_get_dynamical_time_diff+0x102>
jmp    1257 <ln_get_dynamical_time_diff+0x107>
jmp    125c <ln_get_dynamical_time_diff+0x10c>
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ln_get_dynamical_time_diff>:
movsd  0xea8(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1163 <ln_get_dynamical_time_diff+0x13>
jmp    1070 <get_dynamical_diff_sh1@plt>
ucomisd 0xe95(%rip),%xmm0
jb     1180 <ln_get_dynamical_time_diff+0x30>
movsd  0xe93(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1180 <ln_get_dynamical_time_diff+0x30>
jmp    1050 <get_dynamical_diff_sh2@plt>
ucomisd 0xe88(%rip),%xmm0
jb     119d <ln_get_dynamical_time_diff+0x4d>
movsd  0xe86(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    119d <ln_get_dynamical_time_diff+0x4d>
jmp    1060 <get_dynamical_diff_table@plt>
ucomisd 0xe73(%rip),%xmm0
jb     11ba <ln_get_dynamical_time_diff+0x6a>
movsd  0xe71(%rip),%xmm1
ucomisd %xmm0,%xmm1
jb     11ba <ln_get_dynamical_time_diff+0x6a>
jmp    1040 <get_dynamical_diff_near@plt>
jmp    1030 <get_dynamical_diff_other@plt>

LLVM IR (-O0):
define double @ln_get_dynamical_time_diff(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp olt double %4, 0x413F8B7280000000
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load double, double* %2
%8 = call double @get_dynamical_diff_sh1(double %7)
store double %8, double* %3
br label %42
9: ; preds = %1
%10 = load double, double* %2
%11 = fcmp oge double %10, 0x413F8B7280000000
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load double, double* %2
%14 = fcmp olt double %13, 0x414196D3C0000000
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load double, double* %2
%17 = call double @get_dynamical_diff_sh2(double %16)
store double %17, double* %3
br label %41
18: ; preds = %12, %9
%19 = load double, double* %2
%20 = fcmp oge double %19, 0x4141A51840000000
br i1 %20, label %21, label %27
21: ; preds = %18
%22 = load double, double* %2
%23 = fcmp olt double %22, 0x4142AE7740000000
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load double, double* %2
%26 = call double @get_dynamical_diff_table(double %25)
store double %26, double* %3
br label %40
27: ; preds = %21, %18
%28 = load double, double* %2
%29 = fcmp oge double %28, 0x4142AE7740000000
br i1 %29, label %30, label %36
30: ; preds = %27
%31 = load double, double* %2
%32 = fcmp ole double %31, 0x4142BB4EC0000000
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = load double, double* %2
%35 = call double @get_dynamical_diff_near(double %34)
store double %35, double* %3
br label %39
36: ; preds = %30, %27
%37 = load double, double* %2
%38 = call double @get_dynamical_diff_other(double %37)
store double %38, double* %3
br label %39
39: ; preds = %36, %33
br label %40
40: ; preds = %39, %24
br label %41
41: ; preds = %40, %15
br label %42
42: ; preds = %41, %6
%43 = load double, double* %3
ret double %43
}

LLVM IR (-O2):
define double @ln_get_dynamical_time_diff(double %0) {
%2 = fcmp olt double %0, 0x413F8B7280000000
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call double @get_dynamical_diff_sh1(double %0)
br label %25
5: ; preds = %1
%6 = fcmp oge double %0, 0x413F8B7280000000
%7 = fcmp olt double %0, 0x414196D3C0000000
%8 = and i1 %6, %7
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call double @get_dynamical_diff_sh2(double %0)
br label %25
11: ; preds = %5
%12 = fcmp oge double %0, 0x4141A51840000000
%13 = fcmp olt double %0, 0x4142AE7740000000
%14 = and i1 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = tail call double @get_dynamical_diff_table(double %0)
br label %25
17: ; preds = %11
%18 = fcmp oge double %0, 0x4142AE7740000000
%19 = fcmp ole double %0, 0x4142BB4EC0000000
%20 = and i1 %18, %19
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = tail call double @get_dynamical_diff_near(double %0)
br label %25
23: ; preds = %17
%24 = tail call double @get_dynamical_diff_other(double %0)
br label %25
25: ; preds = %9, %21, %23, %15, %3
%26 = phi double [ %4, %3 ], [ %10, %9 ], [ %16, %15 ], [ %22, %21 ], [ %24, %23 ]
ret double %26
}