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

```asm
<dns_parse_rr_label>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x18,%rsp
  mov    (%rsi),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movzbl (%rdi),%r12d
  test   %r12b,%r12b
  je     L40
  mov    %r12d,%eax
  mov    %rdx,%r13
  mov    %rcx,%rbp
  shr    $0x6,%al
  cmp    $0x3,%al
  je     L76
  lea    0x1(%rdi),%rsi
  movzbl %r12b,%r14d
  lea    (%rsi,%r14,1),%rax
  mov    %rsi,(%rbx)
  cmp    %rax,%rdx
  jb     L90
  mov    %rcx,%rdi
  movzbl %r12b,%edx
  xor    %eax,%eax
  call   <buffer_insert@plt>
  mov    $0x1,%edx
  mov    %rbp,%rdi
  xor    %eax,%eax
  lea    D196(%rip),%rsi
  call   <buffer_insert@plt>
  add    %r14,(%rbx)
L160:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L222
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L40:
  add    $0x1,%rdi
  mov    %rdi,(%rsi)
  jmp    L160
  nopl   0x0(%rax)
L76:
  xor    %eax,%eax
  lea    D196(%rip),%r12
  call   <read_uint16@plt>
  addq   $0x2,(%rbx)
  and    $0x3fff,%eax
  lea    (%r14,%rax,1),%r15
L246:
  movzbl (%r15),%ebx
  test   %bl,%bl
  je     L7
  mov    %ebx,%eax
  shr    $0x6,%al
  cmp    $0x3,%al
  je     L236
  lea    0x1(%r15),%rsi
  movzbl %bl,%r15d
  add    %rsi,%r15
  cmp    %r15,%r13
  jb     L55
  movzbl %bl,%edx
  mov    %rbp,%rdi
  xor    %eax,%eax
  movsbl %bl,%ebx
  call   <buffer_insert@plt>
  mov    $0x1,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <buffer_insert@plt>
  test   %ebx,%ebx
  jg     L246
  mov    $0x0,%r12d
  je     L160
  lea    D176(%rip),%r12
  lea    D130(%rip),%rbp
  jmp    L138
  nopl   (%rax)
L7:
  xor    %r12d,%r12d
  jmp    L160
L236:
  mov    %r15,%rdi
  xor    %eax,%eax
  lea    D196(%rip),%r12
  call   <read_uint16@plt>
  and    $0x3fff,%eax
  lea    (%r14,%rax,1),%r15
L342:
  movzbl (%r15),%ebx
  test   %bl,%bl
  je     L7
  mov    %ebx,%eax
  shr    $0x6,%al
  cmp    $0x3,%al
  je     L255
  lea    0x1(%r15),%rsi
  movzbl %bl,%r15d
  add    %rsi,%r15
  cmp    %r15,%r13
  jb     L208
  movzbl %bl,%edx
  mov    %rbp,%rdi
  xor    %eax,%eax
  movsbl %bl,%ebx
  call   <buffer_insert@plt>
  mov    $0x1,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <buffer_insert@plt>
  test   %ebx,%ebx
  jg     L342
  je     L7
  lea    D176(%rip),%r12
  lea    D130(%rip),%rbp
  jmp    L106
  nopw   0x0(%rax,%rax,1)
L255:
  mov    %r15,%rdi
  xor    %eax,%eax
  lea    D196(%rip),%r12
  call   <read_uint16@plt>
  and    $0x3fff,%eax
  lea    (%r14,%rax,1),%r15
L19:
  movzbl (%r15),%ebx
  test   %bl,%bl
  je     L7
  mov    %ebx,%eax
  shr    $0x6,%al
  cmp    $0x3,%al
  je     L110
  lea    0x1(%r15),%rsi
  movzbl %bl,%r15d
  add    %rsi,%r15
  cmp    %r15,%r13
  jb     L135
  movzbl %bl,%edx
  mov    %rbp,%rdi
  xor    %eax,%eax
  movsbl %bl,%ebx
  call   <buffer_insert@plt>
  mov    $0x1,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <buffer_insert@plt>
  test   %ebx,%ebx
  jg     L19
  je     L7
  lea    D176(%rip),%r12
  lea    D130(%rip),%rbp
  jmp    L285
  nopw   0x0(%rax,%rax,1)
L110:
  mov    %r15,%rdi
  xor    %eax,%eax
  lea    D196(%rip),%r12
  call   <read_uint16@plt>
  and    $0x3fff,%eax
  lea    (%r14,%rax,1),%r15
L10:
  movzbl (%r15),%ebx
  test   %bl,%bl
  je     L7
  mov    %ebx,%eax
  shr    $0x6,%al
  cmp    $0x3,%al
  je     L113
  lea    0x1(%r15),%rsi
  movzbl %bl,%r15d
  add    %rsi,%r15
  cmp    %r15,%r13
  jb     L369
  movzbl %bl,%edx
  mov    %rbp,%rdi
  xor    %eax,%eax
  movsbl %bl,%ebx
  call   <buffer_insert@plt>
  mov    $0x1,%edx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <buffer_insert@plt>
  test   %ebx,%ebx
  jg     L10
  je     L7
  lea    D176(%rip),%r12
  lea    D130(%rip),%rbp
  jmp    L136
  nopw   0x0(%rax,%rax,1)
L113:
  mov    %r15,%rdi
  xor    %eax,%eax
  mov    %rsp,%rbx
  call   <read_uint16@plt>
  and    $0x3fff,%eax
  add    %r14,%rax
  mov    %rax,(%rsp)
L56:
  mov    %rbp,%rcx
  mov    %r13,%rdx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <dns_parse_rr_label>
  movsbl %al,%eax
  test   %eax,%eax
  jg     L56
  je     L7
  lea    D176(%rip),%r12
  lea    D130(%rip),%rbp
  xor    %eax,%eax
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <log_debug@plt>
L136:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <log_debug@plt>
L285:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <log_debug@plt>
L106:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  call   <log_debug@plt>
L138:
  mov    %r12,%rsi
  mov    %rbp,%rdi
  xor    %eax,%eax
  mov    $0xffffffff,%r12d
  call   <log_debug@plt>
  jmp    L160
  nopl   0x0(%rax)
L90:
  lea    D224(%rip),%rsi
  lea    D130(%rip),%rdi
  xor    %eax,%eax
  mov    $0xffffffff,%r12d
  call   <log_debug@plt>
  jmp    L160
L55:
  lea    D130(%rip),%rbp
  lea    D224(%rip),%rsi
  xor    %eax,%eax
  mov    %rbp,%rdi
  lea    D176(%rip),%r12
  call   <log_debug@plt>
  jmp    L138
L208:
  lea    D130(%rip),%rbp
  lea    D224(%rip),%rsi
  xor    %eax,%eax
  mov    %rbp,%rdi
  lea    D176(%rip),%r12
  call   <log_debug@plt>
  jmp    L106
L135:
  lea    D130(%rip),%rbp
  lea    D224(%rip),%rsi
  xor    %eax,%eax
  mov    %rbp,%rdi
  lea    D176(%rip),%r12
  call   <log_debug@plt>
  jmp    L285
L369:
  lea    D130(%rip),%rbp
  lea    D224(%rip),%rsi
  xor    %eax,%eax
  mov    %rbp,%rdi
  lea    D176(%rip),%r12
  call   <log_debug@plt>
  jmp    L136
L222:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D196
type: string
name: disassemble_data
arguments: label: D176
type: string
name: disassemble_data
arguments: label: D130
type: string
name: disassemble_data
arguments: label: D224
type: string

tool: D196: .

tool: D176: Failed to read label pointer.

tool: D130: dns_parse_rr_label

tool: D224: End of label outside of buffer!

assistant: ```c
char dns_parse_rr_label(char *bgof_msg, char **cursor, char *cursor_max, struct buffer *output) {
  char *label_ptr;
  unsigned short label_offset;
  unsigned char chunk_len;
  int label_len;
  chunk_len = (unsigned char)**cursor;
  if (chunk_len != 0) {
    if (((chunk_len >> 6) & 0x03) == 3) {
      label_offset = read_uint16(*cursor);
      label_offset &= 0x3fff;
      label_ptr = bgof_msg + label_offset;
      (*cursor) += 2;
      chunk_len = *label_ptr;
      while ((label_len = dns_parse_rr_label(bgof_msg, &label_ptr, cursor_max, output)) > 0) {
      }
      if (label_len == 0) {
        return 0;
      } else {
        log_debug(__func__, "Failed to read label pointer.");
        return -1;
      }
    } else {
      (*cursor)++;
      if (*cursor + chunk_len <= cursor_max) {
        buffer_insert(output, *cursor, chunk_len);
        buffer_insert(output, ".", 1);
        (*cursor) += chunk_len;
        return chunk_len;
      } else {
        log_debug(__func__, "End of label outside of buffer!");
        return -1;
      }
    }
  } else {
    (*cursor)++;
    return 0;
  }
}
```