user: Converte this assembly snippet into its equivalent C code:

```asm
<dga>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  lea    D58(%rip),%rax
  mov    %rax,(%rsp)
  lea    D64(%rip),%rax
  mov    %rax,0x8(%rsp)
  lea    D45(%rip),%rax
  mov    %rax,0x10(%rsp)
  lea    D6(%rip),%rax
  mov    %rax,0x18(%rsp)
  lea    D23(%rip),%rax
  mov    %rax,0x20(%rsp)
  lea    D22(%rip),%rax
  mov    %rax,0x28(%rsp)
  lea    D65(%rip),%rax
  mov    %rax,0x30(%rsp)
  lea    D17(%rip),%rax
  mov    %rax,0x38(%rsp)
  test   %r8d,%r8d
  je     L29
  mov    %edi,%ebp
  mov    %esi,%r13d
  mov    %edx,%r12d
  mov    %ecx,%ebx
  mov    %edi,%esi
  lea    (%rdi,%r8,1),%r15d
L36:
  lea    0x49(%rsp),%rdx
  lea    0x57(%rsp),%rcx
L4:
  mov    %ebp,%edi
  shr    $0xf,%edi
  mov    %ebp,%eax
  xor    %ebx,%eax
  shl    $0x2,%eax
  and    $0x1fff,%ebp
  xor    %eax,%ebp
  shl    $0x4,%ebp
  xor    %edi,%ebp
  mov    %r12d,%edi
  shl    $0x11,%edi
  and    $0xffe00000,%edi
  lea    0x0(,%r12,8),%eax
  sub    %r12d,%eax
  xor    %r12d,%eax
  shr    $0xb,%eax
  xor    %eax,%edi
  mov    %edi,%r12d
  mov    %r13d,%edi
  and    $0xfffffffe,%edi
  imul   $0xe,%edi,%edi
  lea    0x0(,%r13,4),%eax
  xor    %r13d,%eax
  shr    $0x8,%eax
  xor    %eax,%edi
  mov    %edi,%r13d
  mov    %ebx,%eax
  shr    $0x6,%eax
  lea    0x0(%rbp,%rbx,8),%ebx
  shl    $0x8,%ebx
  and    $0x3ffff00,%ebx
  xor    %eax,%ebx
  mov    %r12d,%eax
  xor    %edi,%eax
  xor    %ebp,%eax
  mov    %eax,%edi
  imul   $0x51eb851f,%rdi,%rdi
  shr    $0x23,%rdi
  lea    (%rdi,%rdi,4),%edi
  lea    (%rdi,%rdi,4),%edi
  sub    %edi,%eax
  add    $0x61,%eax
  mov    %al,(%rdx)
  add    $0x1,%rdx
  cmp    %rdx,%rcx
  jne    L4
  lea    0x1(%rsi),%r14d
  mov    %esi,%edx
  sar    $0x1f,%edx
  shr    $0x1d,%edx
  lea    (%rsi,%rdx,1),%eax
  and    $0x7,%eax
  sub    %edx,%eax
  cltq
  mov    (%rsp,%rax,8),%rdx
  lea    0x49(%rsp),%rsi
  lea    D69(%rip),%rdi
  call   <printf@plt>
  cmp    %r14d,%r15d
  je     L29
  mov    %r14d,%esi
  jmp    L36
L29:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L33
  mov    $0x0,%eax
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L33:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D58
datatype: string
name: extract_symbolic_data
arguments: tag: D64
datatype: string
name: extract_symbolic_data
arguments: tag: D45
datatype: string
name: extract_symbolic_data
arguments: tag: D6
datatype: string
name: extract_symbolic_data
arguments: tag: D23
datatype: string
name: extract_symbolic_data
arguments: tag: D22
datatype: string
name: extract_symbolic_data
arguments: tag: D65
datatype: string
name: extract_symbolic_data
arguments: tag: D17
datatype: string
name: extract_symbolic_data
arguments: tag: D69
datatype: string

tool: D58: in

tool: D64: me

tool: D45: cc

tool: D6: su

tool: D23: tw

tool: D22: net

tool: D65: com

tool: D17: pw

tool: D69: %s.%s


assistant: ```c
char *dga(unsigned int day, unsigned int month, unsigned int year, unsigned int seed, unsigned int nr) {
  char *tlds[] = {"in", "me", "cc", "su", "tw", "net", "com", "pw", "org"};
  char domain[15];
  int d;
  int tld_index = day;
  for (d = 0; d < nr; d++) {
    unsigned int i;
    for (i = 0; i < 14; i++) {
      day = (day >> 15) ^ 16 * (day & 0x1FFF ^ 4 * (seed ^ day));
      year = ((year & 0xFFFFFFF0) << 17) ^ ((year ^ (7 * year)) >> 11);
      month = 14 * (month & 0xFFFFFFFE) ^ ((month ^ (4 * month)) >> 8);
      seed = (seed >> 6) ^ ((day + 8 * seed) << 8) & 0x3FFFF00;
      int x = ((day ^ month ^ year) % 25) + 97;
      domain[i] = x;
    }
    printf("%s.%s\n", domain, tlds[tld_index++ % 8]);
  }
}
```