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

```asm
<bytes_to_base32hex>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %rcx,-0x40(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x18(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <base32hex_len@plt>
  add    $0x1,%eax
  cltq
  cmp    %rax,-0x30(%rbp)
  je     L137
  mov    $0x0,%eax
  jmp    L122
L0:
  cmpl   $0x4,-0x18(%rbp)
  ja     L57
  mov    -0x18(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  lea    D1(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D1(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  mov    -0x10(%rbp),%rax
  mov    (%rax),%eax
  sar    $0x3,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x10(%rbp),%rax
  mov    (%rax),%eax
  lea    0x0(,%rax,4),%edx
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  and    $0x1c,%edx
  mov    %edx,(%rax)
  jmp    L57
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  mov    (%rax),%edx
  mov    -0x10(%rbp),%rax
  mov    (%rax),%eax
  sar    $0x6,%eax
  and    $0x3,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  or     %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x10(%rbp),%rax
  mov    (%rax),%eax
  sar    %eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x8,%rax
  and    $0x1f,%edx
  mov    %edx,(%rax)
  mov    -0x10(%rbp),%rax
  mov    (%rax),%eax
  shl    $0x4,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0xc,%rax
  and    $0x10,%edx
  mov    %edx,(%rax)
  jmp    L57
  mov    -0x8(%rbp),%rax
  add    $0xc,%rax
  mov    (%rax),%edx
  mov    -0x10(%rbp),%rax
  mov    (%rax),%eax
  sar    $0x4,%eax
  and    $0xf,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  add    $0xc,%rax
  or     %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x10(%rbp),%rax
  mov    (%rax),%eax
  lea    (%rax,%rax,1),%edx
  mov    -0x8(%rbp),%rax
  add    $0x10,%rax
  and    $0x1e,%edx
  mov    %edx,(%rax)
  jmp    L57
  mov    -0x8(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%edx
  mov    -0x10(%rbp),%rax
  mov    (%rax),%eax
  sar    $0x7,%eax
  and    $0x1,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  add    $0x10,%rax
  or     %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x10(%rbp),%rax
  mov    (%rax),%eax
  sar    $0x2,%eax
  mov    %eax,%edx
  mov    -0x8(%rbp),%rax
  add    $0x14,%rax
  and    $0x1f,%edx
  mov    %edx,(%rax)
  mov    -0x10(%rbp),%rax
  mov    (%rax),%eax
  lea    0x0(,%rax,8),%edx
  mov    -0x8(%rbp),%rax
  add    $0x18,%rax
  and    $0x18,%edx
  mov    %edx,(%rax)
  jmp    L57
  mov    -0x8(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%edx
  mov    -0x10(%rbp),%rax
  mov    (%rax),%eax
  sar    $0x5,%eax
  and    $0x7,%eax
  mov    %eax,%ecx
  mov    -0x8(%rbp),%rax
  add    $0x18,%rax
  or     %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x10(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x8(%rbp),%rax
  add    $0x1c,%rax
  and    $0x1f,%edx
  mov    %edx,(%rax)
  nop
L57:
  subq   $0x1,-0x40(%rbp)
  addq   $0x4,-0x10(%rbp)
  addl   $0x1,-0x18(%rbp)
  cmpl   $0x5,-0x18(%rbp)
  jne    L137
  addq   $0x20,-0x8(%rbp)
  movl   $0x0,-0x18(%rbp)
L137:
  cmpq   $0x0,-0x40(%rbp)
  jne    L0
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  subq   $0x1,-0x30(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L118
L6:
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x9,%eax
  jg     L149
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  lea    0x30(%rax),%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L47
L149:
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  cmp    $0x1f,%eax
  jg     L103
  mov    -0x8(%rbp),%rax
  mov    (%rax),%eax
  lea    0x57(%rax),%edx
  mov    -0x8(%rbp),%rax
  mov    %edx,(%rax)
  jmp    L47
L103:
  mov    -0x8(%rbp),%rax
  movl   $0x3f,(%rax)
L47:
  addq   $0x4,-0x8(%rbp)
  addl   $0x1,-0x14(%rbp)
L118:
  mov    -0x14(%rbp),%eax
  cltq
  cmp    %rax,-0x30(%rbp)
  ja     L6
  mov    -0x28(%rbp),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x28(%rbp),%rax
L122:
  leave
  ret
```

assistant: ```c
char *bytes_to_base32hex(char dst[], size_t dstsize, const uint8_t *src, size_t srcsize) {
  const uint8_t *s = src;
  int byte = 0;
  uint8_t *d = (uint8_t *)dst;
  int i;
  if (dstsize != (base32hex_len(srcsize) + 1)) {
    return NULL;
  }
  while (srcsize) {
    switch (byte) {
    case 0:
      d[0] = *s >> 3;
      d[1] = (*s & 0x07) << 2;
      break;
    case 1:
      d[1] |= (*s >> 6) & 0x03;
      d[2] = (*s >> 1) & 0x1f;
      d[3] = (*s & 0x01) << 4;
      break;
    case 2:
      d[3] |= (*s >> 4) & 0x0f;
      d[4] = (*s & 0x0f) << 1;
      break;
    case 3:
      d[4] |= (*s >> 7) & 0x01;
      d[5] = (*s >> 2) & 0x1f;
      d[6] = (*s & 0x03) << 3;
      break;
    case 4:
      d[6] |= (*s >> 5) & 0x07;
      d[7] = *s & 0x1f;
      break;
    }
    srcsize--;
    s++;
    byte++;
    if (byte == 5) {
      d += 8;
      byte = 0;
    }
  }
  d = (uint8_t *)dst;
  dstsize--;
  for (i = 0; i < dstsize; i++) {
    if (*d < 10) {
      *d = *d + '0';
    } else if (*d < 32) {
      *d = *d - 10 + 'a';
    } else {
      *d = '?';
    }
    d++;
  }
  dst[dstsize] = '\0';
  return dst;
}
```