user: Converte this assembly snippet into its equivalent C code:

```asm
<sha1_chunk>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x1a0,%rsp
  mov    %rdi,-0x198(%rbp)
  mov    %rsi,-0x1a0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x1a0(%rbp),%rcx
  lea    -0x170(%rbp),%rax
  mov    $0x14,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  movl   $0x0,-0x18c(%rbp)
  jmp    L4
L94:
  mov    -0x18c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x198(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%eax
  shl    $0x18,%eax
  mov    %eax,%edx
  mov    -0x18c(%rbp),%eax
  cltq
  add    $0x1,%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x198(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  shl    $0x10,%eax
  or     %eax,%edx
  mov    -0x18c(%rbp),%eax
  cltq
  add    $0x2,%rax
  lea    0x0(,%rax,4),%rcx
  mov    -0x198(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  shl    $0x8,%eax
  mov    %edx,%ecx
  or     %eax,%ecx
  mov    -0x18c(%rbp),%eax
  cltq
  add    $0x3,%rax
  lea    0x0(,%rax,4),%rdx
  mov    -0x198(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%edx
  mov    -0x18c(%rbp),%eax
  sar    $0x2,%eax
  or     %ecx,%edx
  cltq
  mov    %edx,-0x150(%rbp,%rax,4)
  addl   $0x4,-0x18c(%rbp)
L4:
  cmpl   $0x3f,-0x18c(%rbp)
  jle    L94
  movl   $0x10,-0x188(%rbp)
  jmp    L136
L19:
  mov    -0x188(%rbp),%eax
  sub    $0x3,%eax
  cltq
  mov    -0x150(%rbp,%rax,4),%edx
  mov    -0x188(%rbp),%eax
  sub    $0x8,%eax
  cltq
  mov    -0x150(%rbp,%rax,4),%eax
  xor    %eax,%edx
  mov    -0x188(%rbp),%eax
  sub    $0xe,%eax
  cltq
  mov    -0x150(%rbp,%rax,4),%eax
  xor    %eax,%edx
  mov    -0x188(%rbp),%eax
  sub    $0x10,%eax
  cltq
  mov    -0x150(%rbp,%rax,4),%eax
  xor    %edx,%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <rotleft@plt>
  mov    -0x188(%rbp),%edx
  movslq %edx,%rdx
  mov    %eax,-0x150(%rbp,%rdx,4)
  addl   $0x1,-0x188(%rbp)
L136:
  cmpl   $0x4f,-0x188(%rbp)
  jle    L19
  movl   $0x0,-0x184(%rbp)
  jmp    L116
L43:
  mov    -0x184(%rbp),%eax
  cltq
  mov    -0x150(%rbp,%rax,4),%edx
  mov    -0x16c(%rbp),%ecx
  mov    -0x168(%rbp),%eax
  and    %eax,%ecx
  mov    -0x16c(%rbp),%eax
  not    %eax
  mov    %eax,%esi
  mov    -0x164(%rbp),%eax
  and    %esi,%eax
  mov    %ecx,%esi
  or     %eax,%esi
  lea    -0x170(%rbp),%rax
  mov    %edx,%ecx
  mov    $0x5a827999,%edx
  mov    %rax,%rdi
  call   <sha1_step@plt>
  addl   $0x1,-0x184(%rbp)
L116:
  cmpl   $0x13,-0x184(%rbp)
  jle    L43
  movl   $0x14,-0x180(%rbp)
  jmp    L121
L82:
  mov    -0x180(%rbp),%eax
  cltq
  mov    -0x150(%rbp,%rax,4),%edx
  mov    -0x16c(%rbp),%ecx
  mov    -0x168(%rbp),%eax
  xor    %eax,%ecx
  mov    -0x164(%rbp),%eax
  mov    %ecx,%esi
  xor    %eax,%esi
  lea    -0x170(%rbp),%rax
  mov    %edx,%ecx
  mov    $0x6ed9eba1,%edx
  mov    %rax,%rdi
  call   <sha1_step@plt>
  addl   $0x1,-0x180(%rbp)
L121:
  cmpl   $0x27,-0x180(%rbp)
  jle    L82
  movl   $0x28,-0x17c(%rbp)
  jmp    L46
L133:
  mov    -0x17c(%rbp),%eax
  cltq
  mov    -0x150(%rbp,%rax,4),%edx
  mov    -0x16c(%rbp),%eax
  mov    -0x168(%rbp),%esi
  mov    -0x164(%rbp),%ecx
  or     %esi,%ecx
  and    %ecx,%eax
  mov    %eax,%esi
  mov    -0x168(%rbp),%ecx
  mov    -0x164(%rbp),%eax
  and    %ecx,%eax
  or     %eax,%esi
  lea    -0x170(%rbp),%rax
  mov    %edx,%ecx
  mov    $0x8f1bbcdc,%edx
  mov    %rax,%rdi
  call   <sha1_step@plt>
  addl   $0x1,-0x17c(%rbp)
L46:
  cmpl   $0x3b,-0x17c(%rbp)
  jle    L133
  movl   $0x3c,-0x178(%rbp)
  jmp    L68
L78:
  mov    -0x178(%rbp),%eax
  cltq
  mov    -0x150(%rbp,%rax,4),%edx
  mov    -0x16c(%rbp),%ecx
  mov    -0x168(%rbp),%eax
  xor    %eax,%ecx
  mov    -0x164(%rbp),%eax
  mov    %ecx,%esi
  xor    %eax,%esi
  lea    -0x170(%rbp),%rax
  mov    %edx,%ecx
  mov    $0xca62c1d6,%edx
  mov    %rax,%rdi
  call   <sha1_step@plt>
  addl   $0x1,-0x178(%rbp)
L68:
  cmpl   $0x4f,-0x178(%rbp)
  jle    L78
  movl   $0x0,-0x174(%rbp)
  jmp    L53
L85:
  mov    -0x174(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x1a0(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%ecx
  mov    -0x174(%rbp),%eax
  cltq
  mov    -0x170(%rbp,%rax,4),%edx
  mov    -0x174(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rsi
  mov    -0x1a0(%rbp),%rax
  add    %rsi,%rax
  add    %ecx,%edx
  mov    %edx,(%rax)
  addl   $0x1,-0x174(%rbp)
L53:
  cmpl   $0x4,-0x174(%rbp)
  jle    L85
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L55
  call   <__stack_chk_fail@plt>
L55:
  leave
  ret
```

