user: Demonstrate the C code that generates the assembly output below:

```asm
<shahash>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x78(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x1,-0x64(%rbp)
  movq   $0x0,-0x60(%rbp)
  mov    $0x14,%edi
  call   <malloc@plt>
  mov    %rax,-0x58(%rbp)
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <sha_init@plt>
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x68(%rbp)
  cmpl   $0x0,-0x68(%rbp)
  jne    L98
  lea    -0x50(%rbp),%rax
  mov    $0x41,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movb   $0x80,-0x50(%rbp)
  mov    -0x58(%rbp),%rdx
  lea    -0x50(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <sha_hash@plt>
  jmp    L98
L59:
  lea    -0x50(%rbp),%rax
  mov    $0x41,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x78(%rbp),%rcx
  lea    -0x50(%rbp),%rax
  mov    $0x40,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  lea    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x64(%rbp)
  mov    -0x64(%rbp),%eax
  cltq
  add    %rax,-0x60(%rbp)
  mov    -0x64(%rbp),%eax
  sub    %eax,-0x68(%rbp)
  cmpl   $0x0,-0x68(%rbp)
  jg     L100
  shlq   $0x3,-0x60(%rbp)
  mov    -0x64(%rbp),%eax
  cltq
  movb   $0x80,-0x50(%rbp,%rax,1)
  mov    -0x64(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x6c(%rbp)
  jmp    L77
L44:
  mov    -0x6c(%rbp),%eax
  cltq
  movb   $0x0,-0x50(%rbp,%rax,1)
  addl   $0x1,-0x6c(%rbp)
L77:
  cmpl   $0x3f,-0x6c(%rbp)
  jle    L44
  cmpl   $0x37,-0x64(%rbp)
  jle    L56
  mov    -0x58(%rbp),%rdx
  lea    -0x50(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <sha_hash@plt>
  movl   $0x0,-0x6c(%rbp)
  jmp    L85
L39:
  mov    -0x6c(%rbp),%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  lea    -0x50(%rbp),%rax
  add    %rdx,%rax
  movl   $0x0,(%rax)
  addl   $0x1,-0x6c(%rbp)
L85:
  cmpl   $0xd,-0x6c(%rbp)
  jle    L39
L56:
  movl   $0x0,-0x6c(%rbp)
  jmp    L46
L94:
  mov    $0x7,%eax
  sub    -0x6c(%rbp),%eax
  shl    $0x3,%eax
  mov    -0x60(%rbp),%rdx
  mov    %eax,%ecx
  sar    %cl,%rdx
  mov    -0x6c(%rbp),%eax
  add    $0x38,%eax
  cltq
  mov    %dl,-0x50(%rbp,%rax,1)
  addl   $0x1,-0x6c(%rbp)
L46:
  cmpl   $0x7,-0x6c(%rbp)
  jle    L94
L100:
  mov    -0x58(%rbp),%rdx
  lea    -0x50(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <sha_hash@plt>
  addq   $0x40,-0x78(%rbp)
L98:
  cmpl   $0x0,-0x68(%rbp)
  jg     L59
  mov    -0x58(%rbp),%rax
  mov    %rax,%rsi
  lea    D18(%rip),%rax
  mov    %rax,%rdi
  call   <strprintsha@plt>
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  lea    D18(%rip),%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L83
  call   <__stack_chk_fail@plt>
L83:
  leave
  ret
```

assistant: ```c
char *shahash(const char *str) {
  char read_buffer[65];
  int c = 1, i;
  long long length = 0;
  int strsz;
  static char final[40];
  int *hashval;
  hashval = (int *)malloc(20);
  sha_init(hashval);
  strsz = strlen(str);
  if (strsz == 0) {
    memset(read_buffer, 0, 65);
    read_buffer[0] = 0x80;
    sha_hash((int *)read_buffer, hashval);
  }
  while (strsz > 0) {
    memset(read_buffer, 0, 65);
    strncpy((char *)read_buffer, str, 64);
    c = strlen((char *)read_buffer);
    length += c;
    strsz -= c;
    if (strsz <= 0) {
      length <<= 3;
      read_buffer[c] = (char)0x80;
      for (i = c + 1; i < 64; i++)
        read_buffer[i] = 0;
      if (c > 55) {
        sha_hash((int *)read_buffer, hashval);
        for (i = 0; i < 14; i++)
          ((int *)read_buffer)[i] = 0;
      }
      for (i = 0; i < 8; i++) {
        read_buffer[56 + i] = (char)(length >> (56 - (i * 8))) & 0xff;
      }
    }
    sha_hash((int *)read_buffer, hashval);
    str += 64;
  }
  strprintsha((char *) final, hashval);
  free(hashval);
  return (char *) final;
}
```