#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 */
int getopt(int, char **, char *);
int /*<<< orphan*/ optarg;
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ printusage();
int /*<<< orphan*/ slaCldj(long, long, long, double *, int *);
int /*<<< orphan*/ slaCtf2d(long, long, double, float *, int *);
int /*<<< orphan*/ strdup(int /*<<< orphan*/);
double strtod(int /*<<< orphan*/, int /*<<< orphan*/ *);
long strtol(int /*<<< orphan*/, int /*<<< orphan*/ *, int);
int main(int argc, char *argv[]) {
  int c = 0;
  long year = -1, month = -1, day = -1, hour = -1, minute = -1;
  double second = -1.0;
  double djm, mjd;
  float days;
  int k;
  while ((c = getopt(argc, argv, "y:m:d:h:i:s:")) != -1) {
    switch (c) {
    case 'y':
      year = strtol(strdup(optarg), NULL, 10);
      break;
    case 'm':
      month = strtol(strdup(optarg), NULL, 10);
      break;
    case 'd':
      day = strtol(strdup(optarg), NULL, 10);
      break;
    case 'h':
      hour = strtol(strdup(optarg), NULL, 10);
      break;
    case 'i':
      minute = strtol(strdup(optarg), NULL, 10);
      break;
    case 's':
      second = strtod(strdup(optarg), NULL);
      break;
    }
  }
  if (year < 0 || month < 0 || day < 0 || hour < 0 || minute < 0 ||
      second < 0) {
    printusage();
    return (-1);
  }
  slaCldj(year, month, day, &djm, &k);
  slaCtf2d(hour, minute, second, &days, &k);
  mjd = djm + (double)days;
  printf("%.8f\n", mjd);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0xffffffffffffffff,-0x20(%rbp)
ff
movq   $0xffffffffffffffff,-0x28(%rbp)
ff
movq   $0xffffffffffffffff,-0x30(%rbp)
ff
movq   $0xffffffffffffffff,-0x38(%rbp)
ff
movq   $0xffffffffffffffff,-0x40(%rbp)
ff
movsd  0xe33(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    0xe80(%rip),%rdx
call   1090 <getopt@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
je     1300 <main+0x180>
mov    -0x14(%rbp),%eax
add    $0xffffff9c,%eax
mov    %eax,%ecx
mov    %rcx,-0x68(%rbp)
sub    $0x15,%eax
ja     12fb <main+0x17b>
mov    -0x68(%rbp),%rax
lea    0xdf7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x2dd7(%rip),%rax
mov    (%rax),%edi
call   10a0 <strdup@plt>
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %rax,-0x20(%rbp)
jmp    12fb <main+0x17b>
mov    0x2db0(%rip),%rax
mov    (%rax),%edi
call   10a0 <strdup@plt>
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %rax,-0x28(%rbp)
jmp    12fb <main+0x17b>
mov    0x2d89(%rip),%rax
mov    (%rax),%edi
call   10a0 <strdup@plt>
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %rax,-0x30(%rbp)
jmp    12fb <main+0x17b>
mov    0x2d62(%rip),%rax
mov    (%rax),%edi
call   10a0 <strdup@plt>
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %rax,-0x38(%rbp)
jmp    12fb <main+0x17b>
mov    0x2d3b(%rip),%rax
mov    (%rax),%edi
call   10a0 <strdup@plt>
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %rax,-0x40(%rbp)
jmp    12fb <main+0x17b>
mov    0x2d14(%rip),%rax
mov    (%rax),%edi
call   10a0 <strdup@plt>
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <strtod@plt>
movsd  %xmm0,-0x48(%rbp)
jmp    11d2 <main+0x52>
cmpq   $0x0,-0x20(%rbp)
jl     1345 <main+0x1c5>
cmpq   $0x0,-0x28(%rbp)
jl     1345 <main+0x1c5>
cmpq   $0x0,-0x30(%rbp)
jl     1345 <main+0x1c5>
cmpq   $0x0,-0x38(%rbp)
jl     1345 <main+0x1c5>
cmpq   $0x0,-0x40(%rbp)
jl     1345 <main+0x1c5>
xorps  %xmm0,%xmm0
ucomisd -0x48(%rbp),%xmm0
jbe    1358 <main+0x1d8>
mov    $0x0,%al
call   1060 <printusage@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13ba <main+0x23a>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x30(%rbp),%rdx
lea    -0x50(%rbp),%rcx
lea    -0x60(%rbp),%r8
call   1070 <slaCldj@plt>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
movsd  -0x48(%rbp),%xmm0
lea    -0x5c(%rbp),%rdx
lea    -0x60(%rbp),%rcx
call   1040 <slaCtf2d@plt>
movsd  -0x50(%rbp),%xmm0
movss  -0x5c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
lea    0xcbf(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbp
mov    %edi,%r15d
movsd  0xe64(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
movq   $0xffffffffffffffff,0x30(%rsp)
ff ff
lea    0xeae(%rip),%r14
lea    0xe4f(%rip),%r12
mov    0x2e38(%rip),%r13
movq   $0xffffffffffffffff,0x18(%rsp)
ff ff
movq   $0xffffffffffffffff,0x20(%rsp)
ff ff
mov    $0xffffffffffffffff,%rbx
movq   $0xffffffffffffffff,0x28(%rsp)
ff ff
jmp    11f9 <main+0x79>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmp    $0xffffffff,%eax
je     12cf <main+0x14f>
mov    %r15d,%edi
mov    %rbp,%rsi
mov    %r14,%rdx
call   1090 <getopt@plt>
lea    -0x64(%rax),%ecx
cmp    $0x15,%ecx
ja     11f0 <main+0x70>
movslq (%r12,%rcx,4),%rax
add    %r12,%rax
jmp    *%rax
mov    0x0(%r13),%edi
call   10a0 <strdup@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %rax,0x20(%rsp)
jmp    11f9 <main+0x79>
mov    0x0(%r13),%edi
call   10a0 <strdup@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %rax,%rbx
jmp    11f9 <main+0x79>
mov    0x0(%r13),%edi
call   10a0 <strdup@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %rax,0x28(%rsp)
jmp    11f9 <main+0x79>
mov    0x0(%r13),%edi
call   10a0 <strdup@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %rax,0x18(%rsp)
jmp    11f9 <main+0x79>
mov    0x0(%r13),%edi
call   10a0 <strdup@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <strtod@plt>
movsd  %xmm0,0x8(%rsp)
jmp    11f9 <main+0x79>
mov    0x0(%r13),%edi
call   10a0 <strdup@plt>
mov    %eax,%edi
xor    %esi,%esi
mov    $0xa,%edx
call   1080 <strtol@plt>
mov    %rax,0x30(%rsp)
jmp    11f9 <main+0x79>
mov    0x30(%rsp),%rdi
test   %rdi,%rdi
mov    0x28(%rsp),%rbp
mov    0x20(%rsp),%rdx
mov    0x18(%rsp),%rsi
js     1353 <main+0x1d3>
test   %rsi,%rsi
js     1353 <main+0x1d3>
test   %rdx,%rdx
js     1353 <main+0x1d3>
test   %rbx,%rbx
js     1353 <main+0x1d3>
test   %rbp,%rbp
js     1353 <main+0x1d3>
xorpd  %xmm0,%xmm0
ucomisd 0x8(%rsp),%xmm0
ja     1353 <main+0x1d3>
lea    0x38(%rsp),%rcx
lea    0x44(%rsp),%r14
mov    %r14,%r8
call   1070 <slaCldj@plt>
lea    0x14(%rsp),%rdx
mov    %rbx,%rdi
mov    %rbp,%rsi
movsd  0x8(%rsp),%xmm0
mov    %r14,%rcx
call   1040 <slaCtf2d@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  0x38(%rsp),%xmm0
lea    0xd23(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
jmp    135f <main+0x1df>
xor    %eax,%eax
call   1060 <printusage@plt>
mov    $0xffffffff,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"y:m:d:h:i:s:\00"
@optarg = global i32 0
@.str.1 = [6 x i8] c"%.8f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca float
%16 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i64 -1, i64* %7
store i64 -1, i64* %8
store i64 -1, i64* %9
store i64 -1, i64* %10
store i64 -1, i64* %11
store double -1.000000e+00, double* %12
br label %17
17: ; preds = %48, %2
%18 = load i32, i32* %4
%19 = load i8**, i8*** %5
%20 = call i32 @getopt(i32 %18, i8** %19, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
store i32 %20, i32* %6
%21 = icmp ne i32 %20, -1
br i1 %21, label %22, label %49
22: ; preds = %17
%23 = load i32, i32* %6
switch i32 %23, label %48 [
i32 121, label %24
i32 109, label %28
i32 100, label %32
i32 104, label %36
i32 105, label %40
i32 115, label %44
]
24: ; preds = %22
%25 = load i32, i32* @optarg
%26 = call i32 @strdup(i32 %25)
%27 = call i64 @strtol(i32 %26, i32* null, i32 10)
store i64 %27, i64* %7
br label %48
28: ; preds = %22
%29 = load i32, i32* @optarg
%30 = call i32 @strdup(i32 %29)
%31 = call i64 @strtol(i32 %30, i32* null, i32 10)
store i64 %31, i64* %8
br label %48
32: ; preds = %22
%33 = load i32, i32* @optarg
%34 = call i32 @strdup(i32 %33)
%35 = call i64 @strtol(i32 %34, i32* null, i32 10)
store i64 %35, i64* %9
br label %48
36: ; preds = %22
%37 = load i32, i32* @optarg
%38 = call i32 @strdup(i32 %37)
%39 = call i64 @strtol(i32 %38, i32* null, i32 10)
store i64 %39, i64* %10
br label %48
40: ; preds = %22
%41 = load i32, i32* @optarg
%42 = call i32 @strdup(i32 %41)
%43 = call i64 @strtol(i32 %42, i32* null, i32 10)
store i64 %43, i64* %11
br label %48
44: ; preds = %22
%45 = load i32, i32* @optarg
%46 = call i32 @strdup(i32 %45)
%47 = call double @strtod(i32 %46, i32* null)
store double %47, double* %12
br label %48
48: ; preds = %22, %44, %40, %36, %32, %28, %24
br label %17
49: ; preds = %17
%50 = load i64, i64* %7
%51 = icmp slt i64 %50, 0
br i1 %51, label %67, label %52
52: ; preds = %49
%53 = load i64, i64* %8
%54 = icmp slt i64 %53, 0
br i1 %54, label %67, label %55
55: ; preds = %52
%56 = load i64, i64* %9
%57 = icmp slt i64 %56, 0
br i1 %57, label %67, label %58
58: ; preds = %55
%59 = load i64, i64* %10
%60 = icmp slt i64 %59, 0
br i1 %60, label %67, label %61
61: ; preds = %58
%62 = load i64, i64* %11
%63 = icmp slt i64 %62, 0
br i1 %63, label %67, label %64
64: ; preds = %61
%65 = load double, double* %12
%66 = fcmp olt double %65, 0.000000e+00
br i1 %66, label %67, label %69
67: ; preds = %64, %61, %58, %55, %52, %49
%68 = call i32 (...) @printusage()
store i32 -1, i32* %3
br label %84
69: ; preds = %64
%70 = load i64, i64* %7
%71 = load i64, i64* %8
%72 = load i64, i64* %9
%73 = call i32 @slaCldj(i64 %70, i64 %71, i64 %72, double* %13, i32* %16)
%74 = load i64, i64* %10
%75 = load i64, i64* %11
%76 = load double, double* %12
%77 = call i32 @slaCtf2d(i64 %74, i64 %75, double %76, float* %15, i32* %16)
%78 = load double, double* %13
%79 = load float, float* %15
%80 = fpext float %79 to double
%81 = fadd double %78, %80
store double %81, double* %14
%82 = load double, double* %14
%83 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %82)
store i32 0, i32* %3
br label %84
84: ; preds = %69, %67
%85 = load i32, i32* %3
ret i32 %85
}

LLVM IR (-O2):
@.str = [13 x i8] c"y:m:d:h:i:s:\00"
@optarg = global i32 0
@.str.1 = [6 x i8] c"%.8f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca double
%4 = alloca float
%5 = alloca i32
%6 = bitcast double* %3 to i8*
%7 = bitcast float* %4 to i8*
%8 = bitcast i32* %5 to i8*
br label %9
9: ; preds = %38, %2
%10 = phi i64 [ %41, %38 ], [ -1, %2 ]
%11 = phi i64 [ %17, %38 ], [ -1, %2 ]
%12 = phi i64 [ %23, %38 ], [ -1, %2 ]
%13 = phi i64 [ %28, %38 ], [ -1, %2 ]
%14 = phi i64 [ %32, %38 ], [ -1, %2 ]
%15 = phi double [ %35, %38 ], [ -1.000000e+00, %2 ]
br label %16
16: ; preds = %9, %42
%17 = phi i64 [ %11, %9 ], [ %45, %42 ]
%18 = phi i64 [ %12, %9 ], [ %23, %42 ]
%19 = phi i64 [ %13, %9 ], [ %28, %42 ]
%20 = phi i64 [ %14, %9 ], [ %32, %42 ]
%21 = phi double [ %15, %9 ], [ %35, %42 ]
br label %22
22: ; preds = %16, %46
%23 = phi i64 [ %18, %16 ], [ %49, %46 ]
%24 = phi i64 [ %19, %16 ], [ %28, %46 ]
%25 = phi i64 [ %20, %16 ], [ %32, %46 ]
%26 = phi double [ %21, %16 ], [ %35, %46 ]
br label %27
27: ; preds = %22, %50
%28 = phi i64 [ %24, %22 ], [ %53, %50 ]
%29 = phi i64 [ %25, %22 ], [ %32, %50 ]
%30 = phi double [ %26, %22 ], [ %35, %50 ]
br label %31
31: ; preds = %27, %54
%32 = phi i64 [ %29, %27 ], [ %57, %54 ]
%33 = phi double [ %30, %27 ], [ %35, %54 ]
br label %34
34: ; preds = %31, %58
%35 = phi double [ %33, %31 ], [ %61, %58 ]
br label %36
36: ; preds = %34, %36
%37 = tail call i32 @getopt(i32 %0, i8** %1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
switch i32 %37, label %36 [
i32 -1, label %62
i32 121, label %38
i32 109, label %42
i32 100, label %46
i32 104, label %50
i32 105, label %54
i32 115, label %58
]
38: ; preds = %36
%39 = load i32, i32* @optarg
%40 = tail call i32 @strdup(i32 %39)
%41 = tail call i64 @strtol(i32 %40, i32* null, i32 10)
br label %9
42: ; preds = %36
%43 = load i32, i32* @optarg
%44 = tail call i32 @strdup(i32 %43)
%45 = tail call i64 @strtol(i32 %44, i32* null, i32 10)
br label %16
46: ; preds = %36
%47 = load i32, i32* @optarg
%48 = tail call i32 @strdup(i32 %47)
%49 = tail call i64 @strtol(i32 %48, i32* null, i32 10)
br label %22
50: ; preds = %36
%51 = load i32, i32* @optarg
%52 = tail call i32 @strdup(i32 %51)
%53 = tail call i64 @strtol(i32 %52, i32* null, i32 10)
br label %27
54: ; preds = %36
%55 = load i32, i32* @optarg
%56 = tail call i32 @strdup(i32 %55)
%57 = tail call i64 @strtol(i32 %56, i32* null, i32 10)
br label %31
58: ; preds = %36
%59 = load i32, i32* @optarg
%60 = tail call i32 @strdup(i32 %59)
%61 = tail call double @strtod(i32 %60, i32* null)
br label %34
62: ; preds = %36
%63 = icmp slt i64 %10, 0
%64 = icmp slt i64 %17, 0
%65 = select i1 %63, i1 true, i1 %64
%66 = icmp slt i64 %23, 0
%67 = select i1 %65, i1 true, i1 %66
%68 = icmp slt i64 %28, 0
%69 = select i1 %67, i1 true, i1 %68
%70 = icmp slt i64 %32, 0
%71 = select i1 %69, i1 true, i1 %70
%72 = fcmp olt double %35, 0.000000e+00
%73 = select i1 %71, i1 true, i1 %72
br i1 %73, label %74, label %76
74: ; preds = %62
%75 = tail call i32 (...) @printusage()
br label %84
76: ; preds = %62
%77 = call i32 @slaCldj(i64 %10, i64 %17, i64 %23, double* %3, i32* %5)
%78 = call i32 @slaCtf2d(i64 %28, i64 %32, double %35, float* %4, i32* %5)
%79 = load double, double* %3
%80 = load float, float* %4
%81 = fpext float %80 to double
%82 = fadd double %79, %81
%83 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %82)
br label %84
84: ; preds = %76, %74
%85 = phi i32 [ -1, %74 ], [ 0, %76 ]
ret i32 %85
}