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

```asm
<read_dns_name>:
  endbr64
  push   %r15
  movslq %ecx,%rcx
  mov    %rsi,%rax
  lea    0x100(%rdx),%r15
  push   %r14
  xor    %esi,%esi
  lea    (%rdi,%rcx,4),%r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0x8,%rsp
L101:
  movslq (%rax),%rdi
  mov    %edi,%edx
  and    $0xc0,%edx
  cmp    $0xc0,%edx
  je     L102
  test   %edi,%edi
  je     L105
  add    $0x4,%rax
  cmp    $0x1,%esi
  adc    $0x0,%r12d
  test   %edi,%edi
  jle    L91
  add    %rbx,%rdi
  jmp    L265
  nopl   0x0(%rax,%rax,1)
L300:
  add    $0x1,%rbx
  cmp    %r15,%rbx
  ja     L80
  cmp    %rbx,%r13
  ja     L80
  cmp    %rdi,%rbx
  je     L135
L265:
  mov    (%rax),%edx
  mov    %dl,(%rbx)
  test   %esi,%esi
  jne    L287
  cmp    %rax,%r14
  jb     L80
  cmp    %rax,%rbp
  ja     L80
  add    $0x1,%r12d
  cmp    $0x100,%r12d
  jg     L80
  cmp    %r15,%rbx
  ja     L80
  cmp    %rbx,%r13
  ja     L80
L287:
  add    $0x4,%rax
  cmp    %rax,%r14
  setb   %dl
  cmp    %rax,%rbp
  seta   %cl
  or     %cl,%dl
  jne    L80
  cmp    $0x101,%r12d
  jne    L300
  nopl   (%rax)
L80:
  xor    %r12d,%r12d
L179:
  add    $0x8,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L102:
  call   <ntohs@plt>
  sub    $0xc000,%eax
  cltq
  lea    0x0(%rbp,%rax,4),%rax
  cmp    %rax,%rbp
  ja     L80
  cmp    %rax,%r14
  jb     L80
  add    $0x2,%r12d
  cmp    $0x100,%r12d
  jg     L80
  cmp    %r15,%rbx
  ja     L80
  cmp    %r13,%rbx
  jb     L80
  mov    $0x1,%esi
  jmp    L101
  nopl   0x0(%rax)
L135:
  movb   $0x2e,(%rdi)
L2:
  lea    0x1(%rdi),%rbx
  cmp    %r15,%rbx
  ja     L80
  cmp    %rbx,%r13
  jbe    L101
  jmp    L80
L105:
  test   %r12d,%r12d
  je     L139
  movb   $0x0,-0x1(%rbx)
  test   %esi,%esi
  jne    L179
  cmp    %rax,%r14
  jb     L80
  cmp    %rbp,%rax
  jb     L80
  add    $0x1,%r12d
  cmp    $0x101,%r12d
  je     L80
  lea    0x100(%r13),%rax
  cmp    %rax,%rbx
  ja     L80
  cmp    %r13,%rbx
  jae    L179
  jmp    L80
  nopl   (%rax)
L91:
  cmp    %rax,%r14
  movb   $0x2e,(%rbx)
  setb   %dl
  cmp    %rbp,%rax
  setb   %cl
  or     %cl,%dl
  jne    L80
  cmp    $0x101,%r12d
  je     L80
  mov    %rbx,%rdi
  jmp    L2
L139:
  movb   $0x0,(%rbx)
  jmp    L179
```

assistant: ```c
int read_dns_name(u_char *base, u_char *ptr, char *name, int psize) {
  u_char c;
  int len;
  int count = 0, compressed = 0;
  char *base_name = name;
  for (;;) {
    int i;
    c = *ptr;
    if ((c & 0xc0) == 0xc0) {
      int offset;
      offset = (ntohs(*(u_short *)(ptr)) - 0xc000);
      ptr = base;
      do {
        ptr += offset;
        if ((ptr > (base + psize)) || (ptr < base))
          return 0;
        count += 2;
        if ((count > 256) || (count < 0))
          return 0;
        name += 0;
        if ((name > (base_name + 256)) || (name < base_name))
          return 0;
      } while (0);
      compressed = 1;
      continue;
    }
    len = c;
    if (len == 0) {
      if (count > 0) {
        *(name - 1) = '\0';
        if (!compressed)
          do {
            ptr += 0;
            if ((ptr > (base + psize)) || (ptr < base))
              return 0;
            count += 1;
            if ((count > 256) || (count < 0))
              return 0;
            name += 0;
            if ((name > (base_name + 256)) || (name < base_name))
              return 0;
          } while (0);
      } else {
        *name = '\0';
      }
      break;
    }
    ptr++;
    if (!compressed)
      count++;
    for (i = 0; i < len; i++) {
      *name = *ptr;
      if (!compressed)
        do {
          ptr += 0;
          if ((ptr > (base + psize)) || (ptr < base))
            return 0;
          count += 1;
          if ((count > 256) || (count < 0))
            return 0;
          name += 0;
          if ((name > (base_name + 256)) || (name < base_name))
            return 0;
        } while (0);
      do {
        ptr += 1;
        if ((ptr > (base + psize)) || (ptr < base))
          return 0;
        count += 0;
        if ((count > 256) || (count < 0))
          return 0;
        name += 1;
        if ((name > (base_name + 256)) || (name < base_name))
          return 0;
      } while (0);
    }
    *name = '.';
    do {
      ptr += 0;
      if ((ptr > (base + psize)) || (ptr < base))
        return 0;
      count += 0;
      if ((count > 256) || (count < 0))
        return 0;
      name += 1;
      if ((name > (base_name + 256)) || (name < base_name))
        return 0;
    } while (0);
  }
  return count;
}
```