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

```asm
<cover>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %esi,0x18(%rsp)
  test   %esi,%esi
  jle    L80
  mov    %rdi,%r12
  mov    %edx,%ebp
  mov    %esi,%r13d
  mov    $0x0,%r11d
  mov    $0xffffffff,%ebx
  mov    $0xffffffff,%edx
  mov    $0x0,%r8d
  mov    %ebp,%r9d
  jmp    L275
L229:
  add    $0x1,%rax
  cmp    %r9,%rax
  je     L85
L241:
  cmpl   $0x0,(%rdi,%rax,4)
  jne    L229
  mov    %edx,%ecx
  and    %ebx,%ecx
  cmp    $0xffffffff,%ecx
  cmove  %eax,%ebx
  cmove  %r10d,%edx
  add    $0x1,%r8d
  jmp    L229
L85:
  add    $0x1,%r11
  cmp    %r13,%r11
  je     L276
L275:
  mov    %r11d,%r10d
  test   %ebp,%ebp
  jle    L85
  mov    (%r12,%r11,8),%rdi
  mov    $0x0,%eax
  jmp    L241
L276:
  movslq %r8d,%r13
  imul   $0x55555556,%r13,%r13
  shr    $0x20,%r13
  mov    %r8d,%eax
  sar    $0x1f,%eax
  sub    %eax,%r13d
  lea    0x0(%r13,%r13,2),%eax
  sub    %eax,%r8d
  mov    %r8d,%r13d
  jne    L278
  mov    %edx,%eax
  and    %ebx,%eax
  cmp    $0xffffffff,%eax
  je     L274
  movslq %edx,%rax
  lea    0x0(,%rax,8),%rdi
  mov    %rdi,0x10(%rsp)
  lea    (%r12,%rdi,1),%r15
  movslq %ebx,%r14
  lea    0x0(,%r14,4),%rsi
  mov    %rsi,0x8(%rsp)
  mov    (%r15),%rax
  movl   $0x1,(%rax,%r14,4)
  lea    0x1(%rbx),%eax
  mov    %eax,0x1c(%rsp)
  cmp    %ebp,%eax
  jge    L215
  mov    (%r15),%rax
  lea    0x4(%rax,%rsi,1),%rcx
  mov    (%rcx),%eax
  test   %eax,%eax
  jne    L215
  add    $0x1,%edx
  mov    %eax,%r13d
  cmp    0x18(%rsp),%edx
  jge    L50
  lea    0x8(%r12,%rdi,1),%r13
  mov    0x0(%r13),%rdx
  cmpl   $0x0,0x4(%rdx,%rsi,1)
  je     L242
L300:
  mov    %eax,%r13d
  jmp    L266
L242:
  movl   $0x1,(%rcx)
  mov    0x0(%r13),%rax
  movl   $0x1,0x4(%rax,%rsi,1)
  mov    %ebp,%edx
  mov    0x18(%rsp),%esi
  mov    %r12,%rdi
  call   <cover>
  mov    (%r15),%rdx
  mov    0x8(%rsp),%rdi
  movl   $0x0,0x4(%rdx,%rdi,1)
  mov    0x0(%r13),%rdx
  movl   $0x0,0x4(%rdx,%rdi,1)
  jmp    L300
L215:
  add    $0x1,%edx
  cmp    0x18(%rsp),%edx
  jge    L50
L266:
  mov    0x10(%rsp),%rax
  lea    0x8(%r12,%rax,1),%rdx
  mov    %rdx,0x10(%rsp)
  mov    0x8(%rsp),%rdi
  mov    %rdi,%rax
  add    (%rdx),%rax
  cmpl   $0x0,(%rax)
  jne    L50
  movl   $0x1,(%rax)
  test   %ebx,%ebx
  jle    L148
  mov    (%rdx),%rax
  lea    -0x4(%rax,%rdi,1),%rax
  cmpl   $0x0,(%rax)
  je     L180
L148:
  cmp    %ebp,0x1c(%rsp)
  jge    L305
  mov    0x10(%rsp),%rax
  mov    (%rax),%rax
  mov    0x8(%rsp),%rbx
  lea    0x4(%rax,%rbx,1),%rax
  cmpl   $0x0,(%rax)
  je     L32
L305:
  mov    0x10(%rsp),%rbx
  mov    (%rbx),%rax
  movl   $0x0,(%rax,%r14,4)
  mov    %rbx,%rdx
  mov    0x8(%rsp),%rbx
  mov    %rbx,%rax
  add    (%rdx),%rax
  cmpl   $0x0,(%rax)
  jne    L50
  cmp    %ebp,0x1c(%rsp)
  jge    L50
  mov    (%r15),%rdx
  cmpl   $0x0,0x4(%rdx,%rbx,1)
  je     L82
L50:
  mov    (%r15),%rax
  movl   $0x0,(%rax,%r14,4)
L43:
  mov    %r13d,%eax
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L180:
  movl   $0x1,(%rax)
  mov    %ebp,%edx
  mov    0x18(%rsp),%esi
  mov    %r12,%rdi
  call   <cover>
  add    %eax,%r13d
  mov    0x10(%rsp),%rax
  mov    (%rax),%rax
  mov    0x8(%rsp),%rbx
  movl   $0x0,-0x4(%rax,%rbx,1)
  jmp    L148
L32:
  movl   $0x1,(%rax)
  mov    %ebp,%edx
  mov    0x18(%rsp),%esi
  mov    %r12,%rdi
  call   <cover>
  add    %eax,%r13d
  mov    0x10(%rsp),%rax
  mov    (%rax),%rax
  mov    0x8(%rsp),%rbx
  movl   $0x0,0x4(%rax,%rbx,1)
  jmp    L305
L82:
  movl   $0x1,(%rax)
  mov    (%r15),%rax
  movl   $0x1,0x4(%rax,%rbx,1)
  mov    %ebp,%edx
  mov    0x18(%rsp),%esi
  mov    %r12,%rdi
  call   <cover>
  add    %eax,%r13d
  mov    0x10(%rsp),%rax
  mov    (%rax),%rax
  movl   $0x0,(%rax,%r14,4)
  mov    (%r15),%rax
  movl   $0x0,0x4(%rax,%rbx,1)
  jmp    L50
L80:
  mov    $0x1,%r13d
  jmp    L43
L278:
  mov    $0x0,%r13d
  jmp    L43
L274:
  mov    $0x1,%r13d
  jmp    L43
```

