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

```asm
<rsencode>:
  endbr64
  push   %r15
  mov    %edi,%r8d
  mov    %esi,%r9d
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x418,%rsp
  mov    %rdx,0x40(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x408(%rsp)
  xor    %eax,%eax
  movl   $0x1,0x70(%rsp)
  test   %esi,%esi
  jle    L158
  lea    -0x1(%rsi),%eax
  lea    0x74(%rsp),%rdx
  lea    0x78(%rsp,%rax,4),%rdi
  mov    $0x1,%eax
  nopl   0x0(%rax)
L110:
  lea    (%rax,%rax,2),%ecx
  add    $0x4,%rdx
  movslq %ecx,%rax
  mov    %ecx,%esi
  imul   $0x487ede05,%rax,%rax
  sar    $0x1f,%esi
  sar    $0x25,%rax
  sub    %esi,%eax
  imul   $0x71,%eax,%esi
  mov    %ecx,%eax
  sub    %esi,%eax
  mov    %eax,-0x4(%rdx)
  cmp    %rdi,%rdx
  jne    L110
L158:
  movq   $0x0,0x28(%rsp)
  add    %r8d,%r9d
  lea    0x6f(%r9),%edx
  movslq %edx,%rax
  imul   $0xffffffff92492493,%rax,%rax
  shr    $0x20,%rax
  add    %edx,%eax
  sar    $0x1f,%edx
  sar    $0x6,%eax
  sub    %edx,%eax
  mov    %eax,0x48(%rsp)
  lea    -0x1(%r8),%eax
  mov    %eax,0x68(%rsp)
  lea    -0x1(%r9),%eax
  mov    %eax,0x6c(%rsp)
  test   %r9d,%r9d
  jle    L45
  movdqa D7(%rip),%xmm3
  pxor   %xmm4,%xmm4
  movdqa %xmm4,%xmm5
  pcmpgtd %xmm3,%xmm5
  nopl   0x0(%rax)
L92:
  mov    0x48(%rsp),%ebx
  mov    0x68(%rsp),%eax
  mov    0x28(%rsp),%rdi
  add    %ebx,%eax
  sub    %edi,%eax
  mov    %edi,0x60(%rsp)
  cltd
  mov    %edi,0x4c(%rsp)
  idiv   %ebx
  mov    %eax,%r12d
  mov    %eax,0xc(%rsp)
  mov    %eax,%r15d
  mov    0x6c(%rsp),%eax
  add    %ebx,%eax
  sub    %edi,%eax
  cltd
  idiv   %ebx
  mov    %eax,%ebx
  mov    %eax,0x3c(%rsp)
  mov    %eax,%ebp
  sub    %r12d,%ebx
  mov    %ebx,0x8(%rsp)
  mov    %ebx,%r13d
  test   %ebx,%ebx
  jle    L11
  mov    %ebx,%edx
  lea    -0x1(%rbx),%r14d
  xor    %esi,%esi
  movaps %xmm5,0x50(%rsp)
  shl    $0x2,%rdx
  lea    0x244(%rsp),%rdi
  lea    0x240(%rsp),%rbx
  call   <memset@plt>
  mov    %r14d,%eax
  movslq %ebp,%rdx
  mov    %r13d,%ecx
  lea    0x78(%rsp,%rax,4),%r10
  movslq %r12d,%rax
  and    $0xfffffffc,%ecx
  movl   $0x1,0x240(%rsp)
  sub    %rax,%rdx
  mov    %ecx,0x10(%rsp)
  lea    0x74(%rsp),%r8
  pxor   %xmm4,%xmm4
  shl    $0x2,%rdx
  movdqa D7(%rip),%xmm3
  mov    %r15d,0x64(%rsp)
  mov    %r10,%r15
  lea    -0xc(%rbx,%rdx,1),%rax
  lea    -0x10(%rbx,%rdx,1),%rdi
  mov    %r13d,%edx
  movdqa D0(%rip),%xmm8
  shr    $0x2,%edx
  movdqa 0x50(%rsp),%xmm5
  lea    -0x1(%rdx),%esi
  mov    %r13d,%edx
  not    %rsi
  and    $0x3,%edx
  shl    $0x4,%rsi
  cmp    $0x2,%r14d
  cmovbe %r13d,%edx
  movslq %edx,%rcx
  lea    (%rbx,%rcx,4),%r12
  mov    %rcx,0x20(%rsp)
  lea    -0x1(%rdx),%ebx
  lea    -0x2(%rdx),%ecx
  sub    $0x3,%edx
  mov    %ebx,0x18(%rsp)
  movslq %ebx,%rbx
  mov    %ecx,0x38(%rsp)
  movslq %ecx,%r13
  movslq %edx,%rcx
  mov    %rcx,0x30(%rsp)
  cs nopw 0x0(%rax,%rax,1)
L205:
  mov    (%r8),%ecx
  cmp    $0x2,%r14d
  jbe    L163
  movd   %ecx,%xmm6
  xor    %edx,%edx
  pshufd $0x0,%xmm6,%xmm6
  movdqa %xmm6,%xmm7
  psrlq  $0x20,%xmm7
  nopl   0x0(%rax)
L36:
  movdqu (%rdi,%rdx,1),%xmm0
  movdqa %xmm4,%xmm10
  movdqa %xmm5,%xmm11
  pshufd $0x1b,%xmm0,%xmm0
  movdqa %xmm0,%xmm9
  psrlq  $0x20,%xmm0
  pmuludq %xmm6,%xmm9
  pmuludq %xmm7,%xmm0
  pshufd $0x8,%xmm9,%xmm9
  pshufd $0x8,%xmm0,%xmm0
  punpckldq %xmm0,%xmm9
  movdqu (%rax,%rdx,1),%xmm0
  movdqa %xmm9,%xmm2
  punpckldq %xmm9,%xmm2
  pshufd $0x1b,%xmm0,%xmm0
  pcmpgtd %xmm2,%xmm10
  pmuludq %xmm2,%xmm11
  movdqa %xmm2,%xmm1
  pmuludq %xmm3,%xmm1
  movdqa %xmm9,%xmm2
  paddd  %xmm8,%xmm0
  punpckhdq %xmm9,%xmm2
  pmuludq %xmm3,%xmm10
  paddq  %xmm11,%xmm10
  movdqa %xmm5,%xmm11
  psllq  $0x20,%xmm10
  pmuludq %xmm2,%xmm11
  paddq  %xmm10,%xmm1
  movdqa %xmm4,%xmm10
  pcmpgtd %xmm2,%xmm10
  pmuludq %xmm3,%xmm2
  pmuludq %xmm3,%xmm10
  paddq  %xmm11,%xmm10
  psllq  $0x20,%xmm10
  paddq  %xmm10,%xmm2
  movdqa %xmm5,%xmm10
  shufps $0xdd,%xmm2,%xmm1
  movdqa %xmm9,%xmm2
  psrad  $0x5,%xmm1
  psrad  $0x1f,%xmm2
  psubd  %xmm2,%xmm1
  movdqa %xmm1,%xmm2
  pslld  $0x3,%xmm2
  psubd  %xmm1,%xmm2
  pslld  $0x4,%xmm2
  paddd  %xmm2,%xmm1
  psubd  %xmm1,%xmm9
  psubd  %xmm9,%xmm0
  movdqa %xmm4,%xmm9
  movdqa %xmm0,%xmm2
  punpckldq %xmm0,%xmm2
  pcmpgtd %xmm2,%xmm9
  pmuludq %xmm2,%xmm10
  movdqa %xmm2,%xmm1
  pmuludq %xmm3,%xmm1
  movdqa %xmm0,%xmm2
  punpckhdq %xmm0,%xmm2
  pmuludq %xmm3,%xmm9
  paddq  %xmm10,%xmm9
  movdqa %xmm5,%xmm10
  psllq  $0x20,%xmm9
  pmuludq %xmm2,%xmm10
  paddq  %xmm9,%xmm1
  movdqa %xmm4,%xmm9
  pcmpgtd %xmm2,%xmm9
  pmuludq %xmm3,%xmm2
  pmuludq %xmm3,%xmm9
  paddq  %xmm10,%xmm9
  psllq  $0x20,%xmm9
  paddq  %xmm9,%xmm2
  shufps $0xdd,%xmm2,%xmm1
  movdqa %xmm0,%xmm2
  psrad  $0x5,%xmm1
  psrad  $0x1f,%xmm2
  psubd  %xmm2,%xmm1
  movdqa %xmm1,%xmm2
  pslld  $0x3,%xmm2
  psubd  %xmm1,%xmm2
  pslld  $0x4,%xmm2
  paddd  %xmm2,%xmm1
  psubd  %xmm1,%xmm0
  pshufd $0x1b,%xmm0,%xmm0
  movups %xmm0,(%rax,%rdx,1)
  sub    $0x10,%rdx
  cmp    %rsi,%rdx
  jne    L36
  mov    0x10(%rsp),%r10d
  cmp    %r10d,0x8(%rsp)
  je     L76
L163:
  mov    0x240(%rsp,%rbx,4),%r9d
  mov    %ecx,%r10d
  imul   %r9d,%r10d
  movslq %r10d,%rdx
  mov    %r10d,%r11d
  imul   $0x487ede05,%rdx,%rdx
  sar    $0x1f,%r11d
  sar    $0x25,%rdx
  sub    %r11d,%edx
  mov    (%r12),%r11d
  imul   $0x71,%edx,%edx
  sub    %r10d,%r11d
  lea    0x71(%r11,%rdx,1),%r10d
  movslq %r10d,%rdx
  mov    %r10d,%r11d
  imul   $0x487ede05,%rdx,%rdx
  sar    $0x1f,%r11d
  sar    $0x25,%rdx
  sub    %r11d,%edx
  imul   $0x71,%edx,%edx
  sub    %edx,%r10d
  mov    0x20(%rsp),%rdx
  mov    %r10d,0x240(%rsp,%rdx,4)
  mov    0x18(%rsp),%r10d
  test   %r10d,%r10d
  je     L76
  mov    0x240(%rsp,%r13,4),%r10d
  mov    %ecx,%r11d
  imul   %r10d,%r11d
  movslq %r11d,%rdx
  mov    %r11d,%ebp
  sub    %r11d,%r9d
  imul   $0x487ede05,%rdx,%rdx
  sar    $0x1f,%ebp
  sar    $0x25,%rdx
  sub    %ebp,%edx
  imul   $0x71,%edx,%edx
  lea    0x71(%r9,%rdx,1),%r9d
  movslq %r9d,%rdx
  mov    %r9d,%r11d
  imul   $0x487ede05,%rdx,%rdx
  sar    $0x1f,%r11d
  sar    $0x25,%rdx
  sub    %r11d,%edx
  imul   $0x71,%edx,%edx
  sub    %edx,%r9d
  mov    0x38(%rsp),%edx
  mov    %r9d,0x240(%rsp,%rbx,4)
  test   %edx,%edx
  je     L76
  mov    0x30(%rsp),%rdx
  imul   0x240(%rsp,%rdx,4),%ecx
  movslq %ecx,%rdx
  mov    %ecx,%r9d
  sub    %ecx,%r10d
  imul   $0x487ede05,%rdx,%rdx
  sar    $0x1f,%r9d
  sar    $0x25,%rdx
  sub    %r9d,%edx
  imul   $0x71,%edx,%edx
  lea    0x71(%r10,%rdx,1),%ecx
  movslq %ecx,%rdx
  mov    %ecx,%r9d
  imul   $0x487ede05,%rdx,%rdx
  sar    $0x1f,%r9d
  sar    $0x25,%rdx
  sub    %r9d,%edx
  imul   $0x71,%edx,%edx
  sub    %edx,%ecx
  mov    %ecx,0x240(%rsp,%r13,4)
L76:
  add    $0x4,%r8
  cmp    %r15,%r8
  jne    L205
  mov    0x64(%rsp),%r15d
L32:
  mov    0x3c(%rsp),%ebx
  cmp    %ebx,0xc(%rsp)
  jge    L71
  movslq 0x48(%rsp),%rdx
  mov    0xc(%rsp),%ecx
  mov    %ebx,%esi
  mov    %rdx,%rax
  imul   %ecx,%eax
  cltq
  add    0x28(%rsp),%rax
  add    0x40(%rsp),%rax
  nopl   0x0(%rax)
L1:
  add    $0x1,%ecx
  movb   $0x0,(%rax)
  add    %rdx,%rax
  cmp    %ecx,%esi
  jne    L1
L71:
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jle    L58
  mov    0x48(%rsp),%ebx
  mov    0xc(%rsp),%esi
  mov    %r15d,0x38(%rsp)
  xor    %r13d,%r13d
  mov    0x4c(%rsp),%eax
  mov    0x40(%rsp),%rdi
  mov    %ebx,%ebp
  movslq %ebx,%r11
  mov    0x28(%rsp),%r10
  imul   %esi,%ebp
  mov    %rdi,%r14
  add    %r10,%r14
  add    %ebp,%eax
  movslq %ebp,%rbp
  cltq
  add    %rdi,%rax
  mov    %rax,0x10(%rsp)
  mov    0x3c(%rsp),%eax
  sub    $0x1,%eax
  imul   %ebx,%eax
  add    0x60(%rsp),%eax
  lea    0x1(%rsi),%ebx
  cltq
  imul   %r11d,%ebx
  add    %rdi,%rax
  mov    %rax,%rcx
  movslq 0x8(%rsp),%rax
  movslq %ebx,%rbx
  mov    %rcx,%r15
  mov    %rax,%rdx
  mov    0x240(%rsp,%rax,4),%eax
  mov    %eax,0x20(%rsp)
  lea    (%rbx,%r10,1),%rax
  neg    %rbx
  mov    $0x71,%r10d
  add    %rdi,%rax
  mov    %rax,0x18(%rsp)
  lea    -0x2(%rdx),%eax
  lea    0x248(%rsp,%rax,4),%r12
  nopw   0x0(%rax,%rax,1)
L120:
  mov    0x10(%rsp),%rdi
  movzbl (%r14),%eax
  lea    0x244(%rsp),%rsi
  mov    0x18(%rsp),%rcx
  movzbl (%rdi),%edx
  add    %edx,%eax
  movslq %eax,%rdi
  imul   $0x487ede05,%rdi,%rdi
  shr    $0x25,%rdi
  imul   $0x71,%edi,%edx
  sub    %edx,%eax
  cmpl   $0x1,0x8(%rsp)
  mov    %eax,%edi
  jle    L188
  nopw   0x0(%rax,%rax,1)
L62:
  mov    (%rsi),%edx
  lea    (%rcx,%rbp,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    %r10d,%r9d
  imul   $0x71,%eax,%eax
  sub    %eax,%edx
  movzbl (%rcx),%eax
  add    %r11,%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,%rbx,1)
  cmp    %r12,%rsi
  jne    L62
L188:
  imul   0x20(%rsp),%edi
  add    $0x1,%r13d
  add    %r11,%r14
  movslq %edi,%rax
  mov    %edi,%edx
  imul   $0x487ede05,%rax,%rax
  sar    $0x1f,%edx
  sar    $0x25,%rax
  sub    %edx,%eax
  mov    %r10d,%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,(%r15)
  cmp    %r13d,0xc(%rsp)
  jne    L120
  mov    0x38(%rsp),%r15d
L58:
  mov    0x3c(%rsp),%ebx
  cmp    %ebx,0xc(%rsp)
  jge    L177
  movslq 0x48(%rsp),%rsi
  mov    0xc(%rsp),%ecx
  mov    %ebx,%r9d
  mov    $0x71,%edi
  imul   %esi,%ecx
  movslq %ecx,%rcx
  add    0x28(%rsp),%rcx
  add    0x40(%rsp),%rcx
  nopl   0x0(%rax,%rax,1)
L131:
  movzbl (%rcx),%eax
  mov    %edi,%edx
  add    $0x1,%r15d
  sub    %eax,%edx
  movslq %edx,%rax
  mov    %edx,%r8d
  imul   $0x487ede05,%rax,%rax
  sar    $0x1f,%r8d
  sar    $0x25,%rax
  sub    %r8d,%eax
  imul   $0x71,%eax,%eax
  sub    %eax,%edx
  mov    %dl,(%rcx)
  add    %rsi,%rcx
  cmp    %r15d,%r9d
  jne    L131
L177:
  addq   $0x1,0x28(%rsp)
  mov    0x28(%rsp),%rax
  cmp    %eax,0x48(%rsp)
  jg     L92
L45:
  mov    0x408(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L138
  add    $0x418,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L11:
  movl   $0x1,0x240(%rsp)
  jmp    L32
L138:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D7
type: byte[16]
name: unpack_data
arguments: data_tag: D0
type: byte[16]

tool: {"D7": [0x05,0xde,0x7e,0x48,0x05,0xde,0x7e,0x48,0x05,0xde,0x7e,0x48,0x05,0xde,0x7e,0x48]}

tool: {"D0": [0x71,0x00,0x00,0x00,0x71,0x00,0x00,0x00,0x71,0x00,0x00,0x00,0x71,0x00,0x00,0x00]}

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