user: 请从给定的汇编指令推导出C源代码：

```asm
<__dns_decodename>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %ecx,-0x40(%rbp)
  mov    %r8,-0x50(%rbp)
  mov    -0x40(%rbp),%edx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x3c(%rbp),%edx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
  movl   $0x0,-0x24(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L187
L205:
  mov    -0x18(%rbp),%rax
  cmp    -0x50(%rbp),%rax
  jb     L23
  mov    $0xffffffff,%eax
  jmp    L15
L23:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  shr    $0x6,%al
  cmp    $0x3,%al
  jne    L117
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  shl    $0x8,%eax
  and    $0x3f00,%eax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  or     %edx,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x1c(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jb     L131
  mov    $0xffffffff,%eax
  jmp    L15
L131:
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  cmp    %rax,-0x10(%rbp)
  jae    L176
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  mov    %rax,-0x10(%rbp)
L176:
  mov    -0x1c(%rbp),%edx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  movl   $0x0,-0x24(%rbp)
  jmp    L187
L117:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  shr    $0x6,%al
  test   %al,%al
  jne    L119
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  lea    0x1(%rax),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  cmp    %rax,-0x8(%rbp)
  jae    L179
  mov    $0xffffffff,%eax
  jmp    L15
L179:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  lea    0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  cmp    %rax,-0x50(%rbp)
  ja     L138
  mov    $0xffffffff,%eax
  jmp    L15
L138:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,-0x20(%rbp)
  jmp    L14
L218:
  addq   $0x1,-0x18(%rbp)
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  mov    -0x18(%rbp),%rdx
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  subl   $0x1,-0x20(%rbp)
L14:
  cmpl   $0x0,-0x20(%rbp)
  jne    L218
  mov    -0x48(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x48(%rbp)
  movb   $0x2e,(%rax)
  movl   $0x1,-0x24(%rbp)
  addq   $0x1,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  cmp    -0x10(%rbp),%rax
  jbe    L187
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L187
  addq   $0x1,-0x10(%rbp)
  jmp    L187
L119:
  mov    $0xffffffff,%eax
  jmp    L15
L187:
  cmpl   $0x0,-0x40(%rbp)
  je     L34
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L205
L34:
  cmpl   $0x0,-0x24(%rbp)
  je     L48
  subq   $0x1,-0x48(%rbp)
L48:
  mov    -0x48(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x10(%rbp),%rax
  sub    -0x38(%rbp),%rax
L15:
  pop    %rbp
  ret
```

assistant: ```c
int __dns_decodename(const unsigned char *packet, unsigned int offset, unsigned char *dest, unsigned int maxlen, const unsigned char *behindpacket) {
  const unsigned char *tmp;
  const unsigned char *max = dest + maxlen;
  const unsigned char *after = packet + offset;
  int ok = 0;
  for (tmp = after; maxlen > 0 && *tmp;) {
    if (tmp >= behindpacket)
      return -1;
    if ((*tmp >> 6) == 3) {
      unsigned int ofs = ((unsigned int)(*tmp & 0x3f) << 8) | *(tmp + 1);
      if (ofs >= (unsigned int)offset)
        return -1;
      if (after < tmp + 2)
        after = tmp + 2;
      tmp = packet + ofs;
      ok = 0;
    } else if ((*tmp >> 6) == 0) {
      unsigned int duh;
      if (dest + *tmp + 1 > max)
        return -1;
      if (tmp + *tmp + 1 >= behindpacket)
        return -1;
      for (duh = *tmp; duh > 0; --duh)
        *dest++ = *++tmp;
      *dest++ = '.';
      ok = 1;
      ++tmp;
      if (tmp > after) {
        after = tmp;
        if (!*tmp)
          ++after;
      }
    } else
      return -1;
  }
  if (ok)
    --dest;
  *dest = 0;
  return after - packet;
}
```