#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 swe_deltat_ex(double, int, int /*<<< orphan*/ *);
double swe_sidtime0(double, double, double);
double swi_epsiln(double, int /*<<< orphan*/);
int /*<<< orphan*/ swi_init_swed_if_start();
int /*<<< orphan*/ swi_nutation(double, int /*<<< orphan*/, double *);
double swe_sidtime(double tjd_ut) {
  int i;
  double eps, nutlo[2], tsid;
  double tjde;
  tjde = tjd_ut + swe_deltat_ex(tjd_ut, -1, NULL);
  swi_init_swed_if_start();
  eps = swi_epsiln(tjde, 0) * (180.0 / 3.14159265358979323846);
  swi_nutation(tjde, 0, nutlo);
  for (i = 0; i < 2; i++)
    nutlo[i] *= (180.0 / 3.14159265358979323846);
  tsid = swe_sidtime0(tjd_ut, eps + nutlo[1], nutlo[0]);
  return tsid;
}


x86 assembly (clang, -O0):
<swe_sidtime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x8(%rbp),%xmm0
mov    $0xffffffff,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1070 <swe_deltat_ex@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    $0x0,%al
call   1040 <swi_init_swed_if_start@plt>
movsd  -0x40(%rbp),%xmm0
xor    %edi,%edi
call   1030 <swi_epsiln@plt>
movsd  0xe5a(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x40(%rbp),%xmm0
lea    -0x30(%rbp),%rsi
xor    %edi,%edi
call   1050 <swi_nutation@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    11f6 <swe_sidtime+0xa6>
movslq -0xc(%rbp),%rax
movsd  0xe24(%rip),%xmm0
mulsd  -0x30(%rbp,%rax,8),%xmm0
movsd  %xmm0,-0x30(%rbp,%rax,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11c6 <swe_sidtime+0x76>
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
addsd  -0x28(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
call   1060 <swe_sidtime0@plt>
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<swe_sidtime>:
sub    $0x38,%rsp
movsd  %xmm0,0x10(%rsp)
mov    $0xffffffff,%edi
xor    %esi,%esi
call   1070 <swe_deltat_ex@plt>
addsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1040 <swi_init_swed_if_start@plt>
movsd  0x8(%rsp),%xmm0
xor    %edi,%edi
call   1030 <swi_epsiln@plt>
movsd  %xmm0,0x18(%rsp)
lea    0x20(%rsp),%rsi
movsd  0x8(%rsp),%xmm0
xor    %edi,%edi
call   1050 <swi_nutation@plt>
movapd 0x20(%rsp),%xmm2
mulpd  0xe54(%rip),%xmm2
movapd %xmm2,0x20(%rsp)
movsd  0x18(%rsp),%xmm0
mulsd  0xe50(%rip),%xmm0
movapd %xmm2,%xmm1
unpckhpd %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  0x10(%rsp),%xmm0
call   1060 <swe_sidtime0@plt>
add    $0x38,%rsp
ret

LLVM IR (-O0):
define double @swe_sidtime(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca double
%5 = alloca [2 x double]
%6 = alloca double
%7 = alloca double
store double %0, double* %2
%8 = load double, double* %2
%9 = load double, double* %2
%10 = call double @swe_deltat_ex(double %9, i32 -1, i32* null)
%11 = fadd double %8, %10
store double %11, double* %7
%12 = call i32 (...) @swi_init_swed_if_start()
%13 = load double, double* %7
%14 = call double @swi_epsiln(double %13, i32 0)
%15 = fmul double %14, 0x404CA5DC1A63C1F8
store double %15, double* %4
%16 = load double, double* %7
%17 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
%18 = call i32 @swi_nutation(double %16, i32 0, double* %17)
store i32 0, i32* %3
br label %19
19: ; preds = %28, %1
%20 = load i32, i32* %3
%21 = icmp slt i32 %20, 2
br i1 %21, label %22, label %31
22: ; preds = %19
%23 = load i32, i32* %3
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 %24
%26 = load double, double* %25
%27 = fmul double %26, 0x404CA5DC1A63C1F8
store double %27, double* %25
br label %28
28: ; preds = %22
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %19
31: ; preds = %19
%32 = load double, double* %2
%33 = load double, double* %4
%34 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 1
%35 = load double, double* %34
%36 = fadd double %33, %35
%37 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
%38 = load double, double* %37
%39 = call double @swe_sidtime0(double %32, double %36, double %38)
store double %39, double* %6
%40 = load double, double* %6
ret double %40
}

LLVM IR (-O2):
define double @swe_sidtime(double %0) {
%2 = alloca <2 x double>
%3 = bitcast <2 x double>* %2 to i8*
%4 = tail call double @swe_deltat_ex(double %0, i32 -1, i32* null)
%5 = fadd double %4, %0
%6 = tail call i32 (...) @swi_init_swed_if_start()
%7 = tail call double @swi_epsiln(double %5, i32 0)
%8 = getelementptr inbounds <2 x double>, <2 x double>* %2, i64 0, i64 0
%9 = call i32 @swi_nutation(double %5, i32 0, double* %8)
%10 = load <2 x double>, <2 x double>* %2
%11 = fmul <2 x double> %10, <double 0x404CA5DC1A63C1F8, double 0x404CA5DC1A63C1F8>
store <2 x double> %11, <2 x double>* %2
%12 = fmul double %7, 0x404CA5DC1A63C1F8
%13 = extractelement <2 x double> %11, i64 1
%14 = fadd double %12, %13
%15 = extractelement <2 x double> %11, i64 0
%16 = call double @swe_sidtime0(double %0, double %14, double %15)
ret double %16
}