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

```asm
<next_generation>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  lea    D19(%rip),%rdi
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  sub    $0x18,%rsp
  call   <printf@plt>
  lea    -0x1(%rbp),%eax
  mov    %eax,0xc(%rsp)
  test   %ebp,%ebp
  jle    L102
  lea    0x4(%r13,%rax,4),%rax
  mov    %r13,%rbx
  lea    D11(%rip),%r15
  mov    %rax,(%rsp)
  lea    D31(%rip),%r14
  jmp    L173
  nopl   0x0(%rax)
L107:
  mov    %r14,%rdi
  add    $0x4,%rbx
  call   <printf@plt>
  cmp    (%rsp),%rbx
  je     L206
L173:
  mov    (%rbx),%eax
  test   %eax,%eax
  je     L107
  mov    %r15,%rdi
  add    $0x4,%rbx
  call   <printf@plt>
  cmp    (%rsp),%rbx
  jne    L173
L206:
  cmpl   $0x1,0xc(%rsp)
  jle    L17
  mov    %r12,%rax
  sub    %r13,%rax
  cmp    $0x10,%rax
  jbe    L90
  cmp    $0x5,%ebp
  jle    L90
  cmp    $0x2,%ebp
  mov    $0x1,%eax
  lea    -0x2(%rbp),%edi
  movdqa D37(%rip),%xmm1
  cmovle %eax,%edi
  xor    %eax,%eax
  mov    %edi,%edx
  shr    $0x2,%edx
  shl    $0x4,%rdx
  nopw   0x0(%rax,%rax,1)
L252:
  movdqu 0x0(%r13,%rax,1),%xmm0
  movdqu 0x8(%r13,%rax,1),%xmm2
  pcmpeqd %xmm2,%xmm0
  pandn  %xmm1,%xmm0
  movups %xmm0,0x4(%r12,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L252
  mov    %edi,%edx
  and    $0xfffffffc,%edx
  lea    0x1(%rdx),%eax
  cmp    %edx,%edi
  je     L17
  cltq
  xor    %r8d,%r8d
  mov    0xc(%rsp),%ecx
  mov    0x4(%r13,%rax,4),%esi
  cmp    %esi,-0x4(%r13,%rax,4)
  lea    0x0(,%rax,4),%rdi
  setne  %r8b
  mov    %r8d,(%r12,%rax,4)
  lea    0x2(%rdx),%r8d
  cmp    %r8d,%ecx
  jle    L17
  mov    0x8(%r13,%rdi,1),%esi
  cmp    %esi,0x0(%r13,%rax,4)
  setne  %al
  add    $0x3,%edx
  movzbl %al,%eax
  mov    %eax,0x4(%r12,%rdi,1)
  cmp    %edx,%ecx
  jle    L17
  mov    0xc(%r13,%rdi,1),%eax
  cmp    %eax,0x4(%r13,%rdi,1)
  setne  %al
  movzbl %al,%eax
  mov    %eax,0x8(%r12,%rdi,1)
L17:
  lea    0x4(%r12),%rdx
  mov    %r13,%rax
  sub    %rdx,%rax
  cmp    $0x8,%rax
  jbe    L231
  cmp    $0x3,%ebp
  jle    L231
  test   %ebp,%ebp
  mov    $0x1,%edi
  cmovg  %ebp,%edi
  xor    %eax,%eax
  mov    %edi,%edx
  shr    $0x2,%edx
  shl    $0x4,%rdx
  nopl   0x0(%rax)
L104:
  movdqu (%r12,%rax,1),%xmm3
  movups %xmm3,0x0(%r13,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L104
  mov    %edi,%eax
  and    $0xfffffffc,%eax
  and    $0x3,%edi
  je     L225
  mov    %eax,%edi
  mov    (%r12,%rdi,4),%r8d
  lea    0x0(,%rdi,4),%rdx
  mov    %r8d,0x0(%r13,%rdi,4)
  lea    0x1(%rax),%edi
  cmp    %edi,%ebp
  jle    L225
  mov    0x4(%r12,%rdx,1),%edi
  add    $0x2,%eax
  mov    %edi,0x4(%r13,%rdx,1)
  cmp    %ebp,%eax
  jge    L225
  mov    0x8(%r12,%rdx,1),%eax
  mov    %eax,0x8(%r13,%rdx,1)
L225:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L231:
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L79:
  mov    (%r12,%rax,4),%edx
  mov    %edx,0x0(%r13,%rax,4)
  add    $0x1,%rax
  cmp    %eax,%ebp
  jg     L79
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L102:
  cmpl   $0x1,0xc(%rsp)
  jle    L225
L90:
  mov    $0x1,%eax
  nopl   0x0(%rax)
L239:
  mov    -0x4(%r13,%rax,4),%ecx
  cmp    %ecx,0x4(%r13,%rax,4)
  je     L109
  movl   $0x1,(%r12,%rax,4)
  add    $0x1,%rax
  cmp    %eax,0xc(%rsp)
  jg     L239
L46:
  test   %ebp,%ebp
  jle    L225
  jmp    L17
  nopw   0x0(%rax,%rax,1)
L109:
  movl   $0x0,(%r12,%rax,4)
  add    $0x1,%rax
  cmp    %eax,0xc(%rsp)
  jg     L239
  jmp    L46
```

tool_calls: name: disassemble_data
arguments: data_label: D19
datatype: string
name: disassemble_data
arguments: data_label: D11
datatype: string
name: disassemble_data
arguments: data_label: D31
datatype: string
name: disassemble_data
arguments: data_label: D37
datatype: byte[16]

tool: D19: 


tool: D11: *

tool: D31: .

tool: {"D37": [0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00]}

assistant: ```c
void next_generation(int *current, int *next, int length) {
  int i;
  printf("\n");
  for (i = 0; i < length; i++) {
    if (current[i] == 0)
      printf(".");
    else
      printf("*");
  }
  for (i = 1; i < length - 1; i++) {
    if (current[i - 1] == current[i + 1])
      next[i] = 0;
    else
      next[i] = 1;
  }
  for (i = 0; i < length; i++)
    current[i] = next[i];
}
```