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

```asm
<pcaNegCrypt>:
  endbr64
  push   %r12
  lea    D28(%rip),%r12
  lea    D52(%rip),%rsi
  push   %rbp
  mov    %r12,%rdx
  mov    %edi,%ebp
  mov    $0xa,%edi
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  movabs $0xfe000900616f,%rax
  movl   $0xffff,0x12(%rsp)
  movl   $0x0,0x4(%rsp)
  mov    %rax,0xa(%rsp)
  xor    %eax,%eax
  mov    %ax,0x16(%rsp)
  call   <writeError@plt>
  xor    %ecx,%ecx
  lea    0xa(%rsp),%rsi
  mov    %ebp,%edi
  mov    $0xe,%edx
  call   <medusaSend@plt>
  test   %rax,%rax
  js     L15
  mov    %ebp,%edi
  lea    0x4(%rsp),%rsi
  movl   $0x0,0x4(%rsp)
  call   <medusaReceiveRaw@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L13
  lea    0x1c(%rax),%rdi
  lea    D44(%rip),%rsi
  call   <strstr@plt>
  test   %rax,%rax
  jne    L69
  mov    %rbp,%rdi
  call   <free@plt>
  xor    %eax,%eax
L64:
  mov    0x18(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L18
  add    $0x28,%rsp
  pop    %rbp
  pop    %r12
  ret
  nopw   0x0(%rax,%rax,1)
L69:
  mov    %r12,%rdx
  lea    D56(%rip),%rsi
  mov    $0x3,%edi
  call   <writeError@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    $0xffffffff,%eax
  jmp    L64
L15:
  mov    %r12,%rdx
  lea    D12(%rip),%rsi
  mov    $0x3,%edi
  call   <writeError@plt>
  mov    $0xffffffff,%eax
  jmp    L64
L13:
  mov    %r12,%rdx
  lea    D55(%rip),%rsi
  mov    $0x3,%edi
  call   <writeError@plt>
  mov    $0xffffffff,%eax
  jmp    L64
L18:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D28
datatype: string
name: retrieve_data
arguments: data_tag: D52
datatype: string
name: retrieve_data
arguments: data_tag: D44
datatype: string
name: retrieve_data
arguments: data_tag: D56
datatype: string
name: retrieve_data
arguments: data_tag: D12
datatype: string
name: retrieve_data
arguments: data_tag: D55
datatype: string

tool: D28: pcanywhere.mod

tool: D52: %s: Checking encryption level.

tool: D44: Host is denying connection

tool: D56: %s: PcAnywhere host denied connection. Host requires encryption which is currently not supported.

tool: D12: %s failed: medusaSend was not successful

tool: D55: %s failed: medusaReceive returned no data.

assistant: ```c
int pcaNegCrypt(int hSocket) {
  unsigned char bufSend[] = {0x6f, 0x61, 0x00, 0x09, 0x00, 0xfe, 0x00, 0x00, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00};
  int nSendBufferSize = 14;
  unsigned char *bufReceive;
  int nReceiveBufferSize = 0;
  writeError(10, "%s: Checking encryption level.", "pcanywhere.mod");
  if (medusaSend(hSocket, bufSend, nSendBufferSize, 0) < 0) {
    writeError(3, "%s failed: medusaSend was not successful", "pcanywhere.mod");
    return -1;
  }
  nReceiveBufferSize = 0;
  bufReceive = medusaReceiveRaw(hSocket, &nReceiveBufferSize);
  if (bufReceive == NULL) {
    writeError(3, "%s failed: medusaReceive returned no data.", "pcanywhere.mod");
    return -1;
  } else if (strstr((char *)bufReceive + 28, "Host is denying connection")) {
    writeError(3, "%s: PcAnywhere host denied connection. Host requires encryption which is currently not supported.", "pcanywhere.mod");
    if (bufReceive != NULL) {
      free(bufReceive);
      bufReceive = NULL;
    };
    return -1;
  }
  if (bufReceive != NULL) {
    free(bufReceive);
    bufReceive = NULL;
  };
  return 0;
}
```