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

```asm
<jerasure_matrix_decode>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %esi,-0x38(%rbp)
  mov    %edx,-0x3c(%rbp)
  mov    %rcx,-0x48(%rbp)
  mov    %r8d,-0x40(%rbp)
  mov    %r9,-0x50(%rbp)
  cmpl   $0x8,-0x3c(%rbp)
  je     L28
  cmpl   $0x10,-0x3c(%rbp)
  je     L28
  cmpl   $0x20,-0x3c(%rbp)
  je     L28
  mov    $0xffffffff,%eax
  jmp    L167
L28:
  mov    -0x50(%rbp),%rdx
  mov    -0x38(%rbp),%ecx
  mov    -0x34(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <jerasure_erasures_to_erased@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L285
  mov    $0xffffffff,%eax
  jmp    L167
L285:
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x24(%rbp)
  movl   $0x0,-0x28(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L264
L237:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L306
  addl   $0x1,-0x28(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,-0x24(%rbp)
L306:
  addl   $0x1,-0x2c(%rbp)
L264:
  mov    -0x2c(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L237
  cmpl   $0x0,-0x40(%rbp)
  je     L214
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L308
L214:
  mov    -0x34(%rbp),%eax
  mov    %eax,-0x24(%rbp)
L308:
  movq   $0x0,-0x18(%rbp)
  movq   $0x0,-0x20(%rbp)
  cmpl   $0x1,-0x28(%rbp)
  jg     L13
  cmpl   $0x0,-0x28(%rbp)
  jle    L139
  cmpl   $0x0,-0x40(%rbp)
  je     L13
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L139
L13:
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L118
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0xffffffff,%eax
  jmp    L167
L118:
  mov    -0x34(%rbp),%eax
  imul   %eax,%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  jne    L204
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0xffffffff,%eax
  jmp    L167
L204:
  mov    -0x20(%rbp),%r8
  mov    -0x10(%rbp),%rdi
  mov    -0x48(%rbp),%rcx
  mov    -0x3c(%rbp),%edx
  mov    -0x38(%rbp),%esi
  mov    -0x34(%rbp),%eax
  sub    $0x8,%rsp
  push   -0x18(%rbp)
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %eax,%edi
  call   <jerasure_make_decoding_matrix@plt>
  add    $0x10,%rsp
  test   %rax,%rax
  jns    L139
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0xffffffff,%eax
  jmp    L167
L139:
  movl   $0x0,-0x2c(%rbp)
  jmp    L36
L85:
  mov    -0x2c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L236
  mov    -0x2c(%rbp),%eax
  imul   -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  lea    (%rdx,%rax,1),%rdi
  mov    -0x2c(%rbp),%r8d
  mov    -0x18(%rbp),%rdx
  mov    -0x3c(%rbp),%esi
  mov    -0x34(%rbp),%eax
  mov    0x20(%rbp),%ecx
  push   %rcx
  push   0x18(%rbp)
  mov    0x10(%rbp),%r9
  mov    %rdx,%rcx
  mov    %rdi,%rdx
  mov    %eax,%edi
  call   <jerasure_matrix_dotprod@plt>
  add    $0x10,%rsp
  subl   $0x1,-0x28(%rbp)
L236:
  addl   $0x1,-0x2c(%rbp)
L36:
  cmpl   $0x0,-0x28(%rbp)
  jle    L27
  mov    -0x2c(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L85
L27:
  cmpl   $0x0,-0x28(%rbp)
  jle    L152
  mov    -0x34(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x2c(%rbp)
  jmp    L207
L197:
  mov    -0x2c(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L76
  mov    -0x2c(%rbp),%eax
  add    $0x1,%eax
  jmp    L174
L76:
  mov    -0x2c(%rbp),%eax
L174:
  mov    -0x2c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x8(%rbp),%rdx
  add    %rcx,%rdx
  mov    %eax,(%rdx)
  addl   $0x1,-0x2c(%rbp)
L207:
  mov    -0x2c(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L197
  mov    -0x24(%rbp),%r8d
  mov    -0x8(%rbp),%rcx
  mov    -0x48(%rbp),%rdx
  mov    -0x3c(%rbp),%esi
  mov    -0x34(%rbp),%eax
  mov    0x20(%rbp),%edi
  push   %rdi
  push   0x18(%rbp)
  mov    0x10(%rbp),%r9
  mov    %eax,%edi
  call   <jerasure_matrix_dotprod@plt>
  add    $0x10,%rsp
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L152:
  movl   $0x0,-0x2c(%rbp)
  jmp    L25
L121:
  mov    -0x34(%rbp),%edx
  mov    -0x2c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L177
  mov    -0x2c(%rbp),%edx
  mov    -0x34(%rbp),%eax
  lea    (%rdx,%rax,1),%edi
  mov    -0x2c(%rbp),%eax
  imul   -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x48(%rbp),%rax
  add    %rax,%rdx
  mov    -0x3c(%rbp),%esi
  mov    -0x34(%rbp),%eax
  mov    0x20(%rbp),%ecx
  push   %rcx
  push   0x18(%rbp)
  mov    0x10(%rbp),%r9
  mov    %edi,%r8d
  mov    $0x0,%ecx
  mov    %eax,%edi
  call   <jerasure_matrix_dotprod@plt>
  add    $0x10,%rsp
L177:
  addl   $0x1,-0x2c(%rbp)
L25:
  mov    -0x2c(%rbp),%eax
  cmp    -0x38(%rbp),%eax
  jl     L121
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  cmpq   $0x0,-0x18(%rbp)
  je     L93
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L93:
  cmpq   $0x0,-0x20(%rbp)
  je     L340
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L340:
  mov    $0x0,%eax
L167:
  leave
  ret
```

