user: 请将以下的汇编代码转换成C语言代码：

```asm
<asn1_check_tlen>:
  endbr64
  push   %r15
  mov    %r8,%r10
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %r9,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    (%r9),%r9
  mov    0x80(%rsp),%r8
  mov    0x98(%rsp),%r11d
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  mov    0xa0(%rsp),%rbx
  mov    %r9,0x30(%rsp)
  test   %r8,%r8
  jle    L62
  mov    %rdi,%r12
  mov    %rsi,%r13
  mov    %rdx,%r14
  mov    %rcx,%r15
  test   %rbx,%rbx
  je     L79
  mov    (%rbx),%ecx
  test   %ecx,%ecx
  je     L232
  mov    0x8(%rbx),%rdx
  mov    0x4(%rbx),%eax
  mov    %rdx,0x28(%rsp)
  mov    0x10(%rbx),%edx
  mov    %edx,0x24(%rsp)
  mov    0x14(%rbx),%edx
  mov    %edx,0x20(%rsp)
  movslq 0x18(%rbx),%rdx
  add    %r9,%rdx
  mov    %rdx,0x30(%rsp)
L2:
  test   $0x80,%al
  jne    L258
  mov    0x88(%rsp),%edx
  test   %edx,%edx
  js     L243
  mov    0x88(%rsp),%esi
  cmp    %esi,0x20(%rsp)
  je     L154
L256:
  mov    $0xffffffff,%eax
  test   %r11b,%r11b
  je     L246
L81:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L18
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L232:
  lea    0x24(%rsp),%rcx
  lea    0x20(%rsp),%rdx
  mov    %r11d,0x1c(%rsp)
  lea    0x28(%rsp),%rsi
  lea    0x30(%rsp),%rdi
  mov    %r10,0x10(%rsp)
  mov    %r9,0x8(%rsp)
  mov    %r8,0x80(%rsp)
  call   <ASN1_get_object@plt>
  movd   0x24(%rsp),%xmm0
  movd   0x20(%rsp),%xmm1
  movl   $0x1,(%rbx)
  mov    0x30(%rsp),%rdx
  mov    0x8(%rsp),%r9
  mov    %eax,0x4(%rbx)
  mov    0x28(%rsp),%rcx
  punpckldq %xmm1,%xmm0
  mov    0x10(%rsp),%r10
  sub    %r9,%rdx
  test   $0x81,%al
  mov    0x80(%rsp),%r8
  mov    0x1c(%rsp),%r11d
  mov    %rcx,0x8(%rbx)
  mov    %edx,0x18(%rbx)
  movq   %xmm0,0x10(%rbx)
  jne    L2
  movslq %edx,%rdx
  add    %rcx,%rdx
  cmp    %r8,%rdx
  jle    L2
  mov    D57(%rip),%rax
  mov    (%rax),%esi
  mov    D15(%rip),%rax
  mov    (%rax),%edi
  call   <ERR_raise@plt>
  jmp    L218
  nopl   0x0(%rax)
L154:
  mov    0x90(%rsp),%edi
  cmp    %edi,0x24(%rsp)
  jne    L256
  test   %rbx,%rbx
  je     L243
  movl   $0x0,(%rbx)
  nopl   0x0(%rax)
L243:
  mov    0x30(%rsp),%rdx
  test   $0x1,%al
  jne    L65
L242:
  test   %r15,%r15
  je     L212
  mov    %eax,%ecx
  and    $0x1,%ecx
  mov    %cl,(%r15)
L212:
  test   %r10,%r10
  je     L235
  mov    D44(%rip),%rcx
  and    (%rcx),%al
  mov    %al,(%r10)
L235:
  test   %r12,%r12
  je     L76
  mov    0x28(%rsp),%rax
  mov    %rax,(%r12)
L76:
  test   %r14,%r14
  je     L104
  mov    0x24(%rsp),%eax
  mov    %al,(%r14)
L104:
  test   %r13,%r13
  je     L137
  mov    0x20(%rsp),%eax
  mov    %eax,0x0(%r13)
L137:
  mov    %rdx,0x0(%rbp)
  mov    $0x1,%eax
  jmp    L81
  nopl   0x0(%rax)
L65:
  mov    %rdx,%rcx
  sub    %r9,%rcx
  sub    %rcx,%r8
  mov    %r8,0x28(%rsp)
  jmp    L242
L258:
  mov    D29(%rip),%rax
  mov    (%rax),%esi
  mov    D15(%rip),%rax
  mov    (%rax),%edi
  call   <ERR_raise@plt>
L214:
  xor    %eax,%eax
  test   %rbx,%rbx
  je     L81
L218:
  movl   $0x0,(%rbx)
  xor    %eax,%eax
  jmp    L81
  nop
L62:
  mov    D84(%rip),%rax
  mov    (%rax),%esi
  mov    D15(%rip),%rax
  mov    (%rax),%edi
  call   <ERR_raise@plt>
  jmp    L214
  nopl   0x0(%rax)
L79:
  lea    0x24(%rsp),%rcx
  lea    0x20(%rsp),%rdx
  mov    %r11d,0x1c(%rsp)
  lea    0x28(%rsp),%rsi
  lea    0x30(%rsp),%rdi
  mov    %r10,0x10(%rsp)
  mov    %r9,0x8(%rsp)
  mov    %r8,0x80(%rsp)
  call   <ASN1_get_object@plt>
  mov    0x8(%rsp),%r9
  mov    0x10(%rsp),%r10
  mov    0x80(%rsp),%r8
  mov    0x1c(%rsp),%r11d
  jmp    L2
  nopl   0x0(%rax)
L246:
  mov    D36(%rip),%rax
  mov    (%rax),%esi
  mov    D15(%rip),%rax
  mov    (%rax),%edi
  call   <ERR_raise@plt>
  jmp    L214
L18:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int asn1_check_tlen(long *olen, int *otag, unsigned char *oclass, char *inf, char *cst, const unsigned char **in, long len, int exptag, int expclass, char opt, ASN1_TLC *ctx) {
  int i;
  int ptag, pclass;
  long plen;
  const unsigned char *p, *q;
  p = *in;
  q = p;
  if (len <= 0) {
    ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_SMALL);
    goto err;
  }
  if (ctx != NULL && ctx->valid) {
    i = ctx->ret;
    plen = ctx->plen;
    pclass = ctx->pclass;
    ptag = ctx->ptag;
    p += ctx->hdrlen;
  } else {
    i = ASN1_get_object(&p, &plen, &ptag, &pclass, len);
    if (ctx != NULL) {
      ctx->ret = i;
      ctx->plen = plen;
      ctx->pclass = pclass;
      ctx->ptag = ptag;
      ctx->hdrlen = p - q;
      ctx->valid = 1;
      if ((i & 0x81) == 0 && (plen + ctx->hdrlen) > len) {
        ERR_raise(ERR_LIB_ASN1, ASN1_R_TOO_LONG);
        goto err;
      }
    }
  }
  if ((i & 0x80) != 0) {
    ERR_raise(ERR_LIB_ASN1, ASN1_R_BAD_OBJECT_HEADER);
    goto err;
  }
  if (exptag >= 0) {
    if (exptag != ptag || expclass != pclass) {
      if (opt != 0)
        return -1;
      ERR_raise(ERR_LIB_ASN1, ASN1_R_WRONG_TAG);
      goto err;
    }
    do {
      if ((ctx) != NULL)
        (ctx)->valid = 0;
    } while (0);
  }
  if ((i & 1) != 0)
    plen = len - (p - q);
  if (inf != NULL)
    *inf = i & 1;
  if (cst != NULL)
    *cst = i & V_ASN1_CONSTRUCTED;
  if (olen != NULL)
    *olen = plen;
  if (oclass != NULL)
    *oclass = pclass;
  if (otag != NULL)
    *otag = ptag;
  *in = p;
  return 1;
err:
  do {
    if ((ctx) != NULL)
      (ctx)->valid = 0;
  } while (0);
  return 0;
}
```