#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 Julian_Date_of_Year(double);
int modf(double, double *);
double Julian_Date_of_Epoch(double epoch) {
  double year, day;
  day = modf(epoch * 1E-3, &year) * 1E3;
  if (year < 57)
    year = year + 2000;
  else
    year = year + 1900;
  return (Julian_Date_of_Year(year) + day);
}


x86 assembly (clang, -O0):
<Julian_Date_of_Epoch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
lea    -0x10(%rbp),%rdi
call   1040 <modf@plt>
cvtsi2sd %eax,%xmm0
movsd  0xeb9(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xea0(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1182 <Julian_Date_of_Epoch+0x62>
movsd  0xead(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1194 <Julian_Date_of_Epoch+0x74>
movsd  0xe8e(%rip),%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <Julian_Date_of_Year@plt>
addsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Julian_Date_of_Epoch>:
sub    $0x18,%rsp
mulsd  0xed4(%rip),%xmm0
lea    0x10(%rsp),%rdi
call   1040 <modf@plt>
movsd  0x10(%rsp),%xmm0
movsd  0xec4(%rip),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
lea    0xec4(%rip),%rdx
addsd  (%rdx,%rcx,8),%xmm0
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
mulsd  0xea8(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
call   1030 <Julian_Date_of_Year@plt>
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @Julian_Date_of_Epoch(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
store double %0, double* %2
%5 = load double, double* %2
%6 = fmul double %5, 1.000000e-03
%7 = call i32 @modf(double %6, double* %3)
%8 = sitofp i32 %7 to double
%9 = fmul double %8, 1.000000e+03
store double %9, double* %4
%10 = load double, double* %3
%11 = fcmp olt double %10, 5.700000e+01
br i1 %11, label %12, label %15
12: ; preds = %1
%13 = load double, double* %3
%14 = fadd double %13, 2.000000e+03
store double %14, double* %3
br label %18
15: ; preds = %1
%16 = load double, double* %3
%17 = fadd double %16, 1.900000e+03
store double %17, double* %3
br label %18
18: ; preds = %15, %12
%19 = load double, double* %3
%20 = call double @Julian_Date_of_Year(double %19)
%21 = load double, double* %4
%22 = fadd double %20, %21
ret double %22
}

LLVM IR (-O2):
define double @Julian_Date_of_Epoch(double %0) {
%2 = alloca double
%3 = bitcast double* %2 to i8*
%4 = fmul double %0, 1.000000e-03
%5 = call i32 @modf(double %4, double* %2)
%6 = load double, double* %2
%7 = fcmp olt double %6, 5.700000e+01
%8 = select i1 %7, double 2.000000e+03, double 1.900000e+03
%9 = fadd double %6, %8
%10 = sitofp i32 %5 to double
%11 = fmul double %10, 1.000000e+03
%12 = tail call double @Julian_Date_of_Year(double %9)
%13 = fadd double %11, %12
ret double %13
}