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

```asm
<local_ns_initparse>:
  endbr64
  push   %r15
  movslq %esi,%rsi
  mov    %rdx,%r15
  push   %r14
  push   %r13
  push   %r12
  lea    (%rdi,%rsi,1),%r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    D29(%rip),%rbx
  mov    %rdi,(%rdx)
  mov    %r12,0x8(%rdx)
  movslq (%rbx),%rax
  add    %rdi,%rax
  cmp    %rax,%r12
  jb     L14
  mov    %rdi,%rbp
  mov    0x10(%rdx),%rdi
  mov    %rbp,%rsi
  call   <NS_GET16@plt>
  movslq (%rbx),%rax
  add    %rbp,%rax
  cmp    %rax,%r12
  jb     L14
  mov    0x18(%r15),%rdi
  mov    %rbp,%rsi
  call   <NS_GET16@plt>
  mov    D4(%rip),%r13
  mov    0x0(%r13),%esi
  test   %esi,%esi
  jle    L127
  xor    %r14d,%r14d
  jmp    L3
  nopl   0x0(%rax,%rax,1)
L53:
  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    L36
L3:
  movslq (%rbx),%rax
  add    %rbp,%rax
  cmp    %rax,%r12
  jae    L53
L14:
  mov    D36(%rip),%rax
  mov    (%rax),%edx
  mov    D15(%rip),%rax
  mov    %edx,(%rax)
  add    $0x8,%rsp
  mov    $0xffffffff,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L36:
  test   %esi,%esi
  jle    L127
  xor    %ebx,%ebx
  jmp    L108
  nopl   0x0(%rax,%rax,1)
L43:
  mov    0x28(%r15),%rax
  mov    0x0(%r13),%esi
  movq   $0x0,(%rax,%rbx,8)
  add    $0x1,%rbx
  cmp    %ebx,%esi
  jle    L127
L108:
  mov    0x20(%r15),%rax
  mov    %ebx,%edx
  lea    0x0(,%rbx,8),%r14
  mov    (%rax,%rbx,8),%rcx
  test   %rcx,%rcx
  je     L43
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <local_ns_skiprr@plt>
  test   %eax,%eax
  js     L6
  mov    0x28(%r15),%rdx
  mov    0x0(%r13),%esi
  cltq
  add    $0x1,%rbx
  mov    %rbp,(%rdx,%r14,1)
  add    %rax,%rbp
  cmp    %ebx,%esi
  jg     L108
L127:
  cmp    %rbp,%r12
  jne    L14
  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)
L6:
  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;
}
```