user: Please show me the C implementation that matches the assembly code listed below:

```asm
<RandomFunc>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  sub    $0x17447d68,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  and    $0x8,%eax
  test   %eax,%eax
  je     L41
  mov    -0xc(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L40
  mov    -0xc(%rbp),%edx
  mov    -0xc(%rbp),%eax
  shl    $0x2,%eax
  and    $0x1c,%eax
  or     %edx,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L33
L40:
  lea    -0xc(%rbp),%rax
  add    $0x2,%rax
  movzwl (%rax),%eax
  mov    %ax,-0xe(%rbp)
  lea    -0xc(%rbp),%rdx
  lea    -0xc(%rbp),%rax
  add    $0x2,%rax
  movzwl (%rdx),%edx
  mov    %dx,(%rax)
  lea    -0xc(%rbp),%rax
  movzwl -0xe(%rbp),%edx
  mov    %dx,(%rax)
  lea    -0xc(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  mov    %al,-0xf(%rbp)
  lea    -0xc(%rbp),%rdx
  lea    -0xc(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  lea    -0xc(%rbp),%rax
  movzbl -0xf(%rbp),%edx
  mov    %dl,(%rax)
  lea    -0xc(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0xf(%rbp)
  lea    -0xc(%rbp),%rax
  add    $0x2,%rax
  lea    -0xc(%rbp),%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  lea    -0xc(%rbp),%rax
  add    $0x2,%rax
  movzbl -0xf(%rbp),%edx
  mov    %dl,(%rax)
  jmp    L33
L41:
  mov    -0xc(%rbp),%esi
  mov    -0xc(%rbp),%edx
  mov    -0xc(%rbp),%eax
  shr    $0x3,%eax
  and    $0xe,%eax
  or     $0x1,%eax
  mov    %eax,%ecx
  rol    %cl,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  and    $0x1c,%eax
  or     %esi,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%edx
  mov    -0xc(%rbp),%eax
  and    $0x6,%eax
  or     $0x1,%eax
  mov    %eax,%ecx
  shl    %cl,%edx
  mov    %edx,%eax
  mov    %eax,-0xc(%rbp)
L33:
  mov    -0xc(%rbp),%eax
  lea    -0x18a21251(%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L25
  call   <__stack_chk_fail@plt>
L25:
  leave
  ret
```

assistant: ```c
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned short copy12;
  char copy13;
  {
    state[0UL] = (input[0UL] - 51238316UL) - 339126204U;
    if ((state[0UL] >> 3U) & 1U) {
      if (state[0UL] & 1U) {
        state[0UL] |= (state[0UL] & 7U) << 2UL;
      } else {
        copy12 = *((unsigned short *)(&state[0UL]) + 1);
        *((unsigned short *)(&state[0UL]) + 1) = *((unsigned short *)(&state[0UL]) + 0);
        *((unsigned short *)(&state[0UL]) + 0) = copy12;
        copy13 = *((char *)(&state[0UL]) + 1);
        *((char *)(&state[0UL]) + 1) = *((char *)(&state[0UL]) + 0);
        *((char *)(&state[0UL]) + 0) = copy13;
        copy13 = *((char *)(&state[0UL]) + 0);
        *((char *)(&state[0UL]) + 0) = *((char *)(&state[0UL]) + 2);
        *((char *)(&state[0UL]) + 2) = copy13;
      }
    } else {
      state[0UL] |= (((state[0UL] << (((state[0UL] >> 3U) & 15U) | 1UL)) | (state[0UL] >> (32 - (((state[0UL] >> 3U) & 15U) | 1UL)))) & 7U) << 2UL;
      state[0UL] <<= (state[0UL] & 7U) | 1UL;
    }
    output[0UL] = state[0UL] - 413274705UL;
  }
}
```