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

```asm
<main>:
  endbr64
  push   %r14
  push   %r13
  lea    D78(%rip),%r13
  push   %r12
  lea    D63(%rip),%r12
  push   %rbp
  push   %rbx
  sub    $0xc0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xb8(%rsp)
  xor    %eax,%eax
  lea    0xc(%rsp),%rbx
  nopl   0x0(%rax)
L250:
  mov    %r13,%rdi
  call   <printf@plt>
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  mov    0xc(%rsp),%edx
  cmp    $0x14,%edx
  ja     L250
  test   %edx,%edx
  je     L54
  lea    0x10(%rsp),%rbx
  xor    %r14d,%r14d
  lea    D61(%rip),%r13
  nop
L178:
  mov    %r13,%rdi
  call   <printf@plt>
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  cmpl   $0x1,(%rbx)
  ja     L178
  mov    0xc(%rsp),%edx
  add    $0x1,%r14d
  add    $0x4,%rbx
  cmp    %r14d,%edx
  jg     L178
L54:
  mov    0x10(%rsp),%esi
  test   %esi,%esi
  jne    L275
  lea    -0x1(%rdx),%eax
  movslq %eax,%rcx
  mov    0x10(%rsp,%rcx,4),%ecx
  test   %ecx,%ecx
  jne    L275
  xor    %ebx,%ebx
  lea    0x10(%rsp),%r14
  lea    D69(%rip),%r13
  lea    D42(%rip),%r12
  test   %edx,%edx
  jg     L241
L211:
  cltq
  movl   $0x0,0x60(%rsp)
  mov    $0x3e7,%ebx
  movl   $0x0,0x60(%rsp,%rax,4)
  jmp    L138
L100:
  lea    -0x1(%rdx),%eax
  cmp    $0x2,%eax
  jbe    L72
  mov    %edx,%eax
  pxor   %xmm1,%xmm1
  movdqa %xmm1,%xmm0
  shr    $0x2,%eax
  pcmpeqd 0x10(%rsp),%xmm0
  pand   D56(%rip),%xmm0
  cmp    $0x1,%eax
  je     L196
  movdqa %xmm1,%xmm2
  pcmpeqd 0x20(%rsp),%xmm2
  psubd  %xmm2,%xmm0
  cmp    $0x2,%eax
  je     L196
  movdqa %xmm1,%xmm2
  pcmpeqd 0x30(%rsp),%xmm2
  psubd  %xmm2,%xmm0
  cmp    $0x3,%eax
  je     L196
  movdqa %xmm1,%xmm2
  pcmpeqd 0x40(%rsp),%xmm2
  psubd  %xmm2,%xmm0
  cmp    $0x4,%eax
  je     L196
  pcmpeqd 0x50(%rsp),%xmm1
  psubd  %xmm1,%xmm0
L196:
  movdqa %xmm0,%xmm1
  mov    %edx,%eax
  psrldq $0x8,%xmm1
  and    $0xfffffffc,%eax
  paddd  %xmm1,%xmm0
  movdqa %xmm0,%xmm1
  psrldq $0x4,%xmm1
  paddd  %xmm1,%xmm0
  movd   %xmm0,%ebp
  test   $0x3,%dl
  je     L225
L161:
  movslq %eax,%rcx
  cmpl   $0x1,0x10(%rsp,%rcx,4)
  lea    0x1(%rax),%ecx
  adc    $0x0,%ebp
  cmp    %ecx,%edx
  jle    L225
  movslq %ecx,%rcx
  cmpl   $0x1,0x10(%rsp,%rcx,4)
  adc    $0x0,%ebp
  add    $0x2,%eax
  cmp    %eax,%edx
  jle    L225
  cltq
  cmpl   $0x1,0x10(%rsp,%rax,4)
  adc    $0x0,%ebp
L225:
  sub    $0x1,%ebx
  je     L163
L138:
  cmp    %edx,%ebp
  je     L163
  lea    0x60(%rsp),%rsi
  lea    0x10(%rsp),%rdi
  call   <next_generation@plt>
  mov    0xc(%rsp),%edx
  test   %edx,%edx
  jg     L100
  xor    %ebp,%ebp
  jmp    L225
  nopl   (%rax)
L186:
  cmp    $0x1,%eax
  je     L125
L88:
  add    $0x1,%rbx
  cmp    %ebx,%edx
  jle    L148
L241:
  mov    (%r14,%rbx,4),%eax
  test   %eax,%eax
  jne    L186
  mov    %r12,%rdi
  add    $0x1,%rbx
  call   <printf@plt>
  mov    0xc(%rsp),%edx
  cmp    %ebx,%edx
  jg     L241
L148:
  lea    -0x1(%rdx),%eax
  jmp    L211
L72:
  xor    %ebp,%ebp
  xor    %eax,%eax
  jmp    L161
L125:
  mov    %r13,%rdi
  call   <printf@plt>
  mov    0xc(%rsp),%edx
  jmp    L88
L163:
  lea    D52(%rip),%rdi
  call   <printf@plt>
L230:
  mov    0xb8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L1
  add    $0xc0,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L275:
  lea    D17(%rip),%rdi
  call   <printf@plt>
  jmp    L230
L1:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D78
type: string
name: disassemble_data
arguments: data_tag: D63
type: string
name: disassemble_data
arguments: data_tag: D61
type: string
name: disassemble_data
arguments: data_tag: D69
type: string
name: disassemble_data
arguments: data_tag: D42
type: string
name: disassemble_data
arguments: data_tag: D56
type: byte[16]
name: disassemble_data
arguments: data_tag: D52
type: string
name: disassemble_data
arguments: data_tag: D17
type: string

tool: D78: Enter length for the cell chain(you can only use a number between 0 and 20):


tool: D63: %d

tool: D61: Enter a number(you can only use 1 or 0):


tool: D69: *

tool: D42: .

tool: {"D56": [0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00]}

tool: D52: 


tool: D17: Error! Cell chain must start and end with 0.


assistant: ```c
int main() {
  int currentGen[20], nextGen[20], n, i, j, temp;
  do {
    printf("Enter length for the cell chain(you can only use a number between 0 and 20):\n");
    scanf("%d", &n);
  } while (n < 0 || n > 20);
  for (i = 0; i < n; i++) {
    do {
      printf("Enter a number(you can only use 1 or 0):\n");
      scanf("%d", &currentGen[i]);
    } while (currentGen[i] != 0 && currentGen[i] != 1);
  }
  if (currentGen[0] != 0 || currentGen[n - 1] != 0) {
    printf("Error! Cell chain must start and end with 0.\n");
    return 0;
  }
  for (i = 0; i < n; i++) {
    if (currentGen[i] == 0) {
      printf(".");
    } else if (currentGen[i] == 1) {
      printf("*");
    }
  }
  nextGen[0] = 0;
  nextGen[n - 1] = 0;
  for (i = 0; i < 999 && temp != n; i++) {
    next_generation(currentGen, nextGen, n);
    for (j = 0, temp = 0; j < n; j++) {
      if (currentGen[j] == 0)
        temp++;
    }
  }
  printf("\n");
  return 0;
}
```