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    L73
L27:
  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)
L73:
  mov    -0x3c4(%rbp),%eax
  cmp    -0x3d8(%rbp),%eax
  jle    L27
  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    L149
L54:
  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    L85
L159:
  mov    -0x3c4(%rbp),%eax
  cltq
  movl   $0x0,-0x1d0(%rbp,%rax,4)
  addl   $0x1,-0x3c4(%rbp)
L85:
  mov    -0x3c4(%rbp),%eax
  cmp    -0x3a8(%rbp),%eax
  jle    L159
  movl   $0x1,-0x1d0(%rbp)
  movl   $0x1,-0x3c4(%rbp)
  jmp    L71
L186:
  mov    -0x3a8(%rbp),%eax
  mov    %eax,-0x3c0(%rbp)
  jmp    L188
L58:
  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)
L188:
  cmpl   $0x0,-0x3c0(%rbp)
  jg     L58
  addl   $0x1,-0x3c4(%rbp)
L71:
  mov    -0x3c4(%rbp),%eax
  cmp    -0x3a8(%rbp),%eax
  jle    L186
  mov    -0x3b0(%rbp),%eax
  mov    %eax,-0x3c4(%rbp)
  jmp    L175
L127:
  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)
L175:
  mov    -0x3c4(%rbp),%eax
  cmp    -0x3ac(%rbp),%eax
  jl     L127
  movl   $0x0,-0x3c4(%rbp)
  jmp    L52
L96:
  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    L128
L163:
  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)
L128:
  mov    -0x3a8(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x3c0(%rbp)
  jl     L163
  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)
L52:
  mov    -0x3c4(%rbp),%eax
  cmp    -0x3b0(%rbp),%eax
  jl     L96
  mov    -0x3b0(%rbp),%eax
  mov    %eax,-0x3c4(%rbp)
  jmp    L95
L158:
  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)
L95:
  mov    -0x3c4(%rbp),%eax
  cmp    -0x3ac(%rbp),%eax
  jl     L158
  addl   $0x1,-0x3bc(%rbp)
L149:
  mov    -0x3bc(%rbp),%eax
  cmp    -0x3b4(%rbp),%eax
  jl     L54
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L172
  call   <__stack_chk_fail@plt>
L172:
  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++)
    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;
  }
}
```