user: 请从给定的汇编指令推导出C源代码:

```asm
<_hash_sha1>:
  endbr64
  push   %r15
  mov    $0x2431,%ecx
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  mov    %edx,%r12d
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x88,%rsp
  movdqa D52(%rip),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x78(%rsp)
  xor    %eax,%eax
  movl   $0x61687324,0x9(%rsp)
  movabs $0x605f5e5d5c5b403f,%rax
  movaps %xmm0,0x10(%rsp)
  movdqa D85(%rip),%xmm0
  mov    %cx,0xd(%rsp)
  movaps %xmm0,0x20(%rsp)
  movdqa D24(%rip),%xmm0
  movb   $0x0,0xf(%rsp)
  movaps %xmm0,0x30(%rsp)
  movdqa D37(%rip),%xmm0
  mov    %rax,0x60(%rsp)
  movaps %xmm0,0x40(%rsp)
  movdqa D36(%rip),%xmm0
  movb   $0x0,0x68(%rsp)
  movaps %xmm0,0x50(%rsp)
  test   %edx,%edx
  jle    L47
L128:
  xor    %r13d,%r13d
  test   %rbx,%rbx
  je     L23
L73:
  mov    %rbx,%rdi
  call   <strlen@plt>
  movslq %eax,%rbp
  add    $0x13,%rbp
  mov    %rbp,%rdi
  call   <malloc@plt>
  mov    %rax,%r15
  test   %rax,%rax
  je     L14
  lea    0x9(%rsp),%rcx
  sub    $0x8,%rsp
  mov    %r12d,%r8d
  mov    %rbp,%rsi
  push   %rbx
  lea    D13(%rip),%rdx
  mov    $0x24,%r9d
  mov    %rax,%rdi
  call   <snprintf@plt>
  mov    %r15,%rsi
  mov    %r14,%rdi
  call   <crypt@plt>
  mov    %r13,%rdi
  mov    %rax,%r12
  call   <free@plt>
  mov    %r15,%rdi
  call   <free@plt>
  pop    %rax
  pop    %rdx
  test   %r12,%r12
  je     L51
  mov    %r12,%rdi
  call   <strdup@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L74
L70:
  mov    0x78(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L125
  add    $0x88,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L23:
  lea    0x10(%rsp),%rdi
  mov    $0x40,%edx
  mov    $0x8,%esi
  call   <_makepasswd_password@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L48
  mov    %rax,%r13
  jmp    L73
  nopl   0x0(%rax)
L47:
  xor    %eax,%eax
  call   <rand@plt>
  cltd
  shr    $0xe,%edx
  lea    (%rax,%rdx,1),%r12d
  and    $0x3ffff,%r12d
  sub    %edx,%r12d
  jmp    L128
  cs nopw 0x0(%rax,%rax,1)
L51:
  mov    $0x1,%esi
  lea    D15(%rip),%rdi
  call   <_error@plt>
  jmp    L70
  cs nopw 0x0(%rax,%rax,1)
L48:
  xor    %r12d,%r12d
  jmp    L70
L14:
  mov    $0x1,%esi
  lea    D79(%rip),%rdi
  xor    %r12d,%r12d
  call   <_error@plt>
  mov    %r13,%rdi
  call   <free@plt>
  jmp    L70
L125:
  call   <__stack_chk_fail@plt>
L74:
  mov    $0x1,%esi
  lea    D79(%rip),%rdi
  call   <_error@plt>
  jmp    L70
```

tool_calls: name: retrieve_data
arguments: data_tag: D52
type: byte[16]
name: retrieve_data
arguments: data_tag: D85
type: byte[16]
name: retrieve_data
arguments: data_tag: D24
type: byte[16]
name: retrieve_data
arguments: data_tag: D37
type: byte[16]
name: retrieve_data
arguments: data_tag: D36
type: byte[16]
name: retrieve_data
arguments: data_tag: D13
type: string
name: retrieve_data
arguments: data_tag: D15
type: string
name: retrieve_data
arguments: data_tag: D79
type: string

tool: {"D52": [0x21,0x22,0x25,0x26,0x27,0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f,0x41,0x42,0x43]}

tool: {"D85": [0x44,0x45,0x46,0x47,0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f,0x50,0x51,0x52,0x53]}

tool: {"D24": [0x54,0x55,0x56,0x57,0x58,0x59,0x5a,0x61,0x62,0x63,0x64,0x65,0x66,0x67,0x68,0x69]}

tool: {"D37": [0x6a,0x6b,0x6c,0x6d,0x6e,0x6f,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79]}

tool: {"D36": [0x7a,0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e]}

tool: D13: %s%u%c%s

tool: D15: crypt

tool: D79: malloc

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;
}
```