#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 */
struct tm {
  int tm_year;
  int tm_mon;
  int tm_mday;
  double tm_hour;
  double tm_min;
  double tm_sec;
};

/* Variables and functions */
double modJulianDate(struct tm *theTime) {
  double date;
  int month;
  int day;
  int year;
  year = theTime->tm_year + 1900;
  month = theTime->tm_mon + 1;
  day = theTime->tm_mday;
  date = day - 32076 + 1461 * (year + 4800 + (month - 14) / 12) / 4 +
         367 * (month - 2 - (month - 14) / 12 * 12) / 12 -
         3 * ((year + 4900 + (month - 14) / 12) / 100) / 4;
  date += (theTime->tm_hour + 12.0) / 24.0;
  date += (theTime->tm_min) / 1440.0;
  date += (theTime->tm_sec) / 86400.0;
  date -= 2400000.5;
  return date;
}


x86 assembly (clang, -O0):
<modJulianDate>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x76c,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
sub    $0x7d4c,%eax
mov    %eax,-0x30(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x12c0,%eax
mov    %eax,-0x34(%rbp)
mov    -0x14(%rbp),%eax
sub    $0xe,%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
add    %ecx,%eax
imul   $0x5b5,%eax,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x30(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x14(%rbp),%eax
sub    $0xe,%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
imul   $0xc,%ecx,%ecx
sub    %ecx,%eax
imul   $0x16f,%eax,%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x28(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1324,%eax
mov    %eax,-0x24(%rbp)
mov    -0x14(%rbp),%eax
sub    $0xe,%eax
mov    $0xc,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x24(%rbp),%eax
add    %ecx,%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
imul   $0x3,%eax,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0xe28(%rip),%xmm0
addsd  0x10(%rax),%xmm0
movsd  0xe13(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x18(%rax),%xmm0
movsd  0xdec(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x20(%rax),%xmm0
movsd  0xdc5(%rip),%xmm1
divsd  %xmm1,%xmm0
addsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xda2(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<modJulianDate>:
mov    (%rdi),%r8d
mov    0x4(%rdi),%esi
lea    -0xd(%rsi),%eax
cltq
imul   $0x2aaaaaab,%rax,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x21,%rdx
add    %eax,%edx
lea    (%rdx,%r8,1),%eax
imul   $0x5b5,%eax,%eax
lea    0x955d1c(%rax),%ecx
add    $0x955d1f,%eax
test   %ecx,%ecx
cmovns %ecx,%eax
sar    $0x2,%eax
add    0x8(%rdi),%eax
lea    0x0(,%rdx,4),%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%esi
imul   $0x16f,%esi,%ecx
add    $0xfffffe91,%ecx
movslq %ecx,%rcx
imul   $0x2aaaaaab,%rcx,%rsi
mov    %rsi,%rcx
shr    $0x3f,%rcx
sar    $0x21,%rsi
add    %ecx,%esi
lea    (%r8,%rdx,1),%ecx
add    $0x1a90,%ecx
movslq %ecx,%rcx
imul   $0x51eb851f,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%edx
lea    (%rcx,%rcx,2),%ecx
add    $0x3,%ecx
test   %edx,%edx
cmovns %edx,%ecx
sar    $0x2,%ecx
sub    %ecx,%eax
add    %esi,%eax
add    $0xffff82b4,%eax
cvtsi2sd %eax,%xmm0
movsd  0x10(%rdi),%xmm1
addsd  0xe46(%rip),%xmm1
divsd  0xe46(%rip),%xmm1
addsd  %xmm0,%xmm1
movupd 0x18(%rdi),%xmm0
divpd  0xe4d(%rip),%xmm0
addsd  %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
addsd  0xe29(%rip),%xmm0
ret

LLVM IR (-O0):
%struct.tm = type { i32, i32, i32, double, double, double }
define double @modJulianDate(%struct.tm* %0) {
%2 = alloca %struct.tm*
%3 = alloca double
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store %struct.tm* %0, %struct.tm** %2
%7 = load %struct.tm*, %struct.tm** %2
%8 = getelementptr inbounds %struct.tm, %struct.tm* %7, i32 0, i32 0
%9 = load i32, i32* %8
%10 = add nsw i32 %9, 1900
store i32 %10, i32* %6
%11 = load %struct.tm*, %struct.tm** %2
%12 = getelementptr inbounds %struct.tm, %struct.tm* %11, i32 0, i32 1
%13 = load i32, i32* %12
%14 = add nsw i32 %13, 1
store i32 %14, i32* %4
%15 = load %struct.tm*, %struct.tm** %2
%16 = getelementptr inbounds %struct.tm, %struct.tm* %15, i32 0, i32 2
%17 = load i32, i32* %16
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = sub nsw i32 %18, 32076
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 4800
%22 = load i32, i32* %4
%23 = sub nsw i32 %22, 14
%24 = sdiv i32 %23, 12
%25 = add nsw i32 %21, %24
%26 = mul nsw i32 1461, %25
%27 = sdiv i32 %26, 4
%28 = add nsw i32 %19, %27
%29 = load i32, i32* %4
%30 = sub nsw i32 %29, 2
%31 = load i32, i32* %4
%32 = sub nsw i32 %31, 14
%33 = sdiv i32 %32, 12
%34 = mul nsw i32 %33, 12
%35 = sub nsw i32 %30, %34
%36 = mul nsw i32 367, %35
%37 = sdiv i32 %36, 12
%38 = add nsw i32 %28, %37
%39 = load i32, i32* %6
%40 = add nsw i32 %39, 4900
%41 = load i32, i32* %4
%42 = sub nsw i32 %41, 14
%43 = sdiv i32 %42, 12
%44 = add nsw i32 %40, %43
%45 = sdiv i32 %44, 100
%46 = mul nsw i32 3, %45
%47 = sdiv i32 %46, 4
%48 = sub nsw i32 %38, %47
%49 = sitofp i32 %48 to double
store double %49, double* %3
%50 = load %struct.tm*, %struct.tm** %2
%51 = getelementptr inbounds %struct.tm, %struct.tm* %50, i32 0, i32 3
%52 = load double, double* %51
%53 = fadd double %52, 1.200000e+01
%54 = fdiv double %53, 2.400000e+01
%55 = load double, double* %3
%56 = fadd double %55, %54
store double %56, double* %3
%57 = load %struct.tm*, %struct.tm** %2
%58 = getelementptr inbounds %struct.tm, %struct.tm* %57, i32 0, i32 4
%59 = load double, double* %58
%60 = fdiv double %59, 1.440000e+03
%61 = load double, double* %3
%62 = fadd double %61, %60
store double %62, double* %3
%63 = load %struct.tm*, %struct.tm** %2
%64 = getelementptr inbounds %struct.tm, %struct.tm* %63, i32 0, i32 5
%65 = load double, double* %64
%66 = fdiv double %65, 8.640000e+04
%67 = load double, double* %3
%68 = fadd double %67, %66
store double %68, double* %3
%69 = load double, double* %3
%70 = fsub double %69, 0x41424F8040000000
store double %70, double* %3
%71 = load double, double* %3
ret double %71
}

LLVM IR (-O2):
%struct.tm = type { i32, i32, i32, double, double, double }
define double @modJulianDate(%struct.tm* nocapture %0) {
%2 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 2
%7 = load i32, i32* %6
%8 = add nsw i32 %7, -32076
%9 = add nsw i32 %5, -13
%10 = sdiv i32 %9, 12
%11 = add i32 %10, %3
%12 = mul i32 %11, 1461
%13 = add i32 %12, 9788700
%14 = sdiv i32 %13, 4
%15 = add nsw i32 %8, %14
%16 = add nsw i32 %5, -1
%17 = mul nsw i32 %10, -12
%18 = add i32 %16, %17
%19 = mul nsw i32 %18, 367
%20 = sdiv i32 %19, 12
%21 = add i32 %11, 6800
%22 = sdiv i32 %21, 100
%23 = mul nsw i32 %22, 3
%24 = sdiv i32 %23, -4
%25 = add i32 %15, %24
%26 = add i32 %25, %20
%27 = sitofp i32 %26 to double
%28 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 3
%29 = load double, double* %28
%30 = fadd double %29, 1.200000e+01
%31 = fdiv double %30, 2.400000e+01
%32 = fadd double %31, %27
%33 = getelementptr inbounds %struct.tm, %struct.tm* %0, i64 0, i32 4
%34 = bitcast double* %33 to <2 x double>*
%35 = load <2 x double>, <2 x double>* %34
%36 = fdiv <2 x double> %35, <double 1.440000e+03, double 8.640000e+04>
%37 = extractelement <2 x double> %36, i64 0
%38 = fadd double %37, %32
%39 = extractelement <2 x double> %36, i64 1
%40 = fadd double %39, %38
%41 = fadd double %40, 0xC1424F8040000000
ret double %41
}