#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*/ TS_MSG_IMPRINT;
typedef int /*<<< orphan*/ BIO;
typedef int /*<<< orphan*/ ASN1_OCTET_STRING;

/* Variables and functions */
int /*<<< orphan*/ BIO_dump_indent(int /*<<< orphan*/ *, char const *,
                                   int /*<<< orphan*/, int);
int /*<<< orphan*/ BIO_printf(int /*<<< orphan*/ *, char *);
scalar_t__ M_ASN1_STRING_data(int /*<<< orphan*/ const *);
int /*<<< orphan*/ M_ASN1_STRING_length(int /*<<< orphan*/ const *);
int /*<<< orphan*/ TS_MSG_IMPRINT_get_algo(int /*<<< orphan*/ *);
int /*<<< orphan*/ *TS_MSG_IMPRINT_get_msg(int /*<<< orphan*/ *);
int /*<<< orphan*/ TS_X509_ALGOR_print_bio(int /*<<< orphan*/ *,
                                           int /*<<< orphan*/);
int TS_MSG_IMPRINT_print_bio(BIO *bio, TS_MSG_IMPRINT *a) {
  const ASN1_OCTET_STRING *msg;
  TS_X509_ALGOR_print_bio(bio, TS_MSG_IMPRINT_get_algo(a));
  BIO_printf(bio, "Message data:\n");
  msg = TS_MSG_IMPRINT_get_msg(a);
  BIO_dump_indent(bio, (const char *)M_ASN1_STRING_data(msg),
                  M_ASN1_STRING_length(msg), 4);
  return 1;
}


x86 assembly (clang, -O0):
<TS_MSG_IMPRINT_print_bio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <TS_MSG_IMPRINT_get_algo@plt>
mov    -0x30(%rbp),%rdi
mov    %eax,%esi
call   1060 <TS_X509_ALGOR_print_bio@plt>
mov    -0x8(%rbp),%rdi
lea    0xe59(%rip),%rsi
call   1030 <BIO_printf@plt>
mov    -0x10(%rbp),%rdi
call   1040 <TS_MSG_IMPRINT_get_msg@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1090 <M_ASN1_STRING_data@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <M_ASN1_STRING_length@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    %eax,%edx
mov    $0x4,%ecx
call   1080 <BIO_dump_indent@plt>
mov    $0x1,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TS_MSG_IMPRINT_print_bio>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1070 <TS_MSG_IMPRINT_get_algo@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1060 <TS_X509_ALGOR_print_bio@plt>
lea    0xe6c(%rip),%rsi
mov    %r14,%rdi
call   1030 <BIO_printf@plt>
mov    %rbx,%rdi
call   1040 <TS_MSG_IMPRINT_get_msg@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1090 <M_ASN1_STRING_data@plt>
mov    %rax,%r15
mov    %rbx,%rdi
call   1050 <M_ASN1_STRING_length@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %eax,%edx
mov    $0x4,%ecx
call   1080 <BIO_dump_indent@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Message data:\0A\00"
define i32 @TS_MSG_IMPRINT_print_bio(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%6 = load i32*, i32** %3
%7 = load i32*, i32** %4
%8 = call i32 @TS_MSG_IMPRINT_get_algo(i32* %7)
%9 = call i32 @TS_X509_ALGOR_print_bio(i32* %6, i32 %8)
%10 = load i32*, i32** %3
%11 = call i32 @BIO_printf(i32* %10, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%12 = load i32*, i32** %4
%13 = call i32* @TS_MSG_IMPRINT_get_msg(i32* %12)
store i32* %13, i32** %5
%14 = load i32*, i32** %3
%15 = load i32*, i32** %5
%16 = call i64 @M_ASN1_STRING_data(i32* %15)
%17 = inttoptr i64 %16 to i8*
%18 = load i32*, i32** %5
%19 = call i32 @M_ASN1_STRING_length(i32* %18)
%20 = call i32 @BIO_dump_indent(i32* %14, i8* %17, i32 %19, i32 4)
ret i32 1
}

LLVM IR (-O2):
@.str = [15 x i8] c"Message data:\0A\00"
define i32 @TS_MSG_IMPRINT_print_bio(i32* %0, i32* %1) {
%3 = tail call i32 @TS_MSG_IMPRINT_get_algo(i32* %1)
%4 = tail call i32 @TS_X509_ALGOR_print_bio(i32* %0, i32 %3)
%5 = tail call i32 @BIO_printf(i32* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32* @TS_MSG_IMPRINT_get_msg(i32* %1)
%7 = tail call i64 @M_ASN1_STRING_data(i32* %6)
%8 = inttoptr i64 %7 to i8*
%9 = tail call i32 @M_ASN1_STRING_length(i32* %6)
%10 = tail call i32 @BIO_dump_indent(i32* %0, i8* %8, i32 %9, i32 4)
ret i32 1
}