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

```asm
<dns_ptodn>:
  endbr64
  mov    %rdi,%rcx
  mov    %edx,%edi
  lea    0x1(%rsi),%rax
  mov    %rsi,%r9
  sub    $0x1,%rdi
  cmp    $0x100,%edx
  mov    $0xfe,%edx
  mov    %rax,%r8
  cmovae %rdx,%rdi
  movzbl (%rcx),%edx
  add    %rsi,%rdi
  lea    0x1(%rcx),%rsi
  test   %edx,%edx
  jne    L29
  jmp    L111
  nopl   0x0(%rax)
L90:
  cmp    $0x5c,%edx
  je     L50
L114:
  cmp    %rax,%rdi
  jbe    L190
  mov    %dl,(%rax)
  mov    %rsi,%rcx
  add    $0x1,%rax
L94:
  movzbl (%rcx),%edx
  add    $0x1,%rsi
  test   %edx,%edx
  je     L163
L29:
  cmp    $0x2e,%edx
  jne    L90
  mov    %rax,%rdx
  sub    %r8,%rdx
  cmp    %r8d,%eax
  je     L129
  cmp    $0x3f,%edx
  ja     L190
  mov    %rsi,%rcx
  mov    %dl,-0x1(%r8)
  add    $0x1,%rax
  add    $0x1,%rsi
  movzbl (%rcx),%edx
  mov    %rax,%r8
  test   %edx,%edx
  jne    L29
  nopl   0x0(%rax)
L163:
  mov    %rax,%rdx
  sub    %r8,%rdx
  cmp    $0x3f,%edx
  ja     L190
  mov    %dl,-0x1(%r8)
  test   %dl,%dl
  je     L61
  movb   $0x0,(%rax)
  add    $0x1,%rax
L61:
  sub    %r9d,%eax
  ret
  nopw   0x0(%rax,%rax,1)
L50:
  movzbl 0x1(%rcx),%edx
  lea    0x2(%rcx),%rsi
  test   %edx,%edx
  je     L163
  lea    -0x30(%rdx),%r10d
  cmp    $0x9,%r10d
  ja     L114
  movsbl 0x2(%rcx),%edx
  lea    -0x30(%rdx),%r11d
  cmp    $0x9,%r11b
  ja     L63
  lea    (%r10,%r10,4),%esi
  movsbl 0x3(%rcx),%r10d
  lea    -0x30(%rdx,%rsi,2),%edx
  lea    -0x30(%r10),%esi
  cmp    $0x9,%sil
  ja     L175
  lea    (%rdx,%rdx,4),%edx
  lea    0x4(%rcx),%rsi
  lea    -0x30(%r10,%rdx,2),%edx
  cmp    $0xff,%edx
  jbe    L114
  mov    D39(%rip),%rax
  mov    (%rax),%edx
  mov    D31(%rip),%rax
  mov    %edx,(%rax)
  xor    %eax,%eax
  ret
  nopl   0x0(%rax)
L190:
  mov    D4(%rip),%rax
  mov    (%rax),%edx
  mov    D31(%rip),%rax
  mov    %edx,(%rax)
  xor    %eax,%eax
  ret
  nopl   (%rax)
L129:
  mov    %rsi,%rcx
  jmp    L94
  nopl   0x0(%rax,%rax,1)
L63:
  mov    %r10d,%edx
  jmp    L114
  nopl   0x0(%rax,%rax,1)
L175:
  lea    0x3(%rcx),%rsi
  jmp    L114
L111:
  movb   $0x0,(%r9)
  jmp    L61
```

assistant: ```c
unsigned dns_ptodn(const char *name, unsigned char *dn, unsigned dnsiz) {
  unsigned char *d;
  unsigned char *label;
  unsigned char *m;
  unsigned l;
  unsigned c;
  d = dn + 1;
  label = d;
  m = dn + (dnsiz > 255 ? 255 : dnsiz) - 1;
  while ((c = (unsigned char)*name++) != 0) {
    if (c == '.') {
      if ((l = d - label) != 0) {
        if (l > 63) {
          errno = EMSGSIZE;
          return 0;
        }
        label[-1] = (char)l;
        label = ++d;
      }
      continue;
    }
    if (c == '\\') {
      if (!(c = (unsigned char)*name++))
        break;
      if (c >= '0' && c <= '9') {
        c -= '0';
        if (*name >= '0' && *name <= '9') {
          c = (c * 10) + (*name++ - '0');
          if (*name >= '0' && *name <= '9') {
            c = (c * 10) + (*name++ - '0');
            if (c > 255) {
              errno = EINVAL;
              return 0;
            }
          }
        }
      }
    }
    if (d >= m) {
      errno = EMSGSIZE;
      return 0;
    }
    *d++ = (char)c;
  }
  if ((l = d - label) > 63) {
    errno = EMSGSIZE;
    return 0;
  }
  if ((label[-1] = (char)l) != 0)
    *d++ = 0;
  return d - dn;
}
```