user: What would the C source look like for the assembly code provided here?

```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
  shl    $0x7,%eax
  and    $0xb500,%ax
  mov    %ax,-0xa(%rbp)
  movw   $0x0,-0xc(%rbp)
  jmp    L39
L12:
  movzwl -0xa(%rbp),%eax
  cmp    %ax,-0xc(%rbp)
  jae    L4
  movzwl -0xa(%rbp),%eax
  cmp    %ax,-0xc(%rbp)
  jae    L20
  movzwl -0xc(%rbp),%eax
  lea    -0xa(%rbp),%rdx
  cltq
  add    %rax,%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0xd(%rbp)
  movzwl -0xc(%rbp),%eax
  lea    -0xa(%rbp),%rdx
  cltq
  add    %rax,%rax
  add    %rdx,%rax
  add    $0x1,%rax
  movzwl -0xc(%rbp),%edx
  lea    -0xa(%rbp),%rcx
  movslq %edx,%rdx
  add    %rdx,%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  movzwl -0xc(%rbp),%eax
  lea    -0xa(%rbp),%rdx
  cltq
  add    %rax,%rax
  add    %rdx,%rax
  lea    0x1(%rax),%rdx
  movzbl -0xd(%rbp),%eax
  mov    %al,(%rdx)
  jmp    L54
L20:
  movzwl -0xc(%rbp),%eax
  cltq
  movzwl -0xa(%rbp,%rax,2),%eax
  movzwl %ax,%edx
  movzwl -0xa(%rbp),%eax
  shr    $0x3,%ax
  movzwl %ax,%eax
  and    $0x6,%eax
  or     $0x1,%eax
  mov    %eax,%ecx
  sar    %cl,%edx
  movzwl -0xc(%rbp),%eax
  cltq
  mov    %dx,-0xa(%rbp,%rax,2)
  movzwl -0xc(%rbp),%eax
  cltq
  movzwl -0xa(%rbp,%rax,2),%eax
  movzwl %ax,%edx
  movzwl -0xc(%rbp),%eax
  cltq
  movzwl -0xa(%rbp,%rax,2),%eax
  shr    $0x3,%ax
  movzwl %ax,%eax
  and    $0x6,%eax
  or     $0x1,%eax
  mov    %eax,%ecx
  sar    %cl,%edx
  movzwl -0xc(%rbp),%eax
  cltq
  mov    %dx,-0xa(%rbp,%rax,2)
  jmp    L54
L4:
  movzwl -0xc(%rbp),%eax
  cltq
  movzwl -0xa(%rbp,%rax,2),%eax
  movzwl %ax,%edx
  movzwl -0xc(%rbp),%eax
  cltq
  movzwl -0xa(%rbp,%rax,2),%eax
  shr    $0x2,%ax
  movzwl %ax,%eax
  and    $0x6,%eax
  or     $0x1,%eax
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    %edx,%eax
  mov    %ax,-0xa(%rbp)
L54:
  movzwl -0xc(%rbp),%eax
  add    $0x1,%eax
  mov    %ax,-0xc(%rbp)
L39:
  mov    -0x18(%rbp),%rax
  add    $0x2,%rax
  movzwl (%rax),%eax
  cmp    %ax,-0xc(%rbp)
  jb     L12
  movzwl -0xa(%rbp),%eax
  movzwl %ax,%eax
  shr    $0x5,%rax
  xor    $0x9c9f,%ax
  mov    %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %dx,(%rax)
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L33
  call   <__stack_chk_fail@plt>
L33:
  leave
  ret
```

assistant: ```c
void RandomFunc(unsigned short input[1], unsigned short output[1]) {
  unsigned short state[1];
  unsigned short local1;
  char copy11;
  {
    state[0UL] = (input[0UL] & 914778474UL) << (unsigned short)7;
    local1 = 0UL;
    while (local1 < input[1UL]) {
      if (state[0UL] > local1) {
        if (state[0UL] > local1) {
          copy11 = *((char *)(&state[local1]) + 0);
          *((char *)(&state[local1]) + 0) = *((char *)(&state[local1]) + 1);
          *((char *)(&state[local1]) + 1) = copy11;
        } else {
          state[local1] >>= ((state[0UL] >> (unsigned short)3) & (unsigned short)7) | 1UL;
          state[local1] >>= ((state[local1] >> (unsigned short)3) & (unsigned short)7) | 1UL;
        }
      } else {
        state[0UL] = state[local1] >> (((state[local1] >> (unsigned short)2) & (unsigned short)7) | 1UL);
      }
      local1++;
    }
    output[0UL] = (state[0UL] ^ 380867558UL) >> (unsigned short)5;
  }
}
```