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

```asm
<local_ns_initparse>:
  endbr64
  push   %r15
  movslq %esi,%rsi
  movq   %rdi,%xmm0
  push   %r14
  push   %r13
  push   %r12
  lea    (%rdi,%rsi,1),%r12
  push   %rbp
  movq   %r12,%xmm1
  push   %rbx
  punpcklqdq %xmm1,%xmm0
  sub    $0x8,%rsp
  mov    D25(%rip),%rbx
  movups %xmm0,(%rdx)
  movslq (%rbx),%rax
  add    %rdi,%rax
  cmp    %rax,%r12
  jb     L42
  mov    %rdi,%rbp
  mov    0x10(%rdx),%rdi
  mov    %rdx,%r15
  mov    %rbp,%rsi
  call   <NS_GET16@plt>
  movslq (%rbx),%rax
  add    %rbp,%rax
  cmp    %rax,%r12
  jb     L42
  mov    0x18(%r15),%rdi
  mov    %rbp,%rsi
  call   <NS_GET16@plt>
  mov    D38(%rip),%r13
  mov    0x0(%r13),%esi
  test   %esi,%esi
  jle    L73
  xor    %r14d,%r14d
  jmp    L57
  nopl   (%rax)
L121:
  mov    0x20(%r15),%rax
  mov    %rbp,%rsi
  mov    (%rax,%r14,8),%rdi
  add    $0x1,%r14
  call   <NS_GET16@plt>
  mov    0x0(%r13),%esi
  cmp    %r14d,%esi
  jle    L117
L57:
  movslq (%rbx),%rax
  add    %rbp,%rax
  cmp    %rax,%r12
  jae    L121
L42:
  mov    D35(%rip),%rax
  mov    (%rax),%edx
  mov    D8(%rip),%rax
  mov    %edx,(%rax)
  add    $0x8,%rsp
  mov    $0xffffffff,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L117:
  test   %esi,%esi
  jle    L73
  xor    %ebx,%ebx
  jmp    L44
  nopl   0x0(%rax,%rax,1)
L104:
  mov    0x28(%r15),%rax
  mov    0x0(%r13),%esi
  movq   $0x0,(%rax,%rbx,8)
  add    $0x1,%rbx
  cmp    %ebx,%esi
  jle    L73
L44:
  mov    0x20(%r15),%rax
  mov    %ebx,%edx
  lea    0x0(,%rbx,8),%r14
  mov    (%rax,%rbx,8),%rcx
  test   %rcx,%rcx
  je     L104
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <local_ns_skiprr@plt>
  test   %eax,%eax
  js     L81
  mov    0x28(%r15),%rdx
  mov    0x0(%r13),%esi
  cltq
  add    $0x1,%rbx
  mov    %rbp,(%rdx,%r14,1)
  add    %rax,%rbp
  cmp    %ebx,%esi
  jg     L44
L73:
  cmp    %rbp,%r12
  jne    L42
  mov    %r15,%rdi
  call   <local_ns_setsection@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L81:
  add    $0x8,%rsp
  mov    $0xffffffff,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  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;
}
```