user: What is the c source code of the assembly code below?

```asm
<jerasure_invert_bitmatrix>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,-0x40(%rsp)
  mov    %edx,-0x4(%rsp)
  mov    $0x0,%eax
  test   %edx,%edx
  jle    L290
  mov    %rsi,%r13
  mov    $0x0,%edi
  mov    $0x0,%r10d
  mov    %edx,%esi
  mov    -0x4(%rsp),%r8d
L190:
  movslq %edi,%rax
  lea    0x0(%r13,%rax,4),%rcx
  mov    $0x0,%eax
L5:
  cmp    %eax,%r10d
  sete   %dl
  movzbl %dl,%edx
  mov    %edx,(%rcx,%rax,4)
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L5
  add    %r8d,%edi
  lea    0x1(%r10),%r14d
  cmp    %r14d,%r8d
  je     L107
  mov    %r14d,%r10d
  jmp    L190
L107:
  movslq %r14d,%rbx
  lea    0x4(,%rbx,4),%rax
  mov    %rax,-0x18(%rsp)
  lea    0x0(,%rbx,4),%r9
  mov    %r10d,%eax
  mov    -0x40(%rsp),%r15
  lea    0x4(%r15,%rax,4),%r12
  lea    0x2(%rax),%rcx
  mov    %rcx,-0x10(%rsp)
  add    $0x1,%rax
  mov    %rax,-0x20(%rsp)
  mov    %r15,%r11
  mov    %r14d,%edx
  mov    $0x0,%esi
  movq   $0x0,-0x28(%rsp)
  mov    $0x1,%ebp
  lea    (%r14,%r14,1),%eax
  mov    %eax,-0x8(%rsp)
  mov    %r14d,-0x2c(%rsp)
  mov    %rsi,%r14
  jmp    L131
L196:
  mov    %ebp,%eax
  cmp    %ebp,-0x2c(%rsp)
  jle    L206
  movslq %edx,%rdx
  lea    -0x1(%rbp,%rdx,1),%rdx
  mov    -0x40(%rsp),%rsi
  lea    (%rsi,%rdx,4),%rdx
L148:
  cmpl   $0x0,(%rdx)
  jne    L206
  lea    0x1(%rax),%ecx
  add    %r9,%rdx
  cmp    %eax,%r10d
  je     L50
  mov    %ecx,%eax
  jmp    L148
L206:
  mov    -0x2c(%rsp),%esi
  cmp    %eax,%esi
  je     L81
  imul   %esi,%eax
  mov    -0x40(%rsp),%rsi
  lea    (%rsi,%r14,1),%rdx
  lea    0x0(%r13,%r14,1),%rcx
  cltq
  sub    -0x28(%rsp),%rax
L185:
  mov    (%rdx),%esi
  mov    (%rdx,%rax,4),%edi
  mov    %edi,(%rdx)
  mov    %esi,(%rdx,%rax,4)
  mov    (%rcx),%esi
  mov    (%rcx,%rax,4),%edi
  mov    %edi,(%rcx)
  mov    %esi,(%rcx,%rax,4)
  add    $0x4,%rdx
  add    $0x4,%rcx
  cmp    %r12,%rdx
  jne    L185
  jmp    L46
L284:
  lea    0x1(%r8),%eax
  sub    %rbx,%rcx
  add    %r9,%rsi
  add    %r9,%rdi
  cmp    %r8d,%r10d
  je     L29
  mov    %eax,%r8d
L238:
  cmpl   $0x0,(%r11,%rdi,1)
  je     L284
  mov    -0x40(%rsp),%rax
  add    %rdi,%rax
  lea    0x0(%r13,%rdi,1),%rdx
  mov    %rdi,-0x48(%rsp)
L135:
  mov    (%rax,%rcx,4),%edi
  xor    %edi,(%rax)
  mov    (%rdx,%rcx,4),%edi
  xor    %edi,(%rdx)
  add    $0x4,%rax
  add    $0x4,%rdx
  cmp    %rsi,%rax
  jne    L135
  mov    -0x48(%rsp),%rdi
  jmp    L284
L29:
  add    $0x1,%rbp
  add    -0x18(%rsp),%r15
  mov    -0x38(%rsp),%edx
  add    -0x8(%rsp),%edx
  add    $0x4,%r11
  cmp    -0x10(%rsp),%rbp
  je     L36
L131:
  mov    %edx,%eax
  sub    -0x2c(%rsp),%eax
  mov    %eax,-0x38(%rsp)
  cmpl   $0x0,(%r15)
  je     L196
L46:
  mov    %ebp,%r8d
  cmp    -0x20(%rsp),%rbp
  je     L36
  add    %rbx,-0x28(%rsp)
  mov    %rbx,%rcx
  neg    %rcx
  add    %r9,%r12
  add    %r9,%r14
  mov    %r14,%rdi
  mov    %r12,%rsi
  jmp    L238
L47:
  add    $0x1,%r8d
  sub    %rbp,%rcx
  add    %r9,%rsi
  add    %r9,%rdi
  cmp    %ebx,%r8d
  je     L276
L82:
  cmpl   $0x0,(%r11,%rdi,1)
  je     L47
  test   %r15d,%r15d
  jle    L47
  mov    -0x40(%rsp),%rax
  add    %rdi,%rax
  lea    0x0(%r13,%rdi,1),%rdx
  mov    %rdi,-0x48(%rsp)
L262:
  mov    (%rax,%rcx,4),%edi
  xor    %edi,(%rax)
  mov    (%rdx,%rcx,4),%edi
  xor    %edi,(%rdx)
  add    $0x4,%rax
  add    $0x4,%rdx
  cmp    %rsi,%rax
  jne    L262
  mov    -0x48(%rsp),%rdi
  jmp    L47
L160:
  test   %r14d,%r14d
  jns    L276
  mov    $0x0,%eax
  jmp    L290
L276:
  sub    $0x1,%r12d
  sub    $0x1,%r14d
  sub    $0x4,%r11
  sub    %r15d,%r10d
L16:
  mov    %r12d,%ebx
  test   %r12d,%r12d
  jle    L160
  movslq %r10d,%rcx
  mov    -0x38(%rsp),%rsi
  mov    $0x0,%edi
  mov    $0x0,%r8d
  jmp    L82
L50:
  mov    $0xffffffff,%eax
L290:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L81:
  mov    $0xffffffff,%eax
  jmp    L290
L36:
  mov    %r10d,%r12d
  lea    -0x1(%r10),%r14d
  movslq %r10d,%rax
  mov    -0x40(%rsp),%rsi
  lea    (%rsi,%rax,4),%r11
  mov    -0x4(%rsp),%ebx
  imul   %ebx,%r10d
  movslq %ebx,%rbp
  lea    0x0(,%rbp,4),%r9
  lea    -0x1(%rbx),%eax
  lea    0x4(%rsi,%rax,4),%r15
  mov    %r15,-0x38(%rsp)
  mov    %ebx,%r15d
  jmp    L16
```

