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

```asm
<rsencode>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x3e0,%rsp
  mov    %edi,-0x3d4(%rbp)
  mov    %esi,-0x3d8(%rbp)
  mov    %rdx,-0x3e0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x1,-0x3a0(%rbp)
  movl   $0x1,-0x3c4(%rbp)
  jmp    L81
L187:
  mov    -0x3c4(%rbp),%eax
  sub    $0x1,%eax
  cltq
  mov    -0x3a0(%rbp,%rax,4),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %eax,%edx
  movslq %edx,%rax
  imul   $0x487ede05,%rax,%rax
  shr    $0x20,%rax
  sar    $0x5,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  imul   $0x71,%eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    -0x3c4(%rbp),%edx
  movslq %edx,%rdx
  mov    %eax,-0x3a0(%rbp,%rdx,4)
  addl   $0x1,-0x3c4(%rbp)
L81:
  mov    -0x3c4(%rbp),%eax
  cmp    -0x3d8(%rbp),%eax
  jg     L164
  cmpl   $0x70,-0x3c4(%rbp)
  jle    L187
L164:
  mov    -0x3d4(%rbp),%edx
  mov    -0x3d8(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x3b8(%rbp)
  mov    -0x3b8(%rbp),%eax
  add    $0x6f,%eax
  movslq %eax,%rdx
  imul   $0xffffffff92492493,%rdx,%rdx
  shr    $0x20,%rdx
  add    %eax,%edx
  sar    $0x6,%edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x3b4(%rbp)
  movl   $0x0,-0x3bc(%rbp)
  jmp    L192
L190:
  mov    -0x3d4(%rbp),%eax
  sub    -0x3bc(%rbp),%eax
  mov    %eax,%edx
  mov    -0x3b4(%rbp),%eax
  add    %edx,%eax
  sub    $0x1,%eax
  cltd
  idivl  -0x3b4(%rbp)
  mov    %eax,-0x3b0(%rbp)
  mov    -0x3b8(%rbp),%eax
  sub    -0x3bc(%rbp),%eax
  mov    %eax,%edx
  mov    -0x3b4(%rbp),%eax
  add    %edx,%eax
  sub    $0x1,%eax
  cltd
  idivl  -0x3b4(%rbp)
  mov    %eax,-0x3ac(%rbp)
  mov    -0x3ac(%rbp),%eax
  sub    -0x3b0(%rbp),%eax
  mov    %eax,-0x3a8(%rbp)
  movl   $0x1,-0x3c4(%rbp)
  jmp    L62
L101:
  mov    -0x3c4(%rbp),%eax
  cltq
  movl   $0x0,-0x1d0(%rbp,%rax,4)
  addl   $0x1,-0x3c4(%rbp)
L62:
  mov    -0x3c4(%rbp),%eax
  cmp    -0x3a8(%rbp),%eax
  jle    L101
  movl   $0x1,-0x1d0(%rbp)
  movl   $0x1,-0x3c4(%rbp)
  jmp    L79
L189:
  mov    -0x3a8(%rbp),%eax
  mov    %eax,-0x3c0(%rbp)
  jmp    L148
L51:
  mov    -0x3c0(%rbp),%eax
  cltq
  mov    -0x1d0(%rbp,%rax,4),%eax
  lea    0x71(%rax),%esi
  mov    -0x3c4(%rbp),%eax
  cltq
  mov    -0x3a0(%rbp,%rax,4),%edx
  mov    -0x3c0(%rbp),%eax
  sub    $0x1,%eax
  cltq
  mov    -0x1d0(%rbp,%rax,4),%eax
  imul   %edx,%eax
  movslq %eax,%rdx
  imul   $0x487ede05,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x5,%edx
  mov    %eax,%edi
  sar    $0x1f,%edi
  mov    %edx,%ecx
  sub    %edi,%ecx
  imul   $0x71,%ecx,%edx
  sub    %edx,%eax
  mov    %eax,%ecx
  sub    %ecx,%esi
  mov    %esi,%edx
  movslq %edx,%rax
  imul   $0x487ede05,%rax,%rax
  shr    $0x20,%rax
  sar    $0x5,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  imul   $0x71,%eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    -0x3c0(%rbp),%edx
  movslq %edx,%rdx
  mov    %eax,-0x1d0(%rbp,%rdx,4)
  subl   $0x1,-0x3c0(%rbp)
L148:
  cmpl   $0x0,-0x3c0(%rbp)
  jg     L51
  addl   $0x1,-0x3c4(%rbp)
L79:
  mov    -0x3c4(%rbp),%eax
  cmp    -0x3a8(%rbp),%eax
  jle    L189
  mov    -0x3b0(%rbp),%eax
  mov    %eax,-0x3c4(%rbp)
  jmp    L133
L6:
  mov    -0x3c4(%rbp),%eax
  imul   -0x3b4(%rbp),%eax
  mov    %eax,%edx
  mov    -0x3bc(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x3e0(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  addl   $0x1,-0x3c4(%rbp)
L133:
  mov    -0x3c4(%rbp),%eax
  cmp    -0x3ac(%rbp),%eax
  jl     L6
  movl   $0x0,-0x3c4(%rbp)
  jmp    L126
L34:
  mov    -0x3c4(%rbp),%eax
  imul   -0x3b4(%rbp),%eax
  mov    %eax,%edx
  mov    -0x3bc(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x3e0(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x3b0(%rbp),%eax
  imul   -0x3b4(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x3bc(%rbp),%eax
  add    %ecx,%eax
  movslq %eax,%rcx
  mov    -0x3e0(%rbp),%rax
  add    %rcx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %edx,%eax
  movslq %eax,%rdx
  imul   $0x487ede05,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x5,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  mov    %edx,-0x3a4(%rbp)
  mov    -0x3a4(%rbp),%edx
  imul   $0x71,%edx,%edx
  sub    %edx,%eax
  mov    %eax,-0x3a4(%rbp)
  movl   $0x0,-0x3c0(%rbp)
  jmp    L159
L90:
  mov    -0x3c0(%rbp),%eax
  add    $0x1,%eax
  cltq
  mov    -0x1d0(%rbp,%rax,4),%eax
  imul   -0x3a4(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x487ede05,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x5,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x71,%edx,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    $0x71,%eax
  sub    %edx,%eax
  mov    %eax,%ecx
  mov    -0x3b0(%rbp),%edx
  mov    -0x3c0(%rbp),%eax
  add    %edx,%eax
  add    $0x1,%eax
  imul   -0x3b4(%rbp),%eax
  mov    %eax,%edx
  mov    -0x3bc(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x3e0(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  add    %ecx,%eax
  movslq %eax,%rdx
  imul   $0x487ede05,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x5,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x71,%edx,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x3b0(%rbp),%ecx
  mov    -0x3c0(%rbp),%eax
  add    %ecx,%eax
  imul   -0x3b4(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x3bc(%rbp),%eax
  add    %ecx,%eax
  movslq %eax,%rcx
  mov    -0x3e0(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
  addl   $0x1,-0x3c0(%rbp)
L159:
  mov    -0x3a8(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x3c0(%rbp)
  jl     L90
  mov    -0x3a8(%rbp),%eax
  cltq
  mov    -0x1d0(%rbp,%rax,4),%eax
  imul   -0x3a4(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x487ede05,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x5,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x71,%edx,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    $0x71,%eax
  sub    %edx,%eax
  movslq %eax,%rdx
  imul   $0x487ede05,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x5,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x71,%edx,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x3b0(%rbp),%ecx
  mov    -0x3a8(%rbp),%eax
  add    %ecx,%eax
  sub    $0x1,%eax
  imul   -0x3b4(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x3bc(%rbp),%eax
  add    %ecx,%eax
  movslq %eax,%rcx
  mov    -0x3e0(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
  addl   $0x1,-0x3c4(%rbp)
L126:
  mov    -0x3c4(%rbp),%eax
  cmp    -0x3b0(%rbp),%eax
  jl     L34
  mov    -0x3b0(%rbp),%eax
  mov    %eax,-0x3c4(%rbp)
  jmp    L70
L173:
  mov    -0x3c4(%rbp),%eax
  imul   -0x3b4(%rbp),%eax
  mov    %eax,%edx
  mov    -0x3bc(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x3e0(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    $0x71,%eax
  sub    %edx,%eax
  movslq %eax,%rdx
  imul   $0x487ede05,%rdx,%rdx
  shr    $0x20,%rdx
  sar    $0x5,%edx
  mov    %eax,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%edx
  imul   $0x71,%edx,%ecx
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x3c4(%rbp),%eax
  imul   -0x3b4(%rbp),%eax
  mov    %eax,%ecx
  mov    -0x3bc(%rbp),%eax
  add    %ecx,%eax
  movslq %eax,%rcx
  mov    -0x3e0(%rbp),%rax
  add    %rcx,%rax
  mov    %dl,(%rax)
  addl   $0x1,-0x3c4(%rbp)
L70:
  mov    -0x3c4(%rbp),%eax
  cmp    -0x3ac(%rbp),%eax
  jl     L173
  addl   $0x1,-0x3bc(%rbp)
L192:
  mov    -0x3bc(%rbp),%eax
  cmp    -0x3b4(%rbp),%eax
  jl     L190
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L128
  call   <__stack_chk_fail@plt>
L128:
  leave
  ret
```