assistant: ```c
int cover(int *colors[], int rows, int cols) {
  int i = 0, j = 0;
  int white_count = 0, first_white_row = -1, first_white_col = -1;
  for (i = 0; i < rows; i++) {
    for (j = 0; j < cols; j++) {
      if (colors[i][j] == 0) {
        if (first_white_row == -1 && first_white_col == -1) {
          first_white_row = i;
          first_white_col = j;
        }
        white_count++;
      }
    }
  }
  if (white_count % 3 != 0) {
    return 0;
  }
  if (first_white_row == -1 && first_white_col == -1) {
    return 1;
  }
  int result = 0;
  colors[first_white_row][first_white_col] = 1;
  if (first_white_col + 1 < cols && colors[first_white_row][first_white_col + 1] == 0 && first_white_row + 1 < rows && colors[first_white_row + 1][first_white_col + 1] == 0) {
    colors[first_white_row][first_white_col + 1] = 1;
    colors[first_white_row + 1][first_white_col + 1] = 1;
    result += cover(colors, rows, cols);
    colors[first_white_row][first_white_col + 1] = 0;
    colors[first_white_row + 1][first_white_col + 1] = 0;
  }
  if (first_white_row + 1 < rows && colors[first_white_row + 1][first_white_col] == 0) {
    colors[first_white_row + 1][first_white_col] = 1;
    if (first_white_col - 1 >= 0 && colors[first_white_row + 1][first_white_col - 1] == 0) {
      colors[first_white_row + 1][first_white_col - 1] = 1;
      result += cover(colors, rows, cols);
      colors[first_white_row + 1][first_white_col - 1] = 0;
    }
    if (first_white_col + 1 < cols && colors[first_white_row + 1][first_white_col + 1] == 0) {
      colors[first_white_row + 1][first_white_col + 1] = 1;
      result += cover(colors, rows, cols);
      colors[first_white_row + 1][first_white_col + 1] = 0;
    }
    colors[first_white_row + 1][first_white_col] = 0;
  }
  if (first_white_row + 1 < rows && colors[first_white_row + 1][first_white_col] == 0 && first_white_col + 1 < cols && colors[first_white_row][first_white_col + 1] == 0) {
    colors[first_white_row + 1][first_white_col] = 1;
    colors[first_white_row][first_white_col + 1] = 1;
    result += cover(colors, rows, cols);
    colors[first_white_row + 1][first_white_col] = 0;
    colors[first_white_row][first_white_col + 1] = 0;
  }
  colors[first_white_row][first_white_col] = 0;
  return result;
}
```