user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<calc_time>:
  endbr64
  push   %r15
  mov    %rdx,%r15
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  mov    $0x3,%edi
  push   %rbp
  push   %rbx
  mov    $0x1,%ebx
  sub    $0x78,%rsp
  mov    %rsi,0x8(%rsp)
  lea    0x4c(%rsp),%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  movl   $0x1c,0x14(%rsp)
  movabs $0x1e0000001f,%rax
  mov    %rax,0x18(%rsp)
  mov    %rax,0x20(%rsp)
  movabs $0x1f0000001f,%rax
  mov    %rax,0x28(%rsp)
  sub    $0x1,%rax
  mov    %rax,0x30(%rsp)
  mov    %rax,0x38(%rsp)
  call   <malloc@plt>
  mov    $0x18,%edx
  mov    %r12,%rsi
  lea    0x50(%rsp),%rdi
  mov    %rax,%r14
  call   <strncpy@plt>
  mov    %r12,%rdi
  call   <atoi@plt>
  lea    0x3(%r12),%rsi
  mov    $0x3,%edx
  mov    %rbp,%rdi
  mov    %eax,%r13d
  call   <strncpy@plt>
  mov    $0x3,%edx
  lea    D25(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  mov    $0x3,%edx
  lea    D87(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  mov    $0x3,%edx
  lea    D78(%rip),%rsi
  mov    %rbp,%rdi
  cmp    $0x1,%eax
  adc    $0x0,%ebx
  call   <strncmp@plt>
  mov    $0x3,%edx
  lea    D49(%rip),%rsi
  mov    %rbp,%rdi
  test   %eax,%eax
  mov    $0x3,%eax
  cmove  %eax,%ebx
  call   <strncmp@plt>
  mov    $0x3,%edx
  lea    D111(%rip),%rsi
  mov    %rbp,%rdi
  test   %eax,%eax
  mov    $0x4,%eax
  cmove  %eax,%ebx
  call   <strncmp@plt>
  mov    $0x3,%edx
  lea    D66(%rip),%rsi
  mov    %rbp,%rdi
  test   %eax,%eax
  mov    $0x5,%eax
  cmove  %eax,%ebx
  call   <strncmp@plt>
  mov    $0x3,%edx
  lea    D107(%rip),%rsi
  mov    %rbp,%rdi
  test   %eax,%eax
  mov    $0x6,%eax
  cmove  %eax,%ebx
  call   <strncmp@plt>
  mov    $0x3,%edx
  lea    D86(%rip),%rsi
  mov    %rbp,%rdi
  test   %eax,%eax
  mov    $0x7,%eax
  cmove  %eax,%ebx
  call   <strncmp@plt>
  mov    $0x3,%edx
  lea    D4(%rip),%rsi
  mov    %rbp,%rdi
  test   %eax,%eax
  mov    $0x8,%eax
  cmove  %eax,%ebx
  call   <strncmp@plt>
  mov    $0x3,%edx
  lea    D52(%rip),%rsi
  mov    %rbp,%rdi
  test   %eax,%eax
  mov    $0x9,%eax
  cmove  %eax,%ebx
  call   <strncmp@plt>
  mov    $0x3,%edx
  lea    D58(%rip),%rsi
  mov    %rbp,%rdi
  test   %eax,%eax
  mov    $0xa,%eax
  cmove  %eax,%ebx
  call   <strncmp@plt>
  mov    %rbp,%rdi
  mov    $0x3,%edx
  test   %eax,%eax
  lea    D64(%rip),%rsi
  mov    $0xb,%eax
  cmove  %eax,%ebx
  call   <strncmp@plt>
  lea    0x9(%r12),%rdi
  test   %eax,%eax
  je     L127
  call   <atoi@plt>
  mov    %eax,%ebp
  test   $0x3,%al
  jne    L34
  imul   $0xc28f5c29,%eax,%eax
  add    $0x51eb850,%eax
  ror    $0x2,%eax
  cmp    $0x28f5c28,%eax
  jbe    L106
L121:
  movl   $0x1d,0x14(%rsp)
L34:
  cmp    $0x1,%ebx
  je     L56
L46:
  sub    $0x1,%ebx
L76:
  lea    -0x1(%rbx),%edx
  lea    0x14(%rsp),%rax
  mov    $0x1f,%ecx
  lea    (%rax,%rdx,4),%rsi
  xor    %edx,%edx
  jmp    L104
  nopw   0x0(%rax,%rax,1)
L25:
  mov    (%rax),%ecx
  add    $0x4,%rax
L104:
  add    %ecx,%edx
  cmp    %rsi,%rax
  jne    L25
  add    %edx,%r13d
L56:
  lea    0xc(%r12),%rdi
  call   <atoi@plt>
  lea    0xf(%r12),%rdi
  mov    %eax,%ebx
  call   <atoi@plt>
  lea    0x12(%r12),%rdi
  mov    %eax,0x4(%rsp)
  call   <atoi@plt>
  mov    $0x3,%edx
  lea    0x65(%rsp),%rsi
  mov    %r14,%rdi
  mov    %eax,%r12d
  call   <strncpy@plt>
  mov    %rax,%rdi
  call   <atoi@plt>
  cmp    $0x54,%ebp
  pxor   %xmm1,%xmm1
  pxor   %xmm0,%xmm0
  mov    %eax,%r9d
  lea    0x7d0(%rbp),%edx
  lea    0x76c(%rbp),%eax
  mov    0x8(%rsp),%rcx
  cmovle %edx,%eax
  imul   $0x36ee80,%ebx,%ebx
  imul   $0xea60,0x4(%rsp),%ebp
  imul   $0x3e8,%r12d,%r12d
  cvtsi2sd %r13d,%xmm1
  add    %ebp,%ebx
  imul   $0x3e8,%eax,%eax
  add    %r12d,%ebx
  add    %r9d,%ebx
  cvtsi2sd %ebx,%xmm0
  divsd  D59(%rip),%xmm0
  addsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  movsd  %xmm0,(%rcx)
  addsd  %xmm0,%xmm1
  movsd  %xmm1,(%r15)
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L90
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L127:
  call   <atoi@plt>
  mov    $0xb,%ebx
  mov    %eax,%ebp
  test   $0x3,%al
  jne    L76
  imul   $0xc28f5c29,%eax,%eax
  mov    $0xc,%ebx
  add    $0x51eb850,%eax
  ror    $0x2,%eax
  cmp    $0x28f5c28,%eax
  ja     L121
  test   %ebp,%ebp
  jne    L46
  movl   $0x1d,0x14(%rsp)
  jmp    L34
  nopw   0x0(%rax,%rax,1)
L106:
  test   %ebp,%ebp
  jne    L34
  movl   $0x1d,0x14(%rsp)
  jmp    L34
L90:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: tag: D25
type_guessed: string
name: parse_data
arguments: tag: D87
type_guessed: string
name: parse_data
arguments: tag: D78
type_guessed: string
name: parse_data
arguments: tag: D49
type_guessed: string
name: parse_data
arguments: tag: D111
type_guessed: string
name: parse_data
arguments: tag: D66
type_guessed: string
name: parse_data
arguments: tag: D107
type_guessed: string
name: parse_data
arguments: tag: D86
type_guessed: string
name: parse_data
arguments: tag: D4
type_guessed: string
name: parse_data
arguments: tag: D52
type_guessed: string
name: parse_data
arguments: tag: D58
type_guessed: string
name: parse_data
arguments: tag: D64
type_guessed: string
name: parse_data
arguments: tag: D59
type_guessed: byte[8]

tool: D25: JAN

tool: D87: FEB

tool: D78: MAR

tool: D49: APR

tool: D111: MAY

tool: D66: JUN

tool: D107: JUL

tool: D86: AUG

tool: D4: SEP

tool: D52: OCT

tool: D58: NOV

tool: D64: DEC

tool: {"D59": [0x00,0x00,0x00,0x00,0x70,0x99,0x94,0x41]}

assistant: ```c
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;
}
```