user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<run_life>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x58(%rbp)
  mov    D27(%rip),%r12
  mov    %rsp,%rcx
  movslq (%r12),%rdx
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    D20(%rip),%rax
  mov    %rdx,%r10
  lea    0x0(,%rdx,4),%r15
  movslq (%rax),%rax
  mov    %eax,-0x44(%rbp)
  imul   %rdx,%rax
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L129
L161:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L161
L129:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  jne    L48
L72:
  mov    -0x44(%rbp),%eax
  mov    %rsp,-0x60(%rbp)
  test   %eax,%eax
  jle    L62
  test   %r10d,%r10d
  jle    L158
  mov    -0x44(%rbp),%eax
  xor    %edi,%edi
  mov    -0x58(%rbp),%r9
  mov    %r15,-0x50(%rbp)
  mov    %rsp,%r11
  xor    %ebx,%ebx
  lea    0x1(%r10),%r14d
  mov    %edi,%r15d
  sub    $0x1,%eax
  lea    -0x1(%r10),%r13d
  mov    %eax,-0x48(%rbp)
  nopl   0x0(%rax)
L114:
  mov    %r15d,%eax
  add    $0x1,%r15d
  mov    -0x58(%rbp),%rsi
  mov    %ebx,%r8d
  test   %eax,%eax
  lea    -0x1(%rax),%edi
  cmove  -0x48(%rbp),%edi
  mov    -0x50(%rbp),%rax
  mov    $0x1,%edx
  movslq %edi,%rdi
  imul   %rax,%rdi
  add    %rsi,%rdi
  cmp    %r15d,-0x44(%rbp)
  cmovg  %r15d,%r8d
  movslq %r8d,%r8
  imul   %rax,%r8
  add    %rsi,%r8
  jmp    L126
  cs nopw 0x0(%rax,%rax,1)
L58:
  xor    %esi,%esi
  cmp    $0x3,%eax
  sete   %sil
L97:
  mov    %esi,-0x4(%r11,%rdx,4)
  add    $0x1,%rdx
  cmp    %rdx,%r14
  je     L27
L126:
  cmp    $0x1,%rdx
  lea    -0x2(%rdx),%esi
  mov    %ebx,%ecx
  mov    -0x4(%rdi,%rdx,4),%eax
  cmove  %r13d,%esi
  cmp    %edx,%r10d
  cmovg  %edx,%ecx
  movslq %esi,%rsi
  movslq %ecx,%rcx
  add    (%rdi,%rsi,4),%eax
  add    (%rdi,%rcx,4),%eax
  add    (%r9,%rsi,4),%eax
  add    (%r9,%rcx,4),%eax
  add    (%r8,%rsi,4),%eax
  add    -0x4(%r8,%rdx,4),%eax
  add    (%r8,%rcx,4),%eax
  mov    -0x4(%r9,%rdx,4),%ecx
  test   %ecx,%ecx
  je     L58
  xor    %esi,%esi
  cmp    $0x1,%ecx
  jne    L97
  sub    $0x2,%eax
  xor    %esi,%esi
  cmp    $0x1,%eax
  setbe  %sil
  mov    %esi,-0x4(%r11,%rdx,4)
  add    $0x1,%rdx
  cmp    %rdx,%r14
  jne    L126
L27:
  mov    -0x50(%rbp),%rax
  add    %rax,%r11
  add    %rax,%r9
  cmp    %r15d,-0x44(%rbp)
  jne    L114
  mov    %rax,%r15
L158:
  mov    -0x60(%rbp),%rsi
  mov    -0x58(%rbp),%rcx
  xor    %edi,%edi
  test   %r10d,%r10d
  jle    L62
  nop
L167:
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L38:
  mov    (%rsi,%rax,4),%edx
  mov    %edx,(%rcx,%rax,4)
  mov    (%r12),%r10d
  add    $0x1,%rax
  cmp    %eax,%r10d
  jg     L38
  mov    D20(%rip),%rax
  add    $0x1,%edi
  cmp    (%rax),%edi
  jge    L62
  add    %r15,%rsi
  add    %r15,%rcx
  test   %r10d,%r10d
  jg     L167
L62:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L1
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L48:
  orq    $0x0,-0x8(%rsp,%rdx,1)
  jmp    L72
L1:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void run_life(int grid[COLS][LINES]) {
  int i;
  int j;
  int ii;
  int jj;
  int iii;
  int jjj;
  int nei = 0;
  int newgrid[COLS][LINES];
  for (i = 0; i < COLS; i++) {
    for (j = 0; j < LINES; j++) {
      if (i - 1 < 0)
        ii = COLS - 1;
      else
        ii = i - 1;
      if (i + 1 >= COLS)
        iii = 0;
      else
        iii = i + 1;
      if (j - 1 < 0)
        jj = LINES - 1;
      else
        jj = j - 1;
      if (j + 1 >= LINES)
        jjj = 0;
      else
        jjj = j + 1;
      nei = 0;
      nei += grid[ii][jj];
      nei += grid[ii][j];
      nei += grid[ii][jjj];
      nei += grid[i][jj];
      nei += grid[i][jjj];
      nei += grid[iii][jj];
      nei += grid[iii][j];
      nei += grid[iii][jjj];
      if ((grid[i][j] == 0) && nei == 3)
        newgrid[i][j] = 1;
      else if ((grid[i][j] == 1) && (nei == 3 || nei == 2))
        newgrid[i][j] = 1;
      else
        newgrid[i][j] = 0;
    }
  }
  for (i = 0; i < COLS; i++) {
    for (j = 0; j < LINES; j++) {
      grid[i][j] = newgrid[i][j];
    }
  }
}
```