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

```asm
<InverseModify>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  mov    %esi,%r13d
  push   %r12
  lea    0x0(%r13,%r13,1),%r12d
  push   %rbp
  lea    0x1(%r12),%edi
  mov    %rdx,%rbp
  push   %rbx
  mov    %rcx,%rbx
  sub    $0x68,%rsp
  movdqa D4(%rip),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  movb   $0x0,0x50(%rsp)
  movaps %xmm0,0x40(%rsp)
  pxor   %xmm0,%xmm0
  movaps %xmm0,(%rsp)
  movaps %xmm0,0x10(%rsp)
  movaps %xmm0,0x20(%rsp)
  movaps %xmm0,0x30(%rsp)
  call   <malloc@plt>
  mov    %rax,%r15
  test   %r13d,%r13d
  jle    L1
  mov    %r14,%rdx
  mov    %rax,%rcx
  lea    (%rax,%r13,2),%rdi
  nopl   0x0(%rax,%rax,1)
L81:
  movzbl (%rdx),%eax
  add    $0x2,%rcx
  add    $0x1,%rdx
  shr    $0x4,%al
  and    $0xf,%eax
  movzbl 0x40(%rsp,%rax,1),%eax
  mov    %al,-0x2(%rcx)
  movzbl -0x1(%rdx),%eax
  mov    %eax,%esi
  and    $0xf,%eax
  movzbl 0x40(%rsp,%rax,1),%eax
  shr    $0x4,%sil
  and    $0xf,%esi
  mov    %al,-0x1(%rcx)
  movzbl -0x1(%rdx),%eax
  addl   $0x1,(%rsp,%rsi,4)
  and    $0xf,%eax
  addl   $0x1,(%rsp,%rax,4)
  cmp    %rdi,%rcx
  jne    L81
L1:
  movdqu 0x14(%rsp),%xmm1
  movdqu 0x4(%rsp),%xmm4
  movslq %r12d,%r12
  movd   (%rsp),%xmm6
  mov    0x38(%rsp),%edx
  movb   $0x0,(%r15,%r12,1)
  movdqa %xmm1,%xmm0
  mov    0x34(%rsp),%r14d
  pcmpgtd %xmm4,%xmm0
  pshufd $0x0,%xmm6,%xmm3
  cmp    %edx,%r14d
  cmovl  %edx,%r14d
  mov    0x3c(%rsp),%edx
  pand   %xmm0,%xmm1
  pandn  %xmm4,%xmm0
  por    %xmm1,%xmm0
  movdqu 0x24(%rsp),%xmm1
  cmp    %edx,%r14d
  cmovl  %edx,%r14d
  movdqa %xmm1,%xmm2
  pcmpgtd %xmm3,%xmm2
  pand   %xmm2,%xmm1
  pandn  %xmm3,%xmm2
  por    %xmm1,%xmm2
  movdqa %xmm0,%xmm1
  pcmpgtd %xmm2,%xmm1
  pand   %xmm1,%xmm0
  pandn  %xmm2,%xmm1
  por    %xmm1,%xmm0
  movdqa %xmm0,%xmm2
  psrldq $0x8,%xmm2
  movdqa %xmm2,%xmm1
  pcmpgtd %xmm0,%xmm1
  pand   %xmm1,%xmm2
  pandn  %xmm0,%xmm1
  por    %xmm2,%xmm1
  movdqa %xmm1,%xmm2
  psrldq $0x4,%xmm2
  movdqa %xmm2,%xmm0
  pcmpgtd %xmm1,%xmm0
  pand   %xmm0,%xmm2
  pandn  %xmm1,%xmm0
  por    %xmm2,%xmm0
  movd   %xmm0,%eax
  cmp    %eax,%r14d
  cmovl  %eax,%r14d
  xor    %r13d,%r13d
  mov    %r14d,%eax
  shl    $0x4,%eax
  mov    %eax,(%rbx)
  lea    0x1(%rax),%edi
  call   <malloc@plt>
  mov    %rax,0x0(%rbp)
  jmp    L49
  xchg   %ax,%ax
L10:
  movzbl (%r15,%r13,1),%edx
  mov    0x0(%rbp),%rax
  mov    %dl,(%rax,%r13,1)
  add    $0x1,%r13
L49:
  mov    %r15,%rdi
  mov    %r13d,%r12d
  call   <strlen@plt>
  cmp    %r13d,%eax
  jg     L10
  mov    %r15,%rdi
  call   <free@plt>
  xor    %r8d,%r8d
  mov    %rsp,%r10
  lea    -0x1(%r14),%r11d
  nopl   0x0(%rax,%rax,1)
L11:
  mov    (%r10,%r8,4),%r9d
  cmp    %r14d,%r9d
  jge    L51
  movslq %r12d,%rdx
  mov    %r11d,%esi
  movzbl 0x40(%rsp,%r8,1),%edi
  sub    %r9d,%esi
  lea    0x1(%rdx),%rax
  add    %rax,%rsi
  jmp    L44
  nopl   0x0(%rax)
L59:
  add    $0x1,%rax
L44:
  mov    0x0(%rbp),%rcx
  mov    %dil,(%rcx,%rdx,1)
  mov    %rax,%rdx
  cmp    %rsi,%rax
  jne    L59
  add    %r14d,%r12d
  sub    %r9d,%r12d
L51:
  add    $0x1,%r8
  cmp    $0x10,%r8
  jne    L11
  movslq (%rbx),%rax
  mov    0x0(%rbp),%rdx
  movb   $0x0,(%rdx,%rax,1)
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L36
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L36:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D4
type: byte[16]

tool: {"D4": [0x46,0x45,0x48,0x47,0x42,0x41,0x44,0x43,0x4e,0x4d,0x50,0x4f,0x4a,0x49,0x4c,0x4b]}

assistant: ```c
void InverseModify(const char *modifiedBuf, const int modifiedLen, char **restoredString, int *restoredLen) {
  char binList[] = "FEHGBADCNMPOJILK";
  int frequencyTable[16];
  char *shellCodeBuffer;
  int i, j, k;
  int maxNum;
  for (i = 0; i < 16; ++i)
    frequencyTable[i] = 0;
  shellCodeBuffer = (char *)malloc(modifiedLen * 2 + 1);
  for (i = 0; i < modifiedLen; ++i) {
    shellCodeBuffer[i * 2] = binList[(unsigned char)modifiedBuf[i] >> 4];
    ++frequencyTable[(unsigned char)modifiedBuf[i] >> 4];
    shellCodeBuffer[i * 2 + 1] = binList[modifiedBuf[i] & 0x0f];
    ++frequencyTable[modifiedBuf[i] & 0x0f];
  }
  shellCodeBuffer[modifiedLen * 2] = 0;
  maxNum = frequencyTable[0];
  for (i = 1; i < 16; ++i)
    if (maxNum < frequencyTable[i])
      maxNum = frequencyTable[i];
  *restoredLen = maxNum * 16;
  *restoredString = (char *)malloc(*restoredLen + 1);
  for (i = 0; i < strlen(shellCodeBuffer); ++i)
    (*restoredString)[i] = shellCodeBuffer[i];
  free(shellCodeBuffer);
  for (j = 0; j < 16; ++j) {
    for (k = frequencyTable[j]; k < maxNum; ++k) {
      (*restoredString)[i] = binList[j];
      ++i;
    }
  }
  (*restoredString)[*restoredLen] = 0;
}
```