user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<jerasure_smart_bitmatrix_to_schedule>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %edi,-0x64(%rbp)
  mov    %esi,-0x68(%rbp)
  mov    %edx,-0x6c(%rbp)
  mov    %rcx,-0x78(%rbp)
  mov    -0x64(%rbp),%eax
  imul   -0x68(%rbp),%eax
  imul   -0x6c(%rbp),%eax
  imul   -0x6c(%rbp),%eax
  add    $0x1,%eax
  cltq
  shl    $0x3,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x30(%rbp)
  movl   $0x0,-0x5c(%rbp)
  mov    -0x68(%rbp),%eax
  imul   -0x6c(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x28(%rbp)
  mov    -0x68(%rbp),%eax
  imul   -0x6c(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  mov    -0x68(%rbp),%eax
  imul   -0x6c(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x18(%rbp)
  mov    -0x68(%rbp),%eax
  imul   -0x6c(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x78(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x64(%rbp),%eax
  imul   -0x6c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x44(%rbp)
  movl   $0x0,-0x40(%rbp)
  movl   $0x0,-0x58(%rbp)
  jmp    L10
L247:
  movl   $0x0,-0x50(%rbp)
  movl   $0x0,-0x54(%rbp)
  jmp    L128
L14:
  mov    -0x38(%rbp),%rax
  mov    (%rax),%eax
  add    %eax,-0x50(%rbp)
  addq   $0x4,-0x38(%rbp)
  addl   $0x1,-0x54(%rbp)
L128:
  mov    -0x64(%rbp),%eax
  imul   -0x6c(%rbp),%eax
  cmp    %eax,-0x54(%rbp)
  jl     L14
  mov    -0x58(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x50(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x58(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movl   $0xffffffff,(%rax)
  mov    -0x58(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x58(%rbp),%edx
  add    $0x1,%edx
  mov    %edx,(%rax)
  mov    -0x58(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    -0x58(%rbp),%edx
  sub    $0x1,%edx
  mov    %edx,(%rax)
  mov    -0x50(%rbp),%eax
  cmp    -0x44(%rbp),%eax
  jge    L208
  mov    -0x50(%rbp),%eax
  mov    %eax,-0x44(%rbp)
  mov    -0x58(%rbp),%eax
  mov    %eax,-0x48(%rbp)
L208:
  addl   $0x1,-0x58(%rbp)
L10:
  mov    -0x68(%rbp),%eax
  imul   -0x6c(%rbp),%eax
  cmp    %eax,-0x58(%rbp)
  jl     L247
  mov    -0x68(%rbp),%eax
  imul   -0x6c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  lea    -0x4(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movl   $0xffffffff,(%rax)
  jmp    L120
L16:
  mov    -0x48(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0xffffffff,%eax
  jne    L139
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x40(%rbp)
  cmpl   $0xffffffff,-0x40(%rbp)
  je     L239
  mov    -0x40(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  movl   $0xffffffff,(%rax)
  jmp    L239
L139:
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0x3c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x10(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0xffffffff,%eax
  je     L239
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x10(%rbp),%rax
  add    %rdx,%rax
  mov    -0x3c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,4),%rcx
  mov    -0x10(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%eax
  mov    %eax,(%rdx)
L239:
  mov    -0x3c(%rbp),%eax
  imul   -0x64(%rbp),%eax
  imul   -0x6c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    $0xffffffff,%eax
  jne    L135
  movl   $0x0,-0x4c(%rbp)
  movl   $0x0,-0x54(%rbp)
  jmp    L2
L64:
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  test   %eax,%eax
  je     L82
  mov    $0x14,%edi
  call   <malloc@plt>
  mov    -0x5c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x30(%rbp),%rdx
  add    %rcx,%rdx
  mov    %rax,(%rdx)
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    0x10(%rax),%rdx
  mov    -0x4c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rcx
  mov    -0x54(%rbp),%eax
  cltd
  idivl  -0x6c(%rbp)
  mov    %eax,(%rcx)
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    0x4(%rax),%rcx
  mov    -0x54(%rbp),%eax
  cltd
  idivl  -0x6c(%rbp)
  mov    %edx,%eax
  mov    %eax,(%rcx)
  mov    -0x3c(%rbp),%eax
  cltd
  idivl  -0x6c(%rbp)
  mov    %eax,%ecx
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  add    $0x8,%rax
  mov    -0x64(%rbp),%edx
  add    %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    0xc(%rax),%rcx
  mov    -0x3c(%rbp),%eax
  cltd
  idivl  -0x6c(%rbp)
  mov    %edx,%eax
  mov    %eax,(%rcx)
  movl   $0x1,-0x4c(%rbp)
  addl   $0x1,-0x5c(%rbp)
L82:
  addl   $0x1,-0x54(%rbp)
L2:
  mov    -0x64(%rbp),%eax
  imul   -0x6c(%rbp),%eax
  cmp    %eax,-0x54(%rbp)
  jl     L64
  jmp    L201
L135:
  mov    $0x14,%edi
  call   <malloc@plt>
  mov    -0x5c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x30(%rbp),%rdx
  add    %rcx,%rdx
  mov    %rax,(%rdx)
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  add    $0x10,%rax
  movl   $0x0,(%rax)
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cltd
  idivl  -0x6c(%rbp)
  mov    %eax,%ecx
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    -0x64(%rbp),%edx
  add    %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    -0x5c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x30(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rdx),%rdx
  lea    0x4(%rdx),%rcx
  cltd
  idivl  -0x6c(%rbp)
  mov    %edx,%eax
  mov    %eax,(%rcx)
  mov    -0x3c(%rbp),%eax
  cltd
  idivl  -0x6c(%rbp)
  mov    %eax,%ecx
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  add    $0x8,%rax
  mov    -0x64(%rbp),%edx
  add    %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    0xc(%rax),%rcx
  mov    -0x3c(%rbp),%eax
  cltd
  idivl  -0x6c(%rbp)
  mov    %edx,%eax
  mov    %eax,(%rcx)
  addl   $0x1,-0x5c(%rbp)
  mov    -0x3c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  imul   -0x64(%rbp),%eax
  imul   -0x6c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x54(%rbp)
  jmp    L152
L190:
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  cmp    %eax,%edx
  je     L67
  mov    $0x14,%edi
  call   <malloc@plt>
  mov    -0x5c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x30(%rbp),%rdx
  add    %rcx,%rdx
  mov    %rax,(%rdx)
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  add    $0x10,%rax
  movl   $0x1,(%rax)
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rcx
  mov    -0x54(%rbp),%eax
  cltd
  idivl  -0x6c(%rbp)
  mov    %eax,(%rcx)
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    0x4(%rax),%rcx
  mov    -0x54(%rbp),%eax
  cltd
  idivl  -0x6c(%rbp)
  mov    %edx,%eax
  mov    %eax,(%rcx)
  mov    -0x3c(%rbp),%eax
  cltd
  idivl  -0x6c(%rbp)
  mov    %eax,%ecx
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  add    $0x8,%rax
  mov    -0x64(%rbp),%edx
  add    %ecx,%edx
  mov    %edx,(%rax)
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  lea    0xc(%rax),%rcx
  mov    -0x3c(%rbp),%eax
  cltd
  idivl  -0x6c(%rbp)
  mov    %edx,%eax
  mov    %eax,(%rcx)
  movl   $0x1,-0x4c(%rbp)
  addl   $0x1,-0x5c(%rbp)
L67:
  addl   $0x1,-0x54(%rbp)
L152:
  mov    -0x64(%rbp),%eax
  imul   -0x6c(%rbp),%eax
  cmp    %eax,-0x54(%rbp)
  jl     L190
L201:
  mov    -0x64(%rbp),%eax
  imul   -0x6c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x44(%rbp)
  mov    -0x40(%rbp),%eax
  mov    %eax,-0x58(%rbp)
  jmp    L34
L228:
  movl   $0x1,-0x50(%rbp)
  mov    -0x58(%rbp),%eax
  imul   -0x64(%rbp),%eax
  imul   -0x6c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x78(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x8(%rbp)
  movl   $0x0,-0x54(%rbp)
  jmp    L192
L83:
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x54(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x8(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  xor    %edx,%eax
  add    %eax,-0x50(%rbp)
  addl   $0x1,-0x54(%rbp)
L192:
  mov    -0x64(%rbp),%eax
  imul   -0x6c(%rbp),%eax
  cmp    %eax,-0x54(%rbp)
  jl     L83
  mov    -0x58(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x50(%rbp)
  jge    L162
  mov    -0x58(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rax,%rdx
  mov    -0x3c(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x58(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  mov    -0x50(%rbp),%eax
  mov    %eax,(%rdx)
L162:
  mov    -0x58(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  cmp    %eax,-0x44(%rbp)
  jle    L59
  mov    -0x58(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x44(%rbp)
  mov    -0x58(%rbp),%eax
  mov    %eax,-0x48(%rbp)
L59:
  mov    -0x58(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  mov    %eax,-0x58(%rbp)
L34:
  cmpl   $0xffffffff,-0x58(%rbp)
  jne    L228
L120:
  cmpl   $0xffffffff,-0x40(%rbp)
  jne    L16
  mov    $0x14,%edi
  call   <malloc@plt>
  mov    -0x5c(%rbp),%edx
  movslq %edx,%rdx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x30(%rbp),%rdx
  add    %rcx,%rdx
  mov    %rax,(%rdx)
  mov    -0x5c(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  movl   $0xffffffff,(%rax)
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x30(%rbp),%rax
  leave
  ret
```

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;
}
```