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

```asm
<R4Core>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rdi,0x58(%rsp)
  mov    %esi,0x54(%rsp)
  mov    %edx,0x2c(%rsp)
  mov    %rcx,0x38(%rsp)
  test   %esi,%esi
  je     L58
  nopl   0x0(%rax)
L45:
  mov    0x2c(%rsp),%ecx
  mov    0x58(%rsp),%r11
  lea    (%rcx,%rcx,1),%eax
  mov    %r11,%rbx
  movslq %eax,%rdx
  add    %ecx,%eax
  add    %eax,%eax
  lea    0x0(,%rdx,4),%r10
  cltq
  mov    %r10,%r11
  shl    $0x2,%rax
  mov    %rax,0x30(%rsp)
  lea    0x0(,%rdx,8),%rax
  mov    %rax,0x48(%rsp)
  lea    -0x1(%rcx),%eax
  lea    0x8(,%rax,8),%rax
  mov    %rax,0x40(%rsp)
  mov    0x54(%rsp),%eax
  mov    %eax,0x50(%rsp)
  nopl   0x0(%rax)
L39:
  mov    0x48(%rsp),%rax
  mov    0x38(%rsp),%r10
  mov    %r11,%r12
  lea    (%rbx,%rax,1),%r9
  mov    0x40(%rsp),%rax
  mov    %r10,%r13
  mov    %r9,%rbp
  add    %rbx,%rax
  mov    %rax,0x20(%rsp)
  mov    0x2c(%rsp),%eax
  test   %eax,%eax
  je     L8
  nopl   0x0(%rax,%rax,1)
L51:
  mov    (%rbx,%r12,1),%r9d
  mov    0x0(%r13),%r15d
  add    $0x8,%rbx
  add    $0x18,%r13
  mov    -0x4(%rbx,%r12,1),%r8d
  mov    -0x14(%r13),%edi
  add    $0x8,%rbp
  mov    -0x4(%rbx),%ecx
  mov    -0x8(%rbx),%eax
  mov    %r9d,0x8(%rsp)
  lea    (%r15,%rdi,2),%r10d
  lea    (%r9,%r8,1),%esi
  mov    %r8d,0xc(%rsp)
  mov    %ecx,0x4(%rsp)
  mov    %r10d,0x10(%rsp)
  mov    %eax,(%rsp)
  call   <cook_MULSHIFT32@plt>
  mov    0x8(%rsp),%esi
  mov    0x10(%rsp),%edi
  mov    %eax,%r14d
  call   <cook_MULSHIFT32@plt>
  mov    0xc(%rsp),%esi
  mov    %r15d,%edi
  sub    %r14d,%eax
  mov    %eax,0x8(%rsp)
  call   <cook_MULSHIFT32@plt>
  mov    -0x10(%r13),%r8d
  mov    -0x4(%rbp),%r9d
  lea    (%rax,%r14,1),%ecx
  mov    -0xc(%r13),%edi
  mov    -0x8(%rbp),%r14d
  mov    %ecx,0x28(%rsp)
  lea    (%r8,%rdi,2),%r10d
  lea    (%r14,%r9,1),%esi
  mov    %r8d,0x14(%rsp)
  mov    %r10d,0x10(%rsp)
  mov    %r9d,0xc(%rsp)
  call   <cook_MULSHIFT32@plt>
  mov    0x10(%rsp),%edi
  mov    %r14d,%esi
  mov    %eax,%r15d
  call   <cook_MULSHIFT32@plt>
  mov    0xc(%rsp),%esi
  mov    0x14(%rsp),%edi
  mov    %eax,%r14d
  call   <cook_MULSHIFT32@plt>
  mov    -0x8(%r13),%r8d
  mov    -0x4(%r13),%edi
  sub    %r15d,%r14d
  mov    -0x4(%rbp,%r12,1),%r9d
  mov    -0x8(%rbp,%r12,1),%r10d
  lea    (%rax,%r15,1),%edx
  lea    (%r8,%rdi,2),%r11d
  mov    %edx,0x1c(%rsp)
  lea    (%r10,%r9,1),%esi
  mov    %r8d,0x18(%rsp)
  mov    %r11d,0x14(%rsp)
  mov    %r9d,0x10(%rsp)
  mov    %r10d,0xc(%rsp)
  call   <cook_MULSHIFT32@plt>
  mov    0xc(%rsp),%esi
  mov    0x14(%rsp),%edi
  mov    %eax,%r15d
  call   <cook_MULSHIFT32@plt>
  mov    0x10(%rsp),%esi
  mov    0x18(%rsp),%edi
  mov    %eax,%r10d
  sub    %r15d,%r10d
  mov    %r10d,0xc(%rsp)
  call   <cook_MULSHIFT32@plt>
  mov    (%rsp),%edi
  mov    0x8(%rsp),%edx
  lea    (%rax,%r15,1),%esi
  mov    0x4(%rsp),%eax
  mov    0x28(%rsp),%ecx
  sar    $0x2,%edi
  mov    0xc(%rsp),%r10d
  mov    %esi,%r11d
  mov    %edi,%r8d
  add    %edx,%edi
  sar    $0x2,%eax
  sub    %edx,%r8d
  mov    0x1c(%rsp),%edx
  mov    %eax,%r9d
  add    %ecx,%eax
  sub    %ecx,%r9d
  lea    (%r14,%r10,1),%ecx
  sub    %r10d,%r14d
  sub    %edx,%r11d
  add    %edx,%esi
  lea    (%r8,%r11,1),%edx
  sub    %r11d,%r8d
  mov    %edx,-0x8(%rbp,%r12,1)
  lea    (%r9,%r14,1),%edx
  sub    %r14d,%r9d
  mov    %edx,-0x4(%rbp,%r12,1)
  mov    %edi,%edx
  add    %ecx,%edi
  sub    %ecx,%edx
  mov    %edx,-0x8(%rbp)
  mov    %eax,%edx
  add    %esi,%eax
  sub    %esi,%edx
  mov    %edx,-0x4(%rbp)
  mov    %r8d,-0x8(%rbx,%r12,1)
  mov    %r9d,-0x4(%rbx,%r12,1)
  mov    %edi,-0x8(%rbx)
  mov    %eax,-0x4(%rbx)
  cmp    0x20(%rsp),%rbx
  jne    L51
  mov    %r12,%r11
L49:
  mov    0x20(%rsp),%rbx
  add    0x30(%rsp),%rbx
  subl   $0x1,0x50(%rsp)
  jne    L39
  mov    0x30(%rsp),%rcx
  shll   $0x2,0x2c(%rsp)
  add    %rcx,0x38(%rsp)
  sarl   $0x2,0x54(%rsp)
  jne    L45
L58:
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L8:
  mov    %rbx,0x20(%rsp)
  jmp    L49
```

