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
  movzwl (%rax),%eax
  imul   $0xfb16,%ax,%ax
  sub    $0x2e4,%ax
  mov    %ax,-0xa(%rbp)
  movzwl -0xa(%rbp),%eax
  movzwl %ax,%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L87
  movzwl -0xa(%rbp),%eax
  movzwl %ax,%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L77
  movzwl -0xa(%rbp),%eax
  movzwl %ax,%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L80
  lea    -0xa(%rbp),%rax
  movzbl (%rax),%eax
  mov    %al,-0xb(%rbp)
  lea    -0xa(%rbp),%rax
  add    $0x1,%rax
  lea    -0xa(%rbp),%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  lea    -0xa(%rbp),%rax
  add    $0x1,%rax
  movzbl -0xb(%rbp),%edx
  mov    %dl,(%rax)
  lea    -0xa(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  mov    %al,-0xb(%rbp)
  lea    -0xa(%rbp),%rdx
  lea    -0xa(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  lea    -0xa(%rbp),%rax
  movzbl -0xb(%rbp),%edx
  mov    %dl,(%rax)
  jmp    L83
L80:
  movzwl -0xa(%rbp),%edx
  movzwl -0xa(%rbp),%eax
  imul   %edx,%eax
  mov    %ax,-0xa(%rbp)
  jmp    L83
L77:
  movzwl -0xa(%rbp),%eax
  shr    $0x4,%ax
  movzwl %ax,%eax
  and    $0x1,%eax
  test   %eax,%eax
  jne    L83
  movzwl -0xa(%rbp),%edx
  movzwl -0xa(%rbp),%eax
  imul   %edx,%eax
  mov    %ax,-0xa(%rbp)
  jmp    L83
L87:
  movzwl -0xa(%rbp),%eax
  shr    $0x4,%ax
  movzwl %ax,%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L36
  movzwl -0xa(%rbp),%eax
  add    %eax,%eax
  mov    %ax,-0xa(%rbp)
  jmp    L83
L36:
  lea    -0xa(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  mov    %al,-0xc(%rbp)
  lea    -0xa(%rbp),%rdx
  lea    -0xa(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  lea    -0xa(%rbp),%rax
  movzbl -0xc(%rbp),%edx
  mov    %dl,(%rax)
L83:
  movzwl -0xa(%rbp),%eax
  lea    -0x1768(%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    %dx,(%rax)
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L30
  call   <__stack_chk_fail@plt>
L30:
  leave
  ret
```

assistant: ```c
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  char copy11;
  char copy13;
  {
    state[0UL] = (input[0UL] + 914778474UL) * (unsigned short)64278;
    if (state[0UL] & (unsigned short)1) {
      if (state[0UL] & (unsigned short)1) {
        if (state[0UL] & (unsigned short)1) {
          copy11 = *((char *)(&state[0UL]) + 0);
          *((char *)(&state[0UL]) + 0) = *((char *)(&state[0UL]) + 1);
          *((char *)(&state[0UL]) + 1) = copy11;
          copy11 = *((char *)(&state[0UL]) + 1);
          *((char *)(&state[0UL]) + 1) = *((char *)(&state[0UL]) + 0);
          *((char *)(&state[0UL]) + 0) = copy11;
        } else {
          state[0UL] *= state[0UL];
        }
      } else if (!((state[0UL] >> (unsigned short)4) & (unsigned short)1)) {
        state[0UL] *= state[0UL];
      }
    } else if ((state[0UL] >> (unsigned short)4) & (unsigned short)1) {
      state[0UL] += state[0UL];
    } else {
      copy13 = *((char *)(&state[0UL]) + 1);
      *((char *)(&state[0UL]) + 1) = *((char *)(&state[0UL]) + 0);
      *((char *)(&state[0UL]) + 0) = copy13;
    }
    output[0UL] = state[0UL] - (unsigned short)5992;
  }
}
```