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

```asm
<md5>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  lea    0x0(,%rsi,8),%r13d
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x248,%rsp
  movdqa D99(%rip),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x238(%rsp)
  xor    %eax,%eax
  lea    0x1(%r13),%eax
  movaps %xmm0,0x30(%rsp)
  mov    %eax,%edx
  movaps %xmm0,0x40(%rsp)
  and    $0x800001ff,%edx
  movaps %xmm0,0x50(%rsp)
  movaps %xmm0,0x60(%rsp)
  movdqa D48(%rip),%xmm0
  movaps %xmm0,0x70(%rsp)
  movaps %xmm0,0x80(%rsp)
  movaps %xmm0,0x90(%rsp)
  movaps %xmm0,0xa0(%rsp)
  movdqa D108(%rip),%xmm0
  movaps %xmm0,0xb0(%rsp)
  movaps %xmm0,0xc0(%rsp)
  movaps %xmm0,0xd0(%rsp)
  movaps %xmm0,0xe0(%rsp)
  movdqa D155(%rip),%xmm0
  movaps %xmm0,0xf0(%rsp)
  movaps %xmm0,0x100(%rsp)
  movaps %xmm0,0x110(%rsp)
  movaps %xmm0,0x120(%rsp)
  movdqa D15(%rip),%xmm0
  movaps %xmm0,0x130(%rsp)
  movdqa D146(%rip),%xmm0
  movaps %xmm0,0x140(%rsp)
  movdqa D104(%rip),%xmm0
  movaps %xmm0,0x150(%rsp)
  movdqa D10(%rip),%xmm0
  movaps %xmm0,0x160(%rsp)
  movdqa D152(%rip),%xmm0
  movaps %xmm0,0x170(%rsp)
  movdqa D164(%rip),%xmm0
  movaps %xmm0,0x180(%rsp)
  movdqa D185(%rip),%xmm0
  movaps %xmm0,0x190(%rsp)
  movdqa D161(%rip),%xmm0
  movaps %xmm0,0x1a0(%rsp)
  movdqa D6(%rip),%xmm0
  movaps %xmm0,0x1b0(%rsp)
  movdqa D191(%rip),%xmm0
  movaps %xmm0,0x1c0(%rsp)
  movdqa D39(%rip),%xmm0
  movaps %xmm0,0x1d0(%rsp)
  movdqa D21(%rip),%xmm0
  movaps %xmm0,0x1e0(%rsp)
  movdqa D20(%rip),%xmm0
  movaps %xmm0,0x1f0(%rsp)
  movdqa D193(%rip),%xmm0
  movaps %xmm0,0x200(%rsp)
  movdqa D201(%rip),%xmm0
  movaps %xmm0,0x210(%rsp)
  movdqa D103(%rip),%xmm0
  movaps %xmm0,0x220(%rsp)
  cmp    $0x1c0,%edx
  je     L51
  nopl   0x0(%rax,%rax,1)
L11:
  add    $0x1,%eax
  mov    %eax,%edx
  and    $0x800001ff,%edx
  cmp    $0x1c0,%edx
  jne    L11
L51:
  sar    $0x3,%eax
  mov    $0x1,%esi
  lea    0x40(%rax),%edi
  mov    %eax,%r14d
  mov    %eax,0x10(%rsp)
  call   <calloc@plt>
  mov    %rbx,%rdx
  mov    %r12,%rsi
  mov    %rax,%rbp
  mov    %rax,%rdi
  xor    %eax,%eax
  call   <memcpy@plt>
  movl   $0x80,0x0(%rbp,%rbx,4)
  movslq %r14d,%rax
  lea    0x2c(%rsp),%rsi
  lea    0x0(%rbp,%rax,4),%rdi
  mov    $0x4,%edx
  xor    %eax,%eax
  mov    %r13d,0x2c(%rsp)
  call   <memcpy@plt>
  test   %r14d,%r14d
  jle    L61
  movl   $0x10325476,0x8(%rsp)
  xor    %r10d,%r10d
  mov    $0xefcdab89,%r12d
  mov    $0x67452301,%r13d
  movl   $0x98badcfe,0xc(%rsp)
  lea    0x130(%rsp),%r14
  lea    0x30(%rsp),%rbx
  mov    $0x20,%r11d
  xchg   %ax,%ax
L105:
  mov    0x8(%rsp),%r9d
  mov    0xc(%rsp),%r8d
  mov    %r12d,%edi
  mov    %r13d,%edx
  xor    %esi,%esi
  jmp    L32
  nopl   0x0(%rax)
L46:
  mov    %r9d,%eax
  cmp    $0x2f,%esi
  jg     L39
  xor    %r8d,%eax
  lea    0x5(%rsi,%rsi,2),%ecx
  xor    %edi,%eax
  and    $0xf,%ecx
L66:
  movslq %ecx,%rcx
  mov    (%rbx,%rsi,4),%r15d
  add    %edx,%eax
  add    (%r14,%rsi,4),%eax
  add    %r10,%rcx
  add    $0x1,%rsi
  add    0x0(%rbp,%rcx,4),%eax
  mov    %r11d,%ecx
  sub    %r15d,%ecx
  mov    %eax,%edx
  sar    %cl,%edx
  mov    %r15d,%ecx
  shl    %cl,%eax
  or     %edx,%eax
  mov    %r9d,%edx
  add    %edi,%eax
  cmp    $0x40,%rsi
  je     L58
  mov    %r8d,%r9d
  mov    %edi,%r8d
  mov    %eax,%edi
L32:
  mov    %esi,%ecx
  cmp    $0xf,%rsi
  jbe    L56
  cmp    $0x1f,%esi
  jg     L46
  mov    %r8d,%eax
  lea    0x1(%rsi,%rsi,4),%ecx
  xor    %edi,%eax
  and    $0xf,%ecx
  and    %r9d,%eax
  xor    %r8d,%eax
  jmp    L66
  nopl   (%rax)
L56:
  mov    %r9d,%eax
  xor    %r8d,%eax
  and    %edi,%eax
  xor    %r9d,%eax
  jmp    L66
  nopl   (%rax)
L39:
  lea    0x0(,%rsi,8),%r15d
  not    %eax
  sub    %esi,%r15d
  or     %edi,%eax
  mov    %r15d,%ecx
  xor    %r8d,%eax
  and    $0xf,%ecx
  jmp    L66
  nopl   (%rax)
L58:
  add    %edi,0xc(%rsp)
  add    %r9d,%r13d
  add    %eax,%r12d
  add    $0x40,%r10
  add    %r8d,0x8(%rsp)
  cmp    %r10d,0x10(%rsp)
  jg     L105
L114:
  mov    %rbp,%rdi
  lea    D115(%rip),%rbp
  call   <free@plt>
  mov    $0x1,%esi
  mov    $0x21,%edi
  call   <calloc@plt>
  mov    0x28(%rsp),%r9d
  xor    %ecx,%ecx
  mov    %r13d,%edx
  mov    0x20(%rsp),%r8d
  mov    %rbp,%rsi
  mov    %rax,%rdi
  mov    %rax,%r14
  mov    %ecx,0x1c(%rsp)
  mov    %ecx,0x18(%rsp)
  mov    %ecx,0x14(%rsp)
  call   <sprintf@plt>
  mov    0x28(%rsp),%r9d
  xor    %ecx,%ecx
  lea    0x8(%r14),%rdi
  mov    0x20(%rsp),%r8d
  mov    %r12d,%edx
  mov    %rbp,%rsi
  mov    %ecx,0x1c(%rsp)
  mov    %ecx,0x18(%rsp)
  mov    %ecx,0x14(%rsp)
  call   <sprintf@plt>
  mov    0x28(%rsp),%r9d
  mov    0xc(%rsp),%edx
  xor    %ecx,%ecx
  mov    0x20(%rsp),%r8d
  lea    0x10(%r14),%rdi
  mov    %rbp,%rsi
  mov    %ecx,0x1c(%rsp)
  mov    %ecx,0x18(%rsp)
  mov    %ecx,0x14(%rsp)
  call   <sprintf@plt>
  mov    0x28(%rsp),%r9d
  mov    0x8(%rsp),%edx
  xor    %ecx,%ecx
  mov    0x20(%rsp),%r8d
  lea    0x18(%r14),%rdi
  mov    %rbp,%rsi
  mov    %ecx,0x1c(%rsp)
  mov    %ecx,0x18(%rsp)
  mov    %ecx,0x14(%rsp)
  call   <sprintf@plt>
  movb   $0x0,0x20(%r14)
  mov    0x238(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L96
  add    $0x248,%rsp
  mov    %r14,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L61:
  movl   $0x10325476,0x8(%rsp)
  mov    $0xefcdab89,%r12d
  mov    $0x67452301,%r13d
  movl   $0x98badcfe,0xc(%rsp)
  jmp    L114
L96:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D99
data_type: byte[16]
name: unpack_data
arguments: label: D48
data_type: byte[16]
name: unpack_data
arguments: label: D108
data_type: byte[16]
name: unpack_data
arguments: label: D155
data_type: byte[16]
name: unpack_data
arguments: label: D15
data_type: byte[16]
name: unpack_data
arguments: label: D146
data_type: byte[16]
name: unpack_data
arguments: label: D104
data_type: byte[16]
name: unpack_data
arguments: label: D10
data_type: byte[16]
name: unpack_data
arguments: label: D152
data_type: byte[16]
name: unpack_data
arguments: label: D164
data_type: byte[16]
name: unpack_data
arguments: label: D185
data_type: byte[16]
name: unpack_data
arguments: label: D161
data_type: byte[16]
name: unpack_data
arguments: label: D6
data_type: byte[16]
name: unpack_data
arguments: label: D191
data_type: byte[16]
name: unpack_data
arguments: label: D39
data_type: byte[16]
name: unpack_data
arguments: label: D21
data_type: byte[16]
name: unpack_data
arguments: label: D20
data_type: byte[16]
name: unpack_data
arguments: label: D193
data_type: byte[16]
name: unpack_data
arguments: label: D201
data_type: byte[16]
name: unpack_data
arguments: label: D103
data_type: byte[16]
name: unpack_data
arguments: label: D115
data_type: string

tool: {"D99": [0x07,0x00,0x00,0x00,0x0c,0x00,0x00,0x00,0x11,0x00,0x00,0x00,0x16,0x00,0x00,0x00]}

tool: {"D48": [0x05,0x00,0x00,0x00,0x09,0x00,0x00,0x00,0x0e,0x00,0x00,0x00,0x14,0x00,0x00,0x00]}

tool: {"D108": [0x04,0x00,0x00,0x00,0x0b,0x00,0x00,0x00,0x10,0x00,0x00,0x00,0x17,0x00,0x00,0x00]}

tool: {"D155": [0x06,0x00,0x00,0x00,0x0a,0x00,0x00,0x00,0x0f,0x00,0x00,0x00,0x15,0x00,0x00,0x00]}

tool: {"D15": [0x78,0xa4,0x6a,0xd7,0x56,0xb7,0xc7,0xe8,0xdb,0x70,0x20,0x24,0xee,0xce,0xbd,0xc1]}

tool: {"D146": [0xaf,0x0f,0x7c,0xf5,0x2a,0xc6,0x87,0x47,0x13,0x46,0x30,0xa8,0x01,0x95,0x46,0xfd]}

tool: {"D104": [0xd8,0x98,0x80,0x69,0xaf,0xf7,0x44,0x8b,0xb1,0x5b,0xff,0xff,0xbe,0xd7,0x5c,0x89]}

tool: {"D10": [0x22,0x11,0x90,0x6b,0x93,0x71,0x98,0xfd,0x8e,0x43,0x79,0xa6,0x21,0x08,0xb4,0x49]}

tool: {"D152": [0x62,0x25,0x1e,0xf6,0x40,0xb3,0x40,0xc0,0x51,0x5a,0x5e,0x26,0xaa,0xc7,0xb6,0xe9]}

tool: {"D164": [0x5d,0x10,0x2f,0xd6,0x53,0x14,0x44,0x02,0x81,0xe6,0xa1,0xd8,0xc8,0xfb,0xd3,0xe7]}

tool: {"D185": [0xe6,0xcd,0xe1,0x21,0xd6,0x07,0x37,0xc3,0x87,0x0d,0xd5,0xf4,0xed,0x14,0x5a,0x45]}

tool: {"D161": [0x05,0xe9,0xe3,0xa9,0xf8,0xa3,0xef,0xfc,0xd9,0x02,0x6f,0x67,0x8a,0x4c,0x2a,0x8d]}

tool: {"D6": [0x42,0x39,0xfa,0xff,0x81,0xf6,0x71,0x87,0x22,0x61,0x9d,0x6d,0x0c,0x38,0xe5,0xfd]}

tool: {"D191": [0x44,0xea,0xbe,0xa4,0xa9,0xcf,0xde,0x4b,0x60,0x4b,0xbb,0xf6,0x70,0xbc,0xbf,0xbe]}

tool: {"D39": [0xc6,0x7e,0x9b,0x28,0xfa,0x27,0xa1,0xea,0x85,0x30,0xef,0xd4,0x05,0x1d,0x88,0x04]}

tool: {"D21": [0x39,0xd0,0xd4,0xd9,0xe5,0x99,0xdb,0xe6,0xf8,0x7c,0xa2,0x1f,0x65,0x56,0xac,0xc4]}

tool: {"D20": [0x44,0x22,0x29,0xf4,0x97,0xff,0x2a,0x43,0xa7,0x23,0x94,0xab,0x39,0xa0,0x93,0xfc]}

tool: {"D193": [0xc3,0x59,0x5b,0x65,0x92,0xcc,0x0c,0x8f,0x7d,0xf4,0xef,0xff,0xd1,0x5d,0x84,0x85]}

tool: {"D201": [0x4f,0x7e,0xa8,0x6f,0xe0,0xe6,0x2c,0xfe,0x14,0x43,0x01,0xa3,0xa1,0x11,0x08,0x4e]}

tool: {"D103": [0x82,0x7e,0x53,0xf7,0x35,0xf2,0x3a,0xbd,0xbb,0xd2,0xd7,0x2a,0x91,0xd3,0x86,0xeb]}

tool: D115: %2.2x%2.2x%2.2x%2.2x

assistant: ```c
char *md5(char *initial_msg, size_t initial_len) {
  uint8_t *msg = NULL;
  uint32_t r[] = {7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21};
  uint32_t k[] = {0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee, 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501, 0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be, 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821, 0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa, 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8, 0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed, 0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a, 0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c, 0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70, 0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x04881d05, 0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665, 0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039, 0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1, 0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1, 0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391};
  uint32_t h0 = 0x67452301;
  uint32_t h1 = 0xefcdab89;
  uint32_t h2 = 0x98badcfe;
  uint32_t h3 = 0x10325476;
  int new_len;
  for (new_len = initial_len * 8 + 1; new_len % 512 != 448; new_len++)
    ;
  new_len /= 8;
  msg = calloc(new_len + 64, 1);
  memcpy(msg, initial_msg, initial_len);
  msg[initial_len] = 128;
  uint32_t bits_len = 8 * initial_len;
  memcpy(msg + new_len, &bits_len, 4);
  int offset;
  for (offset = 0; offset < new_len; offset += (512 / 8)) {
    uint32_t *w = (uint32_t *)(msg + offset);
    uint32_t a = h0;
    uint32_t b = h1;
    uint32_t c = h2;
    uint32_t d = h3;
    uint32_t i;
    for (i = 0; i < 64; i++) {
      uint32_t f, g;
      if (i < 16) {
        f = (b & c) | ((~b) & d);
        g = i;
      } else if (i < 32) {
        f = (d & b) | ((~d) & c);
        g = (5 * i + 1) % 16;
      } else if (i < 48) {
        f = b ^ c ^ d;
        g = (3 * i + 5) % 16;
      } else {
        f = c ^ (b | (~d));
        g = (7 * i) % 16;
      }
      uint32_t temp = d;
      d = c;
      c = b;
      b = b + ((((a + f + k[i] + w[g])) << (r[i])) | (((a + f + k[i] + w[g])) >> (32 - (r[i]))));
      a = temp;
    }
    h0 += a;
    h1 += b;
    h2 += c;
    h3 += d;
  }
  free(msg);
  char *output = calloc(33, 1);
  uint8_t *p = (uint8_t *)&h0;
  sprintf(output, "%2.2x%2.2x%2.2x%2.2x", p[0], p[1], p[2], p[3]);
  p = (uint8_t *)&h1;
  sprintf(&output[8], "%2.2x%2.2x%2.2x%2.2x", p[0], p[1], p[2], p[3]);
  p = (uint8_t *)&h2;
  sprintf(&output[16], "%2.2x%2.2x%2.2x%2.2x", p[0], p[1], p[2], p[3]);
  p = (uint8_t *)&h3;
  sprintf(&output[24], "%2.2x%2.2x%2.2x%2.2x", p[0], p[1], p[2], p[3]);
  output[32] = '\0';
  return output;
}
```