user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<pbkdf2_sha1>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x98,%rsp
  mov    %rdi,0x30(%rsp)
  mov    %rsi,0x8(%rsp)
  mov    %rdx,%rbx
  mov    %r9,0x38(%rsp)
  mov    0xd0(%rsp),%rbp
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  lea    -0x1(%rbp),%rdx
  mov    $0xfffffffe,%eax
  cmp    %rax,%rdx
  ja     L117
  mov    %rcx,%r15
  mov    %r8d,%r13d
  test   %r8d,%r8d
  jne    L29
L117:
  mov    $0x0,%eax
L5:
  mov    0x88(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L91
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L29:
  lea    0x4(%rcx),%rax
  mov    %rax,0x10(%rsp)
  mov    %rax,%rdi
  call   <malloc@plt>
  mov    %rax,%r12
  mov    $0x0,%eax
  test   %r12,%r12
  je     L5
  lea    -0x1(%rbp),%r14d
  mov    $0xcccccccd,%eax
  imul   %rax,%r14
  shr    $0x24,%r14
  lea    0x1(%r14),%esi
  mov    %esi,0x44(%rsp)
  lea    (%r14,%r14,4),%eax
  shl    $0x2,%eax
  mov    %ebp,%esi
  sub    %eax,%esi
  mov    %esi,0x48(%rsp)
  mov    %r15d,%edx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  call   <memcpy@plt>
  lea    0x2(%r14),%ebx
  mov    %ebx,0x4c(%rsp)
  mov    $0x1,%r14d
  lea    0x70(%rsp),%rbx
  mov    %rbx,0x28(%rsp)
  lea    0x50(%rsp),%rbp
  mov    0x10(%rsp),%eax
  mov    %eax,0x40(%rsp)
  jmp    L45
L24:
  movzbl 0x1c(%rsp),%eax
  mov    %al,(%r12,%r15,1)
  movzbl 0x23(%rsp),%eax
  mov    %al,0x1(%r12,%r15,1)
  movzbl 0x24(%rsp),%eax
  mov    %al,0x2(%r12,%r15,1)
  movzbl 0x10(%rsp),%eax
  mov    %al,0x3(%r12,%r15,1)
  mov    %rbp,%r8
  mov    0x40(%rsp),%ecx
  mov    %r12,%rdx
  mov    0x8(%rsp),%rsi
  mov    %r14,%rdi
  call   <hmac_sha1@plt>
L20:
  lea    0x70(%rsp),%rax
  lea    0x50(%rsp),%rdx
  lea    0x84(%rsp),%rsi
L73:
  movzbl (%rdx),%ecx
  xor    %cl,(%rax)
  add    $0x1,%rax
  add    $0x1,%rdx
  cmp    %rax,%rsi
  jne    L73
  add    $0x1,%ebx
  cmp    %ebx,%r13d
  jb     L95
L10:
  cmp    $0x1,%ebx
  je     L24
  mov    %rbp,%r8
  mov    $0x14,%ecx
  mov    %rbp,%rdx
  mov    0x8(%rsp),%rsi
  mov    %r14,%rdi
  call   <hmac_sha1@plt>
  jmp    L20
L95:
  mov    0x10(%rsp),%r14d
  cmp    %r14d,0x44(%rsp)
  mov    $0x14,%edx
  cmove  0x48(%rsp),%edx
  lea    (%r14,%r14,4),%eax
  lea    -0x14(,%rax,4),%edi
  mov    %edi,%edi
  add    0x38(%rsp),%rdi
  mov    0x28(%rsp),%rsi
  call   <memcpy@plt>
  add    $0x1,%r14d
  cmp    0x4c(%rsp),%r14d
  je     L72
L45:
  mov    $0x14,%edx
  mov    $0x0,%esi
  mov    0x28(%rsp),%rdi
  call   <memset@plt>
  mov    %r14d,%eax
  shr    $0x18,%eax
  mov    %eax,0x1c(%rsp)
  mov    %r14d,%eax
  shr    $0x10,%eax
  mov    %al,0x23(%rsp)
  mov    %r14d,%eax
  movzbl %ah,%eax
  mov    %eax,0x24(%rsp)
  mov    $0x1,%ebx
  mov    %r14d,0x10(%rsp)
  mov    0x30(%rsp),%r14
  jmp    L10
L72:
  mov    %r12,%rdi
  call   <free@plt>
  mov    $0x1,%eax
  jmp    L5
L91:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int pbkdf2_sha1(const char *password, size_t Plen, const char *salt, size_t Slen, unsigned int c, char *derivedKey, size_t dkLen) {
  unsigned int hLen = 20;
  char U[20], T[20];
  unsigned int u, l, r, i, k;
  char *tmp;
  size_t tmplen = Slen + 4;
  if (!c || !dkLen || dkLen > 4294967295U)
    return 0;
  l = (((int)dkLen - 1) / hLen) + 1;
  r = (int)dkLen - (l - 1) * hLen;
  if (!(tmp = (char *)malloc(tmplen)))
    return 0;
  memcpy(tmp, salt, Slen);
  for (i = 1; i <= l; i++) {
    memset(T, 0, hLen);
    for (u = 1; u <= c; u++) {
      if (u == 1) {
        tmp[Slen + 0] = (i & 0xff000000) >> 24;
        tmp[Slen + 1] = (i & 0x00ff0000) >> 16;
        tmp[Slen + 2] = (i & 0x0000ff00) >> 8;
        tmp[Slen + 3] = (i & 0x000000ff) >> 0;
        hmac_sha1(password, Plen, tmp, tmplen, U);
      } else
        hmac_sha1(password, Plen, U, hLen, U);
      for (k = 0; k < hLen; k++)
        T[k] ^= U[k];
    }
    memcpy(derivedKey + (i - 1) * hLen, T, i == l ? r : hLen);
  }
  free(tmp);
  return 1;
}
```