user: Translate the below assembly code into C programming language:

```asm
<calc>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x188,%rsp
  mov    %rdi,%rbx
  mov    %esi,0xc(%rsp)
  mov    %rdx,%r14
  mov    %fs:0x28,%rax
  mov    %rax,0x178(%rsp)
  xor    %eax,%eax
  movl   $0x67452301,0x10(%rsp)
  movl   $0xefcdab89,0x14(%rsp)
  movl   $0x98badcfe,0x18(%rsp)
  movl   $0x10325476,0x1c(%rsp)
  movl   $0xc3d2e1f0,0x20(%rsp)
  lea    -0x3f(%rsi),%r15d
  test   %r15d,%r15d
  jle    L139
  lea    0x30(%rsp),%r12
  mov    $0x0,%r13d
  mov    $0x40,%ebp
  mov    %r12,(%rsp)
  jmp    L35
L77:
  movzbl 0x2(%rbx,%rdx,1),%eax
  shl    $0x8,%eax
  movzbl 0x1(%rbx,%rdx,1),%ecx
  shl    $0x10,%ecx
  or     %ecx,%eax
  movzbl 0x3(%rbx,%rdx,1),%ecx
  or     %ecx,%eax
  movzbl (%rbx,%rdx,1),%ecx
  shl    $0x18,%ecx
  or     %ecx,%eax
  mov    %eax,(%r12,%rdx,1)
  add    $0x4,%rdx
  cmp    %edx,%ebp
  jg     L77
L32:
  lea    0x10(%rsp),%rdi
  mov    (%rsp),%rsi
  call   <innerHash@plt>
  add    $0x40,%ebp
  add    $0x40,%r13
  sub    $0x40,%r12
  cmp    %r13d,%r15d
  jle    L2
L35:
  mov    %r13,%rdx
  cmp    %r13d,%ebp
  jg     L77
  jmp    L32
L2:
  mov    0xc(%rsp),%eax
  sub    $0x40,%eax
  and    $0xffffffc0,%eax
  lea    0x40(%rax),%r12d
L62:
  mov    0xc(%rsp),%ebp
  sub    %r12d,%ebp
  lea    0x30(%rsp),%rdi
  mov    $0x40,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  test   %ebp,%ebp
  jle    L88
  mov    %ebp,%r8d
  mov    $0xfffffff8,%edi
  mov    $0x0,%eax
  movslq %r12d,%r12
  add    %r12,%rbx
L11:
  mov    %eax,%edx
  sar    $0x2,%edx
  movslq %edx,%rdx
  movzbl (%rbx,%rax,1),%esi
  mov    %edi,%ecx
  and    $0x18,%ecx
  shl    %cl,%esi
  or     %esi,0x30(%rsp,%rdx,4)
  add    $0x1,%rax
  sub    $0x8,%edi
  cmp    %r8,%rax
  jne    L11
  mov    %ebp,%eax
L54:
  mov    %eax,%edx
  sar    $0x2,%edx
  movslq %edx,%rdx
  not    %eax
  lea    0x0(,%rax,8),%ecx
  and    $0x18,%ecx
  mov    $0x80,%eax
  shl    %cl,%eax
  or     %eax,0x30(%rsp,%rdx,4)
  cmp    $0x37,%ebp
  jg     L7
L84:
  mov    0xc(%rsp),%eax
  shl    $0x3,%eax
  mov    %eax,0x6c(%rsp)
  lea    0x30(%rsp),%rsi
  lea    0x10(%rsp),%rdi
  call   <innerHash@plt>
  mov    $0xffffff80,%esi
  mov    $0x13,%eax
L138:
  mov    %eax,%edx
  sar    $0x2,%edx
  movslq %edx,%rdx
  mov    %esi,%ecx
  and    $0x18,%ecx
  mov    0x10(%rsp,%rdx,4),%edx
  shr    %cl,%edx
  mov    %dl,(%r14,%rax,1)
  sub    $0x1,%rax
  add    $0x8,%esi
  cmp    $0xffffffffffffffff,%rax
  jne    L138
  mov    0x178(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L93
  add    $0x188,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L139:
  mov    $0x0,%r12d
  jmp    L62
L88:
  mov    $0x0,%eax
  jmp    L54
L7:
  lea    0x30(%rsp),%rbx
  lea    0x10(%rsp),%rdi
  mov    %rbx,%rsi
  call   <innerHash@plt>
  mov    $0x40,%edx
  mov    $0x0,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  jmp    L84
L93:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void calc(const void *src, const int bytelength, unsigned char *hash) {
  unsigned int result[5] = {0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0};
  const unsigned char *sarray = (const unsigned char *)src;
  unsigned int w[80];
  int j, i, i1;
  j = 0;
  for (i = 0, i1 = 64; i <= (bytelength - 64); i = i1, i1 += 64) {
    int k = 0;
    for (j = i; j < i1; j += 4) {
      w[k++] = (unsigned int)sarray[j + 3] | (((unsigned int)sarray[j + 2]) << 8) | (((unsigned int)sarray[j + 1]) << 16) | (((unsigned int)sarray[j]) << 24);
    }
    innerHash(result, w);
  }
  i1 = bytelength - i;
  memset(w, 0, sizeof(unsigned int) * 16);
  for (j = 0; j < i1; j++) {
    w[j >> 2] |= (unsigned int)sarray[j + i] << ((3 - (j & 3)) << 3);
  }
  w[j >> 2] |= 0x80 << ((3 - (j & 3)) << 3);
  if (i1 >= 56) {
    innerHash(result, w);
    memset(w, 0, sizeof(unsigned int) * 16);
  }
  w[15] = bytelength << 3;
  innerHash(result, w);
  for (i = 20; --i >= 0;) {
    hash[i] = (result[i >> 2] >> (((3 - i) & 0x3) << 3)) & 0xFF;
  }
}
```