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

```asm
<wireworld>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %edx,-0x30(%rbp)
  mov    -0x30(%rbp),%edx
  mov    -0x2c(%rbp),%ecx
  mov    -0x28(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <copy_world@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L86
L217:
  movl   $0x0,-0x10(%rbp)
  jmp    L296
L115:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L104
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  jmp    L18
L104:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  jne    L243
  movl   $0x0,-0xc(%rbp)
  cmpl   $0x0,-0x14(%rbp)
  jle    L148
  cmpl   $0x0,-0x10(%rbp)
  jle    L148
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x2,%rax
  sub    $0x4,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x2,%eax
  jne    L148
  addl   $0x1,-0xc(%rbp)
L148:
  cmpl   $0x0,-0x14(%rbp)
  jle    L308
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x2,%eax
  jne    L308
  addl   $0x1,-0xc(%rbp)
L308:
  cmpl   $0x0,-0x14(%rbp)
  jle    L223
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x10(%rbp)
  jge    L223
  mov    -0x14(%rbp),%eax
  cltq
  shl    $0x3,%rax
  lea    -0x8(%rax),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x2,%eax
  jne    L223
  addl   $0x1,-0xc(%rbp)
L223:
  cmpl   $0x0,-0x10(%rbp)
  jle    L158
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x2,%rax
  sub    $0x4,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x2,%eax
  jne    L158
  addl   $0x1,-0xc(%rbp)
L158:
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x10(%rbp)
  jge    L318
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x2,%eax
  jne    L318
  addl   $0x1,-0xc(%rbp)
L318:
  mov    -0x30(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x14(%rbp)
  jge    L155
  cmpl   $0x0,-0x10(%rbp)
  jle    L155
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x2,%rax
  sub    $0x4,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x2,%eax
  jne    L155
  addl   $0x1,-0xc(%rbp)
L155:
  mov    -0x30(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x14(%rbp)
  jge    L95
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x2,%eax
  jne    L95
  addl   $0x1,-0xc(%rbp)
L95:
  mov    -0x30(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x14(%rbp)
  jge    L169
  mov    -0x2c(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x10(%rbp)
  jge    L169
  mov    -0x14(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  add    $0x1,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x2,%eax
  jne    L169
  addl   $0x1,-0xc(%rbp)
L169:
  cmpl   $0x1,-0xc(%rbp)
  je     L248
  cmpl   $0x2,-0xc(%rbp)
  jne    L18
L248:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  movl   $0x2,(%rax)
  jmp    L18
L243:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x2,%eax
  jne    L84
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  movl   $0x3,(%rax)
  jmp    L18
L84:
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x3,%eax
  jne    L18
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x10(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  movl   $0x1,(%rax)
L18:
  addl   $0x1,-0x10(%rbp)
L296:
  mov    -0x10(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L115
  addl   $0x1,-0x14(%rbp)
L86:
  mov    -0x14(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L217
  mov    -0x30(%rbp),%edx
  mov    -0x2c(%rbp),%ecx
  mov    -0x28(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <free_world@plt>
  mov    -0x8(%rbp),%rax
  leave
  ret
```

assistant: ```c
int **wireworld(int **world, int SIZE_X, int SIZE_Y) {
  int **newWorld = copy_world(world, SIZE_X, SIZE_Y);
  int i;
  int j;
  for (i = 0; i < SIZE_Y; i++) {
    for (j = 0; j < SIZE_X; j++) {
      if (world[i][j] == 0)
        newWorld[i][j] = 0;
      else if (world[i][j] == 1) {
        int sum = 0;
        if (i > 0 && j > 0 && world[i - 1][j - 1] == 2)
          sum++;
        if (i > 0 && world[i - 1][j] == 2)
          sum++;
        if (i > 0 && j < SIZE_X - 1 && world[i - 1][j + 1] == 2)
          sum++;
        if (j > 0 && world[i][j - 1] == 2)
          sum++;
        if (j < SIZE_X - 1 && world[i][j + 1] == 2)
          sum++;
        if (i < SIZE_Y - 1 && j > 0 && world[i + 1][j - 1] == 2)
          sum++;
        if (i < SIZE_Y - 1 && world[i + 1][j] == 2)
          sum++;
        if (i < SIZE_Y - 1 && j < SIZE_X - 1 && world[i + 1][j + 1] == 2)
          sum++;
        if (sum == 1 || sum == 2)
          newWorld[i][j] = 2;
      } else if (world[i][j] == 2)
        newWorld[i][j] = 3;
      else if (world[i][j] == 3)
        newWorld[i][j] = 1;
    }
  }
  free_world(world, SIZE_X, SIZE_Y);
  return newWorld;
}
```