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     L141
  mov    %rdi,%r12
  mov    %rsi,%r14
  mov    %rdx,%r13
  mov    %ecx,%r15d
  mov    %rsi,%rax
  and    $0xfffffffffffffffd,%rax
  cmp    $0xd,%rax
  jne    L268
  test   %rdx,%rdx
  je     L168
L135:
  lea    -0x1(%r14),%rbp
  cmpb   $0x5a,-0x1(%r12,%r14,1)
  jne    L241
  mov    %r12,%rbx
  add    %r12,%rbp
L20:
  movzbl (%rbx),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  je     L112
  add    $0x1,%rbx
  cmp    %rbp,%rbx
  jne    L20
  cmp    $0xd,%r14
  je     L25
  mov    $0xffffffff,%eax
  cmp    $0xf,%r14
  jne    L142
  mov    D7(%rip),%rax
  cmp    %r15d,(%rax)
  je     L14
  lea    0x2(%r12),%rdx
  movsbl (%r12),%eax
  lea    -0xf0(%rax,%rax,4),%ecx
  movsbl 0x1(%r12),%eax
  lea    -0x30(%rax,%rcx,2),%eax
  imul   $0x64,%eax,%eax
  sub    $0x76c,%eax
  mov    %eax,0x0(%r13)
  mov    D33(%rip),%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L184
  mov    %rdx,%r12
L25:
  mov    D33(%rip),%rax
  cmp    %r15d,(%rax)
  je     L36
  mov    D7(%rip),%rax
  mov    (%rax),%eax
L15:
  movsbl (%r12),%edx
  lea    -0xf0(%rdx,%rdx,4),%ecx
  movsbl 0x1(%r12),%edx
  lea    -0x30(%rdx,%rcx,2),%edx
  add    0x0(%r13),%edx
  mov    %edx,0x0(%r13)
  mov    D7(%rip),%rcx
  cmp    %eax,(%rcx)
  jne    L295
  cmp    $0x31,%edx
  jle    L144
L295:
  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     L110
  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     L52
  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     L153
  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     L169
  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    $0x3c,%edx
  mov    $0xffffffff,%edx
  cmovae %edx,%eax
  jmp    L142
L168:
  mov    %rsp,%r13
  mov    $0x18,%edx
  mov    $0x0,%esi
  mov    %r13,%rdi
  call   <memset@plt>
  jmp    L135
L184:
  mov    %rdx,%r12
  jmp    L15
L144:
  add    $0x64,%edx
  mov    %edx,0x0(%r13)
  jmp    L295
L141:
  mov    $0xffffffff,%eax
  jmp    L142
L268:
  mov    $0xffffffff,%eax
  jmp    L142
L241:
  mov    $0xffffffff,%eax
  jmp    L142
L112:
  mov    $0xffffffff,%eax
L142:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L289
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L14:
  mov    $0xffffffff,%eax
  jmp    L142
L36:
  mov    $0xffffffff,%eax
  jmp    L142
L110:
  mov    $0xffffffff,%eax
  jmp    L142
L52:
  mov    $0xffffffff,%eax
  jmp    L142
L153:
  mov    $0xffffffff,%eax
  jmp    L142
L169:
  mov    $0xffffffff,%eax
  jmp    L142
L289:
  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);
}
```