assistant: ```c
void R4Core(int *x, int bg, int gp, int *wtab) {
  int ar, ai, br, bi, cr, ci, dr, di, tr, ti;
  int wd, ws, wi;
  int i, j, step;
  int *xptr, *wptr;
  for (; bg != 0; gp <<= 2, bg >>= 2) {
    step = 2 * gp;
    xptr = x;
    for (i = bg; i != 0; i--) {
      wptr = wtab;
      for (j = gp; j != 0; j--) {
        ar = xptr[0];
        ai = xptr[1];
        xptr += step;
        ws = wptr[0];
        wi = wptr[1];
        br = xptr[0];
        bi = xptr[1];
        wd = ws + 2 * wi;
        tr = cook_MULSHIFT32(wi, br + bi);
        br = cook_MULSHIFT32(wd, br) - tr;
        bi = cook_MULSHIFT32(ws, bi) + tr;
        xptr += step;
        ws = wptr[2];
        wi = wptr[3];
        cr = xptr[0];
        ci = xptr[1];
        wd = ws + 2 * wi;
        tr = cook_MULSHIFT32(wi, cr + ci);
        cr = cook_MULSHIFT32(wd, cr) - tr;
        ci = cook_MULSHIFT32(ws, ci) + tr;
        xptr += step;
        ws = wptr[4];
        wi = wptr[5];
        dr = xptr[0];
        di = xptr[1];
        wd = ws + 2 * wi;
        tr = cook_MULSHIFT32(wi, dr + di);
        dr = cook_MULSHIFT32(wd, dr) - tr;
        di = cook_MULSHIFT32(ws, di) + tr;
        wptr += 6;
        tr = ar;
        ti = ai;
        ar = (tr >> 2) - br;
        ai = (ti >> 2) - bi;
        br = (tr >> 2) + br;
        bi = (ti >> 2) + bi;
        tr = cr;
        ti = ci;
        cr = tr + dr;
        ci = di - ti;
        dr = tr - dr;
        di = di + ti;
        xptr[0] = ar + ci;
        xptr[1] = ai + dr;
        xptr -= step;
        xptr[0] = br - cr;
        xptr[1] = bi - di;
        xptr -= step;
        xptr[0] = ar - ci;
        xptr[1] = ai - dr;
        xptr -= step;
        xptr[0] = br + cr;
        xptr[1] = bi + di;
        xptr += 2;
      }
      xptr += 3 * step;
    }
    wtab += 3 * step;
  }
}
```