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

```asm
<RandomFunc>:
  endbr64
  sub    $0x18,%rsp
  mov    0x4(%rdi),%ecx
  mov    %rsi,%rdx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  mov    (%rdi),%eax
  sub    $0x99f4bb,%eax
  test   %ecx,%ecx
  je     L41
  test   %eax,%eax
  jne    L93
L111:
  movl   $0x0,0x4(%rsp)
  xor    %eax,%eax
L79:
  cmp    $0x2,%ecx
  jbe    L41
  cmp    $0x2,%eax
  ja     L113
  lea    (%rax,%rax,1),%esi
  shl    $0x11,%eax
  mov    %esi,%edi
  shr    $0x10,%edi
  or     %edi,%eax
  mov    %eax,0xc(%rsp)
  lea    (%rsi,%rsi,1),%eax
  cmp    $0x2,%esi
  ja     L45
L101:
  mov    %eax,%esi
  mov    %eax,0xc(%rsp)
  sar    $0x18,%esi
  mov    %ah,0xf(%rsp)
  mov    0x4(%rsp),%eax
  mov    %sil,0xd(%rsp)
L16:
  cmp    $0x4,%ecx
  jbe    L41
  mov    $0x4,%esi
  lea    0x4(%rsp),%r10
L97:
  mov    %esi,%r9d
  lea    (%rax,%rax,1),%edi
  lea    (%r10,%r9,4),%r8
  cmp    %esi,%eax
  jbe    L52
  imul   %eax,%eax
  mov    %eax,%edi
L52:
  lea    (%rdi,%rdi,1),%eax
  cmp    %edi,%esi
  jae    L128
  mov    %eax,0x4(%rsp)
L12:
  add    $0x2,%esi
  cmp    %ecx,%esi
  jb     L97
  nopw   0x0(%rax,%rax,1)
L41:
  add    $0x17c2d8f4,%eax
  mov    %eax,(%rdx)
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L63
  add    $0x18,%rsp
  ret
  nopl   0x0(%rax)
L93:
  imul   %eax,%eax
  mov    %eax,%esi
  lea    (%rax,%rax,1),%eax
  test   %esi,%esi
  je     L111
  mov    %eax,0x4(%rsp)
  jmp    L79
  nopl   0x0(%rax)
L113:
  imul   %eax,%eax
  mov    %eax,%esi
  mov    %eax,0xc(%rsp)
  lea    (%rsi,%rsi,1),%eax
  cmp    $0x2,%esi
  jbe    L101
L45:
  mov    %eax,0x4(%rsp)
  jmp    L16
  cs nopw 0x0(%rax,%rax,1)
L128:
  mov    %eax,0x4(%rsp,%r9,4)
  movzbl 0x1(%r8),%eax
  movzbl 0x3(%r8),%edi
  mov    %al,0x3(%r8)
  mov    %dil,0x1(%r8)
  mov    0x4(%rsp),%eax
  jmp    L12
L63:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  unsigned short copy12;
  unsigned short copy13;
  char copy14;
  {
    state[0UL] = input[0UL] + 4284877637U;
    local1 = 0UL;
    while (local1 < input[1UL]) {
      if (state[0UL] > local1) {
        state[local1] = state[0UL] * state[0UL];
      } else {
        state[local1] += state[0UL];
        copy12 = *((unsigned short *)(&state[local1]) + 1);
        *((unsigned short *)(&state[local1]) + 1) = *((unsigned short *)(&state[local1]) + 0);
        *((unsigned short *)(&state[local1]) + 0) = copy12;
      }
      if (state[0UL] > local1) {
        copy13 = *((unsigned short *)(&state[local1]) + 1);
        *((unsigned short *)(&state[local1]) + 1) = *((unsigned short *)(&state[local1]) + 0);
        *((unsigned short *)(&state[local1]) + 0) = copy13;
        copy13 = *((unsigned short *)(&state[local1]) + 0);
        *((unsigned short *)(&state[local1]) + 0) = *((unsigned short *)(&state[local1]) + 1);
        *((unsigned short *)(&state[local1]) + 1) = copy13;
        state[0UL] += state[0UL];
      } else {
        state[local1] += state[local1];
        copy14 = *((char *)(&state[local1]) + 1);
        *((char *)(&state[local1]) + 1) = *((char *)(&state[local1]) + 3);
        *((char *)(&state[local1]) + 3) = copy14;
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] + 398645492UL;
  }
}
```