user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<next_generation>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  push   %r14
  push   %r13
  lea    D18(%rip),%r13
  push   %r12
  mov    %rdi,%r12
  lea    -0x1(%rdx),%edi
  push   %rbp
  lea    0x4(%r12,%rdi,4),%r14
  mov    %rdi,%rax
  push   %rbx
  mov    %edx,%ebx
  mov    %r12,%rdx
  sub    $0x68,%rsp
  mov    %rdi,0x58(%rsp)
  lea    0x4(%rsi),%rdi
  sub    %rdi,%rdx
  mov    %ebx,%edi
  movl   $0x3e8,0xc(%rsp)
  cmp    $0x8,%rdx
  seta   %dl
  cmp    $0x2,%eax
  seta   %al
  and    $0xfffffffc,%edi
  and    %eax,%edx
  mov    %ebx,%eax
  mov    %edi,0x14(%rsp)
  shr    $0x2,%eax
  mov    %dl,0x13(%rsp)
  lea    -0x1(%rax),%ebp
  movslq %edi,%rax
  shl    $0x2,%rax
  add    $0x1,%rbp
  add    %rax,%rsi
  add    %r12,%rax
  shl    $0x4,%rbp
  mov    %rax,0x28(%rsp)
  lea    0x1(%rdi),%eax
  mov    %eax,0x30(%rsp)
  cltq
  shl    $0x2,%rax
  mov    %rsi,0x20(%rsp)
  lea    (%r15,%rax,1),%rsi
  add    %r12,%rax
  mov    %rbp,0x18(%rsp)
  mov    %rax,0x38(%rsp)
  lea    0x2(%rdi),%eax
  mov    %eax,0x34(%rsp)
  cltq
  shl    $0x2,%rax
  mov    %rsi,0x40(%rsp)
  lea    (%r15,%rax,1),%rdi
  add    %r12,%rax
  mov    %rdi,0x50(%rsp)
  mov    %rax,0x48(%rsp)
  mov    %r15,%rax
  mov    %r14,%r15
  mov    %r12,%r14
  mov    %rax,%r12
  nopl   0x0(%rax,%rax,1)
L117:
  test   %ebx,%ebx
  jle    L101
  mov    %r12,%rdx
  mov    %r14,%rax
  jmp    L73
  nopl   0x0(%rax,%rax,1)
L17:
  add    $0x4,%rax
  movl   $0x0,(%rdx)
  add    $0x4,%rdx
  cmp    %r15,%rax
  je     L251
L73:
  cmpl   $0x1,(%rax)
  ja     L17
  mov    -0x4(%rax),%ecx
  test   %ecx,%ecx
  jne    L172
  cmpl   $0x1,0x4(%rax)
  jne    L17
  movl   $0x1,(%rdx)
L47:
  add    $0x4,%rax
  add    $0x4,%rdx
  cmp    %r15,%rax
  jne    L73
  nopl   0x0(%rax)
L251:
  mov    %r14,%rbp
  jmp    L116
  nopl   (%rax)
L231:
  add    $0x4,%rbp
  cmp    %r15,%rbp
  je     L170
L116:
  mov    0x0(%rbp),%eax
  cmp    $0x1,%eax
  je     L194
  test   %eax,%eax
  jne    L231
  mov    %r13,%rdi
  add    $0x4,%rbp
  call   <printf@plt>
  cmp    %r15,%rbp
  jne    L116
L170:
  mov    $0x1,%eax
  nopw   0x0(%rax,%rax,1)
L100:
  mov    -0x4(%r14,%rax,4),%edx
  cmp    %eax,%ebx
  setg   %sil
  cmp    $0x1,%edx
  setne  %cl
  add    $0x1,%rax
  test   %cl,%sil
  jne    L100
  cmp    $0x1,%edx
  jne    L101
  xor    %eax,%eax
  cmpb   $0x0,0x13(%rsp)
  je     L26
  mov    0x18(%rsp),%rdx
  nopl   (%rax)
L98:
  movdqu (%r12,%rax,1),%xmm0
  movups %xmm0,(%r14,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L98
  cmp    %ebx,0x14(%rsp)
  je     L125
  mov    0x20(%rsp),%rax
  mov    0x28(%rsp),%rdi
  mov    (%rax),%eax
  mov    %eax,(%rdi)
  cmp    0x30(%rsp),%ebx
  jle    L125
  mov    0x40(%rsp),%rax
  mov    0x38(%rsp),%rdi
  mov    (%rax),%eax
  mov    %eax,(%rdi)
  cmp    %ebx,0x34(%rsp)
  jge    L125
  mov    0x50(%rsp),%rax
  mov    0x48(%rsp),%rdi
  mov    (%rax),%eax
  mov    %eax,(%rdi)
L125:
  lea    D5(%rip),%rdi
  call   <printf@plt>
  subl   $0x1,0xc(%rsp)
  jne    L117
L101:
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  xchg   %ax,%ax
L172:
  cmp    $0x1,%ecx
  jne    L17
  mov    0x4(%rax),%ecx
  test   %ecx,%ecx
  jne    L17
  movl   $0x1,(%rdx)
  jmp    L47
  nop
L194:
  lea    D0(%rip),%rdi
  call   <printf@plt>
  jmp    L231
  nopl   0x0(%rax)
L26:
  mov    0x58(%rsp),%rcx
  nopl   (%rax)
L106:
  mov    (%r12,%rax,4),%edx
  mov    %edx,(%r14,%rax,4)
  mov    %rax,%rdx
  add    $0x1,%rax
  cmp    %rcx,%rdx
  jne    L106
  jmp    L125
```

tool_calls: name: retrieve_data
arguments: data_label: D18
type_guessed: string
name: retrieve_data
arguments: data_label: D5
type_guessed: string
name: retrieve_data
arguments: data_label: D0
type_guessed: string

tool: D18: .

tool: D5: 


tool: D0: *

assistant: ```c
void next_generation(int *current, int *next, int lenght) {
  int index, limit_times, printing, check, swap, is_checked = 0;
  for (limit_times = 0; limit_times < 1000; limit_times++) {
    for (index = 0; index < lenght; index++) {
      if ((current[index] == 1 || current[index] == 0) && ((current[index - 1] == 0 && current[index + 1] == 1) || (current[index - 1] == 1 && current[index + 1] == 0))) {
        next[index] = 1;
      } else {
        next[index] = 0;
      }
    }
    for (printing = 0; printing < lenght; printing++) {
      if (current[printing] == 1)
        printf("*");
      else if (current[printing] == 0)
        printf(".");
    }
    is_checked = 0;
    for (check = 0; check < lenght && is_checked != 1; check++) {
      if (current[check] == 1)
        is_checked = 1;
    }
    if (is_checked == 0)
      break;
    for (swap = 0; swap < lenght; swap++) {
      current[swap] = next[swap];
    }
    printf("\n");
  }
}
```