user: What is the c source code of the assembly code below?

```asm
<rfc1035NameUnpack>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %r8d,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  cmpl   $0x2,D19(%rip)
  jg     L178
  test   %r8d,%r8d
  jle    L178
  mov    %rsi,%r14
  mov    (%rdx),%rsi
  mov    %rdx,%r13
  cmp    %rsi,%r14
  jbe    L75
  mov    0x10(%rsp),%eax
  mov    %rdi,%r15
  mov    %rcx,%rbp
  xor    %edi,%edi
  sub    $0x1,%eax
  mov    %eax,0x14(%rsp)
  jmp    L141
  nopw   0x0(%rax,%rax,1)
L111:
  cmp    $0x3f,%al
  ja     L133
  add    $0x1,%rsi
  movzbl %al,%r8d
  mov    %rsi,0x0(%r13)
  test   %al,%al
  je     L155
  movslq 0x14(%rsp),%rdx
  cmp    %r8,%rdx
  cmova  %r8,%rdx
  lea    (%rdx,%rsi,1),%rax
  cmp    %r14,%rax
  ja     L178
  movslq 0x10(%rsp),%rax
  lea    (%rdx,%rdi,1),%rbx
  lea    0x1(%rbx),%r12
  mov    %rax,0x18(%rsp)
  cmp    %rax,%r12
  ja     L38
  add    %r15,%rsi
  add    %rbp,%rdi
  mov    %rdx,0x8(%rsp)
  call   <memcpy@plt>
  lea    0x0(%rbp,%rbx,1),%r9
  mov    0x8(%rsp),%rdx
  add    %rdx,0x0(%r13)
  movb   $0x2e,(%r9)
  mov    0x0(%r13),%rsi
  cmp    %r14,%rsi
  jae    L68
  mov    %r12,%rdi
L141:
  lea    (%r15,%rsi,1),%rdx
  movzbl (%rdx),%eax
  cmp    $0xbf,%al
  jbe    L111
  mov    0x4(%r15,%rsi,1),%r8d
  add    $0x2,%rsi
  mov    (%rdx),%edx
  mov    $0x1,%eax
  mov    %rsi,0x0(%r13)
  cmp    %r14,%rsi
  jae    L120
  mov    %edx,%eax
  shl    $0x8,%eax
  or     %r8d,%eax
  and    $0x3fff,%eax
  mov    %rax,0x20(%rsp)
  cmp    $0xb,%rax
  jbe    L58
  cmp    %r14,%rax
  jae    L58
  mov    0x10(%rsp),%r8d
  lea    0x0(%rbp,%rdi,1),%rcx
  lea    0x20(%rsp),%rdx
  mov    %r14,%rsi
  addl   $0x1,D19(%rip)
  sub    %edi,%r8d
  mov    %r15,%rdi
  call   <rfc1035NameUnpack>
  subl   $0x1,D19(%rip)
  jmp    L120
  nopl   0x0(%rax)
L178:
  mov    $0x4,%eax
L120:
  mov    0x28(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L73
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L58:
  mov    $0x2,%eax
  jmp    L120
  nopw   0x0(%rax,%rax,1)
L155:
  test   %rdi,%rdi
  je     L75
  movslq 0x10(%rsp),%rax
  lea    -0x1(%rbp,%rdi,1),%r9
  mov    %rdi,%r12
  mov    %rax,0x18(%rsp)
  nopw   0x0(%rax,%rax,1)
L68:
  movb   $0x0,(%r9)
  xor    %edi,%edi
  cmp    %r12,0x18(%rsp)
  setae  %dil
L30:
  call   <assert@plt>
  xor    %eax,%eax
  jmp    L120
  nopl   0x0(%rax,%rax,1)
L75:
  mov    $0x1,%edi
  jmp    L30
  nopw   0x0(%rax,%rax,1)
L133:
  mov    $0x3,%eax
  jmp    L120
  nopw   0x0(%rax,%rax,1)
L38:
  mov    $0x5,%eax
  jmp    L120
L73:
  call   <__stack_chk_fail@plt>
```

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