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

```asm
<next_generation>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r13
  mov    %rsi,%rbx
  mov    %rdx,%rbp
  cmpl   $0x0,(%rdx)
  jle    L104
  mov    $0x0,%r12d
  lea    D21(%rip),%r15
  lea    D55(%rip),%r14
  jmp    L92
L152:
  mov    %r15,%rdi
  call   <printf@plt>
  jmp    L198
L69:
  add    $0x1,%r12
  cmp    %r12d,0x0(%rbp)
  jle    L104
L92:
  cmpl   $0x1,0x0(%r13,%r12,4)
  je     L152
L198:
  cmpl   $0x0,0x0(%r13,%r12,4)
  jne    L69
  mov    %r14,%rdi
  call   <printf@plt>
  jmp    L69
L104:
  lea    D48(%rip),%rdi
  call   <printf@plt>
  movl   $0x3e8,0xc(%rsp)
  lea    D55(%rip),%r14
  lea    D21(%rip),%r15
  jmp    L79
L176:
  mov    %r14,%rdi
  call   <printf@plt>
L146:
  add    $0x1,%r12
  cmp    %r12d,0x0(%rbp)
  jle    L43
L119:
  cmpl   $0x1,(%rbx,%r12,4)
  jne    L176
  mov    %r15,%rdi
  call   <printf@plt>
  jmp    L146
L43:
  lea    D48(%rip),%rdi
  call   <printf@plt>
  mov    0x0(%rbp),%esi
  test   %esi,%esi
  jle    L18
  mov    %rbx,%rax
  lea    -0x1(%rsi),%edx
  lea    0x4(%rbx,%rdx,4),%rcx
  mov    $0x0,%edx
L150:
  cmpl   $0x1,(%rax)
  adc    $0x0,%edx
  add    $0x4,%rax
  cmp    %rax,%rcx
  jne    L150
  cmp    %esi,%edx
  je     L18
  mov    $0x0,%eax
L109:
  mov    (%rbx,%rax,4),%edx
  mov    %edx,0x0(%r13,%rax,4)
  add    $0x1,%rax
  cmp    %eax,0x0(%rbp)
  jg     L109
  subl   $0x1,0xc(%rsp)
  je     L18
L79:
  mov    $0x1,%eax
  cmpl   $0x2,0x0(%rbp)
  jle    L67
L28:
  movl   $0x0,(%rbx)
  movslq 0x0(%rbp),%rdx
  movl   $0x0,-0x4(%rbx,%rdx,4)
  mov    0x4(%r13,%rax,4),%esi
  cmp    %esi,-0x4(%r13,%rax,4)
  setne  %dl
  movzbl %dl,%edx
  mov    %edx,(%rbx,%rax,4)
  add    $0x1,%rax
  mov    0x0(%rbp),%ecx
  lea    -0x1(%rcx),%edx
  cmp    %eax,%edx
  jg     L28
L67:
  cmpl   $0x0,0x0(%rbp)
  jle    L43
  mov    $0x0,%r12d
  jmp    L119
L18:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D21
type_infered: string
name: unpack_data
arguments: data_tag: D55
type_infered: string
name: unpack_data
arguments: data_tag: D48
type_infered: string

tool: D21: *

tool: D55: .

tool: D48: 


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];
  }
}
```