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

```asm
<RandomFunc>:
  endbr64
  sub    $0x18,%rsp
  mov    %rsi,%r8
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  mov    (%rdi),%rax
  mov    0x8(%rdi),%rdi
  shr    $0x3,%rax
  or     $0x61bab5,%rax
  mov    %rax,(%rsp)
  test   %rdi,%rdi
  je     L23
  mov    %rsp,%rdx
  xor    %esi,%esi
L19:
  cmp    %rax,%rsi
  jae    L9
  movzbl 0x4(%rdx),%eax
  movzbl 0x7(%rdx),%ecx
  movzbl 0x5(%rdx),%r9d
  mov    %cl,0x4(%rdx)
  movzbl (%rdx),%ecx
  mov    %al,(%rdx)
  movzbl 0x2(%rdx),%eax
  mov    %r9b,0x2(%rdx)
  mov    %al,0x5(%rdx)
  movzbl 0x3(%rdx),%eax
  mov    %cl,0x3(%rdx)
  mov    %al,0x7(%rdx)
L43:
  mov    %rsi,%rax
  cmp    %rsi,(%rsp)
  je     L27
  movzwl 0x2(%rdx),%ecx
  movzwl (%rdx),%eax
  mov    %cx,(%rdx)
  movzbl 0x7(%rdx),%ecx
  mov    %ax,0x2(%rdx)
  mov    %ah,0x7(%rdx)
  mov    %cl,0x3(%rdx)
  mov    (%rsp),%rax
L27:
  add    $0x2,%rsi
  add    $0x10,%rdx
  cmp    %rsi,%rdi
  ja     L19
L23:
  shl    $0x6,%rax
  mov    %rax,(%r8)
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L56
  add    $0x18,%rsp
  ret
  nopl   (%rax)
L9:
  mov    %eax,%ecx
  and    $0x6,%ecx
  or     $0x1,%ecx
  shl    %cl,%rax
  mov    %rax,%rcx
  mov    %rax,(%rdx)
  shr    $0x20,%rax
  shr    $0x30,%rcx
  mov    %ax,0x6(%rsp)
  mov    %cx,0x4(%rsp)
  jmp    L43
L56:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  char copy11;
  char copy12;
  unsigned short copy13;
  unsigned short copy16;
  char copy17;
  {
    state[0UL] = (input[0UL] | 51238316UL) >> 3UL;
    local1 = 0UL;
    while (local1 < input[1UL]) {
      if (state[0UL] > local1) {
        copy11 = *((char *)(&state[local1]) + 4);
        *((char *)(&state[local1]) + 4) = *((char *)(&state[local1]) + 7);
        *((char *)(&state[local1]) + 7) = copy11;
        copy11 = *((char *)(&state[local1]) + 7);
        *((char *)(&state[local1]) + 7) = *((char *)(&state[local1]) + 0);
        *((char *)(&state[local1]) + 0) = copy11;
        copy12 = *((char *)(&state[local1]) + 2);
        *((char *)(&state[local1]) + 2) = *((char *)(&state[local1]) + 5);
        *((char *)(&state[local1]) + 5) = copy12;
        copy12 = *((char *)(&state[local1]) + 3);
        *((char *)(&state[local1]) + 3) = *((char *)(&state[local1]) + 7);
        *((char *)(&state[local1]) + 7) = copy12;
      } else {
        state[local1] <<= (state[local1] & 7UL) | 1UL;
        copy13 = *((unsigned short *)(&state[0UL]) + 2);
        *((unsigned short *)(&state[0UL]) + 2) = *((unsigned short *)(&state[0UL]) + 3);
        *((unsigned short *)(&state[0UL]) + 3) = copy13;
      }
      if (!(state[0UL] == local1)) {
        copy16 = *((unsigned short *)(&state[local1]) + 0);
        *((unsigned short *)(&state[local1]) + 0) = *((unsigned short *)(&state[local1]) + 1);
        *((unsigned short *)(&state[local1]) + 1) = copy16;
        copy17 = *((char *)(&state[local1]) + 7);
        *((char *)(&state[local1]) + 7) = *((char *)(&state[local1]) + 3);
        *((char *)(&state[local1]) + 3) = copy17;
      }
      local1 += 2UL;
    }
    output[0UL] = (state[0UL] << 1UL) << 5UL;
  }
}
```