#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 deltaT(int, int);
int /*<<< orphan*/ jdftime(char *, double, char *, int /*<<< orphan*/,
                           int /*<<< orphan*/);
double jdptime(char *, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
void testdeltat() {
  double jd;
  char strout[30];
  jd = jdptime("2012-01-05 18:00", "%y-%m-%d %H:%M", 0, 0);
  printf("%f\n", jd);
  jdftime(strout, jd, "%y-%m-%d %H:%M", 0, 0);
  printf("jdftime output = %s\n", strout);
  int i, year;
  double deltat;
  year = -500;
  for (i = 0; i < 20; i++) {
    deltat = deltaT(year, 1);
    printf("%d   = %.2f\n", year, deltat);
    year += 100;
  }
  return;
}


x86 assembly (clang, -O0):
<testdeltat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xeb1(%rip),%rdi
lea    0xebb(%rip),%rsi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1030 <jdptime@plt>
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
lea    0xeb0(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
movsd  -0x8(%rbp),%xmm0
lea    0xe8a(%rip),%rsi
xor    %ecx,%ecx
mov    %ecx,%edx
call   1050 <jdftime@plt>
lea    -0x30(%rbp),%rsi
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xfffffe0c,-0x38(%rbp)
movl   $0x0,-0x34(%rbp)
cmpl   $0x14,-0x34(%rbp)
jge    11f9 <testdeltat+0xb9>
mov    -0x38(%rbp),%edi
mov    $0x1,%esi
call   1060 <deltaT@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x38(%rbp),%esi
movsd  -0x40(%rbp),%xmm0
lea    0xe5e(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%eax
add    $0x64,%eax
mov    %eax,-0x38(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11b0 <testdeltat+0x70>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testdeltat>:
push   %r14
push   %rbx
sub    $0x38,%rsp
lea    0xeb2(%rip),%rdi
lea    0xebc(%rip),%r14
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1030 <jdptime@plt>
movsd  %xmm0,0x8(%rsp)
lea    0xeb2(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
movsd  0x8(%rsp),%xmm0
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
call   1050 <jdftime@plt>
lea    0xe8e(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xfffffe0c,%edi
mov    $0x1,%esi
call   1060 <deltaT@plt>
lea    0xe83(%rip),%rbx
mov    %rbx,%rdi
mov    $0xfffffe0c,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xfffffe70,%edi
mov    $0x1,%esi
call   1060 <deltaT@plt>
mov    %rbx,%rdi
mov    $0xfffffe70,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xfffffed4,%edi
mov    $0x1,%esi
call   1060 <deltaT@plt>
mov    %rbx,%rdi
mov    $0xfffffed4,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xffffff38,%edi
mov    $0x1,%esi
call   1060 <deltaT@plt>
mov    %rbx,%rdi
mov    $0xffffff38,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xffffff9c,%edi
mov    $0x1,%esi
call   1060 <deltaT@plt>
mov    %rbx,%rdi
mov    $0xffffff9c,%esi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %edi,%edi
mov    $0x1,%esi
call   1060 <deltaT@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x64,%edi
mov    $0x1,%esi
call   1060 <deltaT@plt>
mov    %rbx,%rdi
mov    $0x64,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0xc8,%edi
mov    $0x1,%esi
call   1060 <deltaT@plt>
mov    %rbx,%rdi
mov    $0xc8,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x12c,%edi
mov    $0x1,%esi
call   1060 <deltaT@plt>
mov    %rbx,%rdi
mov    $0x12c,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x190,%edi
mov    $0x1,%esi
call   1060 <deltaT@plt>
mov    %rbx,%rdi
mov    $0x190,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1f4,%edi
mov    $0x1,%esi
call   1060 <deltaT@plt>
mov    %rbx,%rdi
mov    $0x1f4,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x258,%edi
mov    $0x1,%esi
call   1060 <deltaT@plt>
mov    %rbx,%rdi
mov    $0x258,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x2bc,%edi
mov    $0x1,%esi
call   1060 <deltaT@plt>
mov    %rbx,%rdi
mov    $0x2bc,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x320,%edi
mov    $0x1,%esi
call   1060 <deltaT@plt>
mov    %rbx,%rdi
mov    $0x320,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x384,%edi
mov    $0x1,%esi
call   1060 <deltaT@plt>
mov    %rbx,%rdi
mov    $0x384,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x3e8,%edi
mov    $0x1,%esi
call   1060 <deltaT@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x44c,%edi
mov    $0x1,%esi
call   1060 <deltaT@plt>
mov    %rbx,%rdi
mov    $0x44c,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x4b0,%edi
mov    $0x1,%esi
call   1060 <deltaT@plt>
mov    %rbx,%rdi
mov    $0x4b0,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x514,%edi
mov    $0x1,%esi
call   1060 <deltaT@plt>
mov    %rbx,%rdi
mov    $0x514,%esi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x578,%edi
mov    $0x1,%esi
call   1060 <deltaT@plt>
mov    %rbx,%rdi
mov    $0x578,%esi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [17 x i8] c"2012-01-05 18:00\00"
@.str.1 = [15 x i8] c"%y-%m-%d %H:%M\00"
@.str.2 = [4 x i8] c"%f\0A\00"
@.str.3 = [21 x i8] c"jdftime output = %s\0A\00"
@.str.4 = [13 x i8] c"%d = %.2f\0A\00"
define void @testdeltat() {
%1 = alloca double
%2 = alloca [30 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = call double @jdptime(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0)
store double %6, double* %1
%7 = load double, double* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %7)
%9 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%10 = load double, double* %1
%11 = call i32 @jdftime(i8* %9, double %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0)
%12 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %12)
store i32 -500, i32* %4
store i32 0, i32* %3
br label %14
14: ; preds = %25, %0
%15 = load i32, i32* %3
%16 = icmp slt i32 %15, 20
br i1 %16, label %17, label %28
17: ; preds = %14
%18 = load i32, i32* %4
%19 = call double @deltaT(i32 %18, i32 1)
store double %19, double* %5
%20 = load i32, i32* %4
%21 = load double, double* %5
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %20, double %21)
%23 = load i32, i32* %4
%24 = add nsw i32 %23, 100
store i32 %24, i32* %4
br label %25
25: ; preds = %17
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %14
28: ; preds = %14
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"2012-01-05 18:00\00"
@.str.1 = [15 x i8] c"%y-%m-%d %H:%M\00"
@.str.2 = [4 x i8] c"%f\0A\00"
@.str.3 = [21 x i8] c"jdftime output = %s\0A\00"
@.str.4 = [13 x i8] c"%d = %.2f\0A\00"
define void @testdeltat() {
%1 = alloca [30 x i8]
%2 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%3 = tail call double @jdptime(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %3)
%5 = call i32 @jdftime(i8* %2, double %3, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 0, i32 0)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %2)
%7 = call double @deltaT(i32 -500, i32 1)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 -500, double %7)
%9 = call double @deltaT(i32 -400, i32 1)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 -400, double %9)
%11 = call double @deltaT(i32 -300, i32 1)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 -300, double %11)
%13 = call double @deltaT(i32 -200, i32 1)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 -200, double %13)
%15 = call double @deltaT(i32 -100, i32 1)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 -100, double %15)
%17 = call double @deltaT(i32 0, i32 1)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 0, double %17)
%19 = call double @deltaT(i32 100, i32 1)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 100, double %19)
%21 = call double @deltaT(i32 200, i32 1)
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 200, double %21)
%23 = call double @deltaT(i32 300, i32 1)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 300, double %23)
%25 = call double @deltaT(i32 400, i32 1)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 400, double %25)
%27 = call double @deltaT(i32 500, i32 1)
%28 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 500, double %27)
%29 = call double @deltaT(i32 600, i32 1)
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 600, double %29)
%31 = call double @deltaT(i32 700, i32 1)
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 700, double %31)
%33 = call double @deltaT(i32 800, i32 1)
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 800, double %33)
%35 = call double @deltaT(i32 900, i32 1)
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 900, double %35)
%37 = call double @deltaT(i32 1000, i32 1)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 1000, double %37)
%39 = call double @deltaT(i32 1100, i32 1)
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 1100, double %39)
%41 = call double @deltaT(i32 1200, i32 1)
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 1200, double %41)
%43 = call double @deltaT(i32 1300, i32 1)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 1300, double %43)
%45 = call double @deltaT(i32 1400, i32 1)
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 1400, double %45)
ret void
}