user: Converte this assembly snippet into its equivalent C code:

```asm
<RandomFunc>:
  endbr64
  mov    %rsi,%rcx
  mov    (%rdi),%rdx
  sub    $0x17447d68,%rdx
  mov    %rdx,%rax
  test   $0x8,%dl
  je     L26
  test   $0x1,%dl
  je     L25
  mov    %rdx,%rsi
  shl    $0x10,%rsi
  shr    $0x38,%rsi
  shl    $0x30,%rsi
  movabs $0xff00ffffffffffff,%rax
  and    %rdx,%rax
  or     %rsi,%rax
  mov    %edx,%esi
  shl    $0x8,%esi
  sar    $0x18,%esi
  movzbl %sil,%esi
  shl    $0x28,%rsi
  movabs $0xffff00ffffffffff,%rdi
  and    %rdi,%rax
  or     %rsi,%rax
  shr    $0x20,%rdx
  and    $0xff0000,%edx
  mov    %rdx,%rsi
  and    $0xffffffffff00ffff,%rax
  mov    %rax,%rdx
  or     %rsi,%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  and    $0x1f0,%eax
  or     %rdx,%rax
  jmp    L27
L25:
  mov    %edx,%esi
  sar    $0x18,%esi
  shl    $0x38,%rsi
  movabs $0xffffffffffffff,%rax
  and    %rdx,%rax
  or     %rsi,%rax
  mov    %rdx,%rsi
  shr    $0x38,%rsi
  shl    $0x18,%rsi
  movabs $0xffffffff00ffffff,%rdi
  and    %rdi,%rax
  or     %rsi,%rax
  movzbl %dh,%esi
  shl    $0x10,%rsi
  and    $0xffffffffff00ffff,%rax
  or     %rsi,%rax
  shl    $0x8,%edx
  sar    $0x18,%edx
  mov    %dl,%ah
  mov    %rax,%rdx
  shl    $0x4,%rdx
  and    $0x3f0,%edx
  or     %rdx,%rax
  jmp    L27
L26:
  mov    %rdx,%rsi
  shr    $0x10,%rsi
  mov    %si,%ax
  movzwl %dx,%edx
  shl    $0x10,%rdx
  movabs $0xffffffff0000ffff,%rsi
  and    %rsi,%rax
  or     %rdx,%rax
  imul   %rax,%rax
L27:
  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);
  }
}
```