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

```asm
<sendMessage>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %edi,-0x34(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %edx,-0x38(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x38(%rbp),%eax
  add    $0x8,%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x20(%rbp)
  movb   $0x81,-0x12(%rbp)
  cmpl   $0x7d,-0x38(%rbp)
  jg     L19
  mov    -0x38(%rbp),%eax
  mov    %al,-0x11(%rbp)
  movl   $0x2,-0x24(%rbp)
  jmp    L58
L19:
  cmpl   $0x7d,-0x38(%rbp)
  jle    L12
  cmpl   $0xffff,-0x38(%rbp)
  jg     L12
  movb   $0x7e,-0x11(%rbp)
  mov    -0x38(%rbp),%eax
  mov    %eax,%edi
  call   <htons@plt>
  mov    %al,-0x25(%rbp)
  lea    -0x12(%rbp),%rax
  add    $0x2,%rax
  lea    -0x25(%rbp),%rcx
  mov    $0x2,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  movl   $0x4,-0x24(%rbp)
  jmp    L58
L12:
  movb   $0x7f,-0x11(%rbp)
  mov    -0x38(%rbp),%eax
  movsbl %al,%eax
  sar    $0x10,%eax
  mov    %al,-0xb(%rbp)
  mov    -0x38(%rbp),%eax
  movsbl %al,%eax
  sar    $0x8,%eax
  mov    %al,-0xa(%rbp)
  mov    -0x38(%rbp),%eax
  mov    %al,-0x9(%rbp)
  movl   $0xa,-0x24(%rbp)
L58:
  mov    -0x24(%rbp),%edx
  lea    -0x12(%rbp),%rcx
  mov    -0x20(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x38(%rbp),%edx
  mov    -0x40(%rbp),%rax
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  mov    -0x20(%rbp),%rcx
  mov    -0x34(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <write@plt>
  test   %rax,%rax
  jg     L44
  lea    D7(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L44:
  mov    -0x38(%rbp),%eax
  lea    0x8(%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  movq   $0x0,-0x20(%rbp)
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L42
  call   <__stack_chk_fail@plt>
L42:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D7
type_infered: string

tool: D7: 

WE ARE NOT WRITING!!



assistant: ```c
void *sendMessage(int sock, char *s, int len) {
  int frameCount;
  uint16_t len16;
  char frame[10];
  char *reply = malloc(sizeof(char) * (len + 8));
  frame[0] = '\x81';
  if (len <= 125) {
    frame[1] = len;
    frameCount = 2;
  } else if (len >= 126 && len <= 65535) {
    frame[1] = 126;
    len16 = htons(len);
    memcpy(frame + 2, &len16, 2);
    frameCount = 4;
  } else {
    frame[1] = 127;
    frame[7] = (char)(((char)len >> 16) & (char)255);
    frame[8] = (char)(((char)len >> 8) & (char)255);
    frame[9] = (char)(((char)len) & (char)255);
    frameCount = 10;
  }
  memcpy(reply, frame, frameCount);
  memcpy(reply + frameCount, s, len);
  if (write(sock, reply, strlen(reply)) <= 0) {
    printf("\n\nWE ARE NOT WRITING!!\n\n");
  } else {
  }
  memset(reply, '\0', sizeof(char) * (len + 8));
  free(reply);
  reply = NULL;
  return NULL;
}
```