user: 请将以下的汇编代码转换成C语言代码:

```asm
<rsencode>:
  endbr64
  push   %r15
  mov    $0x70,%r9d
  mov    %edi,%r8d
  mov    %esi,%r10d
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x3e8,%rsp
  mov    %rdx,0x28(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x3d8(%rsp)
  xor    %eax,%eax
  cmp    %r9d,%esi
  movl   $0x1,0x40(%rsp)
  cmovle %esi,%r9d
  test   %esi,%esi
  jle    L85
  lea    0x44(%rsp),%rsi
  mov    $0x1,%eax
  mov    $0x1,%ecx
  jmp    L76
  nopl   (%rax)
L103:
  add    $0x4,%rsi
L76:
  lea    (%rax,%rax,2),%edx
  add    $0x1,%ecx
  movslq %edx,%rax
  mov    %edx,%edi
  imul   $0x487ede05,%rax,%rax
  sar    $0x1f,%edi
  sar    $0x25,%rax
  sub    %edi,%eax
  imul   $0x71,%eax,%edi
  mov    %edx,%eax
  sub    %edi,%eax
  mov    %eax,(%rsi)
  cmp    %r9d,%ecx
  jle    L103
L85:
  add    %r8d,%r10d
  mov    $0x71,%ebp
  movq   $0x0,0x18(%rsp)
  lea    0x6f(%r10),%edx
  movslq %edx,%rax
  imul   $0xffffffff92492493,%rax,%rax
  shr    $0x20,%rax
  add    %edx,%eax
  sar    $0x1f,%edx
  sar    $0x6,%eax
  mov    %eax,%ebx
  lea    -0x1(%r10),%eax
  sub    %edx,%ebx
  lea    -0x1(%r8),%edx
  add    %ebx,%edx
  add    %ebx,%eax
  mov    %ebx,0x30(%rsp)
  mov    %edx,0x38(%rsp)
  mov    %eax,0x3c(%rsp)
  test   %r10d,%r10d
  jle    L88
  nopl   (%rax)
L165:
  mov    0x18(%rsp),%rsi
  mov    0x38(%rsp),%eax
  mov    0x30(%rsp),%ecx
  mov    0x3c(%rsp),%edi
  sub    %esi,%eax
  mov    %esi,%r14d
  mov    %esi,%r13d
  cltd
  sub    %esi,%edi
  idiv   %ecx
  mov    %eax,%r11d
  mov    %eax,(%rsp)
  mov    %eax,%ebx
  mov    %edi,%eax
  cltd
  idiv   %ecx
  mov    %eax,%r15d
  mov    %eax,0x24(%rsp)
  sub    %r11d,%r15d
  mov    %r15d,0x4(%rsp)
  test   %r15d,%r15d
  jle    L2
  mov    %r15d,%edx
  lea    0x214(%rsp),%rdi
  xor    %esi,%esi
  shl    $0x2,%rdx
  lea    0x210(%rsp),%r12
  call   <memset@plt>
  movslq %r15d,%rdx
  lea    -0x1(%r15),%eax
  movl   $0x1,0x210(%rsp)
  shl    $0x2,%rdx
  shl    $0x2,%rax
  lea    0x44(%rsp),%r9
  lea    0x20c(%rsp,%rdx,1),%r8
  lea    0x48(%rsp,%rax,1),%r10
  add    %rdx,%r12
  sub    %rax,%r8
  nopl   0x0(%rax,%rax,1)
L141:
  mov    (%r9),%esi
  mov    %r12,%rdx
  xchg   %ax,%ax
L111:
  mov    -0x4(%rdx),%ecx
  sub    $0x4,%rdx
  imul   %esi,%ecx
  movslq %ecx,%rax
  mov    %ecx,%edi
  imul   $0x487ede05,%rax,%rax
  sar    $0x1f,%edi
  sar    $0x25,%rax
  sub    %edi,%eax
  mov    0x4(%rdx),%edi
  imul   $0x71,%eax,%eax
  sub    %ecx,%edi
  lea    0x71(%rdi,%rax,1),%ecx
  movslq %ecx,%rax
  mov    %ecx,%edi
  imul   $0x487ede05,%rax,%rax
  sar    $0x1f,%edi
  sar    $0x25,%rax
  sub    %edi,%eax
  imul   $0x71,%eax,%eax
  sub    %eax,%ecx
  mov    %ecx,0x4(%rdx)
  cmp    %rdx,%r8
  jne    L111
  add    $0x4,%r9
  cmp    %r9,%r10
  jne    L141
L52:
  mov    0x24(%rsp),%esi
  cmp    %esi,(%rsp)
  jge    L63
  movslq 0x30(%rsp),%rdx
  mov    (%rsp),%ecx
  mov    0x24(%rsp),%esi
  mov    %rdx,%rax
  imul   %ecx,%eax
  cltq
  add    0x18(%rsp),%rax
  add    0x28(%rsp),%rax
  nopl   (%rax)
L137:
  add    $0x1,%ecx
  movb   $0x0,(%rax)
  add    %rdx,%rax
  cmp    %ecx,%esi
  jne    L137
L63:
  mov    (%rsp),%eax
  test   %eax,%eax
  jle    L44
  movslq 0x30(%rsp),%r10
  mov    (%rsp),%edi
  mov    %ebx,0x34(%rsp)
  mov    0x28(%rsp),%rcx
  mov    %r10d,%r12d
  lea    0x1(%rdi),%r11d
  imul   %edi,%r12d
  mov    %rcx,%r15
  imul   %r10d,%r11d
  lea    (%r12,%r13,1),%eax
  movslq %r12d,%r12
  cltq
  movslq %r11d,%r11
  add    %rcx,%rax
  mov    %rax,0x8(%rsp)
  mov    0x24(%rsp),%eax
  sub    $0x1,%eax
  imul   %r10d,%eax
  add    %r14d,%eax
  cltq
  add    %rcx,%rax
  mov    %rax,%rdx
  movslq 0x4(%rsp),%rax
  mov    %rdx,%rbx
  mov    %rax,%r14
  mov    0x210(%rsp,%rax,4),%eax
  mov    %eax,0x20(%rsp)
  mov    0x18(%rsp),%rax
  add    %rax,%r15
  add    %r11,%rax
  neg    %r11
  add    %rcx,%rax
  mov    %rax,0x10(%rsp)
  lea    -0x2(%r14),%eax
  xor    %r14d,%r14d
  lea    0x218(%rsp,%rax,4),%r13
L169:
  mov    0x8(%rsp),%rsi
  movzbl (%r15),%eax
  mov    0x10(%rsp),%rcx
  movzbl (%rsi),%edx
  lea    0x214(%rsp),%rsi
  add    %edx,%eax
  movslq %eax,%rdi
  imul   $0x487ede05,%rdi,%rdi
  shr    $0x25,%rdi
  imul   $0x71,%edi,%edx
  sub    %edx,%eax
  cmpl   $0x1,0x4(%rsp)
  mov    %eax,%edi
  jle    L57
  nopw   0x0(%rax,%rax,1)
L112:
  mov    (%rsi),%edx
  lea    (%r12,%rcx,1),%r8
  add    $0x4,%rsi
  imul   %edi,%edx
  movslq %edx,%rax
  mov    %edx,%r9d
  imul   $0x487ede05,%rax,%rax
  sar    $0x1f,%r9d
  sar    $0x25,%rax
  sub    %r9d,%eax
  mov    %ebp,%r9d
  imul   $0x71,%eax,%eax
  sub    %eax,%edx
  movzbl (%rcx),%eax
  add    %r10,%rcx
  sub    %edx,%r9d
  lea    (%r9,%rax,1),%edx
  movslq %edx,%rax
  mov    %edx,%r9d
  imul   $0x487ede05,%rax,%rax
  sar    $0x1f,%r9d
  sar    $0x25,%rax
  sub    %r9d,%eax
  imul   $0x71,%eax,%eax
  sub    %eax,%edx
  mov    %dl,(%r8,%r11,1)
  cmp    %rsi,%r13
  jne    L112
L57:
  imul   0x20(%rsp),%edi
  add    $0x1,%r14d
  add    %r10,%r15
  movslq %edi,%rax
  mov    %edi,%edx
  imul   $0x487ede05,%rax,%rax
  sar    $0x1f,%edx
  sar    $0x25,%rax
  sub    %edx,%eax
  mov    %ebp,%edx
  imul   $0x71,%eax,%eax
  sub    %eax,%edi
  sub    %edi,%edx
  movslq %edx,%rax
  mov    %edx,%ecx
  imul   $0x487ede05,%rax,%rax
  sar    $0x1f,%ecx
  sar    $0x25,%rax
  sub    %ecx,%eax
  imul   $0x71,%eax,%eax
  sub    %eax,%edx
  mov    %dl,(%rbx)
  cmp    %r14d,(%rsp)
  jne    L169
  mov    0x34(%rsp),%ebx
L44:
  mov    0x24(%rsp),%esi
  cmp    %esi,(%rsp)
  jge    L92
  movslq 0x30(%rsp),%rcx
  mov    (%rsp),%esi
  mov    0x24(%rsp),%r8d
  imul   %ecx,%esi
  movslq %esi,%rsi
  add    0x18(%rsp),%rsi
  add    0x28(%rsp),%rsi
  nopw   0x0(%rax,%rax,1)
L46:
  movzbl (%rsi),%eax
  mov    %ebp,%edx
  add    $0x1,%ebx
  sub    %eax,%edx
  movslq %edx,%rax
  mov    %edx,%edi
  imul   $0x487ede05,%rax,%rax
  sar    $0x1f,%edi
  sar    $0x25,%rax
  sub    %edi,%eax
  imul   $0x71,%eax,%eax
  sub    %eax,%edx
  mov    %dl,(%rsi)
  add    %rcx,%rsi
  cmp    %ebx,%r8d
  jne    L46
L92:
  addq   $0x1,0x18(%rsp)
  mov    0x18(%rsp),%rax
  cmp    %eax,0x30(%rsp)
  jg     L165
L88:
  mov    0x3d8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L15
  add    $0x3e8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L2:
  movl   $0x1,0x210(%rsp)
  jmp    L52
L15:
  call   <__stack_chk_fail@plt>
```

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