user: Please show me the C implementation that matches the assembly code listed below:

```asm
<pbkdf2>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  mov    %edx,%edi
  push   %rbx
  sub    $0xb8,%rsp
  mov    %edx,0x4c(%rsp)
  movabs $0x13ffffffec,%rdx
  mov    %rcx,0x40(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xa8(%rsp)
  xor    %eax,%eax
  mov    $0x1,%eax
  cmp    %rdx,%r8
  ja     L88
  mov    %r8,%rax
  mov    %esi,%r12d
  mov    %r8,%rsi
  mov    %rcx,%rbx
  movabs $0xcccccccccccccccd,%rdx
  mul    %rdx
  mov    %rdx,%rax
  shr    $0x4,%rax
  mov    %rax,0x18(%rsp)
  lea    (%rax,%rax,4),%rax
  shl    $0x2,%rax
  sub    %rax,%rsi
  mov    %rsi,0x20(%rsp)
  cmp    $0x13,%r8
  jbe    L210
  mov    %edi,%eax
  mov    %rbx,0x10(%rsp)
  lea    0x58(%rsp),%r13
  mov    %rax,(%rsp)
  lea    0x5c(%rsp),%rax
  mov    %rax,0x28(%rsp)
  lea    0x80(%rsp),%rax
  mov    %rax,0x30(%rsp)
  lea    0x94(%rsp),%rax
  movq   $0x1,0x8(%rsp)
  mov    %rax,0x38(%rsp)
L249:
  mov    0x28(%rsp),%r15
  mov    0x8(%rsp),%edx
  lea    D4(%rip),%rsi
  mov    %r15,%rdi
  call   <sprintf@plt>
  xor    %eax,%eax
  call   <EVP_sha1@plt>
  sub    $0x8,%rsp
  mov    %r15,%rcx
  mov    %r12d,%edx
  push   %r13
  mov    0x40(%rsp),%rbx
  mov    %eax,%edi
  mov    $0x4,%r8d
  mov    %rbp,%rsi
  mov    %rbx,%r9
  call   <HMAC@plt>
  mov    0xa0(%rsp),%eax
  movdqa 0x90(%rsp),%xmm1
  mov    %eax,0x80(%rsp)
  movaps %xmm1,0x70(%rsp)
  pop    %r10
  pop    %r11
  cmpq   $0x1,(%rsp)
  jbe    L18
  mov    0x38(%rsp),%r14
  mov    $0x1,%r15d
  jmp    L131
  nopl   (%rax)
L137:
  mov    %rax,%rbx
L131:
  xor    %eax,%eax
  add    $0x1,%r15
  call   <EVP_sha1@plt>
  sub    $0x8,%rsp
  mov    %r14,%r9
  mov    %rbx,%rcx
  push   %r13
  mov    $0x14,%r8d
  mov    %r12d,%edx
  mov    %eax,%edi
  mov    %rbp,%rsi
  call   <HMAC@plt>
  movzbl 0x80(%rsp),%edx
  xor    %eax,%eax
  xor    0x10(%r14),%dl
  mov    %dl,%al
  movzbl 0x81(%rsp),%edx
  xor    0x11(%r14),%dl
  mov    %dl,%ah
  movzbl 0x82(%rsp),%edx
  xor    0x12(%r14),%dl
  movzbl %dl,%edx
  movzbl 0x83(%rsp),%ecx
  movzwl %ax,%eax
  xor    0x13(%r14),%cl
  shl    $0x10,%edx
  movdqu (%r14),%xmm0
  shl    $0x18,%ecx
  pxor   0x70(%rsp),%xmm0
  or     %edx,%eax
  or     %ecx,%eax
  movaps %xmm0,0x70(%rsp)
  mov    %eax,0x80(%rsp)
  mov    %r14,%rax
  pop    %r8
  mov    %rbx,%r14
  pop    %r9
  cmp    %r15,(%rsp)
  jne    L137
L18:
  mov    0x10(%rsp),%rbx
  mov    0x70(%rsp),%eax
  movdqa 0x60(%rsp),%xmm2
  addq   $0x1,0x8(%rsp)
  mov    %eax,0x10(%rbx)
  add    $0x14,%rbx
  mov    0x8(%rsp),%rax
  movups %xmm2,-0x14(%rbx)
  mov    %rbx,0x10(%rsp)
  cmp    %rax,0x18(%rsp)
  jae    L249
  mov    0x18(%rsp),%rsi
  mov    $0x2,%eax
  lea    0x1(%rsi),%rcx
  lea    (%rsi,%rsi,4),%rdx
  cmp    %rax,%rcx
  cmovae %rcx,%rax
  shl    $0x2,%rdx
  cmp    $0x1,%rcx
  mov    $0x14,%ecx
  cmovbe %rcx,%rdx
  add    %rdx,0x40(%rsp)
L121:
  cmpq   $0x0,0x20(%rsp)
  jne    L160
L20:
  xor    %eax,%eax
L88:
  mov    0xa8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L246
  add    $0xb8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L160:
  lea    0x5c(%rsp),%r14
  mov    %eax,%edx
  lea    D4(%rip),%rsi
  mov    %r14,%rdi
  lea    0x80(%rsp),%rbx
  call   <sprintf@plt>
  xor    %eax,%eax
  call   <EVP_sha1@plt>
  sub    $0x8,%rsp
  mov    %rbp,%rsi
  mov    %rbx,%r9
  lea    0x60(%rsp),%r13
  mov    %eax,%edi
  mov    $0x4,%r8d
  mov    %r14,%rcx
  push   %r13
  mov    %r12d,%edx
  call   <HMAC@plt>
  mov    0xa0(%rsp),%eax
  mov    0x5c(%rsp),%esi
  movdqa 0x90(%rsp),%xmm3
  mov    %eax,0x80(%rsp)
  mov    %rsi,%rax
  mov    %rsi,0x10(%rsp)
  movaps %xmm3,0x70(%rsp)
  pop    %rsi
  pop    %rdi
  cmp    $0x1,%eax
  jbe    L155
  lea    0x94(%rsp),%r14
  mov    $0x1,%r15d
  jmp    L259
  nopl   0x0(%rax)
L12:
  mov    %rax,%rbx
L259:
  xor    %eax,%eax
  add    $0x1,%r15
  call   <EVP_sha1@plt>
  sub    $0x8,%rsp
  mov    %r14,%r9
  mov    %rbx,%rcx
  push   %r13
  mov    %r12d,%edx
  mov    %eax,%edi
  mov    $0x14,%r8d
  mov    %rbp,%rsi
  call   <HMAC@plt>
  movzbl 0x80(%rsp),%edx
  xor    %eax,%eax
  xor    0x10(%r14),%dl
  mov    %dl,%al
  movzbl 0x81(%rsp),%edx
  xor    0x11(%r14),%dl
  mov    %dl,%ah
  movzbl 0x82(%rsp),%edx
  xor    0x12(%r14),%dl
  movzbl %dl,%edx
  movzbl 0x83(%rsp),%ecx
  movzwl %ax,%eax
  xor    0x13(%r14),%cl
  shl    $0x10,%edx
  movdqu (%r14),%xmm0
  shl    $0x18,%ecx
  pxor   0x70(%rsp),%xmm0
  or     %edx,%eax
  or     %ecx,%eax
  movaps %xmm0,0x70(%rsp)
  mov    %eax,0x80(%rsp)
  mov    %r14,%rax
  pop    %rdx
  mov    %rbx,%r14
  pop    %rcx
  cmp    %r15,(%rsp)
  jne    L12
L155:
  mov    0x20(%rsp),%rsi
  lea    -0x8(%rsi),%rax
  cmp    $0xfff7,%rax
  ja     L42
  lea    -0x1(%rsi),%rax
  cmp    $0xe,%rax
  jbe    L207
  mov    0x40(%rsp),%rax
  movdqa 0x60(%rsp),%xmm4
  lea    0x10(%rax),%rdx
  movups %xmm4,(%rax)
  cmp    $0x10,%rsi
  je     L20
  mov    $0x10,%eax
  mov    %rsi,%rdi
L241:
  movzwl %ax,%ecx
  movzbl 0x60(%rsp,%rcx,1),%ecx
  mov    %cl,(%rdx)
  lea    0x1(%rax),%ecx
  movzwl %cx,%esi
  cmp    %rsi,%rdi
  jbe    L20
  and    $0x3f,%ecx
  movzbl 0x60(%rsp,%rcx,1),%ecx
  mov    %cl,0x1(%rdx)
  lea    0x2(%rax),%ecx
  movzwl %cx,%esi
  cmp    %rdi,%rsi
  jae    L20
  movzbl 0x60(%rsp,%rsi,1),%ecx
  mov    %cl,0x2(%rdx)
  lea    0x3(%rax),%ecx
  movzwl %cx,%esi
  cmp    %rdi,%rsi
  jae    L20
  and    $0x3f,%ecx
  movzbl 0x60(%rsp,%rcx,1),%ecx
  mov    %cl,0x3(%rdx)
  lea    0x4(%rax),%ecx
  movzwl %cx,%esi
  cmp    %rsi,%rdi
  jbe    L20
  movzbl 0x60(%rsp,%rsi,1),%ecx
  mov    %cl,0x4(%rdx)
  lea    0x5(%rax),%ecx
  movzwl %cx,%esi
  cmp    %rsi,%rdi
  jbe    L20
  and    $0x3f,%ecx
  add    $0x6,%eax
  movzbl 0x60(%rsp,%rcx,1),%ecx
  mov    %cl,0x5(%rdx)
  movzwl %ax,%ecx
  cmp    %rcx,%rdi
  jbe    L20
  movzbl 0x60(%rsp,%rcx,1),%eax
  mov    %al,0x6(%rdx)
  jmp    L20
L207:
  mov    0x40(%rsp),%rdi
  mov    0x60(%rsp),%rax
  cmpq   $0x8,0x20(%rsp)
  mov    %rax,(%rdi)
  lea    0x8(%rdi),%rdx
  je     L20
  mov    $0x8,%eax
  mov    %rsi,%rdi
  jmp    L241
L210:
  mov    $0x1,%eax
  jmp    L121
L42:
  mov    0x40(%rsp),%rdx
  xor    %eax,%eax
L140:
  movzwl %ax,%ecx
  add    $0x1,%eax
  add    $0x1,%rdx
  movzbl 0x60(%rsp,%rcx,1),%ecx
  mov    %cl,-0x1(%rdx)
  movzwl %ax,%ecx
  cmp    0x20(%rsp),%rcx
  jb     L140
  jmp    L20
L246:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D4
type_guessed: string

tool: D4: %04u

assistant: ```c
int pbkdf2(const unsigned char *pw, unsigned int pwlen, unsigned int ic, unsigned char *dk, unsigned long long dklen) {
  unsigned long l, r, i, j;
  unsigned char txt[4], hash[(20) * 2], tmp[(20)], *p = dk, *lhix, *hix, *swap;
  unsigned short k;
  unsigned int outlen;
  if (dklen > ((((unsigned long long)1) << 32) - 1) * (20)) {
    return 1;
  }
  l = dklen / (20);
  r = dklen % (20);
  for (i = 1; i <= l; i++) {
    sprintf((char *)txt, "%04u", (unsigned int)i);
    HMAC(EVP_sha1(), pw, pwlen, txt, 4, hash, &outlen);
    lhix = hash;
    hix = hash + (20);
    for (k = 0; k < (20); k++) {
      tmp[k] = hash[k];
    }
    for (j = 1; j < ic; j++) {
      HMAC(EVP_sha1(), pw, pwlen, lhix, (20), hix, &outlen);
      for (k = 0; k < (20); k++) {
        tmp[k] ^= hix[k];
      }
      swap = hix;
      hix = lhix;
      lhix = swap;
    }
    for (k = 0; k < (20); k++) {
      *p++ = tmp[k];
    }
  }
  if (r) {
    sprintf((char *)txt, "%04u", (unsigned int)i);
    HMAC(EVP_sha1(), pw, pwlen, txt, 4, hash, &outlen);
    lhix = hash;
    hix = hash + (20);
    for (k = 0; k < (20); k++) {
      tmp[k] = hash[k];
    }
    for (j = 1; j < ic; j++) {
      HMAC(EVP_sha1(), pw, pwlen, lhix, (20), hix, &outlen);
      for (k = 0; k < (20); k++) {
        tmp[k] ^= hix[k];
      }
      swap = hix;
      hix = lhix;
      lhix = swap;
    }
    for (k = 0; k < r; k++) {
      *p++ = tmp[k];
    }
  }
  return 0;
}
```