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

```asm
<g>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x2b8,%rsp
  mov    %rdx,%r15
  mov    %fs:0x28,%rdx
  mov    %rdx,0x2a8(%rsp)
  xor    %edx,%edx
  movzbl (%rdi),%r14d
  shl    $0x18,%r14d
  movzbl 0x1(%rdi),%edx
  shl    $0x10,%edx
  or     %edx,%r14d
  movzbl 0x3(%rdi),%edx
  or     %edx,%r14d
  movzbl 0x2(%rdi),%edx
  shl    $0x8,%edx
  or     %edx,%r14d
  movslq %r14d,%r14
  movzbl 0x4(%rdi),%r13d
  shl    $0x18,%r13d
  movzbl 0x5(%rdi),%edx
  shl    $0x10,%edx
  or     %edx,%r13d
  movzbl 0x7(%rdi),%edx
  or     %edx,%r13d
  movzbl 0x6(%rdi),%edx
  shl    $0x8,%edx
  or     %edx,%r13d
  movslq %r13d,%r13
  movzbl 0x8(%rdi),%edx
  shl    $0x18,%edx
  movzbl 0x9(%rdi),%ecx
  shl    $0x10,%ecx
  or     %ecx,%edx
  movzbl 0xb(%rdi),%ecx
  or     %ecx,%edx
  movzbl 0xa(%rdi),%ecx
  shl    $0x8,%ecx
  or     %ecx,%edx
  movslq %edx,%rbx
  mov    %rbx,0x8(%rsp)
  movzbl 0xc(%rdi),%edx
  shl    $0x18,%edx
  movzbl 0xd(%rdi),%ecx
  shl    $0x10,%ecx
  or     %ecx,%edx
  movzbl 0xf(%rdi),%ecx
  or     %ecx,%edx
  movzbl 0xe(%rdi),%ecx
  shl    $0x8,%ecx
  or     %ecx,%edx
  movslq %edx,%rbx
  mov    %rbx,0x10(%rsp)
  movzbl 0x10(%rdi),%edx
  shl    $0x18,%edx
  movzbl 0x11(%rdi),%ecx
  shl    $0x10,%ecx
  or     %ecx,%edx
  movzbl 0x13(%rdi),%ecx
  or     %ecx,%edx
  movzbl 0x12(%rdi),%eax
  shl    $0x8,%eax
  or     %edx,%eax
  cltq
  mov    %rax,0x18(%rsp)
  movslq %esi,%rsi
  mov    %rsi,0x20(%rsp)
  lea    0x20(%rsp),%rbx
  lea    0x28(%rsp),%rax
  lea    0xa0(%rsp),%rdx
L80:
  movq   $0x0,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L80
  lea    0x200(%rbx),%rcx
  mov    %rbx,%rax
L83:
  mov    0x68(%rax),%rdx
  xor    0x40(%rax),%rdx
  xor    0x10(%rax),%rdx
  xor    (%rax),%rdx
  mov    %rdx,0x80(%rax)
  add    $0x8,%rax
  cmp    %rax,%rcx
  jne    L83
  lea    0xa0(%rbx),%r11
  mov    %rbx,%rdi
  mov    0x18(%rsp),%r10
  mov    0x10(%rsp),%r9
  mov    0x8(%rsp),%r8
  mov    %r13,%rdx
  mov    %r14,%rax
  jmp    L64
L71:
  mov    %r8,%r9
  mov    %rsi,%r8
  mov    %rcx,%rax
L64:
  mov    %rax,%rsi
  shr    $0x1b,%rsi
  mov    %rax,%rcx
  shl    $0x5,%rcx
  or     %rcx,%rsi
  add    (%rdi),%rsi
  mov    %r8,%rcx
  xor    %r9,%rcx
  and    %rdx,%rcx
  xor    %r9,%rcx
  lea    0x5a827999(%rsi,%rcx,1),%rcx
  add    %r10,%rcx
  mov    %rdx,%rsi
  shr    $0x2,%rsi
  shl    $0x1e,%rdx
  or     %rdx,%rsi
  add    $0x8,%rdi
  mov    %rax,%rdx
  mov    %r9,%r10
  cmp    %r11,%rdi
  jne    L71
  lea    0xc0(%rsp),%r10
  lea    0x140(%rbx),%r11
  jmp    L81
L99:
  mov    %rsi,%r8
  mov    %rdi,%rsi
  mov    %rdx,%rcx
L81:
  mov    %rcx,%rdi
  shr    $0x1b,%rdi
  mov    %rcx,%rdx
  shl    $0x5,%rdx
  or     %rdx,%rdi
  mov    %rax,%rdx
  xor    %rsi,%rdx
  xor    %r8,%rdx
  lea    0x6ed9eba1(%rdi,%rdx,1),%rdx
  add    (%r10),%rdx
  add    %r9,%rdx
  mov    %rax,%rdi
  shr    $0x2,%rdi
  shl    $0x1e,%rax
  or     %rax,%rdi
  add    $0x8,%r10
  mov    %rcx,%rax
  mov    %r8,%r9
  cmp    %r11,%r10
  jne    L99
  lea    0x160(%rsp),%r10
  lea    0x1e0(%rbx),%r12
  mov    $0x8f1bbcdc,%ebp
  jmp    L102
L61:
  mov    %rdi,%rsi
  mov    %r9,%rdi
  mov    %rax,%rdx
L102:
  mov    %rdx,%rax
  shr    $0x1b,%rax
  mov    %rdx,%r9
  shl    $0x5,%r9
  or     %r9,%rax
  add    (%r10),%rax
  add    %rbp,%rax
  mov    %rdi,%r9
  or     %rsi,%r9
  and    %rcx,%r9
  mov    %rdi,%r11
  and    %rsi,%r11
  or     %r11,%r9
  add    %r9,%rax
  add    %r8,%rax
  mov    %rcx,%r8
  shr    $0x2,%r8
  shl    $0x1e,%rcx
  or     %rcx,%r8
  mov    %r8,%r9
  add    $0x8,%r10
  mov    %rdx,%rcx
  mov    %rsi,%r8
  cmp    %r10,%r12
  jne    L61
  lea    0x200(%rsp),%r8
  add    $0x280,%rbx
  mov    $0xca62c1d6,%r10d
  jmp    L52
L42:
  mov    %r9,%rdi
  mov    %r11,%r9
  mov    %rcx,%rax
L52:
  mov    %rax,%rcx
  shr    $0x1b,%rcx
  mov    %rax,%r11
  shl    $0x5,%r11
  or     %r11,%rcx
  mov    %rdx,%r11
  xor    %r9,%r11
  xor    %rdi,%r11
  add    %r11,%rcx
  add    %r10,%rcx
  add    (%r8),%rcx
  add    %rsi,%rcx
  mov    %rdx,%rsi
  shr    $0x2,%rsi
  shl    $0x1e,%rdx
  or     %rdx,%rsi
  mov    %rsi,%r11
  add    $0x8,%r8
  mov    %rax,%rdx
  mov    %rdi,%rsi
  cmp    %r8,%rbx
  jne    L42
  add    %rcx,%r14
  mov    %r14,(%r15)
  add    %rax,%r13
  mov    %r13,0x8(%r15)
  mov    0x8(%rsp),%rax
  add    %r11,%rax
  mov    %rax,0x10(%r15)
  mov    0x10(%rsp),%rax
  add    %r9,%rax
  mov    %rax,0x18(%r15)
  mov    0x18(%rsp),%rax
  add    %rdi,%rax
  mov    %rax,0x20(%r15)
  mov    0x2a8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L46
  mov    $0x0,%eax
  add    $0x2b8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L46:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int g(in, i, h)
unsigned char *in;
int i;
unsigned long *h;
{
  unsigned long h0, h1, h2, h3, h4, a, b, c, d, e, temp;
  unsigned char *kp;
  unsigned long w[80];
  kp = in;
  h0 = ((kp[0] << 24) | (kp[1] << 16) | (kp[2] << 8) | (kp[3]));
  kp += 4;
  h1 = ((kp[0] << 24) | (kp[1] << 16) | (kp[2] << 8) | (kp[3]));
  kp += 4;
  h2 = ((kp[0] << 24) | (kp[1] << 16) | (kp[2] << 8) | (kp[3]));
  kp += 4;
  h3 = ((kp[0] << 24) | (kp[1] << 16) | (kp[2] << 8) | (kp[3]));
  kp += 4;
  h4 = ((kp[0] << 24) | (kp[1] << 16) | (kp[2] << 8) | (kp[3]));
  kp += 4;
  w[0] = i;
  for (i = 1; i < 16; i++)
    w[i] = 0;
  for (i = 16; i < 80; i++)
    w[i] = w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16];
  a = h0;
  b = h1;
  c = h2;
  d = h3;
  e = h4;
  for (i = 0; i < 20; i++) {
    temp = (((a) >> 27) | ((a) << 5)) + (((b) & (c)) | ((~(b)) & (d))) + e + w[i] + 0x5a827999;
    e = d;
    d = c;
    c = (((b) >> 2) | ((b) << 30));
    b = a;
    a = temp;
  }
  for (i = 20; i < 40; i++) {
    temp = (((a) >> 27) | ((a) << 5)) + ((b) ^ (c) ^ (d)) + e + w[i] + 0x6ed9eba1;
    e = d;
    d = c;
    c = (((b) >> 2) | ((b) << 30));
    b = a;
    a = temp;
  }
  for (i = 40; i < 60; i++) {
    temp = (((a) >> 27) | ((a) << 5)) + (((b) & (c)) | ((b) & (d)) | ((c) & (d))) + e + w[i] + 0x8f1bbcdc;
    e = d;
    d = c;
    c = (((b) >> 2) | ((b) << 30));
    b = a;
    a = temp;
  }
  for (i = 60; i < 80; i++) {
    temp = (((a) >> 27) | ((a) << 5)) + ((b) ^ (c) ^ (d)) + e + w[i] + 0xca62c1d6;
    e = d;
    d = c;
    c = (((b) >> 2) | ((b) << 30));
    b = a;
    a = temp;
  }
  h[0] = h0 + a;
  h[1] = h1 + b;
  h[2] = h2 + c;
  h[3] = h3 + d;
  h[4] = h4 + e;
  return (0);
}
```