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

```asm
<KeyMD5Encode>:
  endbr64
  push   %r15
  pxor   %xmm0,%xmm0
  push   %r14
  mov    %r8d,%r14d
  push   %r13
  mov    %rcx,%r13
  mov    $0x86,%ecx
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %rsi,%rbp
  mov    $0x36,%esi
  push   %rbx
  mov    %edx,%ebx
  mov    $0x40,%edx
  sub    $0x578,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x568(%rsp)
  xor    %eax,%eax
  lea    0x10(%rsp),%r8
  lea    0x50(%rsp),%r15
  movaps %xmm0,0x10(%rsp)
  lea    0x130(%rsp),%rdi
  mov    %r8,0x8(%rsp)
  movaps %xmm0,0x20(%rsp)
  movaps %xmm0,0x30(%rsp)
  movaps %xmm0,0x40(%rsp)
  movaps %xmm0,0x50(%rsp)
  rep stos %rax,%es:(%rdi)
  movaps %xmm0,0x60(%rsp)
  movaps %xmm0,0x70(%rsp)
  movaps %xmm0,0x80(%rsp)
  movaps %xmm0,0x90(%rsp)
  movaps %xmm0,0xa0(%rsp)
  movaps %xmm0,0xb0(%rsp)
  movb   $0x0,(%rdi)
  mov    %r8,%rdi
  movaps %xmm0,0xc0(%rsp)
  movaps %xmm0,0x120(%rsp)
  movaps %xmm0,0xd0(%rsp)
  movaps %xmm0,0xe0(%rsp)
  movaps %xmm0,0xf0(%rsp)
  movaps %xmm0,0x100(%rsp)
  movaps %xmm0,0x110(%rsp)
  call   <memset@plt>
  mov    $0x40,%edx
  mov    $0x5c,%esi
  mov    %r15,%rdi
  call   <memset@plt>
  mov    %r13,%rsi
  lea    0x90(%rsp),%rdi
  mov    %r14d,%edx
  call   <memcpy@plt>
  movdqa 0x10(%rsp),%xmm1
  mov    0x8(%rsp),%rsi
  lea    0x120(%rsp),%r13
  movdqa 0x90(%rsp),%xmm0
  mov    $0x40,%edx
  mov    %r13,%rdi
  pxor   %xmm0,%xmm1
  pxor   0x50(%rsp),%xmm0
  movaps %xmm1,0x10(%rsp)
  movdqa 0x20(%rsp),%xmm1
  movaps %xmm0,0x50(%rsp)
  movdqa 0xa0(%rsp),%xmm0
  pxor   %xmm0,%xmm1
  pxor   0x60(%rsp),%xmm0
  movaps %xmm1,0x20(%rsp)
  movdqa 0x30(%rsp),%xmm1
  movaps %xmm0,0x60(%rsp)
  movdqa 0xb0(%rsp),%xmm0
  pxor   %xmm0,%xmm1
  pxor   0x70(%rsp),%xmm0
  movaps %xmm1,0x30(%rsp)
  movdqa 0x40(%rsp),%xmm1
  movaps %xmm0,0x70(%rsp)
  movdqa 0xc0(%rsp),%xmm0
  pxor   %xmm0,%xmm1
  pxor   0x80(%rsp),%xmm0
  movaps %xmm1,0x40(%rsp)
  movaps %xmm0,0x80(%rsp)
  call   <memcpy@plt>
  mov    %rbp,%rsi
  lea    0x160(%rsp),%rdi
  mov    %ebx,%edx
  call   <memcpy@plt>
  lea    0x40(%rbx),%eax
  lea    0xd0(%rsp),%rbp
  mov    %r13,%rdi
  mov    %rax,%rsi
  lea    0x110(%rsp),%rdx
  movb   $0x0,0x120(%rsp,%rax,1)
  call   <MDString@plt>
  mov    $0x40,%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <memcpy@plt>
  mov    %r12,%rdx
  mov    $0x50,%esi
  mov    %rbp,%rdi
  call   <MDString@plt>
  mov    0x568(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  add    $0x578,%rsp
  mov    $0x10,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
unsigned int KeyMD5Encode(unsigned char *szEncoded, const unsigned char *szData, unsigned int nSize, unsigned char *szKey, unsigned int nKeyLen) {
  unsigned char ipad[64] = {0}, opad[64] = {0};
  unsigned char K[64] = {0};
  unsigned char firstPad[64 + 1024 + 1] = {0};
  unsigned char midResult[64 + 16] = {0};
  int i;
  memset(ipad, 0x36, 64);
  memset(opad, 0x5c, 64);
  memcpy(K, szKey, nKeyLen);
  for (i = 0; i < 64; i++) {
    ipad[i] ^= K[i];
    opad[i] ^= K[i];
  }
  memcpy(firstPad, ipad, 64);
  memcpy(firstPad + 64, szData, nSize);
  firstPad[64 + nSize] = '\x0';
  MDString(firstPad, 64 + nSize, midResult + 64);
  memcpy(midResult, opad, 64);
  MDString(midResult, 64 + 16, szEncoded);
  return 16;
}
```