user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<ns_initparse>:
  endbr64
  push   %r15
  movslq %esi,%rsi
  mov    %rdx,%r15
  mov    $0x30,%edx
  push   %r14
  push   %r13
  lea    (%rdi,%rsi,4),%r13
  mov    $0x5e,%esi
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  mov    %r15,%rdi
  push   %rbx
  sub    $0x8,%rsp
  call   <memset@plt>
  mov    D27(%rip),%r14
  mov    %rbp,0x28(%r15)
  mov    %r13,0x20(%r15)
  movslq (%r14),%rax
  lea    0x0(%rbp,%rax,4),%rax
  cmp    %rax,%r13
  jb     L103
  mov    (%r15),%rdi
  mov    %rbp,%rsi
  call   <NS_GET16@plt>
  movslq (%r14),%rax
  lea    0x0(%rbp,%rax,4),%rax
  cmp    %rax,%r13
  jb     L103
  mov    0x8(%r15),%rdi
  mov    %rbp,%rsi
  call   <NS_GET16@plt>
  mov    D33(%rip),%r12
  mov    (%r12),%esi
  test   %esi,%esi
  jle    L129
  xor    %ebx,%ebx
  jmp    L8
  nopl   0x0(%rax,%rax,1)
L32:
  mov    0x10(%r15),%rax
  mov    %rbp,%rsi
  mov    (%rax,%rbx,8),%rdi
  add    $0x1,%rbx
  call   <NS_GET16@plt>
  mov    (%r12),%esi
  cmp    %ebx,%esi
  jle    L71
L8:
  movslq (%r14),%rax
  lea    0x0(%rbp,%rax,4),%rax
  cmp    %rax,%r13
  jae    L32
L103:
  mov    D23(%rip),%rax
  mov    (%rax),%edx
  mov    D11(%rip),%rax
  mov    %edx,(%rax)
  add    $0x8,%rsp
  mov    $0xffffffff,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L71:
  test   %esi,%esi
  jle    L129
  xor    %ebx,%ebx
  jmp    L98
  nopl   0x0(%rax,%rax,1)
L38:
  mov    0x18(%r15),%rax
  mov    (%r12),%esi
  movq   $0x0,(%rax,%rbx,8)
  add    $0x1,%rbx
  cmp    %ebx,%esi
  jle    L129
L98:
  mov    0x10(%r15),%rax
  mov    %ebx,%edx
  lea    0x0(,%rbx,8),%r14
  mov    (%rax,%rbx,8),%rcx
  test   %rcx,%rcx
  je     L38
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <ns_skiprr@plt>
  test   %eax,%eax
  js     L16
  mov    0x18(%r15),%rdx
  mov    (%r12),%esi
  cltq
  add    $0x1,%rbx
  mov    %rbp,(%rdx,%r14,1)
  lea    0x0(%rbp,%rax,4),%rbp
  cmp    %ebx,%esi
  jg     L98
L129:
  cmp    %rbp,%r13
  jne    L103
  mov    %r15,%rdi
  call   <setsection@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L16:
  add    $0x8,%rsp
  mov    $0xffffffff,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
int ns_initparse(const u_char *msg, int msglen, ns_msg *handle) {
  const u_char *eom = msg + msglen;
  int i;
  memset(handle, 0x5e, sizeof *handle);
  handle->_msg = msg;
  handle->_eom = eom;
  if (msg + NS_INT16SZ > eom)
    do {
      errno = (EMSGSIZE);
      return (-1);
    } while (0);
  NS_GET16(handle->_id, msg);
  if (msg + NS_INT16SZ > eom)
    do {
      errno = (EMSGSIZE);
      return (-1);
    } while (0);
  NS_GET16(handle->_flags, msg);
  for (i = 0; i < ns_s_max; i++) {
    if (msg + NS_INT16SZ > eom)
      do {
        errno = (EMSGSIZE);
        return (-1);
      } while (0);
    NS_GET16(handle->_counts[i], msg);
  }
  for (i = 0; i < ns_s_max; i++)
    if (handle->_counts[i] == 0)
      handle->_sections[i] = NULL;
    else {
      int b = ns_skiprr(msg, eom, (ns_sect)i, handle->_counts[i]);
      if (b < 0)
        return (-1);
      handle->_sections[i] = msg;
      msg += b;
    }
  if (msg != eom)
    do {
      errno = (EMSGSIZE);
      return (-1);
    } while (0);
  setsection(handle, ns_s_max);
  return (0);
}
```