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

```asm
<dump_cert_info>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  cmpl   $0x0,-0x1c(%rbp)
  je     L55
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <SSL_get_version@plt>
  mov    %rax,%rsi
  lea    D13(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L39
L55:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <SSL_get_version@plt>
  mov    %rax,%rsi
  lea    D27(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L39:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <SSL_get_cipher@plt>
  mov    %rax,%rsi
  lea    D21(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <SSL_get_peer_certificate@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  je     L18
  cmpl   $0x0,-0x1c(%rbp)
  je     L45
  lea    D1(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  jmp    L33
L45:
  lea    D50(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L33:
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <X509_get_subject_name@plt>
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <X509_NAME_oneline@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L14
  lea    D93(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L14:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D55(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <OPENSSL_free@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <X509_get_issuer_name@plt>
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %eax,%edi
  call   <X509_NAME_oneline@plt>
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  jne    L15
  lea    D46(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L15:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D6(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <OPENSSL_free@plt>
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <X509_free@plt>
  jmp    L27
L18:
  lea    D56(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
L27:
  nop
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: tag: D13
datatype: string
name: disassemble_data
arguments: tag: D27
datatype: string
name: disassemble_data
arguments: tag: D21
datatype: string
name: disassemble_data
arguments: tag: D1
datatype: string
name: disassemble_data
arguments: tag: D50
datatype: string
name: disassemble_data
arguments: tag: D93
datatype: string
name: disassemble_data
arguments: tag: D55
datatype: string
name: disassemble_data
arguments: tag: D46
datatype: string
name: disassemble_data
arguments: tag: D6
datatype: string
name: disassemble_data
arguments: tag: D56
datatype: string

tool: D13: Ssl server version: %s

tool: D27: Client Version: %s

tool: D21: Using cipher %s

tool: D1: Client certificate:

tool: D50: Server certificate:

tool: D93: warn X509 subject name is null

tool: D55: 	 Subject: %s


tool: D46: warn X509 issuer name is null

tool: D6: 	 Issuer: %s


tool: D56: Client does not have certificate.

assistant: ```c
void dump_cert_info(SSL *ssl, bool server) {
  if (server) {
    printf("Ssl server version: %s", SSL_get_version(ssl));
  } else {
    printf("Client Version: %s", SSL_get_version(ssl));
  }
  printf("Using cipher %s", SSL_get_cipher(ssl));
  X509 *client_cert = SSL_get_peer_certificate(ssl);
  if (client_cert != NULL) {
    if (server) {
      printf("Client certificate:\n");
    } else {
      printf("Server certificate:\n");
    }
    char *str = X509_NAME_oneline(X509_get_subject_name(client_cert), 0, 0);
    if (str == NULL) {
      printf("warn X509 subject name is null");
    }
    printf("\t Subject: %s\n", str);
    OPENSSL_free(str);
    str = X509_NAME_oneline(X509_get_issuer_name(client_cert), 0, 0);
    if (str == NULL) {
      printf("warn X509 issuer name is null");
    }
    printf("\t Issuer: %s\n", str);
    OPENSSL_free(str);
    X509_free(client_cert);
  } else {
    printf("Client does not have certificate.\n");
  }
}
```