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

```asm
<ns_parserr>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  test   %esi,%esi
  js     L61
  mov    %rdi,%rbx
  mov    %esi,%ebp
  mov    %edx,%r13d
  mov    %rcx,%r12
  mov    D13(%rip),%rax
  cmp    %esi,(%rax)
  jle    L61
  cmp    %esi,(%rdi)
  jne    L171
L58:
  cmp    $0xffffffff,%r13d
  je     L175
L125:
  test   %r13d,%r13d
  js     L129
  movslq %ebp,%r14
  mov    0x8(%rbx),%rax
  cmp    %r13d,(%rax,%r14,4)
  jle    L129
  cmp    %r13d,0x4(%rbx)
  jg     L194
L241:
  mov    0x4(%rbx),%eax
  cmp    %r13d,%eax
  jge    L198
  mov    %r13d,%ecx
  sub    %eax,%ecx
  mov    0x14(%rbx),%esi
  mov    0x10(%rbx),%edi
  mov    %ebp,%edx
  call   <ns_skiprr@plt>
  test   %eax,%eax
  js     L193
  add    %eax,0x10(%rbx)
  mov    %r13d,0x4(%rbx)
L198:
  mov    0x20(%r12),%ecx
  mov    0x10(%rbx),%edx
  mov    0x14(%rbx),%esi
  mov    0x18(%rbx),%edi
  mov    D87(%rip),%rax
  mov    (%rax),%r8d
  call   <dn_expand@plt>
  mov    %eax,%esi
  test   %eax,%eax
  js     L57
  add    0x10(%rbx),%esi
  mov    %esi,0x10(%rbx)
  mov    D30(%rip),%rax
  mov    (%rax),%eax
  lea    (%rsi,%rax,2),%eax
  cmp    0x14(%rbx),%eax
  jg     L217
  mov    (%r12),%edi
  call   <NS_GET16@plt>
  mov    0x10(%rbx),%esi
  mov    0x4(%r12),%edi
  call   <NS_GET16@plt>
  mov    D85(%rip),%rax
  cmp    %ebp,(%rax)
  je     L102
  mov    0x10(%rbx),%esi
  mov    D45(%rip),%rax
  mov    %esi,%ecx
  add    (%rax),%ecx
  mov    %ecx,%eax
  mov    D30(%rip),%rdx
  add    (%rdx),%eax
  cmp    0x14(%rbx),%eax
  jg     L143
  mov    0x18(%r12),%rdi
  call   <NS_GET32@plt>
  mov    0x10(%rbx),%esi
  mov    0x8(%r12),%edi
  call   <NS_GET16@plt>
  mov    0x10(%rbx),%eax
  mov    0x8(%r12),%edx
  lea    (%rax,%rdx,1),%ecx
  cmp    0x14(%rbx),%ecx
  jg     L144
  cltq
  mov    %rax,0x10(%r12)
  add    %edx,0x10(%rbx)
L68:
  mov    0x4(%rbx),%eax
  add    $0x1,%eax
  mov    %eax,0x4(%rbx)
  mov    0x8(%rbx),%rcx
  mov    $0x0,%edx
  cmp    (%rcx,%r14,4),%eax
  jg     L140
L67:
  mov    %edx,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L61:
  mov    D149(%rip),%rax
  mov    (%rax),%edx
  mov    D84(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%edx
  jmp    L67
L171:
  call   <setsection@plt>
  jmp    L58
L175:
  mov    0x4(%rbx),%r13d
  jmp    L125
L129:
  mov    D149(%rip),%rax
  mov    (%rax),%edx
  mov    D84(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%edx
  jmp    L67
L194:
  mov    %ebp,%esi
  mov    %rbx,%rdi
  call   <setsection@plt>
  jmp    L241
L217:
  mov    D42(%rip),%rax
  mov    (%rax),%edx
  mov    D84(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%edx
  jmp    L67
L102:
  movq   $0x0,0x18(%r12)
  movl   $0x0,0x8(%r12)
  movq   $0x0,0x10(%r12)
  jmp    L68
L143:
  mov    D42(%rip),%rax
  mov    (%rax),%edx
  mov    D84(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%edx
  jmp    L67
L144:
  mov    D42(%rip),%rax
  mov    (%rax),%edx
  mov    D84(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%edx
  jmp    L67
L140:
  lea    0x1(%rbp),%esi
  mov    %rbx,%rdi
  call   <setsection@plt>
  mov    $0x0,%edx
  jmp    L67
L193:
  mov    $0xffffffff,%edx
  jmp    L67
L57:
  mov    $0xffffffff,%edx
  jmp    L67
```

assistant: ```c
int ns_parserr(ns_msg *handle, ns_sect section, int rrnum, ns_rr *rr) {
  int b;
  int tmp;
  tmp = section;
  if (tmp < 0 || section >= ns_s_max)
    do {
      errno = (ENODEV);
      return (-1);
    } while (0);
  if (section != handle->_sect)
    setsection(handle, section);
  if (rrnum == -1)
    rrnum = handle->_rrnum;
  if (rrnum < 0 || rrnum >= handle->_counts[(int)section])
    do {
      errno = (ENODEV);
      return (-1);
    } while (0);
  if (rrnum < handle->_rrnum)
    setsection(handle, section);
  if (rrnum > handle->_rrnum) {
    b = ns_skiprr(handle->_msg_ptr, handle->_eom, section, rrnum - handle->_rrnum);
    if (b < 0)
      return (-1);
    handle->_msg_ptr += b;
    handle->_rrnum = rrnum;
  }
  b = dn_expand(handle->_msg, handle->_eom, handle->_msg_ptr, rr->name, NS_MAXDNAME);
  if (b < 0)
    return (-1);
  handle->_msg_ptr += b;
  if (handle->_msg_ptr + NS_INT16SZ + NS_INT16SZ > handle->_eom)
    do {
      errno = (EMSGSIZE);
      return (-1);
    } while (0);
  NS_GET16(rr->type, handle->_msg_ptr);
  NS_GET16(rr->rr_class, handle->_msg_ptr);
  if (section == ns_s_qd) {
    rr->ttl = 0;
    rr->rdlength = 0;
    rr->rdata = NULL;
  } else {
    if (handle->_msg_ptr + NS_INT32SZ + NS_INT16SZ > handle->_eom)
      do {
        errno = (EMSGSIZE);
        return (-1);
      } while (0);
    NS_GET32(rr->ttl, handle->_msg_ptr);
    NS_GET16(rr->rdlength, handle->_msg_ptr);
    if (handle->_msg_ptr + rr->rdlength > handle->_eom)
      do {
        errno = (EMSGSIZE);
        return (-1);
      } while (0);
    rr->rdata = handle->_msg_ptr;
    handle->_msg_ptr += rr->rdlength;
  }
  if (++handle->_rrnum > handle->_counts[(int)section])
    setsection(handle, (ns_sect)((int)section + 1));
  return (0);
}
```