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

```asm
<reed_sol_extended_vandermonde_matrix>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %edx,-0x2c(%rbp)
  cmpl   $0x1d,-0x2c(%rbp)
  jg     L188
  mov    -0x2c(%rbp),%eax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  cmp    %eax,-0x24(%rbp)
  jle    L188
  mov    $0x0,%eax
  jmp    L121
L188:
  cmpl   $0x1d,-0x2c(%rbp)
  jg     L146
  mov    -0x2c(%rbp),%eax
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  cmp    %eax,-0x28(%rbp)
  jle    L146
  mov    $0x0,%eax
  jmp    L121
L146:
  mov    -0x24(%rbp),%eax
  imul   -0x28(%rbp),%eax
  cltq
  shl    $0x2,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L30
  mov    $0x0,%eax
  jmp    L121
L30:
  mov    -0x8(%rbp),%rax
  movl   $0x1,(%rax)
  movl   $0x1,-0x10(%rbp)
  jmp    L87
L106:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  addl   $0x1,-0x10(%rbp)
L87:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L106
  cmpl   $0x1,-0x24(%rbp)
  jne    L88
  mov    -0x8(%rbp),%rax
  jmp    L121
L88:
  mov    -0x24(%rbp),%eax
  lea    -0x1(%rax),%edx
  mov    -0x28(%rbp),%eax
  imul   %edx,%eax
  mov    %eax,-0x14(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L155
L199:
  mov    -0x14(%rbp),%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  addl   $0x1,-0x10(%rbp)
L155:
  mov    -0x28(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x10(%rbp)
  jl     L199
  mov    -0x14(%rbp),%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movl   $0x1,(%rax)
  cmpl   $0x2,-0x24(%rbp)
  jne    L51
  mov    -0x8(%rbp),%rax
  jmp    L121
L51:
  movl   $0x1,-0x14(%rbp)
  jmp    L84
L131:
  movl   $0x1,-0xc(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L112
L57:
  mov    -0x14(%rbp),%eax
  imul   -0x28(%rbp),%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x8(%rbp),%rax
  add    %rax,%rdx
  mov    -0xc(%rbp),%eax
  mov    %eax,(%rdx)
  mov    -0x2c(%rbp),%edx
  mov    -0x14(%rbp),%ecx
  mov    -0xc(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <galois_single_multiply@plt>
  mov    %eax,-0xc(%rbp)
  addl   $0x1,-0x10(%rbp)
L112:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L57
  addl   $0x1,-0x14(%rbp)
L84:
  mov    -0x24(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x14(%rbp)
  jl     L131
  mov    -0x8(%rbp),%rax
L121:
  leave
  ret
```

assistant: ```c
int *reed_sol_extended_vandermonde_matrix(int rows, int cols, int w) {
  int *vdm;
  int i, j, k;
  if (w < 30 && (1 << w) < rows)
    return NULL;
  if (w < 30 && (1 << w) < cols)
    return NULL;
  vdm = (int *)malloc(sizeof(int) * (rows * cols));
  if (vdm == NULL) {
    return NULL;
  }
  vdm[0] = 1;
  for (j = 1; j < cols; j++)
    vdm[j] = 0;
  if (rows == 1)
    return vdm;
  i = (rows - 1) * cols;
  for (j = 0; j < cols - 1; j++)
    vdm[i + j] = 0;
  vdm[i + j] = 1;
  if (rows == 2)
    return vdm;
  for (i = 1; i < rows - 1; i++) {
    k = 1;
    for (j = 0; j < cols; j++) {
      vdm[i * cols + j] = k;
      k = galois_single_multiply(k, i, w);
    }
  }
  return vdm;
}
```