user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<local_ns_initparse>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    -0x1c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x28(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    -0x28(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  mov    %rdx,0x8(%rax)
  mov    D134(%rip),%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  cmp    %rax,-0x8(%rbp)
  jae    L117
  mov    D84(%rip),%rax
  mov    (%rax),%edx
  mov    D60(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L154
L117:
  mov    -0x28(%rbp),%rax
  mov    0x10(%rax),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <NS_GET16@plt>
  mov    D134(%rip),%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  cmp    %rax,-0x8(%rbp)
  jae    L44
  mov    D84(%rip),%rax
  mov    (%rax),%edx
  mov    D60(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L154
L44:
  mov    -0x28(%rbp),%rax
  mov    0x18(%rax),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <NS_GET16@plt>
  movl   $0x0,-0x10(%rbp)
  jmp    L93
L97:
  mov    D134(%rip),%rax
  mov    (%rax),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  cmp    %rax,-0x8(%rbp)
  jae    L9
  mov    D84(%rip),%rax
  mov    (%rax),%edx
  mov    D60(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L154
L9:
  mov    -0x28(%rbp),%rax
  mov    0x20(%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <NS_GET16@plt>
  addl   $0x1,-0x10(%rbp)
L93:
  mov    D55(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x10(%rbp)
  jl     L97
  movl   $0x0,-0x10(%rbp)
  jmp    L4
L59:
  mov    -0x28(%rbp),%rax
  mov    0x20(%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L102
  mov    -0x28(%rbp),%rax
  mov    0x28(%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  movq   $0x0,(%rax)
  jmp    L34
L102:
  mov    -0x28(%rbp),%rax
  mov    0x20(%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rdx,%rax
  mov    (%rax),%rcx
  mov    -0x10(%rbp),%edx
  mov    -0x8(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <local_ns_skiprr@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0xc(%rbp)
  jns    L85
  mov    $0xffffffff,%eax
  jmp    L154
L85:
  mov    -0x28(%rbp),%rax
  mov    0x28(%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x3,%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%rax
  mov    %rax,(%rdx)
  mov    -0xc(%rbp),%eax
  cltq
  add    %rax,-0x18(%rbp)
L34:
  addl   $0x1,-0x10(%rbp)
L4:
  mov    D55(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x10(%rbp)
  jl     L59
  mov    -0x18(%rbp),%rax
  cmp    -0x8(%rbp),%rax
  je     L55
  mov    D84(%rip),%rax
  mov    (%rax),%edx
  mov    D60(%rip),%rax
  mov    %edx,(%rax)
  mov    $0xffffffff,%eax
  jmp    L154
L55:
  mov    D55(%rip),%rax
  mov    (%rax),%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <local_ns_setsection@plt>
  mov    $0x0,%eax
L154:
  leave
  ret
```

assistant: ```c
int local_ns_initparse(const unsigned char *msg, int msglen, ns_msg *handle) {
  const unsigned char *eom = msg + msglen;
  int i;
  handle->_msg = msg;
  handle->_eom = eom;
  if (msg + NS_INT16SZ > eom) {
    errno = EMSGSIZE;
    return -1;
  }
  NS_GET16(handle->_id, msg);
  if (msg + NS_INT16SZ > eom) {
    errno = EMSGSIZE;
    return -1;
  }
  NS_GET16(handle->_flags, msg);
  for (i = 0; i < ns_s_max; i++) {
    if (msg + NS_INT16SZ > eom) {
      errno = EMSGSIZE;
      return -1;
    }
    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 = local_ns_skiprr(msg, eom, (ns_sect)i, handle->_counts[i]);
      if (b < 0)
        return -1;
      handle->_sections[i] = msg;
      msg += b;
    }
  if (msg != eom) {
    errno = EMSGSIZE;
    return -1;
  }
  local_ns_setsection(handle, ns_s_max);
  return 0;
}
```