#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 */
typedef scalar_t__ jday;

/* Variables and functions */
int atoi(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ strncmp(char *, char *, int);
char *strncpy(char *, char *, int);
void calc_time(char time_string[], double *clock_time, double *SC_clock_time) {
  int day_of_month, hour, minute, second, msec, jday, i, month, year, leap;
  int mon_nday[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  char c_month[4], tmp_time_string[24];
  char *string_tmp = (char *)malloc(3);
  strncpy(tmp_time_string, &time_string[0], 24);
  day_of_month = atoi(&time_string[0]);
  strncpy(c_month, &time_string[3], 3);
  if (!strncmp(c_month, "JAN", 3)) {
    month = 1;
  }
  if (!strncmp(c_month, "FEB", 3)) {
    month = 2;
  }
  if (!strncmp(c_month, "MAR", 3)) {
    month = 3;
  }
  if (!strncmp(c_month, "APR", 3)) {
    month = 4;
  }
  if (!strncmp(c_month, "MAY", 3)) {
    month = 5;
  }
  if (!strncmp(c_month, "JUN", 3)) {
    month = 6;
  }
  if (!strncmp(c_month, "JUL", 3)) {
    month = 7;
  }
  if (!strncmp(c_month, "AUG", 3)) {
    month = 8;
  }
  if (!strncmp(c_month, "SEP", 3)) {
    month = 9;
  }
  if (!strncmp(c_month, "OCT", 3)) {
    month = 10;
  }
  if (!strncmp(c_month, "NOV", 3)) {
    month = 11;
  }
  if (!strncmp(c_month, "DEC", 3)) {
    month = 12;
  }
  year = atoi(&time_string[9]);
  if (year % 4 == 0 && year % 100 != 0) {
    leap = 1;
  } else if (year == 00) {
    leap = 1;
  } else {
    leap = 0;
  }
  if (leap) {
    mon_nday[1] = 29;
  }
  jday = 0;
  if (month > 1) {
    for (i = 0; i < month - 1; i++)
      jday = jday + mon_nday[i];
  }
  jday = jday + day_of_month;
  hour = atoi(&time_string[12]);
  minute = atoi(&time_string[15]);
  second = atoi(&time_string[18]);
  msec = atoi(strncpy(string_tmp, tmp_time_string + 21, 3));
  if (year < 85.) {
    year = year + 2000;
  } else {
    year = year + 1900;
  }
  *clock_time =
      (double)(jday) + ((double)(hour * 3600 * 1000 + minute * 60 * 1000 +
                                 second * 1000 + msec) /
                        (double)(24 * 3600 * 1000));
  *SC_clock_time = (double)(year * 1000) + *clock_time;
}


x86 assembly (clang, -O0):
<calc_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xe9e(%rip),%rsi
mov    $0x30,%edx
call   1050 <memcpy@plt>
mov    $0x3,%edi
call   1060 <malloc@plt>
mov    %rax,-0x98(%rbp)
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x18,%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x74(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x3,%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
lea    -0x74(%rbp),%rdi
lea    0xe71(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    11e9 <calc_time+0x99>
movl   $0x1,-0x38(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xe50(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    120e <calc_time+0xbe>
movl   $0x2,-0x38(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xe2f(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1233 <calc_time+0xe3>
movl   $0x3,-0x38(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xe0e(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1258 <calc_time+0x108>
movl   $0x4,-0x38(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xded(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    127d <calc_time+0x12d>
movl   $0x5,-0x38(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xdcc(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    12a2 <calc_time+0x152>
movl   $0x6,-0x38(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xdab(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    12c7 <calc_time+0x177>
movl   $0x7,-0x38(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xd8a(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    12ec <calc_time+0x19c>
movl   $0x8,-0x38(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xd69(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1311 <calc_time+0x1c1>
movl   $0x9,-0x38(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xd48(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1336 <calc_time+0x1e6>
movl   $0xa,-0x38(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xd27(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    135b <calc_time+0x20b>
movl   $0xb,-0x38(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xd06(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1380 <calc_time+0x230>
movl   $0xc,-0x38(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x9,%rdi
call   1070 <atoi@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    13c4 <calc_time+0x274>
mov    -0x3c(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     13c4 <calc_time+0x274>
movl   $0x1,-0x40(%rbp)
jmp    13e6 <calc_time+0x296>
cmpl   $0x0,-0x3c(%rbp)
jne    13da <calc_time+0x28a>
movl   $0x1,-0x40(%rbp)
jmp    13e1 <calc_time+0x291>
movl   $0x0,-0x40(%rbp)
jmp    13e6 <calc_time+0x296>
cmpl   $0x0,-0x40(%rbp)
je     13f7 <calc_time+0x2a7>
movl   $0x1d,-0x6c(%rbp)
movl   $0x0,-0x30(%rbp)
cmpl   $0x1,-0x38(%rbp)
jle    1441 <calc_time+0x2f1>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    143c <calc_time+0x2ec>
mov    -0x30(%rbp),%eax
movslq -0x34(%rbp),%rcx
add    -0x70(%rbp,%rcx,4),%eax
mov    %eax,-0x30(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    140f <calc_time+0x2bf>
jmp    1441 <calc_time+0x2f1>
mov    -0x30(%rbp),%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xc,%rdi
call   1070 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xf,%rdi
call   1070 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x12,%rdi
call   1070 <atoi@plt>
mov    %eax,-0x28(%rbp)
mov    -0x98(%rbp),%rdi
lea    -0x90(%rbp),%rsi
add    $0x15,%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
mov    %rax,%rdi
call   1070 <atoi@plt>
mov    %eax,-0x2c(%rbp)
cvtsi2sdl -0x3c(%rbp),%xmm1
movsd  0xb52(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    14c8 <calc_time+0x378>
mov    -0x3c(%rbp),%eax
add    $0x7d0,%eax
mov    %eax,-0x3c(%rbp)
jmp    14d3 <calc_time+0x383>
mov    -0x3c(%rbp),%eax
add    $0x76c,%eax
mov    %eax,-0x3c(%rbp)
cvtsi2sdl -0x30(%rbp),%xmm0
imul   $0xe10,-0x20(%rbp),%eax
imul   $0x3e8,%eax,%eax
imul   $0x3c,-0x24(%rbp),%ecx
imul   $0x3e8,%ecx,%ecx
add    %ecx,%eax
imul   $0x3e8,-0x28(%rbp),%ecx
add    %ecx,%eax
add    -0x2c(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xaff(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
imul   $0x3e8,-0x3c(%rbp),%eax
cvtsi2sd %eax,%xmm0
mov    -0x10(%rbp),%rax
addsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_time>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rdx,0x50(%rsp)
mov    %rsi,0x48(%rsp)
mov    %rdi,%r12
movaps 0xece(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeb2(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movdqa 0xe95(%rip),%xmm0
movdqa %xmm0,0x10(%rsp)
mov    $0x3,%r14d
mov    $0x3,%edi
call   1050 <malloc@plt>
mov    %rax,0x40(%rsp)
lea    0x60(%rsp),%rdi
mov    %r12,%rsi
mov    $0x18,%edx
call   1030 <strncpy@plt>
mov    %r12,%rdi
call   1060 <atoi@plt>
mov    %eax,0xc(%rsp)
lea    0x3(%r12),%rsi
lea    0x5c(%rsp),%r15
mov    %r15,%rdi
mov    $0x3,%edx
call   1030 <strncpy@plt>
lea    0xe6e(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
lea    0xe5e(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x1,%eax
mov    $0x1,%ebx
adc    $0x0,%ebx
lea    0xe43(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
cmove  %r14d,%ebx
lea    0xe2d(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0x4,%ebp
cmovne %ebx,%ebp
lea    0xe13(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0x5,%ebx
cmovne %ebp,%ebx
lea    0xdf9(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0x6,%ebp
cmovne %ebx,%ebp
lea    0xddf(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0x7,%ebx
cmovne %ebp,%ebx
lea    0xdc5(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0x8,%ebp
cmovne %ebx,%ebp
lea    0xdab(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0x9,%ebx
cmovne %ebp,%ebx
lea    0xd91(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0xa,%ebp
cmovne %ebx,%ebp
lea    0xd77(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0xb,%ebx
cmovne %ebp,%ebx
lea    0xd5d(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0xc,%ebp
cmovne %ebx,%ebp
mov    %r12,%rbx
lea    0x9(%r12),%rdi
call   1060 <atoi@plt>
mov    %eax,%r12d
test   $0x3,%r12b
sete   %al
imul   $0xc28f5c29,%r12d,%ecx
add    $0x51eb850,%ecx
ror    $0x2,%ecx
cmp    $0x28f5c29,%ecx
setae  %cl
test   %cl,%al
jne    135f <calc_time+0x21f>
test   %r12d,%r12d
jne    1367 <calc_time+0x227>
movl   $0x1d,0x14(%rsp)
xor    %r13d,%r13d
cmp    $0x2,%ebp
jb     145e <calc_time+0x31e>
add    $0xffffffff,%ebp
cmp    $0x8,%ebp
jae    1385 <calc_time+0x245>
xor    %eax,%eax
xor    %r13d,%r13d
jmp    1450 <calc_time+0x310>
mov    %ebp,%eax
and    $0xfffffff8,%eax
lea    -0x8(%rax),%rdx
mov    %rdx,%rsi
shr    $0x3,%rsi
add    $0x1,%rsi
mov    %esi,%ecx
and    $0x3,%ecx
cmp    $0x18,%rdx
jae    13b0 <calc_time+0x270>
pxor   %xmm0,%xmm0
xor    %edx,%edx
pxor   %xmm1,%xmm1
jmp    13fd <calc_time+0x2bd>
and    $0xfffffffffffffffc,%rsi
pxor   %xmm0,%xmm0
xor    %edx,%edx
pxor   %xmm1,%xmm1
xchg   %ax,%ax
paddd  0x10(%rsp,%rdx,4),%xmm0
paddd  0x20(%rsp,%rdx,4),%xmm1
paddd  0x30(%rsp,%rdx,4),%xmm0
paddd  0x40(%rsp,%rdx,4),%xmm1
paddd  0x50(%rsp,%rdx,4),%xmm0
paddd  0x60(%rsp,%rdx,4),%xmm1
paddd  0x70(%rsp,%rdx,4),%xmm0
paddd  0x80(%rsp,%rdx,4),%xmm1
add    $0x20,%rdx
add    $0xfffffffffffffffc,%rsi
jne    13c0 <calc_time+0x280>
test   %rcx,%rcx
je     1424 <calc_time+0x2e4>
lea    (%rsp,%rdx,4),%rdx
add    $0x20,%rdx
shl    $0x5,%rcx
xor    %esi,%esi
paddd  -0x10(%rdx,%rsi,1),%xmm0
paddd  (%rdx,%rsi,1),%xmm1
add    $0x20,%rsi
cmp    %rsi,%rcx
jne    1410 <calc_time+0x2d0>
paddd  %xmm1,%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%r13d
cmp    %rbp,%rax
je     145e <calc_time+0x31e>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    0x10(%rsp,%rax,4),%r13d
add    $0x1,%rax
cmp    %rax,%rbp
jne    1450 <calc_time+0x310>
lea    0xc(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,%r14d
lea    0xf(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,%r15d
add    $0x12,%rbx
mov    %rbx,%rdi
call   1060 <atoi@plt>
mov    %eax,%ebx
lea    0x75(%rsp),%rsi
mov    0x40(%rsp),%rdi
mov    $0x3,%edx
call   1030 <strncpy@plt>
mov    %rax,%rdi
call   1060 <atoi@plt>
lea    0x76c(%r12),%ecx
lea    0x7d0(%r12),%edx
cmp    $0x55,%r12d
cmovge %ecx,%edx
add    0xc(%rsp),%r13d
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
imul   $0x36ee80,%r14d,%ecx
imul   $0xea60,%r15d,%esi
add    %ecx,%esi
imul   $0x3e8,%ebx,%ecx
add    %esi,%ecx
add    %eax,%ecx
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
divsd  0xb13(%rip),%xmm1
addsd  %xmm0,%xmm1
mov    0x48(%rsp),%rax
movsd  %xmm1,(%rax)
imul   $0x3e8,%edx,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  %xmm1,%xmm0
mov    0x50(%rsp),%rax
movsd  %xmm0,(%rax)
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.calc_time.mon_nday = [12 x i32] [i32 31, i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31]
@.str = [4 x i8] c"JAN\00"
@.str.1 = [4 x i8] c"FEB\00"
@.str.2 = [4 x i8] c"MAR\00"
@.str.3 = [4 x i8] c"APR\00"
@.str.4 = [4 x i8] c"MAY\00"
@.str.5 = [4 x i8] c"JUN\00"
@.str.6 = [4 x i8] c"JUL\00"
@.str.7 = [4 x i8] c"AUG\00"
@.str.8 = [4 x i8] c"SEP\00"
@.str.9 = [4 x i8] c"OCT\00"
@.str.10 = [4 x i8] c"NOV\00"
@.str.11 = [4 x i8] c"DEC\00"
define void @calc_time(i8* %0, double* %1, double* %2) {
%4 = alloca i8*
%5 = alloca double*
%6 = alloca double*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca [12 x i32]
%18 = alloca [4 x i8]
%19 = alloca [24 x i8]
%20 = alloca i8*
store i8* %0, i8** %4
store double* %1, double** %5
store double* %2, double** %6
%21 = bitcast [12 x i32]* %17 to i8*
%22 = call i64 @malloc(i32 3)
%23 = inttoptr i64 %22 to i8*
store i8* %23, i8** %20
%24 = getelementptr inbounds [24 x i8], [24 x i8]* %19, i64 0, i64 0
%25 = load i8*, i8** %4
%26 = getelementptr inbounds i8, i8* %25, i64 0
%27 = call i8* @strncpy(i8* %24, i8* %26, i32 24)
%28 = load i8*, i8** %4
%29 = getelementptr inbounds i8, i8* %28, i64 0
%30 = call i32 @atoi(i8* %29)
store i32 %30, i32* %7
%31 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 0
%32 = load i8*, i8** %4
%33 = getelementptr inbounds i8, i8* %32, i64 3
%34 = call i8* @strncpy(i8* %31, i8* %33, i32 3)
%35 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 0
%36 = call i32 @strncmp(i8* %35, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%37 = icmp ne i32 %36, 0
br i1 %37, label %39, label %38
38: ; preds = %3
store i32 1, i32* %14
br label %39
39: ; preds = %38, %3
%40 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 0
%41 = call i32 @strncmp(i8* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%42 = icmp ne i32 %41, 0
br i1 %42, label %44, label %43
43: ; preds = %39
store i32 2, i32* %14
br label %44
44: ; preds = %43, %39
%45 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 0
%46 = call i32 @strncmp(i8* %45, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
%47 = icmp ne i32 %46, 0
br i1 %47, label %49, label %48
48: ; preds = %44
store i32 3, i32* %14
br label %49
49: ; preds = %48, %44
%50 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 0
%51 = call i32 @strncmp(i8* %50, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%52 = icmp ne i32 %51, 0
br i1 %52, label %54, label %53
53: ; preds = %49
store i32 4, i32* %14
br label %54
54: ; preds = %53, %49
%55 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 0
%56 = call i32 @strncmp(i8* %55, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 3)
%57 = icmp ne i32 %56, 0
br i1 %57, label %59, label %58
58: ; preds = %54
store i32 5, i32* %14
br label %59
59: ; preds = %58, %54
%60 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 0
%61 = call i32 @strncmp(i8* %60, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 3)
%62 = icmp ne i32 %61, 0
br i1 %62, label %64, label %63
63: ; preds = %59
store i32 6, i32* %14
br label %64
64: ; preds = %63, %59
%65 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 0
%66 = call i32 @strncmp(i8* %65, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 3)
%67 = icmp ne i32 %66, 0
br i1 %67, label %69, label %68
68: ; preds = %64
store i32 7, i32* %14
br label %69
69: ; preds = %68, %64
%70 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 0
%71 = call i32 @strncmp(i8* %70, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 3)
%72 = icmp ne i32 %71, 0
br i1 %72, label %74, label %73
73: ; preds = %69
store i32 8, i32* %14
br label %74
74: ; preds = %73, %69
%75 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 0
%76 = call i32 @strncmp(i8* %75, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 3)
%77 = icmp ne i32 %76, 0
br i1 %77, label %79, label %78
78: ; preds = %74
store i32 9, i32* %14
br label %79
79: ; preds = %78, %74
%80 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 0
%81 = call i32 @strncmp(i8* %80, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 3)
%82 = icmp ne i32 %81, 0
br i1 %82, label %84, label %83
83: ; preds = %79
store i32 10, i32* %14
br label %84
84: ; preds = %83, %79
%85 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 0
%86 = call i32 @strncmp(i8* %85, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32 3)
%87 = icmp ne i32 %86, 0
br i1 %87, label %89, label %88
88: ; preds = %84
store i32 11, i32* %14
br label %89
89: ; preds = %88, %84
%90 = getelementptr inbounds [4 x i8], [4 x i8]* %18, i64 0, i64 0
%91 = call i32 @strncmp(i8* %90, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32 3)
%92 = icmp ne i32 %91, 0
br i1 %92, label %94, label %93
93: ; preds = %89
store i32 12, i32* %14
br label %94
94: ; preds = %93, %89
%95 = load i8*, i8** %4
%96 = getelementptr inbounds i8, i8* %95, i64 9
%97 = call i32 @atoi(i8* %96)
store i32 %97, i32* %15
%98 = load i32, i32* %15
%99 = srem i32 %98, 4
%100 = icmp eq i32 %99, 0
br i1 %100, label %101, label %106
101: ; preds = %94
%102 = load i32, i32* %15
%103 = srem i32 %102, 100
%104 = icmp ne i32 %103, 0
br i1 %104, label %105, label %106
105: ; preds = %101
store i32 1, i32* %16
br label %112
106: ; preds = %101, %94
%107 = load i32, i32* %15
%108 = icmp eq i32 %107, 0
br i1 %108, label %109, label %110
109: ; preds = %106
store i32 1, i32* %16
br label %111
110: ; preds = %106
store i32 0, i32* %16
br label %111
111: ; preds = %110, %109
br label %112
112: ; preds = %111, %105
%113 = load i32, i32* %16
%114 = icmp ne i32 %113, 0
br i1 %114, label %115, label %117
115: ; preds = %112
%116 = getelementptr inbounds [12 x i32], [12 x i32]* %17, i64 0, i64 1
store i32 29, i32* %116
br label %117
117: ; preds = %115, %112
store i32 0, i32* %12
%118 = load i32, i32* %14
%119 = icmp sgt i32 %118, 1
br i1 %119, label %120, label %137
120: ; preds = %117
store i32 0, i32* %13
br label %121
121: ; preds = %133, %120
%122 = load i32, i32* %13
%123 = load i32, i32* %14
%124 = sub nsw i32 %123, 1
%125 = icmp slt i32 %122, %124
br i1 %125, label %126, label %136
126: ; preds = %121
%127 = load i32, i32* %12
%128 = load i32, i32* %13
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [12 x i32], [12 x i32]* %17, i64 0, i64 %129
%131 = load i32, i32* %130
%132 = add nsw i32 %127, %131
store i32 %132, i32* %12
br label %133
133: ; preds = %126
%134 = load i32, i32* %13
%135 = add nsw i32 %134, 1
store i32 %135, i32* %13
br label %121
136: ; preds = %121
br label %137
137: ; preds = %136, %117
%138 = load i32, i32* %12
%139 = load i32, i32* %7
%140 = add nsw i32 %138, %139
store i32 %140, i32* %12
%141 = load i8*, i8** %4
%142 = getelementptr inbounds i8, i8* %141, i64 12
%143 = call i32 @atoi(i8* %142)
store i32 %143, i32* %8
%144 = load i8*, i8** %4
%145 = getelementptr inbounds i8, i8* %144, i64 15
%146 = call i32 @atoi(i8* %145)
store i32 %146, i32* %9
%147 = load i8*, i8** %4
%148 = getelementptr inbounds i8, i8* %147, i64 18
%149 = call i32 @atoi(i8* %148)
store i32 %149, i32* %10
%150 = load i8*, i8** %20
%151 = getelementptr inbounds [24 x i8], [24 x i8]* %19, i64 0, i64 0
%152 = getelementptr inbounds i8, i8* %151, i64 21
%153 = call i8* @strncpy(i8* %150, i8* %152, i32 3)
%154 = call i32 @atoi(i8* %153)
store i32 %154, i32* %11
%155 = load i32, i32* %15
%156 = sitofp i32 %155 to double
%157 = fcmp olt double %156, 8.500000e+01
br i1 %157, label %158, label %161
158: ; preds = %137
%159 = load i32, i32* %15
%160 = add nsw i32 %159, 2000
store i32 %160, i32* %15
br label %164
161: ; preds = %137
%162 = load i32, i32* %15
%163 = add nsw i32 %162, 1900
store i32 %163, i32* %15
br label %164
164: ; preds = %161, %158
%165 = load i32, i32* %12
%166 = sitofp i32 %165 to double
%167 = load i32, i32* %8
%168 = mul nsw i32 %167, 3600
%169 = mul nsw i32 %168, 1000
%170 = load i32, i32* %9
%171 = mul nsw i32 %170, 60
%172 = mul nsw i32 %171, 1000
%173 = add nsw i32 %169, %172
%174 = load i32, i32* %10
%175 = mul nsw i32 %174, 1000
%176 = add nsw i32 %173, %175
%177 = load i32, i32* %11
%178 = add nsw i32 %176, %177
%179 = sitofp i32 %178 to double
%180 = fdiv double %179, 8.640000e+07
%181 = fadd double %166, %180
%182 = load double*, double** %5
store double %181, double* %182
%183 = load i32, i32* %15
%184 = mul nsw i32 %183, 1000
%185 = sitofp i32 %184 to double
%186 = load double*, double** %5
%187 = load double, double* %186
%188 = fadd double %185, %187
%189 = load double*, double** %6
store double %188, double* %189
ret void
}

LLVM IR (-O2):
@__const.calc_time.mon_nday = [12 x i32] [i32 31, i32 28, i32 31, i32 30, i32 31, i32 30, i32 31, i32 31, i32 30, i32 31, i32 30, i32 31]
@.str = [4 x i8] c"JAN\00"
@.str.1 = [4 x i8] c"FEB\00"
@.str.2 = [4 x i8] c"MAR\00"
@.str.3 = [4 x i8] c"APR\00"
@.str.4 = [4 x i8] c"MAY\00"
@.str.5 = [4 x i8] c"JUN\00"
@.str.6 = [4 x i8] c"JUL\00"
@.str.7 = [4 x i8] c"AUG\00"
@.str.8 = [4 x i8] c"SEP\00"
@.str.9 = [4 x i8] c"OCT\00"
@.str.10 = [4 x i8] c"NOV\00"
@.str.11 = [4 x i8] c"DEC\00"
define void @calc_time(i8* %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = alloca [12 x i32]
%5 = alloca [4 x i8]
%6 = alloca [24 x i8]
%7 = bitcast [12 x i32]* %4 to i8*
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%9 = getelementptr inbounds [24 x i8], [24 x i8]* %6, i64 0, i64 0
%10 = tail call i64 @malloc(i32 3)
%11 = call i8* @strncpy(i8* %9, i8* %0, i32 24)
%12 = call i32 @atoi(i8* %0)
%13 = getelementptr inbounds i8, i8* %0, i64 3
%14 = call i8* @strncpy(i8* %8, i8* %13, i32 3)
%15 = call i32 @strncmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%16 = call i32 @strncmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%17 = icmp eq i32 %16, 0
%18 = select i1 %17, i32 2, i32 1
%19 = call i32 @strncmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
%20 = icmp eq i32 %19, 0
%21 = select i1 %20, i32 3, i32 %18
%22 = call i32 @strncmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%23 = icmp eq i32 %22, 0
%24 = select i1 %23, i32 4, i32 %21
%25 = call i32 @strncmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 3)
%26 = icmp eq i32 %25, 0
%27 = select i1 %26, i32 5, i32 %24
%28 = call i32 @strncmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 3)
%29 = icmp eq i32 %28, 0
%30 = select i1 %29, i32 6, i32 %27
%31 = call i32 @strncmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 3)
%32 = icmp eq i32 %31, 0
%33 = select i1 %32, i32 7, i32 %30
%34 = call i32 @strncmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 3)
%35 = icmp eq i32 %34, 0
%36 = select i1 %35, i32 8, i32 %33
%37 = call i32 @strncmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 3)
%38 = icmp eq i32 %37, 0
%39 = select i1 %38, i32 9, i32 %36
%40 = call i32 @strncmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 3)
%41 = icmp eq i32 %40, 0
%42 = select i1 %41, i32 10, i32 %39
%43 = call i32 @strncmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32 3)
%44 = icmp eq i32 %43, 0
%45 = select i1 %44, i32 11, i32 %42
%46 = call i32 @strncmp(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32 3)
%47 = icmp eq i32 %46, 0
%48 = select i1 %47, i32 12, i32 %45
%49 = getelementptr inbounds i8, i8* %0, i64 9
%50 = call i32 @atoi(i8* %49)
%51 = and i32 %50, 3
%52 = icmp eq i32 %51, 0
%53 = srem i32 %50, 100
%54 = icmp ne i32 %53, 0
%55 = and i1 %52, %54
%56 = icmp eq i32 %50, 0
%57 = select i1 %55, i1 true, i1 %56
br i1 %57, label %58, label %60
58: ; preds = %3
%59 = getelementptr inbounds [12 x i32], [12 x i32]* %4, i64 0, i64 1
store i32 29, i32* %59
br label %60
60: ; preds = %3, %58
%61 = icmp ugt i32 %48, 1
br i1 %61, label %62, label %158
62: ; preds = %60
%63 = add nsw i32 %48, -1
%64 = zext i32 %63 to i64
%65 = icmp ult i32 %63, 8
br i1 %65, label %147, label %66
66: ; preds = %62
%67 = and i64 %64, 4294967288
%68 = add nsw i64 %67, -8
%69 = lshr exact i64 %68, 3
%70 = add nuw nsw i64 %69, 1
%71 = and i64 %70, 3
%72 = icmp ult i64 %68, 24
br i1 %72, label %118, label %73
73: ; preds = %66
%74 = and i64 %70, 4611686018427387900
br label %75
75: ; preds = %75, %73
%76 = phi i64 [ 0, %73 ], [ %115, %75 ]
%77 = phi <4 x i32> [ zeroinitializer, %73 ], [ %113, %75 ]
%78 = phi <4 x i32> [ zeroinitializer, %73 ], [ %114, %75 ]
%79 = phi i64 [ 0, %73 ], [ %116, %75 ]
%80 = getelementptr inbounds [12 x i32], [12 x i32]* %4, i64 0, i64 %76
%81 = bitcast i32* %80 to <4 x i32>*
%82 = load <4 x i32>, <4 x i32>* %81
%83 = getelementptr inbounds i32, i32* %80, i64 4
%84 = bitcast i32* %83 to <4 x i32>*
%85 = load <4 x i32>, <4 x i32>* %84
%86 = add <4 x i32> %82, %77
%87 = add <4 x i32> %85, %78
%88 = or i64 %76, 8
%89 = getelementptr inbounds [12 x i32], [12 x i32]* %4, i64 0, i64 %88
%90 = bitcast i32* %89 to <4 x i32>*
%91 = load <4 x i32>, <4 x i32>* %90
%92 = getelementptr inbounds i32, i32* %89, i64 4
%93 = bitcast i32* %92 to <4 x i32>*
%94 = load <4 x i32>, <4 x i32>* %93
%95 = add <4 x i32> %91, %86
%96 = add <4 x i32> %94, %87
%97 = or i64 %76, 16
%98 = getelementptr inbounds [12 x i32], [12 x i32]* %4, i64 0, i64 %97
%99 = bitcast i32* %98 to <4 x i32>*
%100 = load <4 x i32>, <4 x i32>* %99
%101 = getelementptr inbounds i32, i32* %98, i64 4
%102 = bitcast i32* %101 to <4 x i32>*
%103 = load <4 x i32>, <4 x i32>* %102
%104 = add <4 x i32> %100, %95
%105 = add <4 x i32> %103, %96
%106 = or i64 %76, 24
%107 = getelementptr inbounds [12 x i32], [12 x i32]* %4, i64 0, i64 %106
%108 = bitcast i32* %107 to <4 x i32>*
%109 = load <4 x i32>, <4 x i32>* %108
%110 = getelementptr inbounds i32, i32* %107, i64 4
%111 = bitcast i32* %110 to <4 x i32>*
%112 = load <4 x i32>, <4 x i32>* %111
%113 = add <4 x i32> %109, %104
%114 = add <4 x i32> %112, %105
%115 = add nuw i64 %76, 32
%116 = add i64 %79, 4
%117 = icmp eq i64 %116, %74
br i1 %117, label %118, label %75
118: ; preds = %75, %66
%119 = phi <4 x i32> [ undef, %66 ], [ %113, %75 ]
%120 = phi <4 x i32> [ undef, %66 ], [ %114, %75 ]
%121 = phi i64 [ 0, %66 ], [ %115, %75 ]
%122 = phi <4 x i32> [ zeroinitializer, %66 ], [ %113, %75 ]
%123 = phi <4 x i32> [ zeroinitializer, %66 ], [ %114, %75 ]
%124 = icmp eq i64 %71, 0
br i1 %124, label %141, label %125
125: ; preds = %118, %125
%126 = phi i64 [ %138, %125 ], [ %121, %118 ]
%127 = phi <4 x i32> [ %136, %125 ], [ %122, %118 ]
%128 = phi <4 x i32> [ %137, %125 ], [ %123, %118 ]
%129 = phi i64 [ %139, %125 ], [ 0, %118 ]
%130 = getelementptr inbounds [12 x i32], [12 x i32]* %4, i64 0, i64 %126
%131 = bitcast i32* %130 to <4 x i32>*
%132 = load <4 x i32>, <4 x i32>* %131
%133 = getelementptr inbounds i32, i32* %130, i64 4
%134 = bitcast i32* %133 to <4 x i32>*
%135 = load <4 x i32>, <4 x i32>* %134
%136 = add <4 x i32> %132, %127
%137 = add <4 x i32> %135, %128
%138 = add nuw i64 %126, 8
%139 = add i64 %129, 1
%140 = icmp eq i64 %139, %71
br i1 %140, label %141, label %125
141: ; preds = %125, %118
%142 = phi <4 x i32> [ %119, %118 ], [ %136, %125 ]
%143 = phi <4 x i32> [ %120, %118 ], [ %137, %125 ]
%144 = add <4 x i32> %143, %142
%145 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %144)
%146 = icmp eq i64 %67, %64
br i1 %146, label %158, label %147
147: ; preds = %62, %141
%148 = phi i64 [ 0, %62 ], [ %67, %141 ]
%149 = phi i32 [ 0, %62 ], [ %145, %141 ]
br label %150
150: ; preds = %147, %150
%151 = phi i64 [ %156, %150 ], [ %148, %147 ]
%152 = phi i32 [ %155, %150 ], [ %149, %147 ]
%153 = getelementptr inbounds [12 x i32], [12 x i32]* %4, i64 0, i64 %151
%154 = load i32, i32* %153
%155 = add nsw i32 %154, %152
%156 = add nuw nsw i64 %151, 1
%157 = icmp eq i64 %156, %64
br i1 %157, label %158, label %150
158: ; preds = %150, %141, %60
%159 = phi i32 [ 0, %60 ], [ %145, %141 ], [ %155, %150 ]
%160 = inttoptr i64 %10 to i8*
%161 = getelementptr inbounds i8, i8* %0, i64 12
%162 = call i32 @atoi(i8* %161)
%163 = getelementptr inbounds i8, i8* %0, i64 15
%164 = call i32 @atoi(i8* %163)
%165 = getelementptr inbounds i8, i8* %0, i64 18
%166 = call i32 @atoi(i8* %165)
%167 = getelementptr inbounds [24 x i8], [24 x i8]* %6, i64 0, i64 21
%168 = call i8* @strncpy(i8* %160, i8* %167, i32 3)
%169 = call i32 @atoi(i8* %168)
%170 = icmp slt i32 %50, 85
%171 = select i1 %170, i32 2000, i32 1900
%172 = add nsw i32 %171, %50
%173 = add nsw i32 %159, %12
%174 = sitofp i32 %173 to double
%175 = mul i32 %162, 3600000
%176 = mul i32 %164, 60000
%177 = add nsw i32 %176, %175
%178 = mul nsw i32 %166, 1000
%179 = add nsw i32 %177, %178
%180 = add nsw i32 %179, %169
%181 = sitofp i32 %180 to double
%182 = fdiv double %181, 8.640000e+07
%183 = fadd double %182, %174
store double %183, double* %1
%184 = mul nsw i32 %172, 1000
%185 = sitofp i32 %184 to double
%186 = fadd double %183, %185
store double %186, double* %2
ret void
}