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

```asm
<RandomFunc>:
  endbr64
  mov    (%rdi),%rdx
  mov    %rsi,%rcx
  sub    $0x17447d68,%rdx
  test   $0x8,%dl
  je     L4
  push   %rbx
  mov    %edx,%ebx
  shl    $0x8,%ebx
  sar    $0x18,%ebx
  test   $0x1,%dl
  jne    L0
  movabs $0xffffffffffffff,%rax
  mov    %edx,%esi
  movabs $0xffffffff00ffffff,%rdi
  sar    $0x18,%esi
  and    %rdx,%rax
  shl    $0x38,%rsi
  or     %rsi,%rax
  mov    %rdx,%rsi
  movzbl %dh,%edx
  shr    $0x38,%rsi
  and    %rdi,%rax
  shl    $0x10,%rdx
  shl    $0x18,%rsi
  or     %rsi,%rax
  and    $0xffffffffff00ffff,%rax
  or     %rdx,%rax
  mov    %bl,%ah
  pop    %rbx
  mov    %rax,%rdx
  shl    $0x4,%rdx
  and    $0x3f0,%edx
  or     %rdx,%rax
  rol    $0x3,%rax
  mov    %rax,(%rcx)
  ret
  nopw   0x0(%rax,%rax,1)
L4:
  mov    %rdx,%rsi
  mov    %rdx,%rax
  movzwl %dx,%edx
  shr    $0x10,%rsi
  shl    $0x10,%rdx
  mov    %si,%ax
  movabs $0xffffffff0000ffff,%rsi
  and    %rsi,%rax
  or     %rdx,%rax
  imul   %rax,%rax
  rol    $0x3,%rax
  mov    %rax,(%rcx)
  ret
L0:
  movabs $0xff00ffffffffffff,%rax
  mov    %rdx,%rsi
  movzbl %bl,%ebx
  shl    $0x10,%rsi
  and    %rdx,%rax
  shl    $0x28,%rbx
  shr    $0x38,%rsi
  shr    $0x20,%rdx
  shl    $0x30,%rsi
  or     %rsi,%rax
  movabs $0xffff00ffffffffff,%rsi
  and    %rsi,%rax
  mov    %rdx,%rsi
  or     %rbx,%rax
  and    $0xff0000,%esi
  pop    %rbx
  and    $0xffffffffff00ffff,%rax
  mov    %rax,%rdx
  or     %rsi,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  and    $0x1f0,%eax
  or     %rdx,%rax
  rol    $0x3,%rax
  mov    %rax,(%rcx)
  ret
```

assistant: ```c
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  char copy11;
  char copy12;
  unsigned short copy13;
  {
    state[0UL] = (input[0UL] - 51238316UL) - 339126204UL;
    if ((state[0UL] >> 3UL) & 1UL) {
      if (state[0UL] & 1UL) {
        if (state[0UL] & 1UL) {
          copy11 = *((char *)(&state[0UL]) + 6);
          *((char *)(&state[0UL]) + 6) = *((char *)(&state[0UL]) + 5);
          *((char *)(&state[0UL]) + 5) = copy11;
          copy11 = *((char *)(&state[0UL]) + 5);
          *((char *)(&state[0UL]) + 5) = *((char *)(&state[0UL]) + 2);
          *((char *)(&state[0UL]) + 2) = copy11;
          state[0UL] |= (state[0UL] & 31UL) << 4UL;
        } else {
          state[0UL] += state[0UL];
          state[0UL] += state[0UL];
        }
      } else if (state[0UL] & 1UL) {
        state[0UL] |= ((state[0UL] << (((state[0UL] >> 1UL) & 7UL) | 1UL)) & 15UL) << 3UL;
        state[0UL] |= (state[0UL] & 63UL) << 4UL;
      } else {
        copy12 = *((char *)(&state[0UL]) + 7);
        *((char *)(&state[0UL]) + 7) = *((char *)(&state[0UL]) + 3);
        *((char *)(&state[0UL]) + 3) = copy12;
        copy12 = *((char *)(&state[0UL]) + 2);
        *((char *)(&state[0UL]) + 2) = *((char *)(&state[0UL]) + 1);
        *((char *)(&state[0UL]) + 1) = copy12;
        state[0UL] |= (state[0UL] & 63UL) << 4UL;
      }
    } else {
      copy13 = *((unsigned short *)(&state[0UL]) + 0);
      *((unsigned short *)(&state[0UL]) + 0) = *((unsigned short *)(&state[0UL]) + 1);
      *((unsigned short *)(&state[0UL]) + 1) = copy13;
      state[0UL] *= state[0UL];
    }
    output[0UL] = (state[0UL] << 3UL) | (state[0UL] >> 61UL);
  }
}
```