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

```asm
<_hash_sha1>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xc0,%rsp
  mov    %rdi,-0xa8(%rbp)
  mov    %rsi,-0xb0(%rbp)
  mov    %edx,-0xb4(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x61687324,-0x77(%rbp)
  movw   $0x2431,-0x73(%rbp)
  movb   $0x0,-0x71(%rbp)
  movabs $0x2a29282726252221,%rax
  movabs $0x4342412f2e2d2c2b,%rdx
  mov    %rax,-0x70(%rbp)
  mov    %rdx,-0x68(%rbp)
  movabs $0x4b4a494847464544,%rax
  movabs $0x535251504f4e4d4c,%rdx
  mov    %rax,-0x60(%rbp)
  mov    %rdx,-0x58(%rbp)
  movabs $0x615a595857565554,%rax
  movabs $0x6968676665646362,%rdx
  mov    %rax,-0x50(%rbp)
  mov    %rdx,-0x48(%rbp)
  movabs $0x71706f6e6d6c6b6a,%rax
  movabs $0x7978777675747372,%rdx
  mov    %rax,-0x40(%rbp)
  mov    %rdx,-0x38(%rbp)
  movabs $0x363534333231307a,%rax
  movabs $0x3e3d3c3b3a393837,%rdx
  mov    %rax,-0x30(%rbp)
  mov    %rdx,-0x28(%rbp)
  movabs $0x605f5e5d5c5b403f,%rax
  mov    %rax,-0x20(%rbp)
  movb   $0x0,-0x18(%rbp)
  movq   $0x0,-0x90(%rbp)
  cmpl   $0x0,-0xb4(%rbp)
  jg     L91
  mov    $0x0,%eax
  call   <rand@plt>
  cltd
  shr    $0xe,%edx
  add    %edx,%eax
  and    $0x3ffff,%eax
  sub    %edx,%eax
  mov    %eax,-0xb4(%rbp)
L91:
  cmpq   $0x0,-0xb0(%rbp)
  jne    L34
  lea    -0x70(%rbp),%rax
  mov    $0x40,%edx
  mov    $0x8,%esi
  mov    %rax,%rdi
  call   <_makepasswd_password@plt>
  mov    %rax,-0x90(%rbp)
  cmpq   $0x0,-0x90(%rbp)
  jne    L4
  mov    $0x0,%eax
  jmp    L13
L4:
  mov    -0x90(%rbp),%rax
  mov    %rax,-0xb0(%rbp)
L34:
  mov    -0xb0(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    $0x13,%rax
  mov    %rax,-0x88(%rbp)
  mov    -0x88(%rbp),%rax
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,-0x80(%rbp)
  cmpq   $0x0,-0x80(%rbp)
  jne    L55
  mov    $0x1,%esi
  lea    D32(%rip),%rax
  mov    %rax,%rdi
  call   <_error@plt>
  mov    -0x90(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  jmp    L13
L55:
  mov    -0xb4(%rbp),%ecx
  lea    -0x77(%rbp),%rdx
  mov    -0x88(%rbp),%rsi
  mov    -0x80(%rbp),%rax
  sub    $0x8,%rsp
  push   -0xb0(%rbp)
  mov    $0x24,%r9d
  mov    %ecx,%r8d
  mov    %rdx,%rcx
  lea    D12(%rip),%rdx
  mov    %rax,%rdi
  call   <snprintf@plt>
  add    $0x10,%rsp
  mov    -0x80(%rbp),%rdx
  mov    -0xa8(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <crypt@plt>
  mov    %rax,-0x98(%rbp)
  mov    -0x90(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x80(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  cmpq   $0x0,-0x98(%rbp)
  jne    L83
  mov    $0x1,%esi
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  call   <_error@plt>
  jmp    L52
L83:
  mov    -0x98(%rbp),%rax
  mov    %rax,%rdi
  call   <strdup@plt>
  mov    %rax,-0x98(%rbp)
  cmpq   $0x0,-0x98(%rbp)
  jne    L52
  mov    $0x1,%esi
  lea    D32(%rip),%rax
  mov    %rax,%rdi
  call   <_error@plt>
L52:
  mov    -0x98(%rbp),%rax
L13:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L44
  call   <__stack_chk_fail@plt>
L44:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D32
type_guessed: string
name: extract_symbolic_data
arguments: tag: D12
type_guessed: string
name: extract_symbolic_data
arguments: tag: D23
type_guessed: string

tool: D32: malloc

tool: D12: %s%u%c%s

tool: D23: crypt

assistant: ```c
char *_hash_sha1(char const *password, char const *salt, int iterations) {
  const char prefix[] = "$sha1$";
  const char characters[] = "!\"%&'()*+,-./ABCDEFGHIJKLMNOPQRSTUVWXYZ"
                            "abcdefghijklmnopqrstuvwxyz0123456789:;<=>?@[\\]^_`";
  char *ret;
  char *p = NULL;
  size_t len;
  char *s;
  if (iterations <= 0)
    iterations = rand() % (1 << 18);
  if (salt == NULL) {
    if ((p = _makepasswd_password(characters, 8, 64)) == NULL)
      return NULL;
    salt = p;
  }
  len = sizeof(prefix) + 11 + strlen(salt) + 1;
  if ((s = malloc(len)) == NULL) {
    _error("malloc", 1);
    free(p);
    return NULL;
  }
  snprintf(s, len, "%s%u%c%s", prefix, iterations, '$', salt);
  ret = crypt(password, s);
  free(p);
  free(s);
  if (ret == NULL)
    _error("crypt", 1);
  else if ((ret = strdup(ret)) == NULL)
    _error("malloc", 1);
  return ret;
}
```