user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<dump_cert_info>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%rbx
  test   %esi,%esi
  je     L58
  call   <SSL_get_version@plt>
  mov    %rax,%rsi
  lea    D50(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbx,%rdi
  call   <SSL_get_cipher@plt>
  mov    %rax,%rsi
  lea    D63(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbx,%rdi
  call   <SSL_get_peer_certificate@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L52
  lea    D89(%rip),%rdi
  call   <puts@plt>
L7:
  mov    %rbx,%rdi
  call   <X509_get_subject_name@plt>
  mov    %eax,%edi
  mov    $0x0,%edx
  mov    $0x0,%esi
  call   <X509_NAME_oneline@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L5
L30:
  mov    %rbp,%rsi
  lea    D108(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <OPENSSL_free@plt>
  mov    %rbx,%rdi
  call   <X509_get_issuer_name@plt>
  mov    %eax,%edi
  mov    $0x0,%edx
  mov    $0x0,%esi
  call   <X509_NAME_oneline@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L38
L17:
  mov    %rbp,%rsi
  lea    D74(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <OPENSSL_free@plt>
  mov    %rbx,%rdi
  call   <X509_free@plt>
L72:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  ret
L58:
  call   <SSL_get_version@plt>
  mov    %rax,%rsi
  lea    D88(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbx,%rdi
  call   <SSL_get_cipher@plt>
  mov    %rax,%rsi
  lea    D63(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbx,%rdi
  call   <SSL_get_peer_certificate@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L52
  lea    D99(%rip),%rdi
  call   <puts@plt>
  jmp    L7
L5:
  lea    D23(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L30
L38:
  lea    D45(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L17
L52:
  lea    D62(%rip),%rdi
  call   <puts@plt>
  jmp    L72
```

tool_calls: name: read_data
arguments: data_label: D50
datatype: string
name: read_data
arguments: data_label: D63
datatype: string
name: read_data
arguments: data_label: D89
datatype: string
name: read_data
arguments: data_label: D108
datatype: string
name: read_data
arguments: data_label: D74
datatype: string
name: read_data
arguments: data_label: D88
datatype: string
name: read_data
arguments: data_label: D99
datatype: string
name: read_data
arguments: data_label: D23
datatype: string
name: read_data
arguments: data_label: D45
datatype: string
name: read_data
arguments: data_label: D62
datatype: string

tool: D50: Ssl server version: %s

tool: D63: Using cipher %s

tool: D89: Client certificate:

tool: D108: 	 Subject: %s


tool: D74: 	 Issuer: %s


tool: D88: Client Version: %s

tool: D99: Server certificate:

tool: D23: warn X509 subject name is null

tool: D45: warn X509 issuer name is null

tool: D62: 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");
  }
}
```