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

```asm
<theta>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x24(%rbp)
  jmp    L104
L29:
  mov    -0x24(%rbp),%eax
  movw   $0x0,-0x1c(%rbp,%rax,2)
  movl   $0x0,-0x20(%rbp)
  jmp    L54
L51:
  mov    -0x24(%rbp),%eax
  movzwl -0x1c(%rbp,%rax,2),%edi
  mov    -0x24(%rbp),%edx
  mov    %edx,%ecx
  mov    $0xcccccccd,%eax
  imul   %rcx,%rax
  shr    $0x20,%rax
  mov    %eax,%ecx
  shr    $0x2,%ecx
  mov    %ecx,%eax
  shl    $0x2,%eax
  add    %ecx,%eax
  mov    %edx,%ecx
  sub    %eax,%ecx
  mov    -0x20(%rbp),%esi
  mov    %esi,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  shr    $0x2,%eax
  mov    %eax,%edx
  shl    $0x2,%edx
  add    %eax,%edx
  mov    %esi,%eax
  sub    %edx,%eax
  mov    %eax,%edx
  shl    $0x2,%edx
  add    %edx,%eax
  add    %ecx,%eax
  mov    %eax,%eax
  lea    (%rax,%rax,1),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movzwl (%rax),%eax
  xor    %eax,%edi
  mov    %edi,%edx
  mov    -0x24(%rbp),%eax
  mov    %dx,-0x1c(%rbp,%rax,2)
  addl   $0x1,-0x20(%rbp)
L54:
  cmpl   $0x4,-0x20(%rbp)
  jbe    L51
  addl   $0x1,-0x24(%rbp)
L104:
  cmpl   $0x4,-0x24(%rbp)
  jbe    L29
  movl   $0x0,-0x24(%rbp)
  jmp    L78
L89:
  mov    -0x24(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    %ecx,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  mov    %eax,%edx
  shr    $0x2,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  mov    %edx,%eax
  movzwl -0x1c(%rbp,%rax,2),%eax
  movzwl %ax,%eax
  add    %eax,%eax
  mov    %eax,%esi
  mov    -0x24(%rbp),%eax
  lea    0x1(%rax),%ecx
  mov    %ecx,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  mov    %eax,%edx
  shr    $0x2,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  mov    %edx,%eax
  movzwl -0x1c(%rbp,%rax,2),%eax
  shr    $0xf,%ax
  xor    %eax,%esi
  mov    -0x24(%rbp),%eax
  lea    0x4(%rax),%ecx
  mov    %ecx,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  mov    %eax,%edx
  shr    $0x2,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  mov    %edx,%eax
  movzwl -0x1c(%rbp,%rax,2),%eax
  xor    %esi,%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  mov    %dx,-0x12(%rbp,%rax,2)
  addl   $0x1,-0x24(%rbp)
L78:
  cmpl   $0x4,-0x24(%rbp)
  jbe    L89
  movl   $0x0,-0x24(%rbp)
  jmp    L66
L83:
  movl   $0x0,-0x20(%rbp)
  jmp    L94
L103:
  mov    -0x24(%rbp),%ecx
  mov    %ecx,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  mov    %eax,%edx
  shr    $0x2,%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  sub    %eax,%ecx
  mov    %ecx,%edx
  mov    -0x20(%rbp),%esi
  mov    %esi,%ecx
  mov    $0xcccccccd,%eax
  imul   %rcx,%rax
  shr    $0x20,%rax
  shr    $0x2,%eax
  mov    %eax,%ecx
  shl    $0x2,%ecx
  add    %eax,%ecx
  mov    %esi,%eax
  sub    %ecx,%eax
  mov    %eax,%ecx
  shl    $0x2,%ecx
  add    %eax,%ecx
  add    %edx,%ecx
  mov    %ecx,%ecx
  lea    (%rcx,%rcx,1),%rsi
  mov    -0x38(%rbp),%rcx
  add    %rsi,%rcx
  movzwl (%rcx),%edi
  mov    -0x24(%rbp),%ecx
  movzwl -0x12(%rbp,%rcx,2),%esi
  mov    %eax,%ecx
  shl    $0x2,%ecx
  add    %ecx,%eax
  add    %edx,%eax
  mov    %eax,%eax
  lea    (%rax,%rax,1),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  xor    %esi,%edi
  mov    %edi,%edx
  mov    %dx,(%rax)
  addl   $0x1,-0x20(%rbp)
L94:
  cmpl   $0x4,-0x20(%rbp)
  jbe    L103
  addl   $0x1,-0x24(%rbp)
L66:
  cmpl   $0x4,-0x24(%rbp)
  jbe    L83
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L21
  call   <__stack_chk_fail@plt>
L21:
  leave
  ret
```

assistant: ```c
void theta(unsigned short *A) {
  unsigned int x, y;
  unsigned short C[5], D[5];
  for (x = 0; x < 5; x++) {
    C[x] = 0;
    for (y = 0; y < 5; y++)
      C[x] ^= A[(((x) % 5) + 5 * ((y) % 5))];
  }
  for (x = 0; x < 5; x++)
    D[x] = ((1 != 0) ? ((((unsigned short)C[(x + 1) % 5]) << 1) ^ (((unsigned short)C[(x + 1) % 5]) >> (sizeof(unsigned short) * 8 - 1))) : C[(x + 1) % 5]) ^ C[(x + 4) % 5];
  for (x = 0; x < 5; x++)
    for (y = 0; y < 5; y++)
      A[(((x) % 5) + 5 * ((y) % 5))] ^= D[x];
}
```