assistant: ```c
int jerasure_invert_bitmatrix(int *mat, int *inv, int rows) {
  int cols, i, j, k;
  int tmp;
  cols = rows;
  k = 0;
  for (i = 0; i < rows; i++) {
    for (j = 0; j < cols; j++) {
      inv[k] = (i == j) ? 1 : 0;
      k++;
    }
  }
  for (i = 0; i < cols; i++) {
    if ((mat[i * cols + i]) == 0) {
      for (j = i + 1; j < rows && (mat[j * cols + i]) == 0; j++)
        ;
      if (j == rows)
        return -1;
      for (k = 0; k < cols; k++) {
        tmp = mat[i * cols + k];
        mat[i * cols + k] = mat[j * cols + k];
        mat[j * cols + k] = tmp;
        tmp = inv[i * cols + k];
        inv[i * cols + k] = inv[j * cols + k];
        inv[j * cols + k] = tmp;
      }
    }
    for (j = i + 1; j != rows; j++) {
      if (mat[j * cols + i] != 0) {
        for (k = 0; k < cols; k++) {
          mat[j * cols + k] ^= mat[i * cols + k];
          inv[j * cols + k] ^= inv[i * cols + k];
        }
      }
    }
  }
  for (i = rows - 1; i >= 0; i--) {
    for (j = 0; j < i; j++) {
      if (mat[j * cols + i]) {
        for (k = 0; k < cols; k++) {
          mat[j * cols + k] ^= mat[i * cols + k];
          inv[j * cols + k] ^= inv[i * cols + k];
        }
      }
    }
  }
  return 0;
}
```