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

```asm
<jerasure_smart_bitmatrix_to_schedule>:
  endbr64
  mov    %edi,%eax
  push   %r15
  imul   %esi,%eax
  push   %r14
  mov    %edi,%r14d
  push   %r13
  mov    %rcx,%r13
  push   %r12
  imul   %edx,%eax
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  imul   %edx,%eax
  sub    $0x78,%rsp
  mov    %edx,(%rsp)
  lea    0x8(,%rax,8),%edi
  call   <malloc@plt>
  mov    (%rsp),%r8d
  mov    %rax,0x28(%rsp)
  imul   %r8d,%ebp
  mov    %r8d,0x50(%rsp)
  lea    0x0(,%rbp,4),%r12d
  movslq %ebp,%rax
  mov    %r12d,%edi
  mov    %rax,0x38(%rsp)
  call   <malloc@plt>
  mov    %r12d,%edi
  mov    %rax,0x10(%rsp)
  call   <malloc@plt>
  mov    %r12d,%edi
  mov    %rax,0x20(%rsp)
  call   <malloc@plt>
  mov    %r12d,%edi
  mov    %r14d,%r12d
  mov    %rax,(%rsp)
  call   <malloc@plt>
  mov    0x50(%rsp),%r8d
  mov    %rax,0x40(%rsp)
  imul   %r8d,%r12d
  lea    0x1(%r12),%eax
  mov    %eax,0x54(%rsp)
  test   %ebp,%ebp
  jle    L194
  mov    %eax,%r11d
  mov    %r12d,%ebx
  mov    %r12d,%eax
  mov    0x10(%rsp),%r9
  shr    $0x2,%eax
  and    $0xfffffffc,%ebx
  lea    -0x1(%r12),%esi
  mov    %r14d,0x60(%rsp)
  lea    -0x1(%rax),%edi
  mov    %ebx,%eax
  mov    0x20(%rsp),%r15
  mov    (%rsp),%r10
  shl    $0x2,%rax
  mov    %esi,0x50(%rsp)
  mov    %r13,%rcx
  mov    %r9,%rdx
  mov    %rax,0x18(%rsp)
  mov    %esi,%eax
  sub    %r9,%r15
  xor    %esi,%esi
  lea    0x4(,%rax,4),%rax
  mov    %r13,0x58(%rsp)
  sub    %r9,%r10
  mov    %rax,0x48(%rsp)
  lea    0x1(%rdi),%rax
  mov    0x48(%rsp),%r14
  shl    $0x4,%rax
  mov    %r8d,0x48(%rsp)
  mov    %rax,0x30(%rsp)
  mov    0x40(%rsp),%rax
  sub    %r9,%rax
  mov    %rax,%r13
  nopl   0x0(%rax,%rax,1)
L259:
  xor    %eax,%eax
  test   %r12d,%r12d
  jle    L300
  cmpl   $0x2,0x50(%rsp)
  jbe    L121
  mov    0x30(%rsp),%rdi
  mov    %rcx,%rax
  pxor   %xmm0,%xmm0
  add    %rcx,%rdi
  nopl   0x0(%rax)
L275:
  movdqu (%rax),%xmm3
  add    $0x10,%rax
  paddd  %xmm3,%xmm0
  cmp    %rdi,%rax
  jne    L275
  movdqa %xmm0,%xmm1
  mov    0x18(%rsp),%rdi
  psrldq $0x8,%xmm1
  paddd  %xmm1,%xmm0
  lea    (%rcx,%rdi,1),%r8
  mov    %ebx,%edi
  movdqa %xmm0,%xmm1
  psrldq $0x4,%xmm1
  paddd  %xmm1,%xmm0
  movd   %xmm0,%eax
  cmp    %r12d,%ebx
  je     L82
L94:
  lea    0x1(%rdi),%r9d
  add    (%r8),%eax
  cmp    %r9d,%r12d
  jle    L82
  add    $0x2,%edi
  add    0x4(%r8),%eax
  cmp    %edi,%r12d
  jle    L82
  add    0x8(%r8),%eax
L82:
  add    %r14,%rcx
L300:
  lea    0x1(%rsi),%edi
  lea    -0x1(%rsi),%r8d
  mov    %eax,(%rdx)
  movl   $0xffffffff,(%r15,%rdx,1)
  mov    %edi,(%r10,%rdx,1)
  mov    %r8d,0x0(%r13,%rdx,1)
  cmp    %eax,%r11d
  jle    L348
  mov    %esi,0xc(%rsp)
  mov    %eax,%r11d
L348:
  add    $0x4,%rdx
  cmp    %edi,%ebp
  je     L73
  mov    %edi,%esi
  jmp    L259
L73:
  mov    0x60(%rsp),%r14d
  mov    0x48(%rsp),%r8d
  mov    0x58(%rsp),%r13
L260:
  mov    (%rsp),%rax
  mov    0x38(%rsp),%rsi
  mov    %r8d,%r15d
  movl   $0x0,0x48(%rsp)
  movl   $0x0,0x30(%rsp)
  mov    %r14d,%r8d
  movl   $0xffffffff,-0x4(%rax,%rsi,4)
  mov    %r12d,%eax
  shr    $0x2,%eax
  lea    -0x1(%rax),%ebp
  mov    %r12d,%eax
  and    $0xfffffffc,%eax
  add    $0x1,%rbp
  mov    %eax,0x60(%rsp)
  shl    $0x4,%rbp
  nopl   0x0(%rax)
L229:
  movslq 0xc(%rsp),%rax
  mov    0x40(%rsp),%rsi
  lea    0x0(,%rax,4),%r14
  lea    (%rsi,%r14,1),%rcx
  mov    (%rsp),%rsi
  movslq (%rcx),%rdx
  movslq (%rsi,%rax,4),%rax
  cmp    $0xffffffff,%edx
  je     L102
  mov    %eax,(%rsi,%rdx,4)
  cmp    $0xffffffff,%eax
  je     L250
  mov    (%rcx),%edx
  mov    0x40(%rsp),%rsi
  mov    %edx,(%rsi,%rax,4)
L250:
  mov    0xc(%rsp),%eax
  add    0x20(%rsp),%r14
  imul   %r8d,%eax
  imul   %r15d,%eax
  cmpl   $0xffffffff,(%r14)
  cltq
  lea    0x0(%r13,%rax,4),%rbx
  jne    L319
  test   %r12d,%r12d
  jle    L372
  mov    0x50(%rsp),%esi
  xor    %r14d,%r14d
  xor    %ecx,%ecx
  mov    %rbp,0x58(%rsp)
  mov    %r12d,0x64(%rsp)
  mov    %r15d,%ebp
  mov    %rbx,%r15
  mov    %r14,%rbx
  mov    %r13,0x68(%rsp)
  mov    0x30(%rsp),%r14d
  mov    %rsi,%r12
  mov    %ecx,%r13d
  mov    %r8d,0x38(%rsp)
  jmp    L144
  nopw   0x0(%rax,%rax,1)
L349:
  lea    0x1(%rbx),%rax
  cmp    %r12,%rbx
  je     L331
L154:
  mov    %rax,%rbx
L144:
  mov    (%r15,%rbx,4),%eax
  test   %eax,%eax
  je     L349
  mov    $0x14,%edi
  mov    %ebx,0x18(%rsp)
  call   <malloc@plt>
  mov    0x28(%rsp),%rsi
  mov    %rax,%rdi
  movslq %r14d,%rax
  add    $0x1,%r14d
  mov    %rdi,(%rsi,%rax,8)
  mov    0x18(%rsp),%eax
  mov    %r13d,0x10(%rdi)
  mov    $0x1,%r13d
  cltd
  idiv   %ebp
  mov    %eax,%ecx
  mov    0xc(%rsp),%eax
  mov    %edx,%r11d
  movd   %ecx,%xmm0
  movd   %r11d,%xmm6
  cltd
  punpckldq %xmm6,%xmm0
  idiv   %ebp
  add    0x38(%rsp),%eax
  movd   %eax,%xmm1
  lea    0x1(%rbx),%rax
  movd   %edx,%xmm5
  punpckldq %xmm5,%xmm1
  punpcklqdq %xmm1,%xmm0
  movups %xmm0,(%rdi)
  cmp    %r12,%rbx
  jne    L154
L331:
  mov    %r14d,0x30(%rsp)
  mov    %r15,%rbx
  mov    0x64(%rsp),%r12d
  mov    %ebp,%r15d
  mov    0x38(%rsp),%r8d
  mov    0x58(%rsp),%rbp
  mov    0x68(%rsp),%r13
L372:
  mov    0x48(%rsp),%esi
  cmp    $0xffffffff,%esi
  je     L310
L142:
  mov    0xc(%rsp),%r14d
  mov    0x54(%rsp),%r11d
  mov    %r14d,0x18(%rsp)
  mov    0x60(%rsp),%r14d
  nopw   0x0(%rax,%rax,1)
L389:
  mov    %r8d,%edx
  imul   %esi,%edx
  imul   %r15d,%edx
  movslq %edx,%rdx
  test   %r12d,%r12d
  jle    L9
  cmpl   $0x2,0x50(%rsp)
  jbe    L296
  lea    0x0(%r13,%rdx,4),%rcx
  xor    %eax,%eax
  pxor   %xmm1,%xmm1
  nopl   0x0(%rax)
L270:
  movdqu (%rcx,%rax,1),%xmm0
  movdqu (%rbx,%rax,1),%xmm2
  add    $0x10,%rax
  pxor   %xmm2,%xmm0
  paddd  %xmm0,%xmm1
  cmp    %rbp,%rax
  jne    L270
  movdqa %xmm1,%xmm0
  mov    %r14d,%ecx
  psrldq $0x8,%xmm0
  paddd  %xmm0,%xmm1
  movdqa %xmm1,%xmm0
  psrldq $0x4,%xmm0
  paddd  %xmm0,%xmm1
  movd   %xmm1,%eax
  add    $0x1,%eax
  cmp    %r12d,%r14d
  je     L99
L247:
  movslq %ecx,%r9
  lea    (%rdx,%r9,1),%rdi
  lea    0x0(,%r9,4),%r10
  mov    0x0(%r13,%rdi,4),%edi
  xor    (%rbx,%r9,4),%edi
  add    %edi,%eax
  lea    0x1(%rcx),%edi
  cmp    %edi,%r12d
  jle    L99
  movslq %edi,%rdi
  add    $0x2,%ecx
  add    %rdx,%rdi
  mov    0x0(%r13,%rdi,4),%edi
  xor    0x4(%rbx,%r10,1),%edi
  add    %edi,%eax
  cmp    %ecx,%r12d
  jle    L99
  movslq %ecx,%rcx
  add    %rdx,%rcx
  mov    0x0(%r13,%rcx,4),%edx
  xor    0x8(%rbx,%r10,1),%edx
  add    %edx,%eax
L99:
  mov    0x10(%rsp),%rdi
  movslq %esi,%rcx
  lea    (%rdi,%rcx,4),%rdi
  mov    (%rdi),%edx
  cmp    %eax,%edx
  jle    L235
  mov    0x20(%rsp),%rdx
  mov    0xc(%rsp),%r10d
  mov    %r10d,(%rdx,%rcx,4)
  mov    %eax,%edx
  mov    %eax,(%rdi)
L235:
  cmp    %edx,%r11d
  jle    L174
  mov    %esi,0x18(%rsp)
  mov    %edx,%r11d
L174:
  mov    (%rsp),%rax
  mov    (%rax,%rcx,4),%esi
  cmp    $0xffffffff,%esi
  jne    L389
  mov    0x18(%rsp),%r14d
  mov    %r14d,0xc(%rsp)
  jmp    L229
  nopl   0x0(%rax)
L9:
  mov    $0x1,%eax
  jmp    L99
L296:
  mov    $0x1,%eax
  xor    %ecx,%ecx
  jmp    L247
L319:
  mov    $0x14,%edi
  mov    %r8d,0x18(%rsp)
  call   <malloc@plt>
  mov    0x28(%rsp),%rsi
  mov    0x18(%rsp),%r8d
  mov    %rax,%rcx
  movslq 0x30(%rsp),%rax
  mov    %rcx,(%rsi,%rax,8)
  mov    %rax,%rdi
  movl   $0x0,0x10(%rcx)
  mov    (%r14),%eax
  add    $0x1,%edi
  mov    %edi,0x30(%rsp)
  cltd
  idiv   %r15d
  add    %r8d,%eax
  mov    %eax,(%rcx)
  mov    (%r14),%eax
  cltd
  idiv   %r15d
  mov    0xc(%rsp),%eax
  mov    %edx,0x4(%rcx)
  cltd
  idiv   %r15d
  add    %r8d,%eax
  mov    %edx,0xc(%rcx)
  mov    %eax,0x8(%rcx)
  mov    (%r14),%ecx
  imul   %r8d,%ecx
  imul   %r15d,%ecx
  movslq %ecx,%rcx
  test   %r12d,%r12d
  jle    L372
  mov    0x50(%rsp),%r9d
  movd   %eax,%xmm7
  movd   %edx,%xmm5
  xor    %r14d,%r14d
  lea    0x0(%r13,%rcx,4),%rsi
  punpckldq %xmm5,%xmm7
  mov    %rbp,0x38(%rsp)
  mov    %r14,%rbp
  mov    %r12d,0x58(%rsp)
  mov    %r9,%r14
  mov    %rsi,%r12
  mov    %r13,0x68(%rsp)
  mov    %rbx,%r13
  mov    %edi,%ebx
  mov    %r8d,0x64(%rsp)
  mov    %r15d,0x18(%rsp)
  movq   %xmm7,0x30(%rsp)
  jmp    L205
  nopw   0x0(%rax,%rax,1)
L263:
  mov    %rax,%rbp
L205:
  mov    (%r12,%rbp,4),%eax
  cmp    %eax,0x0(%r13,%rbp,4)
  je     L219
  mov    $0x14,%edi
  call   <malloc@plt>
  mov    0x28(%rsp),%rsi
  mov    %rax,%rdi
  movslq %ebx,%rax
  add    $0x1,%ebx
  mov    %rdi,(%rsi,%rax,8)
  mov    %ebp,%eax
  cltd
  movl   $0x1,0x10(%rdi)
  idivl  0x18(%rsp)
  movd   %eax,%xmm0
  movd   %edx,%xmm4
  punpckldq %xmm4,%xmm0
  movhps 0x30(%rsp),%xmm0
  movups %xmm0,(%rdi)
L219:
  lea    0x1(%rbp),%rax
  cmp    %r14,%rbp
  jne    L263
  mov    0x48(%rsp),%esi
  mov    0x38(%rsp),%rbp
  mov    %ebx,0x30(%rsp)
  mov    %r13,%rbx
  mov    0x58(%rsp),%r12d
  mov    0x64(%rsp),%r8d
  mov    0x18(%rsp),%r15d
  mov    0x68(%rsp),%r13
  cmp    $0xffffffff,%esi
  jne    L142
L310:
  mov    $0x14,%edi
  call   <malloc@plt>
  mov    0x28(%rsp),%rbx
  mov    0x20(%rsp),%rdi
  mov    %rax,%rdx
  movslq 0x30(%rsp),%rax
  mov    %rdx,(%rbx,%rax,8)
  movl   $0xffffffff,(%rdx)
  call   <free@plt>
  mov    0x10(%rsp),%rdi
  call   <free@plt>
  mov    0x40(%rsp),%rdi
  call   <free@plt>
  mov    (%rsp),%rdi
  call   <free@plt>
  add    $0x78,%rsp
  mov    %rbx,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L102:
  movl   $0xffffffff,0x48(%rsp)
  cmp    $0xffffffff,%eax
  je     L250
  mov    0x40(%rsp),%rsi
  movslq %eax,%rdx
  mov    %eax,0x48(%rsp)
  movl   $0xffffffff,(%rsi,%rdx,4)
  jmp    L250
L121:
  mov    %rcx,%r8
  xor    %eax,%eax
  xor    %edi,%edi
  jmp    L94
L194:
  lea    -0x1(%r12),%eax
  mov    %eax,0x50(%rsp)
  jmp    L260
```

