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

```asm
<asn1_time_parse>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L41
  mov    %rsi,%rax
  mov    %rsi,%r14
  and    $0xfffffffffffffffd,%rax
  cmp    $0xd,%rax
  jne    L41
  mov    %rdi,%r12
  mov    %rdx,%r13
  mov    %ecx,%r15d
  test   %rdx,%rdx
  je     L160
L136:
  cmpb   $0x5a,-0x1(%r12,%r14,1)
  lea    -0x1(%r14),%rbp
  jne    L41
  mov    %r12,%rbx
  add    %r12,%rbp
  nopw   0x0(%rax,%rax,1)
L161:
  movzbl (%rbx),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L41
  add    $0x1,%rbx
  cmp    %rbx,%rbp
  jne    L161
  cmp    $0xd,%r14
  je     L86
  cmp    $0xf,%r14
  jne    L41
  mov    D36(%rip),%rax
  mov    (%rax),%esi
  cmp    %r15d,%esi
  je     L41
  movsbl (%r12),%eax
  lea    0x2(%r12),%rdx
  lea    -0xf0(%rax,%rax,4),%ecx
  movsbl 0x1(%r12),%eax
  mov    %rdx,%r12
  lea    -0x30(%rax,%rcx,2),%ecx
  mov    D29(%rip),%rax
  imul   $0x64,%ecx,%ecx
  mov    (%rax),%eax
  sub    $0x76c,%ecx
  mov    %ecx,0x0(%r13)
  test   %eax,%eax
  jne    L76
L1:
  cmp    %eax,%r15d
  je     L41
  mov    D36(%rip),%rax
  mov    0x0(%r13),%ecx
  mov    (%rax),%eax
  mov    %eax,%esi
L76:
  movsbl (%r12),%edx
  lea    -0xf0(%rdx,%rdx,4),%edi
  movsbl 0x1(%r12),%edx
  lea    -0x30(%rdx,%rdi,2),%edx
  add    %ecx,%edx
  mov    %edx,0x0(%r13)
  cmp    %esi,%eax
  jne    L14
  cmp    $0x31,%edx
  jle    L64
L14:
  movsbl 0x2(%r12),%edx
  lea    -0xf0(%rdx,%rdx,4),%ecx
  movsbl 0x3(%r12),%edx
  lea    -0x31(%rdx,%rcx,2),%edx
  mov    %edx,0x4(%r13)
  cmp    $0xb,%edx
  ja     L41
  movsbl 0x4(%r12),%edx
  lea    -0xf0(%rdx,%rdx,4),%ecx
  movsbl 0x5(%r12),%edx
  lea    -0x30(%rdx,%rcx,2),%edx
  mov    %edx,0x8(%r13)
  sub    $0x1,%edx
  cmp    $0x1e,%edx
  ja     L41
  movsbl 0x6(%r12),%edx
  lea    -0xf0(%rdx,%rdx,4),%ecx
  movsbl 0x7(%r12),%edx
  lea    -0x30(%rdx,%rcx,2),%edx
  mov    %edx,0xc(%r13)
  cmp    $0x17,%edx
  ja     L41
  movsbl 0x8(%r12),%edx
  lea    -0xf0(%rdx,%rdx,4),%ecx
  movsbl 0x9(%r12),%edx
  lea    -0x30(%rdx,%rcx,2),%edx
  mov    %edx,0x10(%r13)
  cmp    $0x3b,%edx
  ja     L41
  movsbl 0xa(%r12),%edx
  lea    -0xf0(%rdx,%rdx,4),%ecx
  movsbl 0xb(%r12),%edx
  lea    -0x30(%rdx,%rcx,2),%edx
  mov    %edx,0x14(%r13)
  cmp    $0x3b,%edx
  jbe    L180
L41:
  mov    $0xffffffff,%eax
L180:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L26
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L86:
  mov    D29(%rip),%rax
  mov    (%rax),%eax
  jmp    L1
  cs nopw 0x0(%rax,%rax,1)
L160:
  mov    %rsp,%r13
  mov    $0x18,%edx
  xor    %esi,%esi
  mov    %r13,%rdi
  call   <memset@plt>
  jmp    L136
L64:
  add    $0x64,%edx
  mov    %edx,0x0(%r13)
  jmp    L14
L26:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int asn1_time_parse(const char *bytes, size_t len, struct tm *tm, int mode) {
  int i, type = 0;
  struct tm ltm;
  struct tm *lt;
  const char *p;
  if (bytes == NULL)
    return (-1);
  if (len != 13 && len != 15)
    return (-1);
  lt = tm;
  if (lt == NULL) {
    memset(&ltm, 0, sizeof(ltm));
    lt = &ltm;
  }
  if (bytes[len - 1] != 'Z')
    return (-1);
  for (i = 0; i < len - 1; i++) {
    if (isdigit((unsigned char)bytes[i]))
      continue;
    return (-1);
  }
  p = bytes;
  switch (len) {
  case 15:
    if (mode == V_ASN1_UTCTIME)
      return (-1);
    lt->tm_year = (((p) += 2, ((p)[-2] - '0') * 10 + ((p)[-1] - '0')) * 100) - 1900;
    type = V_ASN1_GENERALIZEDTIME;
  case 13:
    if (type == 0) {
      if (mode == V_ASN1_GENERALIZEDTIME)
        return (-1);
      type = V_ASN1_UTCTIME;
    }
    lt->tm_year += ((p) += 2, ((p)[-2] - '0') * 10 + ((p)[-1] - '0'));
    if (type == V_ASN1_UTCTIME) {
      if (lt->tm_year < 50)
        lt->tm_year += 100;
    }
    lt->tm_mon = ((p) += 2, ((p)[-2] - '0') * 10 + ((p)[-1] - '0')) - 1;
    if (lt->tm_mon < 0 || lt->tm_mon > 11)
      return (-1);
    lt->tm_mday = ((p) += 2, ((p)[-2] - '0') * 10 + ((p)[-1] - '0'));
    if (lt->tm_mday < 1 || lt->tm_mday > 31)
      return (-1);
    lt->tm_hour = ((p) += 2, ((p)[-2] - '0') * 10 + ((p)[-1] - '0'));
    if (lt->tm_hour < 0 || lt->tm_hour > 23)
      return (-1);
    lt->tm_min = ((p) += 2, ((p)[-2] - '0') * 10 + ((p)[-1] - '0'));
    if (lt->tm_min < 0 || lt->tm_min > 59)
      return (-1);
    lt->tm_sec = ((p) += 2, ((p)[-2] - '0') * 10 + ((p)[-1] - '0'));
    if (lt->tm_sec < 0 || lt->tm_sec > 59)
      return (-1);
    break;
  default:
    return (-1);
  }
  return (type);
}
```