user: Please show me the C implementation that matches the assembly code listed below:

```asm
<next_generation>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L114
L191:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  jne    L129
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L129:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L75
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L75:
  addl   $0x1,-0xc(%rbp)
L114:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0xc(%rbp)
  jl     L191
  lea    D26(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movl   $0x0,-0xc(%rbp)
  jmp    L45
L145:
  movl   $0x1,-0x8(%rbp)
  jmp    L176
L9:
  mov    -0x20(%rbp),%rax
  movl   $0x0,(%rax)
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  mov    -0x8(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x8(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  jne    L80
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  jmp    L3
L80:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movl   $0x1,(%rax)
L3:
  addl   $0x1,-0x8(%rbp)
L176:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x8(%rbp)
  jl     L9
  movl   $0x0,-0x8(%rbp)
  jmp    L172
L150:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  jne    L125
  lea    D35(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L34
L125:
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L34:
  addl   $0x1,-0x8(%rbp)
L172:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x8(%rbp)
  jl     L150
  lea    D26(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L98
L95:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L1
  addl   $0x1,-0x4(%rbp)
L1:
  addl   $0x1,-0x8(%rbp)
L98:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x8(%rbp)
  jl     L95
  mov    -0x4(%rbp),%eax
  cmp    -0x8(%rbp),%eax
  je     L72
  movl   $0x0,-0x8(%rbp)
  jmp    L37
L66:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x8(%rbp)
L37:
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x8(%rbp)
  jl     L66
  addl   $0x1,-0xc(%rbp)
L45:
  cmpl   $0x3e7,-0xc(%rbp)
  jle    L145
  jmp    L208
L72:
  nop
L208:
  nop
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D35
datatype: string
name: retrieve_data
arguments: data_label: D21
datatype: string
name: retrieve_data
arguments: data_label: D26
datatype: string

tool: D35: *

tool: D21: .

tool: D26: 


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