assistant: ```c
void rsencode(int nd, int nc, unsigned char *wd) {
  int i, j, k, nw, start, step, root[113], c[113];
  root[0] = 1;
  for (i = 1; (i <= nc) && (i < 113); i++)
    root[i] = (3 * root[i - 1]) % 113;
  nw = nd + nc;
  step = (nw + 113 - 2) / (113 - 1);
  for (start = 0; start < step; start++) {
    int ND = (nd - start + step - 1) / step, NW = (nw - start + step - 1) / step, NC = NW - ND;
    for (i = 1; i <= NC; i++)
      c[i] = 0;
    c[0] = 1;
    for (i = 1; i <= NC; i++) {
      for (j = NC; j >= 1; j--) {
        c[j] = (113 + c[j] - (root[i] * c[j - 1]) % 113) % 113;
      }
    }
    for (i = ND; i < NW; i++)
      wd[start + i * step] = 0;
    for (i = 0; i < ND; i++) {
      k = (wd[start + i * step] + wd[start + ND * step]) % 113;
      for (j = 0; j < NC - 1; j++) {
        wd[start + (ND + j) * step] = (113 - ((c[j + 1] * k) % 113) + wd[start + (ND + j + 1) * step]) % 113;
      }
      wd[start + (ND + NC - 1) * step] = (113 - ((c[NC] * k) % 113)) % 113;
    }
    for (i = ND; i < NW; i++)
      wd[start + i * step] = (113 - wd[start + i * step]) % 113;
  }
}
```