#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 sin(double);
double tdt2tdb(double tdt) {
  double T;
  double dt;
  double g;
  double tdb;
  T = (tdt - (2451545.0)) / 36525;
  g = ((357.528 + (T * 35999.050)) * ((3.14159265358979323846) / 180.0));
  dt = 0.001658 * sin(g + (0.01671 * sin(g)));
  tdb = tdt + (dt / 86400);
  return (tdb);
}


x86 assembly (clang, -O0):
<tdt2tdb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xf0e(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xefa(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xed4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xed0(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xeb4(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1030 <sin@plt>
movsd  -0x30(%rbp),%xmm1
movsd  0xe82(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
call   1030 <sin@plt>
movaps %xmm0,%xmm1
movsd  0xe62(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  0xe3f(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tdt2tdb>:
sub    $0x18,%rsp
movsd  %xmm0,0x10(%rsp)
movsd  0xede(%rip),%xmm1
addsd  %xmm0,%xmm1
divsd  0xeda(%rip),%xmm1
mulsd  0xeda(%rip),%xmm1
addsd  0xeda(%rip),%xmm1
mulsd  0xeda(%rip),%xmm1
movsd  %xmm1,0x8(%rsp)
movapd %xmm1,%xmm0
call   1030 <sin@plt>
mulsd  0xecb(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
call   1030 <sin@plt>
mulsd  0xec0(%rip),%xmm0
divsd  0xec0(%rip),%xmm0
addsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @tdt2tdb(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %2
%7 = load double, double* %2
%8 = fsub double %7, 0x4142B42C80000000
%9 = fdiv double %8, 3.652500e+04
store double %9, double* %3
%10 = load double, double* %3
%11 = call double @llvm.fmuladd.f64(double %10, double 0x40E193E19999999A, double 3.575280e+02)
%12 = fmul double %11, 0x3F91DF46A2529D39
store double %12, double* %5
%13 = load double, double* %5
%14 = load double, double* %5
%15 = call double @sin(double %14)
%16 = call double @llvm.fmuladd.f64(double 1.671000e-02, double %15, double %13)
%17 = call double @sin(double %16)
%18 = fmul double 1.658000e-03, %17
store double %18, double* %4
%19 = load double, double* %2
%20 = load double, double* %4
%21 = fdiv double %20, 8.640000e+04
%22 = fadd double %19, %21
store double %22, double* %6
%23 = load double, double* %6
ret double %23
}

LLVM IR (-O2):
define double @tdt2tdb(double %0) {
%2 = fadd double %0, 0xC142B42C80000000
%3 = fdiv double %2, 3.652500e+04
%4 = tail call double @llvm.fmuladd.f64(double %3, double 0x40E193E19999999A, double 3.575280e+02)
%5 = fmul double %4, 0x3F91DF46A2529D39
%6 = tail call double @sin(double %5)
%7 = tail call double @llvm.fmuladd.f64(double %6, double 1.671000e-02, double %5)
%8 = tail call double @sin(double %7)
%9 = fmul double %8, 1.658000e-03
%10 = fdiv double %9, 8.640000e+04
%11 = fadd double %10, %0
ret double %11
}