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

```asm
<main>:
  endbr64
  push   %r15
  pxor   %xmm0,%xmm0
  push   %r14
  push   %r13
  push   %r12
  lea    D56(%rip),%r12
  push   %rbp
  push   %rbx
  sub    $0x118,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  movaps %xmm0,0x40(%rsp)
  lea    0x40(%rsp),%r14
  movaps %xmm0,0x50(%rsp)
  mov    %r14,%rbp
  movaps %xmm0,0x60(%rsp)
  movaps %xmm0,0x70(%rsp)
  movaps %xmm0,0x80(%rsp)
  movaps %xmm0,0x90(%rsp)
  movaps %xmm0,0xa0(%rsp)
  movaps %xmm0,0xb0(%rsp)
  movaps %xmm0,0xc0(%rsp)
  movaps %xmm0,0xd0(%rsp)
  movaps %xmm0,0xe0(%rsp)
  movaps %xmm0,0xf0(%rsp)
  movdqa D75(%rip),%xmm0
  movb   $0x0,0x100(%rsp)
  movaps %xmm0,0x10(%rsp)
  movdqa D32(%rip),%xmm0
  movl   $0x0,0xc(%rsp)
  movaps %xmm0,0x20(%rsp)
  movl   $0x16d6f63,0x30(%rsp)
  movb   $0x0,0x34(%rsp)
  call   <ERR_load_crypto_strings@plt>
  xor    %eax,%eax
  call   <OpenSSL_add_all_algorithms@plt>
  xor    %edi,%edi
  call   <OPENSSL_config@plt>
  xor    %eax,%eax
  call   <EVP_sha512@plt>
  push   %r14
  mov    $0x8,%esi
  lea    D26(%rip),%rdi
  push   $0x40
  mov    %eax,%r9d
  mov    $0x100,%r8d
  mov    $0x4,%ecx
  lea    D70(%rip),%rdx
  lea    0x90(%rsp),%r15
  lea    0x110(%rsp),%r13
  call   <PKCS5_PBKDF2_HMAC@plt>
  mov    %r15,%rbx
  pop    %rsi
  pop    %rdi
  nop
L44:
  movzbl 0x0(%rbp),%edx
  mov    %rbx,%rdi
  mov    %r12,%rsi
  add    $0x2,%rbx
  add    $0x1,%rbp
  call   <sprintf@plt>
  cmp    %rbx,%r13
  jne    L44
  lea    D54(%rip),%rdi
  xor    %ebx,%ebx
  lea    D38(%rip),%rbp
  call   <puts@plt>
  nopl   0x0(%rax)
L29:
  mov    (%r14,%rbx,4),%edi
  call   <ntohl@plt>
  mov    %ebx,%esi
  mov    %rbp,%rdi
  add    $0x1,%rbx
  mov    %eax,%edx
  xor    %eax,%eax
  call   <printf@plt>
  cmp    $0x10,%rbx
  jne    L29
  xor    %eax,%eax
  call   <EVP_sha512@plt>
  lea    0x10(%rsp),%rcx
  xor    %r9d,%r9d
  mov    %r14,%rsi
  sub    $0x8,%rsp
  mov    %eax,%edi
  mov    $0x40,%edx
  mov    $0x25,%r8d
  lea    0x14(%rsp),%rax
  push   %rax
  call   <HMAC@plt>
  mov    0x1c(%rsp),%esi
  lea    D114(%rip),%rdi
  mov    %rax,%r13
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x1c(%rsp),%eax
  pop    %rdx
  pop    %rcx
  test   %eax,%eax
  je     L28
  xor    %ebx,%ebx
  nopl   0x0(%rax,%rax,1)
L45:
  movzbl 0x0(%r13,%rbx,1),%edx
  lea    (%r15,%rbx,2),%rdi
  mov    %r12,%rsi
  add    $0x1,%rbx
  call   <sprintf@plt>
  mov    0xc(%rsp),%eax
  cmp    %ebx,%eax
  ja     L45
L28:
  movb   $0x0,0x0(%r13,%rax,1)
  mov    %r13,%rsi
  lea    D34(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D65(%rip),%rdi
  call   <puts@plt>
  mov    0xc(%rsp),%eax
  shr    $0x2,%eax
  je     L32
  xor    %ebx,%ebx
  nopl   0x0(%rax)
L12:
  mov    0x0(%r13,%rbx,4),%edi
  call   <ntohl@plt>
  mov    %ebx,%esi
  mov    %rbp,%rdi
  add    $0x1,%rbx
  mov    %eax,%edx
  xor    %eax,%eax
  call   <printf@plt>
  mov    0xc(%rsp),%eax
  shr    $0x2,%eax
  cmp    %ebx,%eax
  ja     L12
L32:
  mov    %r15,%rsi
  lea    D4(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x40,%esi
  mov    %r13,%rdi
  call   <base64@plt>
  lea    D42(%rip),%rdi
  mov    %rax,%rsi
  xor    %eax,%eax
  call   <printf@plt>
  xor    %eax,%eax
  call   <EVP_cleanup@plt>
  xor    %eax,%eax
  call   <CRYPTO_cleanup_all_ex_data@plt>
  xor    %eax,%eax
  call   <ERR_free_strings@plt>
  mov    0x108(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L40
  add    $0x118,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L40:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D56
datatype: string
name: retrieve_data
arguments: label: D75
datatype: byte[16]
name: retrieve_data
arguments: label: D32
datatype: byte[16]
name: retrieve_data
arguments: label: D26
datatype: string
name: retrieve_data
arguments: label: D70
datatype: string
name: retrieve_data
arguments: label: D54
datatype: string
name: retrieve_data
arguments: label: D38
datatype: string
name: retrieve_data
arguments: label: D114
datatype: string
name: retrieve_data
arguments: label: D34
datatype: string
name: retrieve_data
arguments: label: D65
datatype: string
name: retrieve_data
arguments: label: D4
datatype: string
name: retrieve_data
arguments: label: D42
datatype: string

tool: D56: %02x

tool: {"D75": [0x95,0xb1,0x4f,0x6e,0x65,0x53,0x68,0x61,0x6c,0x6c,0x50,0x61,0x73,0x73,0x20,0x76]}

tool: {"D32": [0x32,0x2e,0x30,0xa4,0x73,0x61,0x6c,0x74,0xaa,0x67,0x6f,0x6f,0x67,0x6c,0x65,0x2e]}

tool: D26: password

tool: D70: salt

tool: D54: dk:

tool: D38: [%d] %d


tool: D114: md_len: %d


tool: D34: digest raw: %s


tool: D65: digest:

tool: D4: digest %s


tool: D42: digest base64 %s


assistant: ```c
int main(int argc, char **argv) {
  char derived_key[64] = {0};
  char hexResult[2 * 64 + 1] = {0};
  unsigned int md_len = 0;
  unsigned char data[] = {149, 177, 79, 110, 101, 83, 104, 97, 108, 108, 80, 97, 115, 115, 32, 118, 50, 46, 48, 164, 115, 97, 108, 116, 170, 103, 111, 111, 103, 108, 101, 46, 99, 111, 109, 1, 0};
  int i;
  ERR_load_crypto_strings();
  OpenSSL_add_all_algorithms();
  OPENSSL_config(NULL);
  PKCS5_PBKDF2_HMAC("password", 8, "salt", 4, 256, EVP_sha512(), 64, derived_key);
  for (i = 0; i < 64; i++) {
    sprintf(hexResult + (i * 2), "%02x", 255 & derived_key[i]);
  };
  printf("dk:\n");
  for (i = 0; i < 64 / 4; i++) {
    printf("[%d] %d\n", i, ntohl(*(int *)(derived_key + 4 * i)));
  }
  unsigned char *digest = HMAC(EVP_sha512(), derived_key, 64, data, sizeof(data), NULL, &md_len);
  printf("md_len: %d\n", md_len);
  for (i = 0; i < md_len; i++) {
    sprintf(hexResult + (i * 2), "%02x", 255 & digest[i]);
  };
  digest[md_len] = 0;
  printf("digest raw: %s\n", digest);
  printf("digest:\n");
  for (i = 0; i < md_len / 4; i++) {
    printf("[%d] %d\n", i, ntohl(*(int *)(digest + i * 4)));
  }
  printf("digest %s\n", hexResult);
  printf("digest base64 %s\n", base64(digest, 64));
  EVP_cleanup();
  CRYPTO_cleanup_all_ex_data();
  ERR_free_strings();
  return 0;
}
```