user: 请从给定的汇编指令推导出C源代码:

```asm
<dump_cert_info>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  test   %esi,%esi
  je     L47
  call   <SSL_get_version@plt>
  lea    D35(%rip),%rdi
  mov    %rax,%rsi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <SSL_get_cipher@plt>
  lea    D91(%rip),%rdi
  mov    %rax,%rsi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <SSL_get_peer_certificate@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L77
  lea    D61(%rip),%rdi
  call   <puts@plt>
  jmp    L61
  nopl   0x0(%rax,%rax,1)
L47:
  call   <SSL_get_version@plt>
  lea    D31(%rip),%rdi
  mov    %rax,%rsi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <SSL_get_cipher@plt>
  lea    D91(%rip),%rdi
  mov    %rax,%rsi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rdi
  call   <SSL_get_peer_certificate@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L77
  lea    D10(%rip),%rdi
  call   <puts@plt>
L61:
  mov    %rbp,%rdi
  call   <X509_get_subject_name@plt>
  xor    %edx,%edx
  xor    %esi,%esi
  mov    %eax,%edi
  call   <X509_NAME_oneline@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L40
L35:
  mov    %r12,%rsi
  lea    D80(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r12,%rdi
  call   <OPENSSL_free@plt>
  mov    %rbp,%rdi
  call   <X509_get_issuer_name@plt>
  xor    %edx,%edx
  xor    %esi,%esi
  mov    %eax,%edi
  call   <X509_NAME_oneline@plt>
  mov    %rax,%r12
  test   %rax,%rax
  je     L59
L73:
  mov    %r12,%rsi
  lea    D42(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r12,%rdi
  call   <OPENSSL_free@plt>
  add    $0x8,%rsp
  mov    %rbp,%rdi
  pop    %rbp
  pop    %r12
  jmp    1160 <X509_free@plt>
  nopw   0x0(%rax,%rax,1)
L77:
  add    $0x8,%rsp
  lea    D30(%rip),%rdi
  pop    %rbp
  pop    %r12
  jmp    10e0 <puts@plt>
  nopl   0x0(%rax,%rax,1)
L59:
  lea    D92(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L73
L40:
  lea    D66(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L35
```

tool_calls: name: read_data
arguments: data_tag: D35
type_guessed: string
name: read_data
arguments: data_tag: D91
type_guessed: string
name: read_data
arguments: data_tag: D61
type_guessed: string
name: read_data
arguments: data_tag: D31
type_guessed: string
name: read_data
arguments: data_tag: D10
type_guessed: string
name: read_data
arguments: data_tag: D80
type_guessed: string
name: read_data
arguments: data_tag: D42
type_guessed: string
name: read_data
arguments: data_tag: D30
type_guessed: string
name: read_data
arguments: data_tag: D92
type_guessed: string
name: read_data
arguments: data_tag: D66
type_guessed: string

tool: D35: Ssl server version: %s

tool: D91: Using cipher %s

tool: D61: Client certificate:

tool: D31: Client Version: %s

tool: D10: Server certificate:

tool: D80: 	 Subject: %s


tool: D42: 	 Issuer: %s


tool: D30: Client does not have certificate.

tool: D92: warn X509 issuer name is null

tool: D66: warn X509 subject name is null

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