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

```asm
<send_dns_query>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x850,%rsp
  mov    %edi,-0x834(%rbp)
  mov    %rsi,-0x840(%rbp)
  mov    %rdx,-0x848(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x0,%eax
  call   <rand@plt>
  mov    -0x848(%rbp),%rdx
  mov    %eax,(%rdx)
  lea    -0x810(%rbp),%rax
  mov    $0x800,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x848(%rbp),%rax
  mov    (%rax),%edx
  lea    -0x810(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <dns_query_append16@plt>
  movl   $0x1,-0x808(%rbp)
  movl   $0x0,-0x804(%rbp)
  lea    -0x810(%rbp),%rax
  add    $0x10,%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <dns_query_append16@plt>
  lea    -0x810(%rbp),%rax
  add    $0x18,%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <dns_query_append16@plt>
  lea    -0x810(%rbp),%rax
  add    $0x20,%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <dns_query_append16@plt>
  lea    -0x810(%rbp),%rax
  add    $0x28,%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <dns_query_append16@plt>
  lea    -0x810(%rbp),%rax
  add    $0x30,%rax
  mov    %rax,-0x830(%rbp)
  mov    -0x840(%rbp),%rax
  mov    %rax,-0x828(%rbp)
  jmp    L36
L71:
  mov    -0x830(%rbp),%rax
  mov    %rax,-0x818(%rbp)
  addq   $0x4,-0x830(%rbp)
  jmp    L14
L52:
  mov    -0x828(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x828(%rbp)
  movzbl (%rax),%ecx
  mov    -0x830(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x830(%rbp)
  movsbl %cl,%edx
  mov    %edx,(%rax)
L14:
  mov    -0x828(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L78
  mov    -0x828(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L52
L78:
  mov    -0x830(%rbp),%rax
  sub    -0x818(%rbp),%rax
  sar    $0x2,%rax
  sub    $0x1,%eax
  mov    %eax,%edx
  mov    -0x818(%rbp),%rax
  mov    %edx,(%rax)
  mov    -0x828(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L36
  addq   $0x1,-0x828(%rbp)
L36:
  mov    -0x828(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L71
  mov    -0x830(%rbp),%rax
  lea    0x4(%rax),%rdx
  mov    %rdx,-0x830(%rbp)
  movl   $0x0,(%rax)
  mov    -0x830(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <dns_query_append16@plt>
  mov    %rax,-0x830(%rbp)
  mov    -0x830(%rbp),%rax
  mov    $0x1,%esi
  mov    %rax,%rdi
  call   <dns_query_append16@plt>
  mov    %rax,-0x830(%rbp)
  lea    -0x810(%rbp),%rdx
  mov    -0x830(%rbp),%rax
  sub    %rdx,%rax
  sar    $0x2,%rax
  mov    %rax,-0x820(%rbp)
  mov    -0x820(%rbp),%rdx
  lea    -0x810(%rbp),%rsi
  mov    -0x834(%rbp),%eax
  mov    $0x0,%ecx
  mov    %eax,%edi
  call   <send@plt>
  test   %rax,%rax
  jns    L22
  mov    D9(%rip),%rax
  mov    (%rax),%eax
  jmp    L33
L22:
  mov    $0x0,%eax
L33:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L0
  call   <__stack_chk_fail@plt>
L0:
  leave
  ret
```

assistant: ```c
int send_dns_query(int sock, const char *nodename, uint16_t *id) {
  uint8_t dns_query[512];
  size_t dns_query_len;
  uint8_t *pq;
  uint8_t *plen;
  const char *pname;
  *id = rand();
  memset(dns_query, 0, sizeof(dns_query));
  dns_query_append16(&dns_query[0], *id);
  dns_query[2] = (0 << 3) | (1 << 0);
  dns_query[3] = 0x00;
  dns_query_append16(&dns_query[4], 1);
  dns_query_append16(&dns_query[6], 0);
  dns_query_append16(&dns_query[8], 0);
  dns_query_append16(&dns_query[10], 0);
  pq = &dns_query[12];
  pname = nodename;
  while (*pname != '\0') {
    plen = pq;
    pq++;
    while ((*pname != '.') && (*pname != '\0')) {
      *pq++ = *pname++;
    }
    *plen = pq - plen - 1;
    if (*pname == '.') {
      pname++;
    }
  }
  *pq++ = 0x00;
  pq = dns_query_append16(pq, 1);
  pq = dns_query_append16(pq, 1);
  dns_query_len = (size_t)(pq - &dns_query[0]);
  if (send(sock, dns_query, dns_query_len, 0) < 0) {
    return EAI_SYSTEM;
  }
  return 0;
}
```