#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 atoi(char *);
int /*<<< orphan*/ strncmp(char *, char *, int);
int /*<<< orphan*/ strncpy(char *, char *, int);
void calc_time(char time_string[], double *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];
  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(&tmp_time_string[21]);
  if (year < 85.) {
    year = year + 2000.;
  } else {
    year = year + 1900.;
  }
  *clock_time = (double)(year * 1000 + jday) +
                ((double)(hour * 3600 * 1000 + minute * 60 * 1000 +
                          second * 1000 + msec) /
                 (double)(24 * 3600 * 1000));
}


x86 assembly (clang, -O0):
<calc_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xec2(%rip),%rsi
mov    $0x30,%edx
call   1050 <memcpy@plt>
lea    -0x90(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x18,%edx
call   1030 <strncpy@plt>
mov    -0x8(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
lea    -0x74(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x3,%rsi
mov    $0x3,%edx
call   1030 <strncpy@plt>
lea    -0x74(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    11c4 <calc_time+0x84>
movl   $0x1,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xe85(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    11e9 <calc_time+0xa9>
movl   $0x2,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xe64(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    120e <calc_time+0xce>
movl   $0x3,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xe43(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1233 <calc_time+0xf3>
movl   $0x4,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xe22(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1258 <calc_time+0x118>
movl   $0x5,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xe01(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    127d <calc_time+0x13d>
movl   $0x6,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xde0(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    12a2 <calc_time+0x162>
movl   $0x7,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xdbf(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    12c7 <calc_time+0x187>
movl   $0x8,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xd9e(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    12ec <calc_time+0x1ac>
movl   $0x9,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xd7d(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1311 <calc_time+0x1d1>
movl   $0xa,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xd5c(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1336 <calc_time+0x1f6>
movl   $0xb,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xd3b(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    135b <calc_time+0x21b>
movl   $0xc,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x9,%rdi
call   1060 <atoi@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    139f <calc_time+0x25f>
mov    -0x34(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     139f <calc_time+0x25f>
movl   $0x1,-0x38(%rbp)
jmp    13c1 <calc_time+0x281>
cmpl   $0x0,-0x34(%rbp)
jne    13b5 <calc_time+0x275>
movl   $0x1,-0x38(%rbp)
jmp    13bc <calc_time+0x27c>
movl   $0x0,-0x38(%rbp)
jmp    13c1 <calc_time+0x281>
cmpl   $0x0,-0x38(%rbp)
je     13d2 <calc_time+0x292>
movl   $0x1d,-0x6c(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x1,-0x30(%rbp)
jle    141c <calc_time+0x2dc>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1417 <calc_time+0x2d7>
mov    -0x28(%rbp),%eax
movslq -0x2c(%rbp),%rcx
add    -0x70(%rbp,%rcx,4),%eax
mov    %eax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    13ea <calc_time+0x2aa>
jmp    141c <calc_time+0x2dc>
mov    -0x28(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xc,%rdi
call   1060 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xf,%rdi
call   1060 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x12,%rdi
call   1060 <atoi@plt>
mov    %eax,-0x20(%rbp)
lea    -0x90(%rbp),%rdi
add    $0x15,%rdi
call   1060 <atoi@plt>
mov    %eax,-0x24(%rbp)
cvtsi2sdl -0x34(%rbp),%xmm1
movsd  0xb8b(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    149c <calc_time+0x35c>
cvtsi2sdl -0x34(%rbp),%xmm0
movsd  0xb84(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x34(%rbp)
jmp    14b4 <calc_time+0x374>
cvtsi2sdl -0x34(%rbp),%xmm0
movsd  0xb5f(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x34(%rbp)
imul   $0x3e8,-0x34(%rbp),%eax
add    -0x28(%rbp),%eax
cvtsi2sd %eax,%xmm0
imul   $0xe10,-0x18(%rbp),%eax
imul   $0x3e8,%eax,%eax
imul   $0x3c,-0x1c(%rbp),%ecx
imul   $0x3e8,%ecx,%ecx
add    %ecx,%eax
imul   $0x3e8,-0x20(%rbp),%ecx
add    %ecx,%eax
add    -0x24(%rbp),%eax
cvtsi2sd %eax,%xmm1
movsd  0xb25(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calc_time>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rsi,0x40(%rsp)
mov    %rdi,%r13
movaps 0xef3(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xed7(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movdqa 0xeba(%rip),%xmm0
movdqa %xmm0,0x10(%rsp)
lea    0x50(%rsp),%rdi
mov    %r13,%rsi
mov    $0x18,%edx
call   1030 <strncpy@plt>
mov    %r13,%rdi
call   1050 <atoi@plt>
mov    %eax,0xc(%rsp)
lea    0x3(%r13),%rsi
lea    0x4c(%rsp),%r15
mov    $0x3,%r14d
mov    %r15,%rdi
mov    $0x3,%edx
call   1030 <strncpy@plt>
lea    0xea3(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
lea    0xe93(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x1,%eax
mov    $0x1,%ebx
adc    $0x0,%ebx
lea    0xe78(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
cmove  %r14d,%ebx
lea    0xe62(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0x4,%ebp
cmovne %ebx,%ebp
lea    0xe48(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0x5,%ebx
cmovne %ebp,%ebx
lea    0xe2e(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0x6,%ebp
cmovne %ebx,%ebp
lea    0xe14(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0x7,%ebx
cmovne %ebp,%ebx
lea    0xdfa(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0x8,%ebp
cmovne %ebx,%ebp
lea    0xde0(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0x9,%ebx
cmovne %ebp,%ebx
lea    0xdc6(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0xa,%ebp
cmovne %ebx,%ebp
lea    0xdac(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0xb,%ebx
cmovne %ebp,%ebx
lea    0xd92(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0xc,%ebp
cmovne %ebx,%ebp
lea    0x9(%r13),%rdi
call   1050 <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    1336 <calc_time+0x206>
test   %r12d,%r12d
jne    133e <calc_time+0x20e>
movl   $0x1d,0x14(%rsp)
xor    %r15d,%r15d
cmp    $0x2,%ebp
jb     143e <calc_time+0x30e>
add    $0xffffffff,%ebp
cmp    $0x8,%ebp
jae    135c <calc_time+0x22c>
xor    %eax,%eax
xor    %r15d,%r15d
jmp    1430 <calc_time+0x300>
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    1387 <calc_time+0x257>
pxor   %xmm0,%xmm0
xor    %edx,%edx
pxor   %xmm1,%xmm1
jmp    13dd <calc_time+0x2ad>
and    $0xfffffffffffffffc,%rsi
pxor   %xmm0,%xmm0
xor    %edx,%edx
pxor   %xmm1,%xmm1
cs nopw 0x0(%rax,%rax,1)
nop
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    13a0 <calc_time+0x270>
test   %rcx,%rcx
je     1404 <calc_time+0x2d4>
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    13f0 <calc_time+0x2c0>
paddd  %xmm1,%xmm0
pshufd $0xee,%xmm0,%xmm1
paddd  %xmm0,%xmm1
pshufd $0x55,%xmm1,%xmm0
paddd  %xmm1,%xmm0
movd   %xmm0,%r15d
cmp    %rbp,%rax
je     143e <calc_time+0x30e>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    0x10(%rsp,%rax,4),%r15d
add    $0x1,%rax
cmp    %rax,%rbp
jne    1430 <calc_time+0x300>
lea    0xc(%r13),%rdi
call   1050 <atoi@plt>
mov    %eax,%r14d
lea    0xf(%r13),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebx
add    $0x12,%r13
mov    %r13,%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
lea    0x65(%rsp),%rdi
call   1050 <atoi@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r12d,%xmm0
xor    %ecx,%ecx
cmp    $0x55,%r12d
setl   %cl
lea    0xb7b(%rip),%rdx
addsd  (%rdx,%rcx,8),%xmm0
cvttsd2si %xmm0,%ecx
imul   $0x3e8,%ecx,%ecx
add    0xc(%rsp),%ecx
add    %r15d,%ecx
xorps  %xmm0,%xmm0
cvtsi2sd %ecx,%xmm0
imul   $0x36ee80,%r14d,%ecx
imul   $0xea60,%ebx,%edx
add    %ecx,%edx
imul   $0x3e8,%ebp,%ecx
add    %edx,%ecx
add    %eax,%ecx
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
divsd  0xb46(%rip),%xmm1
addsd  %xmm0,%xmm1
mov    0x40(%rsp),%rax
movsd  %xmm1,(%rax)
add    $0x68,%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) {
%3 = alloca i8*
%4 = alloca double*
%5 = alloca i32
%6 = alloca i32
%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 [12 x i32]
%16 = alloca [4 x i8]
%17 = alloca [24 x i8]
store i8* %0, i8** %3
store double* %1, double** %4
%18 = bitcast [12 x i32]* %15 to i8*
%19 = getelementptr inbounds [24 x i8], [24 x i8]* %17, i64 0, i64 0
%20 = load i8*, i8** %3
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = call i32 @strncpy(i8* %19, i8* %21, i32 24)
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = call i32 @atoi(i8* %24)
store i32 %25, i32* %5
%26 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i64 3
%29 = call i32 @strncpy(i8* %26, i8* %28, i32 3)
%30 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%31 = call i32 @strncmp(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%32 = icmp ne i32 %31, 0
br i1 %32, label %34, label %33
33: ; preds = %2
store i32 1, i32* %12
br label %34
34: ; preds = %33, %2
%35 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%36 = call i32 @strncmp(i8* %35, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%37 = icmp ne i32 %36, 0
br i1 %37, label %39, label %38
38: ; preds = %34
store i32 2, i32* %12
br label %39
39: ; preds = %38, %34
%40 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%41 = call i32 @strncmp(i8* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
%42 = icmp ne i32 %41, 0
br i1 %42, label %44, label %43
43: ; preds = %39
store i32 3, i32* %12
br label %44
44: ; preds = %43, %39
%45 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%46 = call i32 @strncmp(i8* %45, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%47 = icmp ne i32 %46, 0
br i1 %47, label %49, label %48
48: ; preds = %44
store i32 4, i32* %12
br label %49
49: ; preds = %48, %44
%50 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%51 = call i32 @strncmp(i8* %50, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 3)
%52 = icmp ne i32 %51, 0
br i1 %52, label %54, label %53
53: ; preds = %49
store i32 5, i32* %12
br label %54
54: ; preds = %53, %49
%55 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%56 = call i32 @strncmp(i8* %55, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 3)
%57 = icmp ne i32 %56, 0
br i1 %57, label %59, label %58
58: ; preds = %54
store i32 6, i32* %12
br label %59
59: ; preds = %58, %54
%60 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%61 = call i32 @strncmp(i8* %60, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 3)
%62 = icmp ne i32 %61, 0
br i1 %62, label %64, label %63
63: ; preds = %59
store i32 7, i32* %12
br label %64
64: ; preds = %63, %59
%65 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%66 = call i32 @strncmp(i8* %65, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 3)
%67 = icmp ne i32 %66, 0
br i1 %67, label %69, label %68
68: ; preds = %64
store i32 8, i32* %12
br label %69
69: ; preds = %68, %64
%70 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%71 = call i32 @strncmp(i8* %70, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 3)
%72 = icmp ne i32 %71, 0
br i1 %72, label %74, label %73
73: ; preds = %69
store i32 9, i32* %12
br label %74
74: ; preds = %73, %69
%75 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%76 = call i32 @strncmp(i8* %75, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 3)
%77 = icmp ne i32 %76, 0
br i1 %77, label %79, label %78
78: ; preds = %74
store i32 10, i32* %12
br label %79
79: ; preds = %78, %74
%80 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%81 = call i32 @strncmp(i8* %80, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32 3)
%82 = icmp ne i32 %81, 0
br i1 %82, label %84, label %83
83: ; preds = %79
store i32 11, i32* %12
br label %84
84: ; preds = %83, %79
%85 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%86 = call i32 @strncmp(i8* %85, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32 3)
%87 = icmp ne i32 %86, 0
br i1 %87, label %89, label %88
88: ; preds = %84
store i32 12, i32* %12
br label %89
89: ; preds = %88, %84
%90 = load i8*, i8** %3
%91 = getelementptr inbounds i8, i8* %90, i64 9
%92 = call i32 @atoi(i8* %91)
store i32 %92, i32* %13
%93 = load i32, i32* %13
%94 = srem i32 %93, 4
%95 = icmp eq i32 %94, 0
br i1 %95, label %96, label %101
96: ; preds = %89
%97 = load i32, i32* %13
%98 = srem i32 %97, 100
%99 = icmp ne i32 %98, 0
br i1 %99, label %100, label %101
100: ; preds = %96
store i32 1, i32* %14
br label %107
101: ; preds = %96, %89
%102 = load i32, i32* %13
%103 = icmp eq i32 %102, 0
br i1 %103, label %104, label %105
104: ; preds = %101
store i32 1, i32* %14
br label %106
105: ; preds = %101
store i32 0, i32* %14
br label %106
106: ; preds = %105, %104
br label %107
107: ; preds = %106, %100
%108 = load i32, i32* %14
%109 = icmp ne i32 %108, 0
br i1 %109, label %110, label %112
110: ; preds = %107
%111 = getelementptr inbounds [12 x i32], [12 x i32]* %15, i64 0, i64 1
store i32 29, i32* %111
br label %112
112: ; preds = %110, %107
store i32 0, i32* %10
%113 = load i32, i32* %12
%114 = icmp sgt i32 %113, 1
br i1 %114, label %115, label %132
115: ; preds = %112
store i32 0, i32* %11
br label %116
116: ; preds = %128, %115
%117 = load i32, i32* %11
%118 = load i32, i32* %12
%119 = sub nsw i32 %118, 1
%120 = icmp slt i32 %117, %119
br i1 %120, label %121, label %131
121: ; preds = %116
%122 = load i32, i32* %10
%123 = load i32, i32* %11
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds [12 x i32], [12 x i32]* %15, i64 0, i64 %124
%126 = load i32, i32* %125
%127 = add nsw i32 %122, %126
store i32 %127, i32* %10
br label %128
128: ; preds = %121
%129 = load i32, i32* %11
%130 = add nsw i32 %129, 1
store i32 %130, i32* %11
br label %116
131: ; preds = %116
br label %132
132: ; preds = %131, %112
%133 = load i32, i32* %10
%134 = load i32, i32* %5
%135 = add nsw i32 %133, %134
store i32 %135, i32* %10
%136 = load i8*, i8** %3
%137 = getelementptr inbounds i8, i8* %136, i64 12
%138 = call i32 @atoi(i8* %137)
store i32 %138, i32* %6
%139 = load i8*, i8** %3
%140 = getelementptr inbounds i8, i8* %139, i64 15
%141 = call i32 @atoi(i8* %140)
store i32 %141, i32* %7
%142 = load i8*, i8** %3
%143 = getelementptr inbounds i8, i8* %142, i64 18
%144 = call i32 @atoi(i8* %143)
store i32 %144, i32* %8
%145 = getelementptr inbounds [24 x i8], [24 x i8]* %17, i64 0, i64 21
%146 = call i32 @atoi(i8* %145)
store i32 %146, i32* %9
%147 = load i32, i32* %13
%148 = sitofp i32 %147 to double
%149 = fcmp olt double %148, 8.500000e+01
br i1 %149, label %150, label %155
150: ; preds = %132
%151 = load i32, i32* %13
%152 = sitofp i32 %151 to double
%153 = fadd double %152, 2.000000e+03
%154 = fptosi double %153 to i32
store i32 %154, i32* %13
br label %160
155: ; preds = %132
%156 = load i32, i32* %13
%157 = sitofp i32 %156 to double
%158 = fadd double %157, 1.900000e+03
%159 = fptosi double %158 to i32
store i32 %159, i32* %13
br label %160
160: ; preds = %155, %150
%161 = load i32, i32* %13
%162 = mul nsw i32 %161, 1000
%163 = load i32, i32* %10
%164 = add nsw i32 %162, %163
%165 = sitofp i32 %164 to double
%166 = load i32, i32* %6
%167 = mul nsw i32 %166, 3600
%168 = mul nsw i32 %167, 1000
%169 = load i32, i32* %7
%170 = mul nsw i32 %169, 60
%171 = mul nsw i32 %170, 1000
%172 = add nsw i32 %168, %171
%173 = load i32, i32* %8
%174 = mul nsw i32 %173, 1000
%175 = add nsw i32 %172, %174
%176 = load i32, i32* %9
%177 = add nsw i32 %175, %176
%178 = sitofp i32 %177 to double
%179 = fdiv double %178, 8.640000e+07
%180 = fadd double %165, %179
%181 = load double*, double** %4
store double %180, double* %181
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) {
%3 = alloca [12 x i32]
%4 = alloca [4 x i8]
%5 = alloca [24 x i8]
%6 = bitcast [12 x i32]* %3 to i8*
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [24 x i8], [24 x i8]* %5, i64 0, i64 0
%9 = call i32 @strncpy(i8* %8, i8* %0, i32 24)
%10 = call i32 @atoi(i8* %0)
%11 = getelementptr inbounds i8, i8* %0, i64 3
%12 = call i32 @strncpy(i8* %7, i8* %11, i32 3)
%13 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%14 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%15 = icmp eq i32 %14, 0
%16 = select i1 %15, i32 2, i32 1
%17 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
%18 = icmp eq i32 %17, 0
%19 = select i1 %18, i32 3, i32 %16
%20 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%21 = icmp eq i32 %20, 0
%22 = select i1 %21, i32 4, i32 %19
%23 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 3)
%24 = icmp eq i32 %23, 0
%25 = select i1 %24, i32 5, i32 %22
%26 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 3)
%27 = icmp eq i32 %26, 0
%28 = select i1 %27, i32 6, i32 %25
%29 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 3)
%30 = icmp eq i32 %29, 0
%31 = select i1 %30, i32 7, i32 %28
%32 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 3)
%33 = icmp eq i32 %32, 0
%34 = select i1 %33, i32 8, i32 %31
%35 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 3)
%36 = icmp eq i32 %35, 0
%37 = select i1 %36, i32 9, i32 %34
%38 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 3)
%39 = icmp eq i32 %38, 0
%40 = select i1 %39, i32 10, i32 %37
%41 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32 3)
%42 = icmp eq i32 %41, 0
%43 = select i1 %42, i32 11, i32 %40
%44 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32 3)
%45 = icmp eq i32 %44, 0
%46 = select i1 %45, i32 12, i32 %43
%47 = getelementptr inbounds i8, i8* %0, i64 9
%48 = call i32 @atoi(i8* %47)
%49 = and i32 %48, 3
%50 = icmp eq i32 %49, 0
%51 = srem i32 %48, 100
%52 = icmp ne i32 %51, 0
%53 = and i1 %50, %52
%54 = icmp eq i32 %48, 0
%55 = select i1 %53, i1 true, i1 %54
br i1 %55, label %56, label %58
56: ; preds = %2
%57 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 1
store i32 29, i32* %57
br label %58
58: ; preds = %2, %56
%59 = icmp ugt i32 %46, 1
br i1 %59, label %60, label %156
60: ; preds = %58
%61 = add nsw i32 %46, -1
%62 = zext i32 %61 to i64
%63 = icmp ult i32 %61, 8
br i1 %63, label %145, label %64
64: ; preds = %60
%65 = and i64 %62, 4294967288
%66 = add nsw i64 %65, -8
%67 = lshr exact i64 %66, 3
%68 = add nuw nsw i64 %67, 1
%69 = and i64 %68, 3
%70 = icmp ult i64 %66, 24
br i1 %70, label %116, label %71
71: ; preds = %64
%72 = and i64 %68, 4611686018427387900
br label %73
73: ; preds = %73, %71
%74 = phi i64 [ 0, %71 ], [ %113, %73 ]
%75 = phi <4 x i32> [ zeroinitializer, %71 ], [ %111, %73 ]
%76 = phi <4 x i32> [ zeroinitializer, %71 ], [ %112, %73 ]
%77 = phi i64 [ 0, %71 ], [ %114, %73 ]
%78 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 %74
%79 = bitcast i32* %78 to <4 x i32>*
%80 = load <4 x i32>, <4 x i32>* %79
%81 = getelementptr inbounds i32, i32* %78, i64 4
%82 = bitcast i32* %81 to <4 x i32>*
%83 = load <4 x i32>, <4 x i32>* %82
%84 = add <4 x i32> %80, %75
%85 = add <4 x i32> %83, %76
%86 = or i64 %74, 8
%87 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 %86
%88 = bitcast i32* %87 to <4 x i32>*
%89 = load <4 x i32>, <4 x i32>* %88
%90 = getelementptr inbounds i32, i32* %87, i64 4
%91 = bitcast i32* %90 to <4 x i32>*
%92 = load <4 x i32>, <4 x i32>* %91
%93 = add <4 x i32> %89, %84
%94 = add <4 x i32> %92, %85
%95 = or i64 %74, 16
%96 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 %95
%97 = bitcast i32* %96 to <4 x i32>*
%98 = load <4 x i32>, <4 x i32>* %97
%99 = getelementptr inbounds i32, i32* %96, i64 4
%100 = bitcast i32* %99 to <4 x i32>*
%101 = load <4 x i32>, <4 x i32>* %100
%102 = add <4 x i32> %98, %93
%103 = add <4 x i32> %101, %94
%104 = or i64 %74, 24
%105 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 %104
%106 = bitcast i32* %105 to <4 x i32>*
%107 = load <4 x i32>, <4 x i32>* %106
%108 = getelementptr inbounds i32, i32* %105, i64 4
%109 = bitcast i32* %108 to <4 x i32>*
%110 = load <4 x i32>, <4 x i32>* %109
%111 = add <4 x i32> %107, %102
%112 = add <4 x i32> %110, %103
%113 = add nuw i64 %74, 32
%114 = add i64 %77, 4
%115 = icmp eq i64 %114, %72
br i1 %115, label %116, label %73
116: ; preds = %73, %64
%117 = phi <4 x i32> [ undef, %64 ], [ %111, %73 ]
%118 = phi <4 x i32> [ undef, %64 ], [ %112, %73 ]
%119 = phi i64 [ 0, %64 ], [ %113, %73 ]
%120 = phi <4 x i32> [ zeroinitializer, %64 ], [ %111, %73 ]
%121 = phi <4 x i32> [ zeroinitializer, %64 ], [ %112, %73 ]
%122 = icmp eq i64 %69, 0
br i1 %122, label %139, label %123
123: ; preds = %116, %123
%124 = phi i64 [ %136, %123 ], [ %119, %116 ]
%125 = phi <4 x i32> [ %134, %123 ], [ %120, %116 ]
%126 = phi <4 x i32> [ %135, %123 ], [ %121, %116 ]
%127 = phi i64 [ %137, %123 ], [ 0, %116 ]
%128 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 %124
%129 = bitcast i32* %128 to <4 x i32>*
%130 = load <4 x i32>, <4 x i32>* %129
%131 = getelementptr inbounds i32, i32* %128, i64 4
%132 = bitcast i32* %131 to <4 x i32>*
%133 = load <4 x i32>, <4 x i32>* %132
%134 = add <4 x i32> %130, %125
%135 = add <4 x i32> %133, %126
%136 = add nuw i64 %124, 8
%137 = add i64 %127, 1
%138 = icmp eq i64 %137, %69
br i1 %138, label %139, label %123
139: ; preds = %123, %116
%140 = phi <4 x i32> [ %117, %116 ], [ %134, %123 ]
%141 = phi <4 x i32> [ %118, %116 ], [ %135, %123 ]
%142 = add <4 x i32> %141, %140
%143 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %142)
%144 = icmp eq i64 %65, %62
br i1 %144, label %156, label %145
145: ; preds = %60, %139
%146 = phi i64 [ 0, %60 ], [ %65, %139 ]
%147 = phi i32 [ 0, %60 ], [ %143, %139 ]
br label %148
148: ; preds = %145, %148
%149 = phi i64 [ %154, %148 ], [ %146, %145 ]
%150 = phi i32 [ %153, %148 ], [ %147, %145 ]
%151 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 %149
%152 = load i32, i32* %151
%153 = add nsw i32 %152, %150
%154 = add nuw nsw i64 %149, 1
%155 = icmp eq i64 %154, %62
br i1 %155, label %156, label %148
156: ; preds = %148, %139, %58
%157 = phi i32 [ 0, %58 ], [ %143, %139 ], [ %153, %148 ]
%158 = getelementptr inbounds i8, i8* %0, i64 12
%159 = call i32 @atoi(i8* %158)
%160 = getelementptr inbounds i8, i8* %0, i64 15
%161 = call i32 @atoi(i8* %160)
%162 = getelementptr inbounds i8, i8* %0, i64 18
%163 = call i32 @atoi(i8* %162)
%164 = getelementptr inbounds [24 x i8], [24 x i8]* %5, i64 0, i64 21
%165 = call i32 @atoi(i8* %164)
%166 = sitofp i32 %48 to double
%167 = icmp slt i32 %48, 85
%168 = select i1 %167, double 2.000000e+03, double 1.900000e+03
%169 = fadd double %168, %166
%170 = fptosi double %169 to i32
%171 = mul nsw i32 %170, 1000
%172 = add i32 %171, %10
%173 = add i32 %172, %157
%174 = sitofp i32 %173 to double
%175 = mul i32 %159, 3600000
%176 = mul i32 %161, 60000
%177 = add nsw i32 %176, %175
%178 = mul nsw i32 %163, 1000
%179 = add nsw i32 %177, %178
%180 = add nsw i32 %179, %165
%181 = sitofp i32 %180 to double
%182 = fdiv double %181, 8.640000e+07
%183 = fadd double %182, %174
store double %183, double* %1
ret void
}