user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<parse_asn1_time>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x20,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  mov    (%rdi),%eax
  add    $0xffffff80,%eax
  mov    $0x1,%edx
  cmp    $0x1,%eax
  jbe    L28
L9:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L19
  mov    %edx,%eax
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L28:
  mov    %rdi,%rbp
  mov    %rsi,%rbx
  mov    $0x18,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  mov    0x8(%rbp),%r12
  mov    0x0(%rbp),%eax
  cmp    $0x80,%eax
  je     L24
  mov    $0x1,%edx
  cmp    $0x81,%eax
  jne    L9
  lea    0xc(%rsp),%rdx
  lea    D13(%rip),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  mov    0xc(%rsp),%eax
  sub    $0x76c,%eax
  mov    %eax,0xc(%rsp)
  mov    $0x4,%r14d
L49:
  mov    %eax,(%rbx)
  lea    0x13(%rsp),%rbp
  mov    %r14d,%edi
  add    %r12,%rdi
  mov    %rbp,%rdx
  lea    D15(%rip),%r13
  mov    %r13,%rsi
  mov    $0x0,%eax
  call   <sscanf@plt>
  movb   $0x0,0x15(%rsp)
  mov    $0xa,%edx
  mov    $0x0,%esi
  mov    %rbp,%rdi
  call   <strtol@plt>
  sub    $0x1,%eax
  mov    %eax,0xc(%rsp)
  mov    %eax,0x4(%rbx)
  lea    0x2(%r14),%edi
  mov    %edi,%edi
  add    %r12,%rdi
  mov    %rbp,%rdx
  mov    %r13,%rsi
  mov    $0x0,%eax
  call   <sscanf@plt>
  movb   $0x0,0x15(%rsp)
  mov    $0xa,%edx
  mov    $0x0,%esi
  mov    %rbp,%rdi
  call   <strtol@plt>
  mov    %eax,0xc(%rsp)
  mov    %eax,0x8(%rbx)
  lea    0x4(%r14),%edi
  mov    %edi,%edi
  add    %r12,%rdi
  mov    %rbp,%rdx
  mov    %r13,%rsi
  mov    $0x0,%eax
  call   <sscanf@plt>
  movb   $0x0,0x15(%rsp)
  mov    $0xa,%edx
  mov    $0x0,%esi
  mov    %rbp,%rdi
  call   <strtol@plt>
  mov    %eax,0xc(%rsp)
  mov    %eax,0xc(%rbx)
  lea    0x6(%r14),%edi
  mov    %edi,%edi
  add    %r12,%rdi
  mov    %rbp,%rdx
  mov    %r13,%rsi
  mov    $0x0,%eax
  call   <sscanf@plt>
  movb   $0x0,0x15(%rsp)
  mov    $0xa,%edx
  mov    $0x0,%esi
  mov    %rbp,%rdi
  call   <strtol@plt>
  mov    %eax,0xc(%rsp)
  mov    %eax,0x10(%rbx)
  lea    0x8(%r14),%eax
  mov    %eax,%eax
  lea    (%r12,%rax,1),%rdi
  mov    %rbp,%rdx
  mov    %r13,%rsi
  mov    $0x0,%eax
  call   <sscanf@plt>
  movb   $0x0,0x15(%rsp)
  mov    $0xa,%edx
  mov    $0x0,%esi
  mov    %rbp,%rdi
  call   <strtol@plt>
  mov    %eax,0x14(%rbx)
  mov    $0x0,%edx
  jmp    L9
L24:
  lea    0xc(%rsp),%rdx
  lea    D23(%rip),%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <sscanf@plt>
  mov    0xc(%rsp),%eax
  cmp    $0x31,%eax
  jg     L5
  add    $0x64,%eax
  mov    %eax,0xc(%rsp)
L5:
  mov    0xc(%rsp),%eax
  mov    $0x2,%r14d
  jmp    L49
L19:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D13
type_guessed: string
name: read_data
arguments: data_tag: D15
type_guessed: string
name: read_data
arguments: data_tag: D23
type_guessed: string

tool: D13: %04i

tool: D15: %02s

tool: D23: %02i

assistant: ```c
int parse_asn1_time(const ASN1_TIME *atp, struct tm *tsp) {
  const char *str;
  unsigned offset;
  int val;
  char buff[5];
  if ((atp->type != V_ASN1_GENERALIZEDTIME) && (atp->type != V_ASN1_UTCTIME))
    return (1);
  memset(tsp, 0, sizeof(struct tm));
  str = (const char *)atp->data;
  offset = 0;
  switch (atp->type) {
  case V_ASN1_GENERALIZEDTIME:
    sscanf(&str[offset], "%04i", &val);
    val -= 1900;
    tsp->tm_year = val;
    offset += 4;
    break;
  case V_ASN1_UTCTIME:
    sscanf(&str[offset], "%02i", &val);
    if (val < 50)
      val += 2000 - 1900;
    tsp->tm_year = val;
    offset += 2;
    break;
  default:
    return (1);
  };
  sscanf(&str[offset], "%02s", buff);
  buff[2] = '\0';
  val = strtol(buff, NULL, 10) - 1;
  tsp->tm_mon = val;
  offset += 2;
  sscanf(&str[offset], "%02s", buff);
  buff[2] = '\0';
  val = strtol(buff, NULL, 10);
  tsp->tm_mday = val;
  offset += 2;
  sscanf(&str[offset], "%02s", buff);
  buff[2] = '\0';
  val = strtol(buff, NULL, 10);
  tsp->tm_hour = val;
  offset += 2;
  sscanf(&str[offset], "%02s", buff);
  buff[2] = '\0';
  val = strtol(buff, NULL, 10);
  tsp->tm_min = val;
  offset += 2;
  sscanf(&str[offset], "%02s", buff);
  buff[2] = '\0';
  val = strtol(buff, NULL, 10);
  tsp->tm_sec = val;
  return (0);
}
```