user: 请从给定的汇编指令推导出C源代码:

```asm
<ns_initparse>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%rbp
  mov    %rdx,%r12
  movslq %esi,%rsi
  lea    (%rdi,%rsi,4),%r13
  mov    $0x30,%edx
  mov    $0x5e,%esi
  mov    %r12,%rdi
  call   <memset@plt>
  mov    %rbp,0x28(%r12)
  mov    %r13,0x20(%r12)
  mov    D136(%rip),%rax
  movslq (%rax),%rax
  lea    0x0(%rbp,%rax,4),%rax
  cmp    %rax,%r13
  jb     L9
  mov    %rbp,%rsi
  mov    (%r12),%rdi
  call   <NS_GET16@plt>
  mov    D136(%rip),%rax
  movslq (%rax),%rax
  lea    0x0(%rbp,%rax,4),%rax
  cmp    %rax,%r13
  jb     L66
  mov    0x8(%r12),%rdi
  mov    %rbp,%rsi
  call   <NS_GET16@plt>
  mov    D54(%rip),%rax
  mov    (%rax),%esi
  test   %esi,%esi
  jle    L135
  mov    $0x0,%ebx
  mov    D136(%rip),%r14
L28:
  movslq (%r14),%rax
  lea    0x0(%rbp,%rax,4),%rax
  cmp    %rax,%r13
  jb     L35
  mov    0x10(%r12),%rax
  mov    (%rax,%rbx,8),%rdi
  mov    %rbp,%rsi
  call   <NS_GET16@plt>
  mov    D54(%rip),%rax
  mov    (%rax),%esi
  add    $0x1,%rbx
  cmp    %ebx,%esi
  jg     L28
  test   %esi,%esi
  jle    L135
  mov    $0x0,%ebx
  jmp    L2
L9:
  mov    D135(%rip),%rax
  mov    (%rax),%edx
  mov    D55(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L36
L66:
  mov    D135(%rip),%rax
  mov    (%rax),%edx
  mov    D55(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L36
L35:
  mov    D135(%rip),%rax
  mov    (%rax),%edx
  mov    D55(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
L36:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L38:
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <ns_skiprr@plt>
  test   %eax,%eax
  js     L42
  mov    0x18(%r12),%rdx
  mov    %rbp,(%rdx,%r14,1)
  cltq
  lea    0x0(%rbp,%rax,4),%rbp
L111:
  mov    D54(%rip),%rax
  mov    (%rax),%esi
  add    $0x1,%rbx
  cmp    %ebx,%esi
  jle    L135
L2:
  mov    %ebx,%edx
  lea    0x0(,%rbx,8),%r14
  mov    0x10(%r12),%rax
  mov    (%rax,%rbx,8),%rcx
  test   %rcx,%rcx
  jne    L38
  mov    0x18(%r12),%rax
  movq   $0x0,(%rax,%rbx,8)
  jmp    L111
L135:
  cmp    %rbp,%r13
  jne    L45
  mov    %r12,%rdi
  call   <setsection@plt>
  mov    $0x0,%eax
  jmp    L36
L45:
  mov    D135(%rip),%rax
  mov    (%rax),%edx
  mov    D55(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L36
L42:
  mov    $0xffffffff,%eax
  jmp    L36
```

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);
}
```