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

```asm
<rfc1035NameUnpack>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %r8d,-0x54(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movq   $0x0,-0x18(%rbp)
  mov    D32(%rip),%eax
  cmp    $0x2,%eax
  jle    L226
  mov    $0x4,%eax
  jmp    L87
L226:
  cmpl   $0x0,-0x54(%rbp)
  jg     L12
  mov    $0x4,%eax
  jmp    L87
L12:
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rax
  cmp    %rax,-0x40(%rbp)
  jbe    L69
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x27(%rbp)
  cmpb   $0xbf,-0x27(%rbp)
  jbe    L215
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  shl    $0x8,%eax
  mov    %eax,%ecx
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rax
  lea    0x4(%rax),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  or     %ecx,%eax
  mov    %ax,-0x26(%rbp)
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rax
  lea    0x2(%rax),%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rax
  cmp    %rax,-0x40(%rbp)
  ja     L60
  mov    $0x1,%eax
  jmp    L87
L60:
  movzwl -0x26(%rbp),%eax
  and    $0x3fff,%eax
  mov    %rax,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  cmp    %rax,-0x40(%rbp)
  ja     L103
  mov    $0x2,%eax
  jmp    L87
L103:
  mov    -0x20(%rbp),%rax
  cmp    $0xb,%rax
  ja     L185
  mov    $0x2,%eax
  jmp    L87
L185:
  mov    D32(%rip),%eax
  add    $0x1,%eax
  mov    %eax,D1(%rip)
  mov    -0x54(%rbp),%eax
  mov    -0x18(%rbp),%rdx
  sub    %edx,%eax
  mov    %eax,%edi
  mov    -0x50(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x20(%rbp),%rdx
  mov    -0x40(%rbp),%rsi
  mov    -0x38(%rbp),%rax
  mov    %edi,%r8d
  mov    %rax,%rdi
  call   <rfc1035NameUnpack>
  mov    %eax,-0x24(%rbp)
  mov    D1(%rip),%eax
  sub    $0x1,%eax
  mov    %eax,D1(%rip)
  mov    -0x24(%rbp),%eax
  jmp    L87
L215:
  cmpb   $0x3f,-0x27(%rbp)
  jbe    L44
  mov    $0x3,%eax
  jmp    L87
L44:
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,(%rax)
  movzbl -0x27(%rbp),%eax
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L198
  mov    -0x54(%rbp),%eax
  sub    $0x1,%eax
  cltq
  cmp    %rax,-0x10(%rbp)
  jbe    L54
  mov    -0x54(%rbp),%eax
  sub    $0x1,%eax
  cltq
  mov    %rax,-0x10(%rbp)
L54:
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  cmp    %rax,-0x40(%rbp)
  jae    L159
  mov    $0x4,%eax
  jmp    L87
L159:
  mov    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  lea    0x1(%rax),%rdx
  mov    -0x54(%rbp),%eax
  cltq
  cmp    %rax,%rdx
  jbe    L153
  mov    $0x5,%eax
  jmp    L87
L153:
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x38(%rbp),%rax
  lea    (%rdx,%rax,1),%rsi
  mov    -0x50(%rbp),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdx
  mov    %rcx,%rdi
  call   <memcpy@plt>
  mov    -0x48(%rbp),%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%rax
  add    %rax,%rdx
  mov    -0x48(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x10(%rbp),%rax
  add    %rax,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x18(%rbp)
  mov    -0x50(%rbp),%rdx
  add    %rdx,%rax
  movb   $0x2e,(%rax)
  cmpb   $0x0,-0x27(%rbp)
  jne    L12
  jmp    L17
L69:
  nop
  jmp    L17
L198:
  nop
L17:
  cmpq   $0x0,-0x18(%rbp)
  je     L161
  mov    -0x18(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L161:
  mov    -0x54(%rbp),%eax
  cltq
  cmp    %rax,-0x18(%rbp)
  setbe  %al
  movzbl %al,%eax
  mov    %eax,%edi
  call   <assert@plt>
  mov    $0x0,%eax
L87:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L85
  call   <__stack_chk_fail@plt>
L85:
  leave
  ret
```

assistant: ```c
int rfc1035NameUnpack(const u_char *buf, size_t sz, off_t *off, char *name, int ns) {
  off_t no = 0;
  unsigned char c;
  size_t len;
  static int loop_detect = 0;
  if (loop_detect > 2)
    return 4;
  if (ns <= 0)
    return 4;
  do {
    if ((*off) >= sz)
      break;
    c = *(buf + (*off));
    if (c > 191) {
      int rc;
      unsigned short s;
      off_t ptr;
      s = ((((uint8_t *)(buf + (*off)))[0] << 8) | ((uint8_t *)(buf + (*off)))[1]);
      (*off) += sizeof(s);
      if ((*off) >= sz)
        return 1;
      ptr = s & 0x3FFF;
      if (ptr >= sz)
        return 2;
      if (ptr < 12)
        return 2;
      loop_detect++;
      rc = rfc1035NameUnpack(buf, sz, &ptr, name + no, ns - no);
      loop_detect--;
      return rc;
    } else if (c > 63) {
      return 3;
      break;
    } else {
      (*off)++;
      len = (size_t)c;
      if (len == 0)
        break;
      if (len > (ns - 1))
        len = ns - 1;
      if ((*off) + len > sz)
        return 4;
      if (no + len + 1 > ns)
        return 5;
      memcpy(name + no, buf + (*off), len);
      (*off) += len;
      no += len;
      *(name + (no++)) = '.';
    }
  } while (c > 0);
  if (no > 0)
    *(name + no - 1) = '\0';
  assert(no <= ns);
  return 0;
}
```