#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*/ BIGNUM;

/* Variables and functions */
int /*<<< orphan*/ BN_is_zero(int /*<<< orphan*/ const *);
int /*<<< orphan*/ test_fail_bignum_mono_message(int /*<<< orphan*/ *,
                                                 char const *, int, char *,
                                                 char const *, char *, char *,
                                                 int /*<<< orphan*/ const *);
int test_BN_ne_zero(const char *file, int line, const char *s,
                    const BIGNUM *a) {
  if (a != NULL && (!BN_is_zero(a)))
    return 1;
  test_fail_bignum_mono_message(NULL, file, line, "BIGNUM", s, "0", "!=", a);
  return 0;
}


x86 assembly (clang, -O0):
<test_BN_ne_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1160 <test_BN_ne_zero+0x40>
mov    -0x28(%rbp),%rdi
call   1030 <BN_is_zero@plt>
cmp    $0x0,%eax
jne    1160 <test_BN_ne_zero+0x40>
movl   $0x1,-0x4(%rbp)
jmp    119d <test_BN_ne_zero+0x7d>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edi
lea    0xe86(%rip),%rcx
lea    0xe86(%rip),%r9
lea    0xe81(%rip),%r10
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1040 <test_fail_bignum_mono_message@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_BN_ne_zero>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rcx,%rbx
mov    %rdx,%r14
mov    %esi,%r15d
mov    %rdi,%r12
test   %rcx,%rcx
je     1145 <test_BN_ne_zero+0x25>
mov    %rbx,%rdi
call   1030 <BN_is_zero@plt>
test   %eax,%eax
je     1174 <test_BN_ne_zero+0x54>
lea    0xebd(%rip),%rax
lea    0xead(%rip),%rcx
lea    0xead(%rip),%r9
xor    %ebp,%ebp
xor    %edi,%edi
mov    %r12,%rsi
mov    %r15d,%edx
mov    %r14,%r8
push   %rbx
push   %rax
call   1040 <test_fail_bignum_mono_message@plt>
add    $0x10,%rsp
jmp    1179 <test_BN_ne_zero+0x59>
mov    $0x1,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"BIGNUM\00"
@.str.1 = [2 x i8] c"0\00"
@.str.2 = [3 x i8] c"!=\00"
define i32 @test_BN_ne_zero(i8* %0, i32 %1, i8* %2, i32* %3) {
%5 = icmp eq i32* %3, null
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = tail call i32 @BN_is_zero(i32* %3)
%8 = icmp eq i32 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6, %4
%10 = tail call i32 @test_fail_bignum_mono_message(i32* null, i8* %0, i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
br label %11
11: ; preds = %6, %9
%12 = phi i32 [ 0, %9 ], [ 1, %6 ]
ret i32 %12
}