assistant: ```c
int jerasure_matrix_decode(int k, int m, int w, int *matrix, int row_k_ones, int *erasures, char **data_ptrs, char **coding_ptrs, int size) {
  int i, edd, lastdrive;
  int *tmpids;
  int *erased, *decoding_matrix, *dm_ids;
  if (w != 8 && w != 16 && w != 32)
    return -1;
  erased = jerasure_erasures_to_erased(k, m, erasures);
  if (erased == NULL)
    return -1;
  lastdrive = k;
  edd = 0;
  for (i = 0; i < k; i++) {
    if (erased[i]) {
      edd++;
      lastdrive = i;
    }
  }
  if (!row_k_ones || erased[k])
    lastdrive = k;
  dm_ids = NULL;
  decoding_matrix = NULL;
  if (edd > 1 || (edd > 0 && (!row_k_ones || erased[k]))) {
    dm_ids = (int *)malloc(sizeof(int) * (k));
    if (dm_ids == NULL) {
      free(erased);
      return -1;
    }
    decoding_matrix = (int *)malloc(sizeof(int) * (k * k));
    if (decoding_matrix == NULL) {
      free(erased);
      free(dm_ids);
      return -1;
    }
    if (jerasure_make_decoding_matrix(k, m, w, matrix, erased, decoding_matrix, dm_ids) < 0) {
      free(erased);
      free(dm_ids);
      free(decoding_matrix);
      return -1;
    }
  }
  for (i = 0; edd > 0 && i < lastdrive; i++) {
    if (erased[i]) {
      jerasure_matrix_dotprod(k, w, decoding_matrix + (i * k), dm_ids, i, data_ptrs, coding_ptrs, size);
      edd--;
    }
  }
  if (edd > 0) {
    tmpids = (int *)malloc(sizeof(int) * (k));
    for (i = 0; i < k; i++) {
      tmpids[i] = (i < lastdrive) ? i : i + 1;
    }
    jerasure_matrix_dotprod(k, w, matrix, tmpids, lastdrive, data_ptrs, coding_ptrs, size);
    free(tmpids);
  }
  for (i = 0; i < m; i++) {
    if (erased[k + i]) {
      jerasure_matrix_dotprod(k, w, matrix + (i * k), NULL, i + k, data_ptrs, coding_ptrs, size);
    }
  }
  free(erased);
  if (dm_ids != NULL)
    free(dm_ids);
  if (decoding_matrix != NULL)
    free(decoding_matrix);
  return 0;
}
```