user: Demonstrate the C code that generates the assembly output below:

```asm
<dns_ptodn>:
  endbr64
  mov    %rdi,%rcx
  mov    %rsi,%r9
  lea    0x1(%rsi),%rax
  mov    %edx,%edi
  sub    $0x1,%rdi
  cmp    $0x100,%edx
  mov    $0xfe,%edx
  cmovae %rdx,%rdi
  add    %rsi,%rdi
  lea    0x1(%rcx),%rsi
  movzbl (%rcx),%edx
  test   %edx,%edx
  je     L139
  mov    %rax,%r8
  jmp    L164
L177:
  mov    %rax,%rdx
  sub    %r8,%rdx
  cmp    %r8d,%eax
  je     L37
  cmp    $0x3f,%edx
  jbe    L150
  mov    D74(%rip),%rax
  mov    (%rax),%edx
  mov    D21(%rip),%rax
  mov    %edx,(%rax)
  mov    $0x0,%eax
  ret
L150:
  mov    %dl,-0x1(%r8)
  add    $0x1,%rax
  mov    %rax,%r8
  mov    %rsi,%rcx
  jmp    L153
L176:
  lea    (%rdx,%rdx,4),%edx
  lea    0x4(%rcx),%rsi
  movsbl %r10b,%r10d
  lea    -0x30(%r10,%rdx,2),%edx
  cmp    $0xff,%edx
  jbe    L107
  mov    D32(%rip),%rax
  mov    (%rax),%edx
  mov    D21(%rip),%rax
  mov    %edx,(%rax)
  mov    $0x0,%eax
  ret
L132:
  mov    %r10d,%edx
L107:
  cmp    %rax,%rdi
  jbe    L95
  mov    %dl,(%rax)
  lea    0x1(%rax),%rax
  mov    %rsi,%rcx
L153:
  lea    0x1(%rcx),%rsi
  movzbl (%rcx),%edx
  test   %edx,%edx
  je     L25
L164:
  cmp    $0x2e,%edx
  je     L177
  cmp    $0x5c,%edx
  jne    L107
  lea    0x2(%rcx),%rsi
  movzbl 0x1(%rcx),%edx
  test   %edx,%edx
  je     L25
  lea    -0x30(%rdx),%r10d
  cmp    $0x9,%r10d
  ja     L107
  movzbl 0x2(%rcx),%edx
  lea    -0x30(%rdx),%r11d
  cmp    $0x9,%r11b
  ja     L132
  lea    (%r10,%r10,4),%esi
  movsbl %dl,%edx
  lea    -0x30(%rdx,%rsi,2),%edx
  movzbl 0x3(%rcx),%r10d
  lea    -0x30(%r10),%esi
  cmp    $0x9,%sil
  jbe    L176
  lea    0x3(%rcx),%rsi
  jmp    L107
L95:
  mov    D74(%rip),%rax
  mov    (%rax),%edx
  mov    D21(%rip),%rax
  mov    %edx,(%rax)
  mov    $0x0,%eax
  ret
L37:
  mov    %rsi,%rcx
  jmp    L153
L25:
  mov    %rax,%rdx
  sub    %r8,%rdx
  cmp    $0x3f,%edx
  ja     L81
  mov    %dl,-0x1(%r8)
  test   %dl,%dl
  je     L42
  movb   $0x0,(%rax)
  lea    0x1(%rax),%rax
L42:
  sub    %r9d,%eax
  ret
L81:
  mov    D74(%rip),%rax
  mov    (%rax),%edx
  mov    D21(%rip),%rax
  mov    %edx,(%rax)
  mov    $0x0,%eax
  ret
L139:
  movb   $0x0,(%r9)
  jmp    L42
```

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