user: Translate the below assembly code into C programming language:

```asm
<asn1_check_tlen>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,0x8(%rsp)
  mov    %rsi,0x10(%rsp)
  mov    %rdx,0x18(%rsp)
  mov    0x98(%rsp),%r15d
  mov    0xa0(%rsp),%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  mov    (%r9),%r14
  mov    %r14,0x30(%rsp)
  cmpq   $0x0,0x80(%rsp)
  jle    L32
  mov    %rcx,%r12
  mov    %r8,%r13
  mov    %r9,%rbp
  test   %rbx,%rbx
  je     L118
  cmpl   $0x0,(%rbx)
  je     L103
  mov    0x4(%rbx),%eax
  mov    0x8(%rbx),%rdx
  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    %r14,%rdx
  mov    %rdx,0x30(%rsp)
L208:
  test   $0x80,%al
  jne    L221
  cmpl   $0x0,0x88(%rsp)
  js     L135
  mov    0x88(%rsp),%esi
  cmp    %esi,0x20(%rsp)
  je     L65
L184:
  mov    $0xffffffff,%eax
  test   %r15b,%r15b
  jne    L34
  mov    D25(%rip),%rax
  mov    (%rax),%esi
  mov    D7(%rip),%rax
  mov    (%rax),%edi
  call   <ERR_raise@plt>
  jmp    L41
L32:
  mov    D47(%rip),%rax
  mov    (%rax),%esi
  mov    D7(%rip),%rax
  mov    (%rax),%edi
  call   <ERR_raise@plt>
  jmp    L41
L221:
  mov    D56(%rip),%rax
  mov    (%rax),%esi
  mov    D7(%rip),%rax
  mov    (%rax),%edi
  call   <ERR_raise@plt>
L41:
  mov    $0x0,%eax
  test   %rbx,%rbx
  je     L34
L66:
  movl   $0x0,(%rbx)
  mov    $0x0,%eax
L34:
  mov    0x38(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L237
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L65:
  mov    0x90(%rsp),%edi
  cmp    %edi,0x24(%rsp)
  jne    L184
  test   %rbx,%rbx
  je     L135
  movl   $0x0,(%rbx)
L135:
  test   $0x1,%al
  je     L229
  sub    0x30(%rsp),%r14
  mov    0x80(%rsp),%rdi
  lea    (%r14,%rdi,1),%rdx
  mov    %rdx,0x28(%rsp)
L229:
  test   %r12,%r12
  je     L210
  mov    %eax,%edx
  and    $0x1,%edx
  mov    %dl,(%r12)
L210:
  test   %r13,%r13
  je     L76
  mov    D83(%rip),%rdx
  and    (%rdx),%al
  mov    %al,0x0(%r13)
L76:
  mov    0x8(%rsp),%rsi
  test   %rsi,%rsi
  je     L226
  mov    0x28(%rsp),%rax
  mov    %rax,(%rsi)
L226:
  mov    0x18(%rsp),%rdi
  test   %rdi,%rdi
  je     L187
  mov    0x24(%rsp),%eax
  mov    %al,(%rdi)
L187:
  mov    0x10(%rsp),%rcx
  test   %rcx,%rcx
  je     L83
  mov    0x20(%rsp),%eax
  mov    %eax,(%rcx)
L83:
  mov    0x30(%rsp),%rax
  mov    %rax,0x0(%rbp)
  mov    $0x1,%eax
  jmp    L34
L103:
  lea    0x24(%rsp),%rcx
  lea    0x20(%rsp),%rdx
  lea    0x28(%rsp),%rsi
  lea    0x30(%rsp),%rdi
  mov    0x80(%rsp),%r8
  call   <ASN1_get_object@plt>
  mov    %eax,0x4(%rbx)
  mov    0x28(%rsp),%rcx
  mov    %rcx,0x8(%rbx)
  mov    0x24(%rsp),%edx
  mov    %edx,0x10(%rbx)
  mov    0x20(%rsp),%edx
  mov    %edx,0x14(%rbx)
  mov    0x30(%rsp),%rdx
  sub    %r14,%rdx
  mov    %edx,0x18(%rbx)
  movl   $0x1,(%rbx)
  test   $0x81,%al
  jne    L208
  movslq %edx,%rdx
  add    %rcx,%rdx
  cmp    0x80(%rsp),%rdx
  jle    L208
  mov    D49(%rip),%rax
  mov    (%rax),%esi
  mov    D7(%rip),%rax
  mov    (%rax),%edi
  call   <ERR_raise@plt>
  jmp    L66
L118:
  lea    0x24(%rsp),%rcx
  lea    0x20(%rsp),%rdx
  lea    0x28(%rsp),%rsi
  lea    0x30(%rsp),%rdi
  mov    0x80(%rsp),%r8
  call   <ASN1_get_object@plt>
  jmp    L208
L237:
  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;
}
```