user: 请从给定的汇编指令推导出C源代码：

```asm
<next_generation>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L23
L82:
  movl   $0x0,-0xc(%rbp)
  lea    D28(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L62
L119:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L71
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L71:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  jne    L134
  lea    D20(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L134:
  addl   $0x1,-0xc(%rbp)
L62:
  mov    -0xc(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jne    L119
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x4(%rbp)
  jmp    L65
L46:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L92
  addl   $0x1,-0x4(%rbp)
L92:
  addl   $0x1,-0xc(%rbp)
L65:
  mov    -0xc(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jne    L46
  mov    -0x4(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  je     L14
  movl   $0x1,-0xc(%rbp)
  jmp    L148
L122:
  mov    -0x20(%rbp),%rax
  movl   $0x0,(%rax)
  mov    -0x24(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  mov    -0xc(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0xc(%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    L103
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  jmp    L55
L103:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movl   $0x1,(%rax)
L55:
  addl   $0x1,-0xc(%rbp)
L148:
  mov    -0x24(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0xc(%rbp)
  jne    L122
  movl   $0x0,-0xc(%rbp)
  jmp    L70
L111:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    -0xc(%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,-0xc(%rbp)
L70:
  mov    -0xc(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jne    L111
  addl   $0x1,-0x8(%rbp)
L23:
  cmpl   $0x3e8,-0x8(%rbp)
  jne    L82
  jmp    L116
L14:
  nop
L116:
  nop
  leave
  ret
```

tool_calls: name: read_data
arguments: data_label: D28
type_infered: string
name: read_data
arguments: data_label: D21
type_infered: string
name: read_data
arguments: data_label: D20
type_infered: string

tool: D28: 


tool: D21: .

tool: D20: *

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