#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 greg2jul(int, int, int, int, int, double);
int /*<<< orphan*/ jul2greg(double, int *, int *, int *, int *, int *,
                            double *);
int julian_get_half_hour_number(double);
double julian_round_to_half_hour(double current) {
  int year, month, day, hour, minute, half_hour_number;
  double seconds;
  jul2greg(current, &month, &day, &year, &hour, &minute, &seconds);
  half_hour_number = julian_get_half_hour_number(current);
  minute = half_hour_number;
  return greg2jul(month, day, year, hour, minute, 0.0);
}


x86 assembly (clang, -O0):
<julian_round_to_half_hour>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x18(%rbp),%rcx
lea    -0x1c(%rbp),%r8
lea    -0x28(%rbp),%r9
call   1050 <jul2greg@plt>
movsd  -0x8(%rbp),%xmm0
call   1040 <julian_get_half_hour_number@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
xorps  %xmm0,%xmm0
call   1030 <greg2jul@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<julian_round_to_half_hour>:
sub    $0x28,%rsp
movsd  %xmm0,0x18(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0x4(%rsp),%r8
lea    0x20(%rsp),%r9
call   1050 <jul2greg@plt>
movsd  0x18(%rsp),%xmm0
call   1040 <julian_get_half_hour_number@plt>
mov    %eax,0x4(%rsp)
mov    0x10(%rsp),%edi
mov    0xc(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0x8(%rsp),%ecx
xorps  %xmm0,%xmm0
mov    %eax,%r8d
call   1030 <greg2jul@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @julian_round_to_half_hour(double %0) {
%2 = alloca double
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
store double %0, double* %2
%10 = load double, double* %2
%11 = call i32 @jul2greg(double %10, i32* %4, i32* %5, i32* %3, i32* %6, i32* %7, double* %9)
%12 = load double, double* %2
%13 = call i32 @julian_get_half_hour_number(double %12)
store i32 %13, i32* %8
%14 = load i32, i32* %8
store i32 %14, i32* %7
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = load i32, i32* %3
%18 = load i32, i32* %6
%19 = load i32, i32* %7
%20 = call double @greg2jul(i32 %15, i32 %16, i32 %17, i32 %18, i32 %19, double 0.000000e+00)
ret double %20
}

LLVM IR (-O2):
define double @julian_round_to_half_hour(double %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = bitcast double* %7 to i8*
%14 = call i32 @jul2greg(double %0, i32* %3, i32* %4, i32* %2, i32* %5, i32* %6, double* %7)
%15 = call i32 @julian_get_half_hour_number(double %0)
store i32 %15, i32* %6
%16 = load i32, i32* %3
%17 = load i32, i32* %4
%18 = load i32, i32* %2
%19 = load i32, i32* %5
%20 = call double @greg2jul(i32 %16, i32 %17, i32 %18, i32 %19, i32 %15, double 0.000000e+00)
ret double %20
}