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

```asm
<pbkdf2_check>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  sub    $0xd0,%rsp
  mov    %rdi,-0xd8(%rbp)
  mov    %rsi,-0xe0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0xc8(%rbp)
  lea    -0xcc(%rbp),%rdx
  mov    -0xe0(%rbp),%rax
  lea    D98(%rip),%r8
  lea    D29(%rip),%rcx
  lea    D23(%rip),%rsi
  mov    %rax,%rdi
  call   <detoken@plt>
  test   %rax,%rax
  je     L43
  mov    -0xc8(%rbp),%eax
  jmp    L11
L43:
  mov    D29(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0xbc(%rbp)
  mov    $0x0,%eax
  call   <EVP_sha256@plt>
  mov    %rax,-0xa8(%rbp)
  mov    D23(%rip),%rax
  lea    D39(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L103
  mov    $0x0,%eax
  call   <EVP_sha1@plt>
  mov    %rax,-0xa8(%rbp)
  jmp    L45
L103:
  mov    D23(%rip),%rax
  lea    D13(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L45
  mov    $0x0,%eax
  call   <EVP_sha512@plt>
  mov    %rax,-0xa8(%rbp)
L45:
  mov    -0xcc(%rbp),%r12d
  mov    D29(%rip),%rbx
  mov    -0xd8(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%esi
  mov    -0xa8(%rbp),%rdi
  mov    -0xbc(%rbp),%edx
  mov    -0xd8(%rbp),%rax
  lea    -0xa0(%rbp),%rcx
  push   %rcx
  push   $0x18
  mov    %rdi,%r9
  mov    %r12d,%r8d
  mov    %edx,%ecx
  mov    %rbx,%rdx
  mov    %rax,%rdi
  call   <PKCS5_PBKDF2_HMAC@plt>
  add    $0x10,%rsp
  lea    -0xb0(%rbp),%rdx
  lea    -0xa0(%rbp),%rax
  mov    $0x18,%esi
  mov    %rax,%rdi
  call   <base64_encode@plt>
  mov    %eax,-0xb8(%rbp)
  cmpl   $0x0,-0xb8(%rbp)
  jle    L34
  movl   $0x0,-0xc0(%rbp)
  mov    D98(%rip),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0xb4(%rbp)
  movl   $0x0,-0xc4(%rbp)
  jmp    L14
L104:
  mov    D98(%rip),%rdx
  mov    -0xc4(%rbp),%eax
  cltq
  add    %rdx,%rax
  movzbl (%rax),%edx
  mov    -0xb0(%rbp),%rcx
  mov    -0xc4(%rbp),%eax
  cltq
  add    %rcx,%rax
  movzbl (%rax),%eax
  xor    %edx,%eax
  movsbl %al,%eax
  or     %eax,-0xc0(%rbp)
  addl   $0x1,-0xc4(%rbp)
L14:
  mov    -0xc4(%rbp),%eax
  cmp    -0xb8(%rbp),%eax
  jge    L38
  mov    -0xc4(%rbp),%eax
  cmp    -0xb4(%rbp),%eax
  jl     L104
L38:
  cmpl   $0x0,-0xc0(%rbp)
  sete   %al
  movzbl %al,%eax
  mov    %eax,-0xc8(%rbp)
  mov    -0xb4(%rbp),%eax
  cmp    -0xb8(%rbp),%eax
  je     L54
  movl   $0x0,-0xc8(%rbp)
L54:
  mov    -0xb0(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L34:
  mov    D23(%rip),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    D29(%rip),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    D98(%rip),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0xc8(%rbp),%eax
L11:
  mov    -0x18(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L74
  call   <__stack_chk_fail@plt>
L74:
  lea    -0x10(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
```

tool_calls: name: retrieve_data
arguments: data_label: D39
type_infered: string
name: retrieve_data
arguments: data_label: D13
type_infered: string

tool: D39: sha1

tool: D13: sha512

assistant: ```c
int pbkdf2_check(char *password, char *hash) {
  static char *sha, *salt, *h_pw;
  int iterations, saltlen, blen;
  char *b64;
  unsigned char key[128];
  int match = (0);
  const EVP_MD *evpmd;
  if (detoken(hash, &sha, &iterations, &salt, &h_pw) != 0)
    return match;
  saltlen = strlen((char *)salt);
  evpmd = EVP_sha256();
  if (strcmp(sha, "sha1") == 0) {
    evpmd = EVP_sha1();
  } else if (strcmp(sha, "sha512") == 0) {
    evpmd = EVP_sha512();
  }
  PKCS5_PBKDF2_HMAC(password, strlen(password), (unsigned char *)salt, saltlen, iterations, evpmd, 24, key);
  blen = base64_encode(key, 24, &b64);
  if (blen > 0) {
    int i, diff = 0, hlen = strlen(h_pw);
    for (i = 0; (i < blen) && (i < hlen); i++) {
      diff |= h_pw[i] ^ b64[i];
    }
    match = diff == 0;
    if (hlen != blen)
      match = 0;
    free(b64);
  }
  free(sha);
  free(salt);
  free(h_pw);
  return match;
}
```