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

```asm
<ns_parserr>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  test   %rsi,%rsi
  js     L163
  mov    %rdi,%rbx
  mov    %rsi,%rbp
  mov    %edx,%r13d
  mov    %rcx,%r12
  mov    D105(%rip),%rax
  cmp    %rsi,(%rax)
  jle    L163
  cmp    %esi,0x30(%rdi)
  je     L23
  mov    %rsi,0x30(%rdi)
  movl   $0x0,(%rdi)
  movslq %esi,%rax
  mov    0x10(%rdi),%rdx
  mov    (%rdx,%rax,8),%rax
  mov    %rax,0x8(%rdi)
L23:
  cmp    $0xffffffff,%r13d
  je     L203
L172:
  test   %r13d,%r13d
  js     L163
  movslq %ebp,%rax
  mov    0x18(%rbx),%rdx
  cmp    %r13d,(%rdx,%rax,4)
  jle    L163
  cmp    %r13d,(%rbx)
  jle    L208
  movl   $0x0,(%rbx)
  mov    0x10(%rbx),%rdx
  mov    (%rdx,%rax,8),%rax
  mov    %rax,0x8(%rbx)
L208:
  mov    %r13d,%ecx
  sub    (%rbx),%ecx
  mov    0x20(%rbx),%rsi
  mov    0x28(%rbx),%edi
  mov    %rbp,%rdx
  call   <skiprr@plt>
  test   %eax,%eax
  js     L102
  movslq %eax,%rdx
  add    0x8(%rbx),%rdx
  mov    %rdx,0x8(%rbx)
  mov    %r13d,(%rbx)
  mov    0x20(%r12),%ecx
  mov    0x20(%rbx),%rsi
  mov    0x28(%rbx),%edi
  mov    D91(%rip),%rax
  mov    (%rax),%r8d
  call   <dn_expand@plt>
  test   %eax,%eax
  js     L115
  movslq %eax,%rsi
  add    0x8(%rbx),%rsi
  mov    %rsi,0x8(%rbx)
  mov    D85(%rip),%rax
  movslq (%rax),%rax
  add    %rsi,%rax
  cmp    0x20(%rbx),%rax
  jg     L124
  mov    (%r12),%edi
  call   <NS_GET16@plt>
  mov    0x8(%rbx),%rsi
  mov    D85(%rip),%rax
  movslq (%rax),%rax
  add    %rsi,%rax
  cmp    0x20(%rbx),%rax
  jg     L124
  mov    0x4(%r12),%edi
  call   <NS_GET16@plt>
  mov    D97(%rip),%rax
  cmp    %rbp,(%rax)
  je     L43
  mov    0x8(%rbx),%rsi
  mov    D74(%rip),%rax
  movslq (%rax),%rax
  add    %rsi,%rax
  cmp    0x20(%rbx),%rax
  jg     L124
  mov    0x18(%r12),%rdi
  call   <NS_GET32@plt>
  mov    0x8(%rbx),%rsi
  mov    D85(%rip),%rax
  movslq (%rax),%rax
  add    %rsi,%rax
  cmp    0x20(%rbx),%rax
  jg     L124
  mov    0x8(%r12),%edi
  call   <NS_GET16@plt>
  mov    0x8(%rbx),%rdx
  movslq 0x8(%r12),%rax
  lea    (%rdx,%rax,1),%rcx
  cmp    0x20(%rbx),%rcx
  jg     L124
  mov    %rdx,0x10(%r12)
  add    %rax,0x8(%rbx)
L20:
  addl   $0x1,(%rbx)
  mov    $0x0,%eax
L95:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L203:
  mov    (%rbx),%r13d
  jmp    L172
L43:
  movq   $0x0,0x18(%r12)
  movl   $0x0,0x8(%r12)
  movq   $0x0,0x10(%r12)
  jmp    L20
L163:
  mov    D57(%rip),%rax
  mov    (%rax),%edx
  mov    D28(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L95
L124:
  mov    D72(%rip),%rax
  mov    (%rax),%edx
  mov    D28(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L95
L102:
  mov    $0xffffffff,%eax
  jmp    L95
L115:
  mov    $0xffffffff,%eax
  jmp    L95
```

assistant: ```c
int ns_parserr(ns_msg *handle, ns_sect section, int rrnum, ns_rr *rr) {
  int b;
  if (section < 0 || section >= ns_s_max)
    goto enodev;
  if ((int)section != (int)handle->_sect) {
    handle->_sect = section;
    handle->_rrnum = 0;
    handle->_msg_ptr = handle->_sections[(int)section];
  }
  if (rrnum == -1)
    rrnum = handle->_rrnum;
  if (rrnum < 0 || rrnum >= handle->_counts[(int)section])
    goto enodev;
  if (rrnum < handle->_rrnum) {
    handle->_rrnum = 0;
    handle->_msg_ptr = handle->_sections[(int)section];
  }
  b = skiprr(handle->_msg, 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 > handle->_eom)
    goto emsgsize;
  NS_GET16(rr->type, handle->_msg_ptr);
  if (handle->_msg_ptr + NS_INT16SZ > handle->_eom)
    goto emsgsize;
  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 > handle->_eom)
      goto emsgsize;
    NS_GET32(rr->ttl, handle->_msg_ptr);
    if (handle->_msg_ptr + NS_INT16SZ > handle->_eom)
      goto emsgsize;
    NS_GET16(rr->rdlength, handle->_msg_ptr);
    if (handle->_msg_ptr + rr->rdlength > handle->_eom)
      goto emsgsize;
    rr->rdata = handle->_msg_ptr;
    handle->_msg_ptr += rr->rdlength;
  }
  handle->_rrnum++;
  return (0);
enodev:
  errno = ENODEV;
  return (-1);
emsgsize:
  errno = EMSGSIZE;
  return (-1);
}
```