#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 *);
scalar_t__ malloc(int);
int /*<<< orphan*/ strncmp(char *, char *, int);
char *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];
  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)(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    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x70(%rbp),%rdi
lea    0xeb2(%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,-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    0xe85(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    11e5 <calc_time+0x95>
movl   $0x1,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xe64(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    120a <calc_time+0xba>
movl   $0x2,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xe43(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    122f <calc_time+0xdf>
movl   $0x3,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xe22(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1254 <calc_time+0x104>
movl   $0x4,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xe01(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1279 <calc_time+0x129>
movl   $0x5,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xde0(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    129e <calc_time+0x14e>
movl   $0x6,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xdbf(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    12c3 <calc_time+0x173>
movl   $0x7,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xd9e(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    12e8 <calc_time+0x198>
movl   $0x8,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xd7d(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    130d <calc_time+0x1bd>
movl   $0x9,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xd5c(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1332 <calc_time+0x1e2>
movl   $0xa,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xd3b(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    1357 <calc_time+0x207>
movl   $0xb,-0x30(%rbp)
lea    -0x74(%rbp),%rdi
lea    0xd1a(%rip),%rsi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    137c <calc_time+0x22c>
movl   $0xc,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x9,%rdi
call   1070 <atoi@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    13c0 <calc_time+0x270>
mov    -0x34(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     13c0 <calc_time+0x270>
movl   $0x1,-0x38(%rbp)
jmp    13e2 <calc_time+0x292>
cmpl   $0x0,-0x34(%rbp)
jne    13d6 <calc_time+0x286>
movl   $0x1,-0x38(%rbp)
jmp    13dd <calc_time+0x28d>
movl   $0x0,-0x38(%rbp)
jmp    13e2 <calc_time+0x292>
cmpl   $0x0,-0x38(%rbp)
je     13f3 <calc_time+0x2a3>
movl   $0x1d,-0x6c(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x1,-0x30(%rbp)
jle    143d <calc_time+0x2ed>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1438 <calc_time+0x2e8>
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    140b <calc_time+0x2bb>
jmp    143d <calc_time+0x2ed>
mov    -0x28(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xc,%rdi
call   1070 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
add    $0xf,%rdi
call   1070 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x12,%rdi
call   1070 <atoi@plt>
mov    %eax,-0x20(%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,-0x24(%rbp)
cvtsi2sdl -0x34(%rbp),%xmm1
movsd  0xb56(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    14d1 <calc_time+0x381>
cvtsi2sdl -0x34(%rbp),%xmm0
movsd  0xb4f(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x34(%rbp)
jmp    14e9 <calc_time+0x399>
cvtsi2sdl -0x34(%rbp),%xmm0
movsd  0xb2a(%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  0xaf0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
mov    -0x10(%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    %rsi,0x50(%rsp)
mov    %rdi,%r12
movaps 0xee3(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xec7(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movdqa 0xeaa(%rip),%xmm0
movdqa %xmm0,0x10(%rsp)
mov    $0x3,%r14d
mov    $0x3,%edi
call   1050 <malloc@plt>
mov    %rax,0x48(%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    0xe83(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
lea    0xe73(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
cmp    $0x1,%eax
mov    $0x1,%ebx
adc    $0x0,%ebx
lea    0xe58(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
cmove  %r14d,%ebx
lea    0xe42(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0x4,%ebp
cmovne %ebx,%ebp
lea    0xe28(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0x5,%ebx
cmovne %ebp,%ebx
lea    0xe0e(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0x6,%ebp
cmovne %ebx,%ebp
lea    0xdf4(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0x7,%ebx
cmovne %ebp,%ebx
lea    0xdda(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0x8,%ebp
cmovne %ebx,%ebp
lea    0xdc0(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0x9,%ebx
cmovne %ebp,%ebx
lea    0xda6(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0xa,%ebp
cmovne %ebx,%ebp
lea    0xd8c(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0xb,%ebx
cmovne %ebp,%ebx
lea    0xd72(%rip),%rsi
mov    %r15,%rdi
mov    $0x3,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
mov    $0xc,%ebp
cmovne %ebx,%ebp
lea    0x9(%r12),%rdi
call   1060 <atoi@plt>
mov    %eax,%r13d
test   $0x3,%r13b
sete   %al
imul   $0xc28f5c29,%r13d,%ecx
add    $0x51eb850,%ecx
ror    $0x2,%ecx
cmp    $0x28f5c29,%ecx
setae  %cl
test   %cl,%al
jne    1357 <calc_time+0x217>
test   %r13d,%r13d
jne    135f <calc_time+0x21f>
movl   $0x1d,0x14(%rsp)
xor    %r15d,%r15d
cmp    $0x2,%ebp
jb     145e <calc_time+0x31e>
add    $0xffffffff,%ebp
cmp    $0x8,%ebp
jae    137d <calc_time+0x23d>
xor    %eax,%eax
xor    %r15d,%r15d
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    13a8 <calc_time+0x268>
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
cs nopw 0x0(%rax,%rax,1)
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,%r15d
cmp    %rbp,%rax
je     145e <calc_time+0x31e>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    0x10(%rsp,%rax,4),%r15d
add    $0x1,%rax
cmp    %rax,%rbp
jne    1450 <calc_time+0x310>
lea    0xc(%r12),%rdi
call   1060 <atoi@plt>
mov    %eax,%ebp
lea    0xf(%r12),%rdi
call   1060 <atoi@plt>
mov    %eax,%r14d
add    $0x12,%r12
mov    %r12,%rdi
call   1060 <atoi@plt>
mov    %eax,%ebx
lea    0x75(%rsp),%rsi
mov    0x48(%rsp),%rdi
mov    $0x3,%edx
call   1030 <strncpy@plt>
mov    %rax,%rdi
call   1060 <atoi@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %r13d,%xmm0
xor    %ecx,%ecx
cmp    $0x55,%r13d
setl   %cl
lea    0xb47(%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,%ebp,%ecx
imul   $0xea60,%r14d,%edx
add    %ecx,%edx
imul   $0x3e8,%ebx,%ecx
add    %edx,%ecx
add    %eax,%ecx
xorps  %xmm1,%xmm1
cvtsi2sd %ecx,%xmm1
divsd  0xb12(%rip),%xmm1
addsd  %xmm0,%xmm1
mov    0x50(%rsp),%rax
movsd  %xmm1,(%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) {
%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]
%18 = alloca i8*
store i8* %0, i8** %3
store double* %1, double** %4
%19 = bitcast [12 x i32]* %15 to i8*
%20 = call i64 @malloc(i32 3)
%21 = inttoptr i64 %20 to i8*
store i8* %21, i8** %18
%22 = getelementptr inbounds [24 x i8], [24 x i8]* %17, i64 0, i64 0
%23 = load i8*, i8** %3
%24 = getelementptr inbounds i8, i8* %23, i64 0
%25 = call i8* @strncpy(i8* %22, i8* %24, i32 24)
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 0
%28 = call i32 @atoi(i8* %27)
store i32 %28, i32* %5
%29 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%30 = load i8*, i8** %3
%31 = getelementptr inbounds i8, i8* %30, i64 3
%32 = call i8* @strncpy(i8* %29, i8* %31, i32 3)
%33 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%34 = call i32 @strncmp(i8* %33, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%35 = icmp ne i32 %34, 0
br i1 %35, label %37, label %36
36: ; preds = %2
store i32 1, i32* %12
br label %37
37: ; preds = %36, %2
%38 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%39 = call i32 @strncmp(i8* %38, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%40 = icmp ne i32 %39, 0
br i1 %40, label %42, label %41
41: ; preds = %37
store i32 2, i32* %12
br label %42
42: ; preds = %41, %37
%43 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%44 = call i32 @strncmp(i8* %43, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
%45 = icmp ne i32 %44, 0
br i1 %45, label %47, label %46
46: ; preds = %42
store i32 3, i32* %12
br label %47
47: ; preds = %46, %42
%48 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%49 = call i32 @strncmp(i8* %48, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%50 = icmp ne i32 %49, 0
br i1 %50, label %52, label %51
51: ; preds = %47
store i32 4, i32* %12
br label %52
52: ; preds = %51, %47
%53 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%54 = call i32 @strncmp(i8* %53, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 3)
%55 = icmp ne i32 %54, 0
br i1 %55, label %57, label %56
56: ; preds = %52
store i32 5, i32* %12
br label %57
57: ; preds = %56, %52
%58 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%59 = call i32 @strncmp(i8* %58, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 3)
%60 = icmp ne i32 %59, 0
br i1 %60, label %62, label %61
61: ; preds = %57
store i32 6, i32* %12
br label %62
62: ; preds = %61, %57
%63 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%64 = call i32 @strncmp(i8* %63, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 3)
%65 = icmp ne i32 %64, 0
br i1 %65, label %67, label %66
66: ; preds = %62
store i32 7, i32* %12
br label %67
67: ; preds = %66, %62
%68 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%69 = call i32 @strncmp(i8* %68, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 3)
%70 = icmp ne i32 %69, 0
br i1 %70, label %72, label %71
71: ; preds = %67
store i32 8, i32* %12
br label %72
72: ; preds = %71, %67
%73 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%74 = call i32 @strncmp(i8* %73, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 3)
%75 = icmp ne i32 %74, 0
br i1 %75, label %77, label %76
76: ; preds = %72
store i32 9, i32* %12
br label %77
77: ; preds = %76, %72
%78 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%79 = call i32 @strncmp(i8* %78, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 3)
%80 = icmp ne i32 %79, 0
br i1 %80, label %82, label %81
81: ; preds = %77
store i32 10, i32* %12
br label %82
82: ; preds = %81, %77
%83 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%84 = call i32 @strncmp(i8* %83, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32 3)
%85 = icmp ne i32 %84, 0
br i1 %85, label %87, label %86
86: ; preds = %82
store i32 11, i32* %12
br label %87
87: ; preds = %86, %82
%88 = getelementptr inbounds [4 x i8], [4 x i8]* %16, i64 0, i64 0
%89 = call i32 @strncmp(i8* %88, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32 3)
%90 = icmp ne i32 %89, 0
br i1 %90, label %92, label %91
91: ; preds = %87
store i32 12, i32* %12
br label %92
92: ; preds = %91, %87
%93 = load i8*, i8** %3
%94 = getelementptr inbounds i8, i8* %93, i64 9
%95 = call i32 @atoi(i8* %94)
store i32 %95, i32* %13
%96 = load i32, i32* %13
%97 = srem i32 %96, 4
%98 = icmp eq i32 %97, 0
br i1 %98, label %99, label %104
99: ; preds = %92
%100 = load i32, i32* %13
%101 = srem i32 %100, 100
%102 = icmp ne i32 %101, 0
br i1 %102, label %103, label %104
103: ; preds = %99
store i32 1, i32* %14
br label %110
104: ; preds = %99, %92
%105 = load i32, i32* %13
%106 = icmp eq i32 %105, 0
br i1 %106, label %107, label %108
107: ; preds = %104
store i32 1, i32* %14
br label %109
108: ; preds = %104
store i32 0, i32* %14
br label %109
109: ; preds = %108, %107
br label %110
110: ; preds = %109, %103
%111 = load i32, i32* %14
%112 = icmp ne i32 %111, 0
br i1 %112, label %113, label %115
113: ; preds = %110
%114 = getelementptr inbounds [12 x i32], [12 x i32]* %15, i64 0, i64 1
store i32 29, i32* %114
br label %115
115: ; preds = %113, %110
store i32 0, i32* %10
%116 = load i32, i32* %12
%117 = icmp sgt i32 %116, 1
br i1 %117, label %118, label %135
118: ; preds = %115
store i32 0, i32* %11
br label %119
119: ; preds = %131, %118
%120 = load i32, i32* %11
%121 = load i32, i32* %12
%122 = sub nsw i32 %121, 1
%123 = icmp slt i32 %120, %122
br i1 %123, label %124, label %134
124: ; preds = %119
%125 = load i32, i32* %10
%126 = load i32, i32* %11
%127 = sext i32 %126 to i64
%128 = getelementptr inbounds [12 x i32], [12 x i32]* %15, i64 0, i64 %127
%129 = load i32, i32* %128
%130 = add nsw i32 %125, %129
store i32 %130, i32* %10
br label %131
131: ; preds = %124
%132 = load i32, i32* %11
%133 = add nsw i32 %132, 1
store i32 %133, i32* %11
br label %119
134: ; preds = %119
br label %135
135: ; preds = %134, %115
%136 = load i32, i32* %10
%137 = load i32, i32* %5
%138 = add nsw i32 %136, %137
store i32 %138, i32* %10
%139 = load i8*, i8** %3
%140 = getelementptr inbounds i8, i8* %139, i64 12
%141 = call i32 @atoi(i8* %140)
store i32 %141, i32* %6
%142 = load i8*, i8** %3
%143 = getelementptr inbounds i8, i8* %142, i64 15
%144 = call i32 @atoi(i8* %143)
store i32 %144, i32* %7
%145 = load i8*, i8** %3
%146 = getelementptr inbounds i8, i8* %145, i64 18
%147 = call i32 @atoi(i8* %146)
store i32 %147, i32* %8
%148 = load i8*, i8** %18
%149 = getelementptr inbounds [24 x i8], [24 x i8]* %17, i64 0, i64 0
%150 = getelementptr inbounds i8, i8* %149, i64 21
%151 = call i8* @strncpy(i8* %148, i8* %150, i32 3)
%152 = call i32 @atoi(i8* %151)
store i32 %152, i32* %9
%153 = load i32, i32* %13
%154 = sitofp i32 %153 to double
%155 = fcmp olt double %154, 8.500000e+01
br i1 %155, label %156, label %161
156: ; preds = %135
%157 = load i32, i32* %13
%158 = sitofp i32 %157 to double
%159 = fadd double %158, 2.000000e+03
%160 = fptosi double %159 to i32
store i32 %160, i32* %13
br label %166
161: ; preds = %135
%162 = load i32, i32* %13
%163 = sitofp i32 %162 to double
%164 = fadd double %163, 1.900000e+03
%165 = fptosi double %164 to i32
store i32 %165, i32* %13
br label %166
166: ; preds = %161, %156
%167 = load i32, i32* %13
%168 = mul nsw i32 %167, 1000
%169 = load i32, i32* %10
%170 = add nsw i32 %168, %169
%171 = sitofp i32 %170 to double
%172 = load i32, i32* %6
%173 = mul nsw i32 %172, 3600
%174 = mul nsw i32 %173, 1000
%175 = load i32, i32* %7
%176 = mul nsw i32 %175, 60
%177 = mul nsw i32 %176, 1000
%178 = add nsw i32 %174, %177
%179 = load i32, i32* %8
%180 = mul nsw i32 %179, 1000
%181 = add nsw i32 %178, %180
%182 = load i32, i32* %9
%183 = add nsw i32 %181, %182
%184 = sitofp i32 %183 to double
%185 = fdiv double %184, 8.640000e+07
%186 = fadd double %171, %185
%187 = load double*, double** %4
store double %186, double* %187
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 = tail call i64 @malloc(i32 3)
%10 = call i8* @strncpy(i8* %8, i8* %0, i32 24)
%11 = call i32 @atoi(i8* %0)
%12 = getelementptr inbounds i8, i8* %0, i64 3
%13 = call i8* @strncpy(i8* %7, i8* %12, i32 3)
%14 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%15 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 3)
%16 = icmp eq i32 %15, 0
%17 = select i1 %16, i32 2, i32 1
%18 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
%19 = icmp eq i32 %18, 0
%20 = select i1 %19, i32 3, i32 %17
%21 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%22 = icmp eq i32 %21, 0
%23 = select i1 %22, i32 4, i32 %20
%24 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 3)
%25 = icmp eq i32 %24, 0
%26 = select i1 %25, i32 5, i32 %23
%27 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 3)
%28 = icmp eq i32 %27, 0
%29 = select i1 %28, i32 6, i32 %26
%30 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i32 3)
%31 = icmp eq i32 %30, 0
%32 = select i1 %31, i32 7, i32 %29
%33 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), i32 3)
%34 = icmp eq i32 %33, 0
%35 = select i1 %34, i32 8, i32 %32
%36 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 3)
%37 = icmp eq i32 %36, 0
%38 = select i1 %37, i32 9, i32 %35
%39 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i32 3)
%40 = icmp eq i32 %39, 0
%41 = select i1 %40, i32 10, i32 %38
%42 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.10, i64 0, i64 0), i32 3)
%43 = icmp eq i32 %42, 0
%44 = select i1 %43, i32 11, i32 %41
%45 = call i32 @strncmp(i8* %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.11, i64 0, i64 0), i32 3)
%46 = icmp eq i32 %45, 0
%47 = select i1 %46, i32 12, i32 %44
%48 = getelementptr inbounds i8, i8* %0, i64 9
%49 = call i32 @atoi(i8* %48)
%50 = and i32 %49, 3
%51 = icmp eq i32 %50, 0
%52 = srem i32 %49, 100
%53 = icmp ne i32 %52, 0
%54 = and i1 %51, %53
%55 = icmp eq i32 %49, 0
%56 = select i1 %54, i1 true, i1 %55
br i1 %56, label %57, label %59
57: ; preds = %2
%58 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 1
store i32 29, i32* %58
br label %59
59: ; preds = %2, %57
%60 = icmp ugt i32 %47, 1
br i1 %60, label %61, label %157
61: ; preds = %59
%62 = add nsw i32 %47, -1
%63 = zext i32 %62 to i64
%64 = icmp ult i32 %62, 8
br i1 %64, label %146, label %65
65: ; preds = %61
%66 = and i64 %63, 4294967288
%67 = add nsw i64 %66, -8
%68 = lshr exact i64 %67, 3
%69 = add nuw nsw i64 %68, 1
%70 = and i64 %69, 3
%71 = icmp ult i64 %67, 24
br i1 %71, label %117, label %72
72: ; preds = %65
%73 = and i64 %69, 4611686018427387900
br label %74
74: ; preds = %74, %72
%75 = phi i64 [ 0, %72 ], [ %114, %74 ]
%76 = phi <4 x i32> [ zeroinitializer, %72 ], [ %112, %74 ]
%77 = phi <4 x i32> [ zeroinitializer, %72 ], [ %113, %74 ]
%78 = phi i64 [ 0, %72 ], [ %115, %74 ]
%79 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 %75
%80 = bitcast i32* %79 to <4 x i32>*
%81 = load <4 x i32>, <4 x i32>* %80
%82 = getelementptr inbounds i32, i32* %79, i64 4
%83 = bitcast i32* %82 to <4 x i32>*
%84 = load <4 x i32>, <4 x i32>* %83
%85 = add <4 x i32> %81, %76
%86 = add <4 x i32> %84, %77
%87 = or i64 %75, 8
%88 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 %87
%89 = bitcast i32* %88 to <4 x i32>*
%90 = load <4 x i32>, <4 x i32>* %89
%91 = getelementptr inbounds i32, i32* %88, i64 4
%92 = bitcast i32* %91 to <4 x i32>*
%93 = load <4 x i32>, <4 x i32>* %92
%94 = add <4 x i32> %90, %85
%95 = add <4 x i32> %93, %86
%96 = or i64 %75, 16
%97 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 %96
%98 = bitcast i32* %97 to <4 x i32>*
%99 = load <4 x i32>, <4 x i32>* %98
%100 = getelementptr inbounds i32, i32* %97, i64 4
%101 = bitcast i32* %100 to <4 x i32>*
%102 = load <4 x i32>, <4 x i32>* %101
%103 = add <4 x i32> %99, %94
%104 = add <4 x i32> %102, %95
%105 = or i64 %75, 24
%106 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 %105
%107 = bitcast i32* %106 to <4 x i32>*
%108 = load <4 x i32>, <4 x i32>* %107
%109 = getelementptr inbounds i32, i32* %106, i64 4
%110 = bitcast i32* %109 to <4 x i32>*
%111 = load <4 x i32>, <4 x i32>* %110
%112 = add <4 x i32> %108, %103
%113 = add <4 x i32> %111, %104
%114 = add nuw i64 %75, 32
%115 = add i64 %78, 4
%116 = icmp eq i64 %115, %73
br i1 %116, label %117, label %74
117: ; preds = %74, %65
%118 = phi <4 x i32> [ undef, %65 ], [ %112, %74 ]
%119 = phi <4 x i32> [ undef, %65 ], [ %113, %74 ]
%120 = phi i64 [ 0, %65 ], [ %114, %74 ]
%121 = phi <4 x i32> [ zeroinitializer, %65 ], [ %112, %74 ]
%122 = phi <4 x i32> [ zeroinitializer, %65 ], [ %113, %74 ]
%123 = icmp eq i64 %70, 0
br i1 %123, label %140, label %124
124: ; preds = %117, %124
%125 = phi i64 [ %137, %124 ], [ %120, %117 ]
%126 = phi <4 x i32> [ %135, %124 ], [ %121, %117 ]
%127 = phi <4 x i32> [ %136, %124 ], [ %122, %117 ]
%128 = phi i64 [ %138, %124 ], [ 0, %117 ]
%129 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 %125
%130 = bitcast i32* %129 to <4 x i32>*
%131 = load <4 x i32>, <4 x i32>* %130
%132 = getelementptr inbounds i32, i32* %129, i64 4
%133 = bitcast i32* %132 to <4 x i32>*
%134 = load <4 x i32>, <4 x i32>* %133
%135 = add <4 x i32> %131, %126
%136 = add <4 x i32> %134, %127
%137 = add nuw i64 %125, 8
%138 = add i64 %128, 1
%139 = icmp eq i64 %138, %70
br i1 %139, label %140, label %124
140: ; preds = %124, %117
%141 = phi <4 x i32> [ %118, %117 ], [ %135, %124 ]
%142 = phi <4 x i32> [ %119, %117 ], [ %136, %124 ]
%143 = add <4 x i32> %142, %141
%144 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %143)
%145 = icmp eq i64 %66, %63
br i1 %145, label %157, label %146
146: ; preds = %61, %140
%147 = phi i64 [ 0, %61 ], [ %66, %140 ]
%148 = phi i32 [ 0, %61 ], [ %144, %140 ]
br label %149
149: ; preds = %146, %149
%150 = phi i64 [ %155, %149 ], [ %147, %146 ]
%151 = phi i32 [ %154, %149 ], [ %148, %146 ]
%152 = getelementptr inbounds [12 x i32], [12 x i32]* %3, i64 0, i64 %150
%153 = load i32, i32* %152
%154 = add nsw i32 %153, %151
%155 = add nuw nsw i64 %150, 1
%156 = icmp eq i64 %155, %63
br i1 %156, label %157, label %149
157: ; preds = %149, %140, %59
%158 = phi i32 [ 0, %59 ], [ %144, %140 ], [ %154, %149 ]
%159 = inttoptr i64 %9 to i8*
%160 = getelementptr inbounds i8, i8* %0, i64 12
%161 = call i32 @atoi(i8* %160)
%162 = getelementptr inbounds i8, i8* %0, i64 15
%163 = call i32 @atoi(i8* %162)
%164 = getelementptr inbounds i8, i8* %0, i64 18
%165 = call i32 @atoi(i8* %164)
%166 = getelementptr inbounds [24 x i8], [24 x i8]* %5, i64 0, i64 21
%167 = call i8* @strncpy(i8* %159, i8* %166, i32 3)
%168 = call i32 @atoi(i8* %167)
%169 = sitofp i32 %49 to double
%170 = icmp slt i32 %49, 85
%171 = select i1 %170, double 2.000000e+03, double 1.900000e+03
%172 = fadd double %171, %169
%173 = fptosi double %172 to i32
%174 = mul nsw i32 %173, 1000
%175 = add i32 %174, %11
%176 = add i32 %175, %158
%177 = sitofp i32 %176 to double
%178 = mul i32 %161, 3600000
%179 = mul i32 %163, 60000
%180 = add nsw i32 %179, %178
%181 = mul nsw i32 %165, 1000
%182 = add nsw i32 %180, %181
%183 = add nsw i32 %182, %168
%184 = sitofp i32 %183 to double
%185 = fdiv double %184, 8.640000e+07
%186 = fadd double %185, %177
store double %186, double* %1
ret void
}