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

```asm
<wsha1_transform>:
  endbr64
  push   %r15
  lea    0x40(%rdi),%rcx
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x168,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x158(%rsp)
  mov    %rdi,%rax
L28:
  mov    (%rax),%edx
  add    $0x4,%rax
  bswap  %edx
  mov    %edx,-0x4(%rax)
  cmp    %rax,%rcx
  jne    L28
  movdqu (%rdi),%xmm0
  movdqu 0x10(%rdi),%xmm1
  lea    0x10(%rsp),%r9
  lea    0x110(%rsp),%rcx
  movdqu 0x20(%rdi),%xmm2
  movdqu 0x30(%rdi),%xmm3
  mov    %r9,%r10
  mov    %r9,%rdx
  movaps %xmm0,0x10(%rsp)
  movaps %xmm1,0x20(%rsp)
  movaps %xmm2,0x30(%rsp)
  movaps %xmm3,0x40(%rsp)
  nopw   0x0(%rax,%rax,1)
L6:
  mov    0x34(%rdx),%eax
  xor    0x20(%rdx),%eax
  add    $0x4,%rdx
  xor    -0x4(%rdx),%eax
  xor    0x4(%rdx),%eax
  rol    %eax
  mov    %eax,0x3c(%rdx)
  cmp    %rdx,%rcx
  jne    L6
  mov    0xc(%rbx),%edi
  mov    0x10(%rbx),%eax
  lea    0x50(%r9),%r11
  mov    %r9,%rdx
  mov    (%rbx),%ebp
  mov    0x4(%rbx),%r12d
  mov    0x8(%rbx),%r13d
  mov    %edi,0x8(%rsp)
  mov    %eax,0xc(%rsp)
  mov    %ebp,%esi
  mov    %r12d,%ecx
  mov    %r13d,%r8d
L18:
  mov    (%rdx),%r14d
  mov    %esi,%r15d
  movl   $0x0,(%rdx)
  rol    $0x5,%r15d
  lea    0x5a827999(%r15,%r14,1),%r15d
  mov    %r8d,%r14d
  xor    %edi,%r14d
  and    %ecx,%r14d
  ror    $0x2,%ecx
  xor    %edi,%r14d
  add    %r14d,%r15d
  mov    %ecx,%r14d
  add    %r15d,%eax
  xor    %r8d,%r14d
  mov    0x4(%rdx),%r15d
  movl   $0x0,0x4(%rdx)
  and    %esi,%r14d
  ror    $0x2,%esi
  xor    %r8d,%r14d
  lea    0x5a827999(%rdi,%r15,1),%edi
  mov    0x8(%rdx),%r15d
  movl   $0x0,0x8(%rdx)
  add    %edi,%r14d
  mov    %eax,%edi
  rol    $0x5,%edi
  lea    0x5a827999(%r8,%r15,1),%r8d
  mov    0xc(%rdx),%r15d
  movl   $0x0,0xc(%rdx)
  add    %r14d,%edi
  mov    %ecx,%r14d
  xor    %esi,%r14d
  and    %eax,%r14d
  ror    $0x2,%eax
  xor    %ecx,%r14d
  lea    0x5a827999(%rcx,%r15,1),%ecx
  mov    0x10(%rdx),%r15d
  movl   $0x0,0x10(%rdx)
  add    %r8d,%r14d
  mov    %edi,%r8d
  rol    $0x5,%r8d
  add    %r14d,%r8d
  mov    %esi,%r14d
  xor    %eax,%r14d
  and    %edi,%r14d
  ror    $0x2,%edi
  xor    %esi,%r14d
  lea    0x5a827999(%rsi,%r15,1),%esi
  add    %ecx,%r14d
  mov    %r8d,%ecx
  rol    $0x5,%ecx
  add    %r14d,%ecx
  mov    %eax,%r14d
  xor    %edi,%r14d
  and    %r8d,%r14d
  xor    %eax,%r14d
  add    %esi,%r14d
  mov    %ecx,%esi
  rol    $0x5,%esi
  add    $0x14,%rdx
  ror    $0x2,%r8d
  add    %r14d,%esi
  cmp    %rdx,%r11
  jne    L18
  mov    %r9,%rdx
L35:
  mov    0x50(%rdx),%r14d
  mov    %esi,%r15d
  add    $0x14,%rdx
  rol    $0x5,%r15d
  lea    0x6ed9eba1(%r15,%r14,1),%r14d
  mov    %ecx,%r15d
  ror    $0x2,%ecx
  xor    %r8d,%r15d
  xor    %edi,%r15d
  add    %r15d,%r14d
  add    %r14d,%eax
  mov    %r8d,%r14d
  xor    %esi,%r14d
  ror    $0x2,%esi
  xor    %ecx,%r14d
  lea    0x6ed9eba1(%rdi,%r14,1),%r14d
  mov    %eax,%edi
  add    0x40(%rdx),%r14d
  rol    $0x5,%edi
  add    %r14d,%edi
  mov    0x44(%rdx),%r14d
  lea    0x6ed9eba1(%r8,%r14,1),%r14d
  mov    %ecx,%r8d
  xor    %esi,%r8d
  xor    %eax,%r8d
  ror    $0x2,%eax
  add    %r8d,%r14d
  mov    %edi,%r8d
  rol    $0x5,%r8d
  add    %r14d,%r8d
  mov    0x48(%rdx),%r14d
  lea    0x6ed9eba1(%rcx,%r14,1),%ecx
  mov    %esi,%r14d
  xor    %eax,%r14d
  xor    %edi,%r14d
  ror    $0x2,%edi
  add    %r14d,%ecx
  mov    %r8d,%r14d
  rol    $0x5,%r14d
  add    %r14d,%ecx
  mov    0x4c(%rdx),%r14d
  lea    0x6ed9eba1(%rsi,%r14,1),%esi
  mov    %eax,%r14d
  xor    %edi,%r14d
  xor    %r8d,%r14d
  ror    $0x2,%r8d
  add    %r14d,%esi
  mov    %ecx,%r14d
  rol    $0x5,%r14d
  add    %r14d,%esi
  cmp    %rdx,%r11
  jne    L35
L48:
  mov    %r8d,%edx
  mov    %r8d,%r14d
  mov    %esi,%r15d
  or     %edi,%edx
  and    %edi,%r14d
  rol    $0x5,%r15d
  and    %ecx,%edx
  ror    $0x2,%ecx
  or     %r14d,%edx
  mov    0xa0(%r9),%r14d
  movl   $0x0,0xa0(%r9)
  lea    -0x70e44324(%r15,%r14,1),%r14d
  add    %r14d,%edx
  mov    %ecx,%r14d
  add    %edx,%eax
  mov    %ecx,%edx
  and    %r8d,%r14d
  or     %r8d,%edx
  and    %esi,%edx
  ror    $0x2,%esi
  or     %r14d,%edx
  mov    0xa4(%r9),%r14d
  movl   $0x0,0xa4(%r9)
  lea    -0x70e44324(%rdi,%r14,1),%edi
  mov    %ecx,%r14d
  add    %edi,%edx
  mov    %eax,%edi
  and    %esi,%r14d
  rol    $0x5,%edi
  add    %edx,%edi
  mov    %ecx,%edx
  or     %esi,%edx
  and    %eax,%edx
  ror    $0x2,%eax
  or     %r14d,%edx
  mov    0xa8(%r9),%r14d
  movl   $0x0,0xa8(%r9)
  lea    -0x70e44324(%r8,%r14,1),%r8d
  mov    %esi,%r14d
  add    %r8d,%edx
  mov    %edi,%r8d
  and    %eax,%r14d
  rol    $0x5,%r8d
  add    %edx,%r8d
  mov    %esi,%edx
  or     %eax,%edx
  and    %edi,%edx
  ror    $0x2,%edi
  or     %r14d,%edx
  mov    0xac(%r9),%r14d
  movl   $0x0,0xac(%r9)
  lea    -0x70e44324(%rcx,%r14,1),%ecx
  mov    %eax,%r14d
  add    %ecx,%edx
  mov    %r8d,%ecx
  rol    $0x5,%ecx
  add    %edx,%ecx
  mov    %eax,%edx
  or     %edi,%edx
  and    %edi,%r14d
  add    $0x14,%r9
  and    %r8d,%edx
  ror    $0x2,%r8d
  or     %r14d,%edx
  mov    0x9c(%r9),%r14d
  movl   $0x0,0x9c(%r9)
  lea    -0x70e44324(%rsi,%r14,1),%esi
  add    %esi,%edx
  mov    %ecx,%esi
  rol    $0x5,%esi
  add    %edx,%esi
  cmp    %r9,%r11
  jne    L48
L0:
  mov    %ecx,%edx
  mov    %esi,%r9d
  ror    $0x2,%ecx
  add    $0x14,%r10
  xor    %r8d,%edx
  rol    $0x5,%r9d
  xor    %edi,%edx
  lea    -0x359d3e2a(%rdx,%r9,1),%edx
  add    0xdc(%r10),%edx
  mov    0xe4(%r10),%r9d
  add    %edx,%eax
  mov    %esi,%edx
  ror    $0x2,%esi
  xor    %r8d,%edx
  lea    -0x359d3e2a(%r8,%r9,1),%r8d
  mov    %ecx,%r9d
  xor    %ecx,%edx
  xor    %esi,%r9d
  lea    -0x359d3e2a(%rdi,%rdx,1),%edx
  mov    %eax,%edi
  xor    %eax,%r9d
  ror    $0x2,%eax
  add    0xe0(%r10),%edx
  rol    $0x5,%edi
  add    %r9d,%r8d
  add    %edx,%edi
  mov    %edi,%edx
  rol    $0x5,%edx
  add    %r8d,%edx
  mov    0xe8(%r10),%r8d
  mov    %edx,%r9d
  lea    -0x359d3e2a(%rcx,%r8,1),%ecx
  mov    %esi,%r8d
  rol    $0x5,%r9d
  xor    %eax,%r8d
  xor    %edi,%r8d
  ror    $0x2,%edi
  add    %r8d,%ecx
  mov    %edx,%r8d
  add    %r9d,%ecx
  mov    0xec(%r10),%r9d
  ror    $0x2,%r8d
  lea    -0x359d3e2a(%rsi,%r9,1),%esi
  mov    %eax,%r9d
  xor    %edi,%r9d
  xor    %r9d,%edx
  add    %esi,%edx
  mov    %ecx,%esi
  rol    $0x5,%esi
  add    %edx,%esi
  cmp    %r10,%r11
  jne    L0
  mov    0x8(%rsp),%edx
  add    %esi,%ebp
  add    %ecx,%r12d
  add    %r8d,%r13d
  add    0xc(%rsp),%eax
  mov    %ebp,(%rbx)
  add    %edi,%edx
  mov    %r12d,0x4(%rbx)
  mov    %r13d,0x8(%rbx)
  mov    %edx,0xc(%rbx)
  mov    %eax,0x10(%rbx)
  mov    0x158(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L4
  add    $0x168,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L4:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void wsha1_transform(int *data, int *state) {
  unsigned W[80];
  unsigned A, B, C, D, E, F, G, H, M, N;
  int i;
  for (i = 0; i < 16; i++) {
    data[i] = (((((unsigned)(data[i])) & 0x000000FF) << 24) | ((((unsigned)(data[i])) & 0x0000FF00) << 8) | ((((unsigned)(data[i])) & 0x00FF0000) >> 8) | ((((unsigned)(data[i])) & 0xFF000000) >> 24));
  }
  memcpy(W, data, 64);
  for (i = 0; i < 64; i++) {
    W[i + 16] = ((((unsigned)(W[i + 13] ^ W[i + 8] ^ W[i + 0] ^ W[i + 2])) << (1)) | (((unsigned)(W[i + 13] ^ W[i + 8] ^ W[i + 0] ^ W[i + 2])) >> (32 - (1))));
  }
  M = state[0];
  B = state[1];
  C = state[2];
  N = state[3];
  E = state[4];
  for (i = 0; i < 20; i += 5) {
    E = E + ((((unsigned)((M))) << (5)) | (((unsigned)((M))) >> (32 - (5)))) + ((~B & (N)) | (B & (C))) + W[i + 0] + 0x5A827999;
    W[i + 0] = 0;
    B = ((((unsigned)(B)) << (30)) | (((unsigned)(B)) >> (32 - (30))));
    N = N + ((((unsigned)((E))) << (5)) | (((unsigned)((E))) >> (32 - (5)))) + ((~M & (C)) | (M & (B))) + W[i + 1] + 0x5A827999;
    W[i + 1] = 0;
    M = ((((unsigned)(M)) << (30)) | (((unsigned)(M)) >> (32 - (30))));
    C = C + ((((unsigned)((N))) << (5)) | (((unsigned)((N))) >> (32 - (5)))) + ((~E & (B)) | (E & (M))) + W[i + 2] + 0x5A827999;
    W[i + 2] = 0;
    E = ((((unsigned)(E)) << (30)) | (((unsigned)(E)) >> (32 - (30))));
    B = B + ((((unsigned)((C))) << (5)) | (((unsigned)((C))) >> (32 - (5)))) + ((~N & (M)) | (N & (E))) + W[i + 3] + 0x5A827999;
    W[i + 3] = 0;
    N = ((((unsigned)(N)) << (30)) | (((unsigned)(N)) >> (32 - (30))));
    M = M + ((((unsigned)((B))) << (5)) | (((unsigned)((B))) >> (32 - (5)))) + ((~C & (E)) | (C & (N))) + W[i + 4] + 0x5A827999;
    W[i + 4] = 0;
    C = ((((unsigned)(C)) << (30)) | (((unsigned)(C)) >> (32 - (30))));
  }
  F = M;
  D = N;
  for (i = 20; i < 40; i += 5) {
    G = W[i] + ((((unsigned)(F)) << (5)) | (((unsigned)(F)) >> (32 - (5)))) + (D ^ C ^ B);
    D = D + ((((unsigned)(G + E + 0x6ED9EBA1)) << (5)) | (((unsigned)(G + E + 0x6ED9EBA1)) >> (32 - (5)))) + (C ^ ((((unsigned)(B)) << (30)) | (((unsigned)(B)) >> (32 - (30)))) ^ F) + W[i + 1] + 0x6ED9EBA1;
    C = C + ((((unsigned)(D)) << (5)) | (((unsigned)(D)) >> (32 - (5)))) + ((G + E + 0x6ED9EBA1) ^ ((((unsigned)(B)) << (30)) | (((unsigned)(B)) >> (32 - (30)))) ^ ((((unsigned)(F)) << (30)) | (((unsigned)(F)) >> (32 - (30))))) + W[i + 2] + 0x6ED9EBA1;
    E = ((((unsigned)(G + E + 0x6ED9EBA1)) << (30)) | (((unsigned)(G + E + 0x6ED9EBA1)) >> (32 - (30))));
    B = ((((unsigned)(B)) << (30)) | (((unsigned)(B)) >> (32 - (30)))) + ((((unsigned)(C)) << (5)) | (((unsigned)(C)) >> (32 - (5)))) + (E ^ D ^ ((((unsigned)(F)) << (30)) | (((unsigned)(F)) >> (32 - (30))))) + W[i + 3] + 0x6ED9EBA1;
    D = ((((unsigned)(D)) << (30)) | (((unsigned)(D)) >> (32 - (30))));
    F = ((((unsigned)(F)) << (30)) | (((unsigned)(F)) >> (32 - (30)))) + ((((unsigned)(B)) << (5)) | (((unsigned)(B)) >> (32 - (5)))) + (E ^ D ^ C) + W[i + 4] + 0x6ED9EBA1;
    C = ((((unsigned)(C)) << (30)) | (((unsigned)(C)) >> (32 - (30))));
  }
  M = F;
  N = D;
  for (i = 40; i < 60; i += 5) {
    E = E + ((((N) | (C)) & B) | ((C) & (N))) + ((((unsigned)((M))) << (5)) | (((unsigned)((M))) >> (32 - (5)))) + W[i + 0] - 0x70E44324;
    W[i + 0] = 0;
    B = ((((unsigned)(B)) << (30)) | (((unsigned)(B)) >> (32 - (30))));
    N = N + ((((C) | (B)) & M) | ((B) & (C))) + ((((unsigned)((E))) << (5)) | (((unsigned)((E))) >> (32 - (5)))) + W[i + 1] - 0x70E44324;
    W[i + 1] = 0;
    M = ((((unsigned)(M)) << (30)) | (((unsigned)(M)) >> (32 - (30))));
    C = C + ((((B) | (M)) & E) | ((M) & (B))) + ((((unsigned)((N))) << (5)) | (((unsigned)((N))) >> (32 - (5)))) + W[i + 2] - 0x70E44324;
    W[i + 2] = 0;
    E = ((((unsigned)(E)) << (30)) | (((unsigned)(E)) >> (32 - (30))));
    B = B + ((((M) | (E)) & N) | ((E) & (M))) + ((((unsigned)((C))) << (5)) | (((unsigned)((C))) >> (32 - (5)))) + W[i + 3] - 0x70E44324;
    W[i + 3] = 0;
    N = ((((unsigned)(N)) << (30)) | (((unsigned)(N)) >> (32 - (30))));
    M = M + ((((E) | (N)) & C) | ((N) & (E))) + ((((unsigned)((B))) << (5)) | (((unsigned)((B))) >> (32 - (5)))) + W[i + 4] - 0x70E44324;
    W[i + 4] = 0;
    C = ((((unsigned)(C)) << (30)) | (((unsigned)(C)) >> (32 - (30))));
  }
  F = M;
  A = M;
  D = N;
  for (i = 60; i < 80; i += 5) {
    G = ((((unsigned)(A)) << (5)) | (((unsigned)(A)) >> (32 - (5)))) + (D ^ C ^ B) + W[i + 0] + E - 0x359D3E2A;
    B = ((((unsigned)(B)) << (30)) | (((unsigned)(B)) >> (32 - (30))));
    E = G;
    D = (C ^ B ^ A) + W[i + 1] + D + ((((unsigned)(G)) << (5)) | (((unsigned)(G)) >> (32 - (5)))) - 0x359D3E2A;
    A = ((((unsigned)(A)) << (30)) | (((unsigned)(A)) >> (32 - (30))));
    G = ((((unsigned)(D)) << (5)) | (((unsigned)(D)) >> (32 - (5))));
    G = (E ^ B ^ A) + W[i + 2] + C + G - 0x359D3E2A;
    E = ((((unsigned)(E)) << (30)) | (((unsigned)(E)) >> (32 - (30))));
    C = G;
    G = ((((unsigned)(G)) << (5)) | (((unsigned)(G)) >> (32 - (5)))) + (E ^ D ^ A) + W[i + 3] + B - 0x359D3E2A;
    D = ((((unsigned)(D)) << (30)) | (((unsigned)(D)) >> (32 - (30))));
    H = (E ^ D ^ C) + W[i + 4];
    B = G;
    G = ((((unsigned)(G)) << (5)) | (((unsigned)(G)) >> (32 - (5))));
    C = ((((unsigned)(C)) << (30)) | (((unsigned)(C)) >> (32 - (30))));
    A = H + A + G - 0x359D3E2A;
  }
  state[0] += A;
  state[1] += B;
  state[2] += C;
  state[3] += D;
  state[4] += E;
}
```