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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  lea    D49(%rip),%r14
  push   %r13
  mov    %r14,%rdi
  push   %r12
  push   %rbp
  xor    %ebp,%ebp
  push   %rbx
  sub    $0xd8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xc8(%rsp)
  xor    %eax,%eax
  lea    0x1c(%rsp),%rsi
  lea    0x20(%rsp),%rbx
  call   <scanf@plt>
  mov    0x1c(%rsp),%ecx
  mov    %rbx,%r12
  test   %ecx,%ecx
  jle    L113
  xchg   %ax,%ax
L125:
  mov    %r12,%rsi
  mov    %r14,%rdi
  add    $0x1,%ebp
  add    $0x4,%r12
  call   <scanf@plt>
  mov    0x1c(%rsp),%ecx
  cmp    %ebp,%ecx
  jg     L125
L113:
  lea    0x70(%rsp),%r14
  lea    D35(%rip),%rbp
  lea    D23(%rip),%r12
  nopl   (%rax)
L107:
  add    $0x1,%r13d
  test   %ecx,%ecx
  jle    L130
  lea    -0x1(%rcx),%edx
  mov    %rbx,%rax
  lea    0x24(%rsp,%rdx,4),%rdx
  jmp    L123
  nopl   0x0(%rax)
L94:
  add    $0x4,%rax
  cmp    %rdx,%rax
  je     L68
L123:
  cmpl   $0x1,(%rax)
  jne    L94
  cmp    $0x3e7,%r13d
  setle  0xb(%rsp)
L101:
  xor    %r15d,%r15d
  jmp    L153
  nopl   0x0(%rax,%rax,1)
L100:
  mov    %rbp,%rdi
  add    $0x1,%r15
  call   <printf@plt>
  cmp    %r15d,0x1c(%rsp)
  jle    L38
L153:
  cmpl   $0x1,(%rbx,%r15,4)
  jne    L100
  mov    %r12,%rdi
  add    $0x1,%r15
  call   <printf@plt>
  cmp    %r15d,0x1c(%rsp)
  jg     L153
L38:
  lea    D47(%rip),%rdi
  call   <printf@plt>
  mov    0x1c(%rsp),%edx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <next_generation@plt>
  mov    0x1c(%rsp),%ecx
  test   %ecx,%ecx
  jle    L111
L8:
  movslq %ecx,%rdx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  mov    %ecx,0xc(%rsp)
  shl    $0x2,%rdx
  call   <memcpy@plt>
  mov    0xc(%rsp),%ecx
L111:
  cmpb   $0x0,0xb(%rsp)
  jne    L107
L115:
  mov    0xc8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L118
  add    $0xd8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L68:
  movb   $0x0,0xb(%rsp)
  jmp    L101
L130:
  lea    D47(%rip),%rdi
  call   <printf@plt>
  mov    0x1c(%rsp),%edx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <next_generation@plt>
  mov    0x1c(%rsp),%ecx
  test   %ecx,%ecx
  jle    L115
  movb   $0x0,0xb(%rsp)
  jmp    L8
L118:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D49
type_infered: string
name: extract_symbolic_data
arguments: data_label: D35
type_infered: string
name: extract_symbolic_data
arguments: data_label: D23
type_infered: string
name: extract_symbolic_data
arguments: data_label: D47
type_infered: string

tool: D49: %d

tool: D35: .

tool: D23: *

tool: D47: 


assistant: ```c
int main() {
  int n, i;
  int hasAnotherLoop = 1;
  int current[20];
  int next[20];
  int loops;
  scanf("%d", &n);
  for (i = 0; i < n; i++) {
    scanf("%d", &current[i]);
  }
  do {
    hasAnotherLoop = 0;
    for (i = 0; i < n; i++) {
      if (current[i] == 1) {
        hasAnotherLoop = 1;
        break;
      }
    }
    for (i = 0; i < n; i++) {
      if (current[i] == 1) {
        printf("*");
      } else {
        printf(".");
      }
    }
    printf("\n");
    next_generation(current, next, n);
    for (i = 0; i < n; i++) {
      current[i] = next[i];
    }
    loops++;
  } while (hasAnotherLoop == 1 && loops < 1000);
  return 0;
}
```