user: 请从给定的汇编指令推导出C源代码：

```asm
<echelonform>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,0x18(%rsp)
  mov    %edx,0x10(%rsp)
  test   %esi,%esi
  jle    L205
  mov    %esi,%r14d
  mov    %edx,%eax
  test   %edx,%edx
  jle    L152
  movslq %edx,%rdx
  mov    %rdx,0x38(%rsp)
  lea    -0x1(%rax),%eax
  lea    0x1(%rdi,%rax,1),%rax
  mov    %rax,0x20(%rsp)
  mov    %rax,0x30(%rsp)
  movl   $0x0,0x2c(%rsp)
  mov    $0x0,%r15d
  movl   $0x0,0xc(%rsp)
  movl   $0x0,0x28(%rsp)
  jmp    L96
L95:
  mov    %r10d,0x28(%rsp)
  mov    0x2c(%rsp),%r8d
  mov    0x18(%rsp),%rax
  lea    (%rax,%r15,1),%rbx
  mov    %rbx,%rax
  movslq %esi,%rsi
  mov    0x30(%rsp),%r9
L154:
  movzbl (%rax),%ecx
  mov    %rax,%rdx
  sub    %r15,%rdx
  movzbl (%rdx,%rsi,1),%edi
  mov    %dil,(%rax)
  mov    %cl,(%rdx,%rsi,1)
  add    $0x1,%rax
  cmp    %r9,%rax
  jne    L154
  mov    0x28(%rsp),%eax
  add    %r8d,%eax
  cltq
  mov    0x18(%rsp),%rdx
  movzbl (%rdx,%rax,1),%ebp
  test   %bpl,%bpl
  jne    L106
L183:
  mov    $0x0,%ebp
  movl   $0x0,0x8(%rsp)
  mov    %r14d,0x14(%rsp)
  jmp    L81
L106:
  movzbl %bpl,%ebp
  mov    0x30(%rsp),%r12
L40:
  movzbl (%rbx),%edi
  mov    %ebp,%esi
  call   <divs@plt>
  mov    %al,(%rbx)
  add    $0x1,%rbx
  cmp    %r12,%rbx
  jne    L40
  jmp    L183
L15:
  mov    0x8(%rsp),%eax
  add    $0x1,%eax
  add    0x10(%rsp),%ebp
  cmp    %eax,0x14(%rsp)
  je     L193
  mov    %eax,0x8(%rsp)
L81:
  mov    0x8(%rsp),%ecx
  cmp    %ecx,0xc(%rsp)
  je     L15
  mov    0x28(%rsp),%eax
  add    %ebp,%eax
  cltq
  movslq %ebp,%r14
  mov    0x18(%rsp),%rcx
  lea    (%rcx,%r14,1),%rbx
  mov    0x20(%rsp),%rdx
  lea    (%r14,%rdx,1),%r13
  movzbl (%rcx,%rax,1),%r12d
L72:
  mov    %rbx,%rax
  sub    %r14,%rax
  movzbl (%rax,%r15,1),%esi
  mov    %r12d,%edi
  call   <mul@plt>
  mov    %eax,%esi
  movzbl (%rbx),%edi
  call   <sub@plt>
  mov    %al,(%rbx)
  add    $0x1,%rbx
  cmp    %rbx,%r13
  jne    L72
  jmp    L15
L193:
  mov    0x14(%rsp),%r14d
  addl   $0x1,0x28(%rsp)
  mov    0xc(%rsp),%edx
  lea    0x1(%rdx),%eax
  cmp    0x8(%rsp),%edx
  je     L177
  mov    0x38(%rsp),%rdi
  add    %rdi,%r15
  mov    0x10(%rsp),%ecx
  add    %ecx,0x2c(%rsp)
  add    %rdi,0x30(%rsp)
  cmp    0x28(%rsp),%ecx
  jle    L92
  mov    %eax,0xc(%rsp)
L96:
  mov    0x28(%rsp),%r10d
  movslq %r10d,%rdi
  add    %r15,%rdi
  add    0x18(%rsp),%rdi
  mov    0x38(%rsp),%r9
  mov    0x10(%rsp),%r8d
L202:
  mov    %rdi,%rdx
  mov    0x2c(%rsp),%eax
  mov    0xc(%rsp),%ecx
L176:
  mov    %eax,%esi
  cmpb   $0x0,(%rdx)
  jne    L95
  add    $0x1,%ecx
  add    %r8d,%eax
  add    %r9,%rdx
  cmp    %ecx,%r14d
  jne    L176
  add    $0x1,%r10d
  add    $0x1,%rdi
  cmp    %r10d,%r8d
  jne    L202
  mov    $0x0,%eax
L10:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L177:
  mov    $0x1,%eax
  jmp    L10
L205:
  mov    $0x1,%eax
  jmp    L10
L152:
  mov    $0x0,%eax
  jmp    L10
L92:
  mov    $0x0,%eax
  jmp    L10
```

assistant: ```c
int echelonform(unsigned char M[], int nrows, int ncols) {
  int lead = 0, rix = 0, iix = 0, j, k;
  unsigned char temp, de, sb;
  for (rix = 0; rix < nrows; rix++) {
    if (lead >= ncols) {
      return 0;
    }
    iix = rix;
    while (M[iix * ncols + lead] == 0) {
      iix++;
      if (iix == nrows) {
        iix = rix;
        lead++;
        if (ncols == lead) {
          return 0;
        }
      }
    }
    for (j = 0; j < ncols; j++) {
      temp = M[rix * ncols + j];
      M[rix * ncols + j] = M[iix * ncols + j];
      M[iix * ncols + j] = temp;
    }
    de = M[rix * ncols + lead];
    if (de != 0) {
      for (j = 0; j < ncols; j++) {
        M[rix * ncols + j] = divs(M[rix * ncols + j], de);
      }
    }
    for (j = 0; j < nrows; j++) {
      if (j != rix) {
        sb = M[j * ncols + lead];
        for (k = 0; k < ncols; k++) {
          M[j * ncols + k] = sub(M[j * ncols + k], mul(sb, M[rix * ncols + k]));
        }
      }
    }
    lead++;
  }
  return 1;
}
```