#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*/ BIO;
typedef int /*<<< orphan*/ BIGNUM;
typedef int /*<<< orphan*/ ASN1_VALUE;
typedef int /*<<< orphan*/ ASN1_PCTX;
typedef int /*<<< orphan*/ ASN1_ITEM;

/* Variables and functions */
scalar_t__ BIO_printf(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ BN_print(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int bn_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it, int indent,
             const ASN1_PCTX *pctx) {
  BIGNUM *bn = (BIGNUM *)*pval;
  if (!BN_print(out, bn))
    return 0;
  if (BIO_printf(out, "\n") <= 0)
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<bn_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1040 <BN_print@plt>
cmp    $0x0,%eax
jne    1168 <bn_print+0x48>
movl   $0x0,-0x4(%rbp)
jmp    1195 <bn_print+0x75>
mov    -0x10(%rbp),%rdi
lea    0xe8d(%rip),%rsi
call   1030 <BIO_printf@plt>
cmp    $0x0,%rax
jg     118e <bn_print+0x6e>
movl   $0x0,-0x4(%rbp)
jmp    1195 <bn_print+0x75>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bn_print>:
push   %rbx
mov    %rdi,%rbx
mov    (%rsi),%rsi
call   1040 <BN_print@plt>
test   %eax,%eax
je     114c <bn_print+0x2c>
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
call   1030 <BIO_printf@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setg   %al
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @bn_print(i32* %0, i32** %1, i32* %2, i32 %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32**
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
store i32* %0, i32** %7
store i32** %1, i32*** %8
store i32* %2, i32** %9
store i32 %3, i32* %10
store i32* %4, i32** %11
%13 = load i32**, i32*** %8
%14 = load i32*, i32** %13
store i32* %14, i32** %12
%15 = load i32*, i32** %7
%16 = load i32*, i32** %12
%17 = call i32 @BN_print(i32* %15, i32* %16)
%18 = icmp ne i32 %17, 0
br i1 %18, label %20, label %19
19: ; preds = %5
store i32 0, i32* %6
br label %26
20: ; preds = %5
%21 = load i32*, i32** %7
%22 = call i64 @BIO_printf(i32* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%23 = icmp sle i64 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %20
store i32 0, i32* %6
br label %26
25: ; preds = %20
store i32 1, i32* %6
br label %26
26: ; preds = %25, %24, %19
%27 = load i32, i32* %6
ret i32 %27
}

LLVM IR (-O2):
@.str = [2 x i8] c"\0A\00"
define i32 @bn_print(i32* %0, i32** nocapture %1, i32* nocapture readnone %2, i32 %3, i32* nocapture readnone %4) {
%6 = load i32*, i32** %1
%7 = tail call i32 @BN_print(i32* %0, i32* %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = tail call i64 @BIO_printf(i32* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = icmp sgt i64 %10, 0
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %9, %5
%14 = phi i32 [ 0, %5 ], [ %12, %9 ]
ret i32 %14
}