assistant: ```c
int **jerasure_smart_bitmatrix_to_schedule(int k, int m, int w, int *bitmatrix) {
  int **operations;
  int op;
  int i, j;
  int *diff, *from, *b1, *flink, *blink;
  int *ptr, no, row;
  int optodo;
  int bestrow, bestdiff, top;
  operations = (int **)malloc(sizeof(int *) * (k * m * w * w + 1));
  op = 0;
  diff = (int *)malloc(sizeof(int) * (m * w));
  from = (int *)malloc(sizeof(int) * (m * w));
  flink = (int *)malloc(sizeof(int) * (m * w));
  blink = (int *)malloc(sizeof(int) * (m * w));
  ptr = bitmatrix;
  bestdiff = k * w + 1;
  top = 0;
  for (i = 0; i < m * w; i++) {
    no = 0;
    for (j = 0; j < k * w; j++) {
      no += *ptr;
      ptr++;
    }
    diff[i] = no;
    from[i] = -1;
    flink[i] = i + 1;
    blink[i] = i - 1;
    if (no < bestdiff) {
      bestdiff = no;
      bestrow = i;
    }
  }
  flink[m * w - 1] = -1;
  while (top != -1) {
    row = bestrow;
    if (blink[row] == -1) {
      top = flink[row];
      if (top != -1)
        blink[top] = -1;
    } else {
      flink[blink[row]] = flink[row];
      if (flink[row] != -1) {
        blink[flink[row]] = blink[row];
      }
    }
    ptr = bitmatrix + row * k * w;
    if (from[row] == -1) {
      optodo = 0;
      for (j = 0; j < k * w; j++) {
        if (ptr[j]) {
          operations[op] = (int *)malloc(sizeof(int) * (5));
          operations[op][4] = optodo;
          operations[op][0] = j / w;
          operations[op][1] = j % w;
          operations[op][2] = k + row / w;
          operations[op][3] = row % w;
          optodo = 1;
          op++;
        }
      }
    } else {
      operations[op] = (int *)malloc(sizeof(int) * (5));
      operations[op][4] = 0;
      operations[op][0] = k + from[row] / w;
      operations[op][1] = from[row] % w;
      operations[op][2] = k + row / w;
      operations[op][3] = row % w;
      op++;
      b1 = bitmatrix + from[row] * k * w;
      for (j = 0; j < k * w; j++) {
        if (ptr[j] ^ b1[j]) {
          operations[op] = (int *)malloc(sizeof(int) * (5));
          operations[op][4] = 1;
          operations[op][0] = j / w;
          operations[op][1] = j % w;
          operations[op][2] = k + row / w;
          operations[op][3] = row % w;
          optodo = 1;
          op++;
        }
      }
    }
    bestdiff = k * w + 1;
    for (i = top; i != -1; i = flink[i]) {
      no = 1;
      b1 = bitmatrix + i * k * w;
      for (j = 0; j < k * w; j++)
        no += (ptr[j] ^ b1[j]);
      if (no < diff[i]) {
        from[i] = row;
        diff[i] = no;
      }
      if (diff[i] < bestdiff) {
        bestdiff = diff[i];
        bestrow = i;
      }
    }
  }
  operations[op] = (int *)malloc(sizeof(int) * (5));
  operations[op][0] = -1;
  free(from);
  free(diff);
  free(blink);
  free(flink);
  return operations;
}
```