user: Translate the below assembly code into C programming language:

```asm
<dns_parse_rr_label>:
  endbr64
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x10,%rsp
  mov    (%rsi),%rdi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movzbl (%rdi),%r12d
  test   %r12b,%r12b
  je     L80
  mov    %r12d,%eax
  mov    %rdx,%r13
  mov    %rcx,%rbp
  shr    $0x6,%al
  cmp    $0x3,%al
  je     L49
  lea    0x1(%rdi),%rsi
  movzbl %r12b,%r14d
  lea    (%rsi,%r14,1),%rax
  mov    %rsi,(%rbx)
  cmp    %rax,%rdx
  jb     L59
  mov    %rcx,%rdi
  movzbl %r12b,%edx
  xor    %eax,%eax
  call   <buffer_insert@plt>
  mov    $0x1,%edx
  mov    %rbp,%rdi
  xor    %eax,%eax
  lea    D0(%rip),%rsi
  call   <buffer_insert@plt>
  add    %r14,(%rbx)
L62:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L85
  add    $0x10,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   (%rax)
L80:
  add    $0x1,%rdi
  mov    %rdi,(%rsi)
  jmp    L62
  nopl   0x0(%rax)
L49:
  xor    %eax,%eax
  call   <read_uint16@plt>
  addq   $0x2,(%rbx)
  mov    %rsp,%rbx
  and    $0x3fff,%eax
  add    %r14,%rax
  mov    %rax,(%rsp)
L2:
  mov    %rbp,%rcx
  mov    %r13,%rdx
  mov    %rbx,%rsi
  mov    %r14,%rdi
  call   <dns_parse_rr_label>
  movsbl %al,%eax
  test   %eax,%eax
  jg     L2
  jne    L35
  xor    %r12d,%r12d
  jmp    L62
  nopl   0x0(%rax)
L59:
  lea    D28(%rip),%rsi
  lea    D34(%rip),%rdi
  xor    %eax,%eax
  mov    $0xffffffff,%r12d
  call   <log_debug@plt>
  jmp    L62
L35:
  lea    D25(%rip),%rsi
  lea    D34(%rip),%rdi
  xor    %eax,%eax
  mov    $0xffffffff,%r12d
  call   <log_debug@plt>
  jmp    L62
L85:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D0
type_guessed: string
name: retrieve_data
arguments: tag: D28
type_guessed: string
name: retrieve_data
arguments: tag: D34
type_guessed: string
name: retrieve_data
arguments: tag: D25
type_guessed: string

tool: D0: .

tool: D28: End of label outside of buffer!

tool: D34: dns_parse_rr_label

tool: D25: Failed to read label pointer.

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