assistant: ```c
void sha1_chunk(uint8_t *chunk, uint32_t *hash) {
  uint32_t state[5], w[80];
  memcpy(state, hash, sizeof(state));
  for (uint32_t src = 0; src < 64; src += 4) {
    w[src >> 2] = chunk[src] << 24 | chunk[src + 1] << 16 | chunk[src + 2] << 8 | chunk[src + 3];
  }
  for (uint32_t cur = 16; cur < 80; cur++) {
    w[cur] = rotleft(w[cur - 3] ^ w[cur - 8] ^ w[cur - 14] ^ w[cur - 16], 1);
  }
  for (uint32_t cur = 0; cur < 20; cur++) {
    sha1_step(state, (state[1] & state[2]) | ((~state[1]) & state[3]), 0x5A827999, w[cur]);
  }
  for (uint32_t cur = 20; cur < 40; cur++) {
    sha1_step(state, state[1] ^ state[2] ^ state[3], 0x6ED9EBA1, w[cur]);
  }
  for (uint32_t cur = 40; cur < 60; cur++) {
    sha1_step(state, (state[1] & state[2]) | (state[1] & state[3]) | (state[2] & state[3]), 0x8F1BBCDC, w[cur]);
  }
  for (uint32_t cur = 60; cur < 80; cur++) {
    sha1_step(state, state[1] ^ state[2] ^ state[3], 0xCA62C1D6, w[cur]);
  }
  for (uint32_t i = 0; i < 5; i++) {
    hash[i] += state[i];
  }
}
```