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

```asm
<next_generation>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %edx,-0x34(%rbp)
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L231
L132:
  movl   $0x0,-0x18(%rbp)
  jmp    L101
L233:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  je     L82
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L176
L82:
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L184
  mov    -0x18(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  je     L97
L184:
  mov    -0x18(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  jne    L176
  mov    -0x18(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L176
L97:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movl   $0x1,(%rax)
  jmp    L80
L176:
  mov    -0x18(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
L80:
  addl   $0x1,-0x18(%rbp)
L101:
  mov    -0x18(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L233
  movl   $0x0,-0x10(%rbp)
  jmp    L208
L203:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  jne    L93
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  jmp    L234
L93:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L234
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L234:
  addl   $0x1,-0x10(%rbp)
L208:
  mov    -0x10(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L203
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0xc(%rbp)
  jmp    L238
L48:
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  jne    L5
  movl   $0x1,-0x4(%rbp)
L5:
  addl   $0x1,-0xc(%rbp)
L238:
  mov    -0xc(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jge    L153
  cmpl   $0x1,-0x4(%rbp)
  jne    L48
L153:
  cmpl   $0x0,-0x4(%rbp)
  je     L22
  movl   $0x0,-0x8(%rbp)
  jmp    L12
L138:
  mov    -0x8(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    -0x8(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x28(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x8(%rbp)
L12:
  mov    -0x8(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L138
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  addl   $0x1,-0x14(%rbp)
L231:
  cmpl   $0x3e7,-0x14(%rbp)
  jle    L132
  jmp    L72
L22:
  nop
L72:
  nop
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D2
datatype: string
name: disassemble_data
arguments: data_tag: D14
datatype: string
name: disassemble_data
arguments: data_tag: D9
datatype: string

tool: D2: *

tool: D14: .

tool: D9: 


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");
  }
}
```