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

```asm
<jerasure_invertible_matrix>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %esi,-0x4c(%rbp)
  mov    %edx,-0x50(%rbp)
  mov    -0x4c(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  movl   $0x0,-0x34(%rbp)
  jmp    L52
L108:
  mov    -0x24(%rbp),%eax
  imul   -0x34(%rbp),%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x20(%rbp),%edx
  mov    -0x34(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  jne    L149
  mov    -0x34(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x30(%rbp)
  jmp    L87
L181:
  addl   $0x1,-0x30(%rbp)
L87:
  mov    -0x30(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jge    L203
  mov    -0x24(%rbp),%eax
  imul   -0x30(%rbp),%eax
  mov    %eax,%edx
  mov    -0x34(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L181
L203:
  mov    -0x30(%rbp),%eax
  cmp    -0x4c(%rbp),%eax
  jne    L162
  mov    $0x0,%eax
  jmp    L0
L162:
  mov    -0x30(%rbp),%eax
  imul   -0x24(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L200
L113:
  mov    -0x20(%rbp),%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x1c(%rbp),%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    -0x20(%rbp),%ecx
  mov    -0x2c(%rbp),%edx
  add    %ecx,%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x48(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x1c(%rbp),%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  mov    -0x18(%rbp),%eax
  mov    %eax,(%rdx)
  addl   $0x1,-0x2c(%rbp)
L200:
  mov    -0x2c(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L113
L149:
  mov    -0x20(%rbp),%edx
  mov    -0x34(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x18(%rbp)
  cmpl   $0x1,-0x18(%rbp)
  je     L22
  mov    -0x50(%rbp),%edx
  mov    -0x18(%rbp),%eax
  mov    %eax,%esi
  mov    $0x1,%edi
  call   <galois_single_divide@plt>
  mov    %eax,-0x14(%rbp)
  movl   $0x0,-0x30(%rbp)
  jmp    L74
L110:
  mov    -0x20(%rbp),%edx
  mov    -0x30(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    -0x20(%rbp),%ecx
  mov    -0x30(%rbp),%edx
  add    %ecx,%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x48(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    -0x50(%rbp),%edx
  mov    -0x14(%rbp),%ecx
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <galois_single_multiply@plt>
  mov    %eax,(%rbx)
  addl   $0x1,-0x30(%rbp)
L74:
  mov    -0x30(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L110
L22:
  mov    -0x20(%rbp),%edx
  mov    -0x34(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x34(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x30(%rbp)
  jmp    L78
L16:
  mov    -0x24(%rbp),%eax
  add    %eax,-0x2c(%rbp)
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L76
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0x1,%eax
  jne    L71
  mov    -0x24(%rbp),%eax
  imul   -0x30(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  movl   $0x0,-0x28(%rbp)
  jmp    L25
L120:
  mov    -0x1c(%rbp),%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x20(%rbp),%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x1c(%rbp),%esi
  mov    -0x28(%rbp),%eax
  add    %esi,%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x48(%rbp),%rax
  add    %rsi,%rax
  xor    %ecx,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x28(%rbp)
L25:
  mov    -0x28(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L120
  jmp    L76
L71:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x24(%rbp),%eax
  imul   -0x30(%rbp),%eax
  mov    %eax,-0x1c(%rbp)
  movl   $0x0,-0x28(%rbp)
  jmp    L115
L153:
  mov    -0x20(%rbp),%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x50(%rbp),%edx
  mov    -0x18(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <galois_single_multiply@plt>
  mov    %eax,%edx
  mov    -0x1c(%rbp),%ecx
  mov    -0x28(%rbp),%eax
  add    %ecx,%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x48(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%ecx
  mov    -0x1c(%rbp),%esi
  mov    -0x28(%rbp),%eax
  add    %esi,%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x48(%rbp),%rax
  add    %rsi,%rax
  xor    %ecx,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x28(%rbp)
L115:
  mov    -0x28(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L153
L76:
  addl   $0x1,-0x30(%rbp)
L78:
  mov    -0x30(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jne    L16
  addl   $0x1,-0x34(%rbp)
L52:
  mov    -0x34(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L108
  mov    $0x1,%eax
L0:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int jerasure_invertible_matrix(int *mat, int rows, int w) {
  int cols, i, j, k, x, rs2;
  int row_start, tmp, inverse;
  cols = rows;
  for (i = 0; i < cols; i++) {
    row_start = cols * i;
    if (mat[row_start + i] == 0) {
      for (j = i + 1; j < rows && mat[cols * j + i] == 0; j++)
        ;
      if (j == rows)
        return 0;
      rs2 = j * cols;
      for (k = 0; k < cols; k++) {
        tmp = mat[row_start + k];
        mat[row_start + k] = mat[rs2 + k];
        mat[rs2 + k] = tmp;
      }
    }
    tmp = mat[row_start + i];
    if (tmp != 1) {
      inverse = galois_single_divide(1, tmp, w);
      for (j = 0; j < cols; j++) {
        mat[row_start + j] = galois_single_multiply(mat[row_start + j], inverse, w);
      }
    }
    k = row_start + i;
    for (j = i + 1; j != cols; j++) {
      k += cols;
      if (mat[k] != 0) {
        if (mat[k] == 1) {
          rs2 = cols * j;
          for (x = 0; x < cols; x++) {
            mat[rs2 + x] ^= mat[row_start + x];
          }
        } else {
          tmp = mat[k];
          rs2 = cols * j;
          for (x = 0; x < cols; x++) {
            mat[rs2 + x] ^= galois_single_multiply(tmp, mat[row_start + x], w);
          }
        }
      }
    }
  }
  return 1;
}
```