#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ SSL_CTX;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ BIO_printf(int /*<<< orphan*/ *, char *, int /*<<< orphan*/,
                              ...);
int /*<<< orphan*/ SSL_CTX_sess_accept(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_CTX_sess_accept_good(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_CTX_sess_accept_renegotiate(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_CTX_sess_cache_full(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_CTX_sess_cb_hits(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_CTX_sess_connect(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_CTX_sess_connect_good(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_CTX_sess_connect_renegotiate(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_CTX_sess_get_cache_size(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_CTX_sess_hits(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_CTX_sess_misses(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_CTX_sess_number(int /*<<< orphan*/ *);
int /*<<< orphan*/ SSL_CTX_sess_timeouts(int /*<<< orphan*/ *);
void print_stats(BIO *bio, SSL_CTX *ssl_ctx) {
  BIO_printf(bio, "%4ld items in the session cache\n",
             SSL_CTX_sess_number(ssl_ctx));
  BIO_printf(bio, "%4ld client connects (SSL_connect())\n",
             SSL_CTX_sess_connect(ssl_ctx));
  BIO_printf(bio, "%4ld client renegotiates (SSL_connect())\n",
             SSL_CTX_sess_connect_renegotiate(ssl_ctx));
  BIO_printf(bio, "%4ld client connects that finished\n",
             SSL_CTX_sess_connect_good(ssl_ctx));
  BIO_printf(bio, "%4ld server accepts (SSL_accept())\n",
             SSL_CTX_sess_accept(ssl_ctx));
  BIO_printf(bio, "%4ld server renegotiates (SSL_accept())\n",
             SSL_CTX_sess_accept_renegotiate(ssl_ctx));
  BIO_printf(bio, "%4ld server accepts that finished\n",
             SSL_CTX_sess_accept_good(ssl_ctx));
  BIO_printf(bio, "%4ld session cache hits\n", SSL_CTX_sess_hits(ssl_ctx));
  BIO_printf(bio, "%4ld session cache misses\n", SSL_CTX_sess_misses(ssl_ctx));
  BIO_printf(bio, "%4ld session cache timeouts\n",
             SSL_CTX_sess_timeouts(ssl_ctx));
  BIO_printf(bio, "%4ld callback cache hits\n", SSL_CTX_sess_cb_hits(ssl_ctx));
  BIO_printf(bio, "%4ld cache full overflows (%ld allowed)\n",
             SSL_CTX_sess_cache_full(ssl_ctx),
             SSL_CTX_sess_get_cache_size(ssl_ctx));
}


x86 assembly (clang, -O0):
<print_stats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x10(%rbp),%rdi
call   10e0 <SSL_CTX_sess_number@plt>
mov    -0x78(%rbp),%rdi
mov    %eax,%edx
lea    0xdef(%rip),%rsi
mov    $0x0,%al
call   1060 <BIO_printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x10(%rbp),%rdi
call   10f0 <SSL_CTX_sess_connect@plt>
mov    -0x70(%rbp),%rdi
mov    %eax,%edx
lea    0xdeb(%rip),%rsi
mov    $0x0,%al
call   1060 <BIO_printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x10(%rbp),%rdi
call   10d0 <SSL_CTX_sess_connect_renegotiate@plt>
mov    -0x68(%rbp),%rdi
mov    %eax,%edx
lea    0xdec(%rip),%rsi
mov    $0x0,%al
call   1060 <BIO_printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <SSL_CTX_sess_connect_good@plt>
mov    -0x60(%rbp),%rdi
mov    %eax,%edx
lea    0xdf1(%rip),%rsi
mov    $0x0,%al
call   1060 <BIO_printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <SSL_CTX_sess_accept@plt>
mov    -0x58(%rbp),%rdi
mov    %eax,%edx
lea    0xdf0(%rip),%rsi
mov    $0x0,%al
call   1060 <BIO_printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rdi
call   1090 <SSL_CTX_sess_accept_renegotiate@plt>
mov    -0x50(%rbp),%rdi
mov    %eax,%edx
lea    0xdef(%rip),%rsi
mov    $0x0,%al
call   1060 <BIO_printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <SSL_CTX_sess_accept_good@plt>
mov    -0x48(%rbp),%rdi
mov    %eax,%edx
lea    0xdf3(%rip),%rsi
mov    $0x0,%al
call   1060 <BIO_printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rdi
call   10a0 <SSL_CTX_sess_hits@plt>
mov    -0x40(%rbp),%rdi
mov    %eax,%edx
lea    0xdf1(%rip),%rsi
mov    $0x0,%al
call   1060 <BIO_printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
call   1100 <SSL_CTX_sess_misses@plt>
mov    -0x38(%rbp),%rdi
mov    %eax,%edx
lea    0xde5(%rip),%rsi
mov    $0x0,%al
call   1060 <BIO_printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   10c0 <SSL_CTX_sess_timeouts@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%edx
lea    0xddb(%rip),%rsi
mov    $0x0,%al
call   1060 <BIO_printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <SSL_CTX_sess_cb_hits@plt>
mov    -0x28(%rbp),%rdi
mov    %eax,%edx
lea    0xdd3(%rip),%rsi
mov    $0x0,%al
call   1060 <BIO_printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   10b0 <SSL_CTX_sess_cache_full@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1080 <SSL_CTX_sess_get_cache_size@plt>
mov    -0x20(%rbp),%rdi
mov    -0x14(%rbp),%edx
mov    %eax,%ecx
lea    0xdb9(%rip),%rsi
mov    $0x0,%al
call   1060 <BIO_printf@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_stats>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   10e0 <SSL_CTX_sess_number@plt>
lea    0xe07(%rip),%rsi
mov    %r14,%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <BIO_printf@plt>
mov    %rbx,%rdi
call   10f0 <SSL_CTX_sess_connect@plt>
lea    0xe0d(%rip),%rsi
mov    %r14,%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <BIO_printf@plt>
mov    %rbx,%rdi
call   10d0 <SSL_CTX_sess_connect_renegotiate@plt>
lea    0xe18(%rip),%rsi
mov    %r14,%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <BIO_printf@plt>
mov    %rbx,%rdi
call   1050 <SSL_CTX_sess_connect_good@plt>
lea    0xe27(%rip),%rsi
mov    %r14,%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <BIO_printf@plt>
mov    %rbx,%rdi
call   1030 <SSL_CTX_sess_accept@plt>
lea    0xe30(%rip),%rsi
mov    %r14,%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <BIO_printf@plt>
mov    %rbx,%rdi
call   1090 <SSL_CTX_sess_accept_renegotiate@plt>
lea    0xe39(%rip),%rsi
mov    %r14,%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <BIO_printf@plt>
mov    %rbx,%rdi
call   1040 <SSL_CTX_sess_accept_good@plt>
lea    0xe47(%rip),%rsi
mov    %r14,%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <BIO_printf@plt>
mov    %rbx,%rdi
call   10a0 <SSL_CTX_sess_hits@plt>
lea    0xe4f(%rip),%rsi
mov    %r14,%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <BIO_printf@plt>
mov    %rbx,%rdi
call   1100 <SSL_CTX_sess_misses@plt>
lea    0xe4d(%rip),%rsi
mov    %r14,%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <BIO_printf@plt>
mov    %rbx,%rdi
call   10c0 <SSL_CTX_sess_timeouts@plt>
lea    0xe4d(%rip),%rsi
mov    %r14,%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <BIO_printf@plt>
mov    %rbx,%rdi
call   1070 <SSL_CTX_sess_cb_hits@plt>
lea    0xe4f(%rip),%rsi
mov    %r14,%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <BIO_printf@plt>
mov    %rbx,%rdi
call   10b0 <SSL_CTX_sess_cache_full@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1080 <SSL_CTX_sess_get_cache_size@plt>
lea    0xe44(%rip),%rsi
mov    %r14,%rdi
mov    %ebp,%edx
mov    %eax,%ecx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1060 <BIO_printf@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"%4ld items in the session cache\0A\00"
@.str.1 = [38 x i8] c"%4ld client connects (SSL_connect())\0A\00"
@.str.2 = [42 x i8] c"%4ld client renegotiates (SSL_connect())\0A\00"
@.str.3 = [36 x i8] c"%4ld client connects that finished\0A\00"
@.str.4 = [36 x i8] c"%4ld server accepts (SSL_accept())\0A\00"
@.str.5 = [41 x i8] c"%4ld server renegotiates (SSL_accept())\0A\00"
@.str.6 = [35 x i8] c"%4ld server accepts that finished\0A\00"
@.str.7 = [25 x i8] c"%4ld session cache hits\0A\00"
@.str.8 = [27 x i8] c"%4ld session cache misses\0A\00"
@.str.9 = [29 x i8] c"%4ld session cache timeouts\0A\00"
@.str.10 = [26 x i8] c"%4ld callback cache hits\0A\00"
@.str.11 = [41 x i8] c"%4ld cache full overflows (%ld allowed)\0A\00"
define void @print_stats(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %3
%6 = load i32*, i32** %4
%7 = call i32 @SSL_CTX_sess_number(i32* %6)
%8 = call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %5, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load i32*, i32** %3
%10 = load i32*, i32** %4
%11 = call i32 @SSL_CTX_sess_connect(i32* %10)
%12 = call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %9, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = load i32*, i32** %3
%14 = load i32*, i32** %4
%15 = call i32 @SSL_CTX_sess_connect_renegotiate(i32* %14)
%16 = call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %13, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = load i32*, i32** %3
%18 = load i32*, i32** %4
%19 = call i32 @SSL_CTX_sess_connect_good(i32* %18)
%20 = call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %17, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i32 %19)
%21 = load i32*, i32** %3
%22 = load i32*, i32** %4
%23 = call i32 @SSL_CTX_sess_accept(i32* %22)
%24 = call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %21, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 %23)
%25 = load i32*, i32** %3
%26 = load i32*, i32** %4
%27 = call i32 @SSL_CTX_sess_accept_renegotiate(i32* %26)
%28 = call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %25, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i32 %27)
%29 = load i32*, i32** %3
%30 = load i32*, i32** %4
%31 = call i32 @SSL_CTX_sess_accept_good(i32* %30)
%32 = call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %29, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i32 %31)
%33 = load i32*, i32** %3
%34 = load i32*, i32** %4
%35 = call i32 @SSL_CTX_sess_hits(i32* %34)
%36 = call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %33, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i32 %35)
%37 = load i32*, i32** %3
%38 = load i32*, i32** %4
%39 = call i32 @SSL_CTX_sess_misses(i32* %38)
%40 = call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %37, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i32 %39)
%41 = load i32*, i32** %3
%42 = load i32*, i32** %4
%43 = call i32 @SSL_CTX_sess_timeouts(i32* %42)
%44 = call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %41, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0), i32 %43)
%45 = load i32*, i32** %3
%46 = load i32*, i32** %4
%47 = call i32 @SSL_CTX_sess_cb_hits(i32* %46)
%48 = call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %45, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), i32 %47)
%49 = load i32*, i32** %3
%50 = load i32*, i32** %4
%51 = call i32 @SSL_CTX_sess_cache_full(i32* %50)
%52 = load i32*, i32** %4
%53 = call i32 @SSL_CTX_sess_get_cache_size(i32* %52)
%54 = call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %49, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.11, i64 0, i64 0), i32 %51, i32 %53)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"%4ld items in the session cache\0A\00"
@.str.1 = [38 x i8] c"%4ld client connects (SSL_connect())\0A\00"
@.str.2 = [42 x i8] c"%4ld client renegotiates (SSL_connect())\0A\00"
@.str.3 = [36 x i8] c"%4ld client connects that finished\0A\00"
@.str.4 = [36 x i8] c"%4ld server accepts (SSL_accept())\0A\00"
@.str.5 = [41 x i8] c"%4ld server renegotiates (SSL_accept())\0A\00"
@.str.6 = [35 x i8] c"%4ld server accepts that finished\0A\00"
@.str.7 = [25 x i8] c"%4ld session cache hits\0A\00"
@.str.8 = [27 x i8] c"%4ld session cache misses\0A\00"
@.str.9 = [29 x i8] c"%4ld session cache timeouts\0A\00"
@.str.10 = [26 x i8] c"%4ld callback cache hits\0A\00"
@.str.11 = [41 x i8] c"%4ld cache full overflows (%ld allowed)\0A\00"
define void @print_stats(i32* %0, i32* %1) {
%3 = tail call i32 @SSL_CTX_sess_number(i32* %1)
%4 = tail call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @SSL_CTX_sess_connect(i32* %1)
%6 = tail call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %0, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = tail call i32 @SSL_CTX_sess_connect_renegotiate(i32* %1)
%8 = tail call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %0, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = tail call i32 @SSL_CTX_sess_connect_good(i32* %1)
%10 = tail call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %0, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0), i32 %9)
%11 = tail call i32 @SSL_CTX_sess_accept(i32* %1)
%12 = tail call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %0, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0), i32 %11)
%13 = tail call i32 @SSL_CTX_sess_accept_renegotiate(i32* %1)
%14 = tail call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %0, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0), i32 %13)
%15 = tail call i32 @SSL_CTX_sess_accept_good(i32* %1)
%16 = tail call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %0, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0), i32 %15)
%17 = tail call i32 @SSL_CTX_sess_hits(i32* %1)
%18 = tail call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.7, i64 0, i64 0), i32 %17)
%19 = tail call i32 @SSL_CTX_sess_misses(i32* %1)
%20 = tail call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i32 %19)
%21 = tail call i32 @SSL_CTX_sess_timeouts(i32* %1)
%22 = tail call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0), i32 %21)
%23 = tail call i32 @SSL_CTX_sess_cb_hits(i32* %1)
%24 = tail call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %0, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.10, i64 0, i64 0), i32 %23)
%25 = tail call i32 @SSL_CTX_sess_cache_full(i32* %1)
%26 = tail call i32 @SSL_CTX_sess_get_cache_size(i32* %1)
%27 = tail call i32 (i32*, i8*, i32, ...) @BIO_printf(i32* %0, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.11, i64 0, i64 0), i32 %25, i32 %26)
ret void
}