#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 */
scalar_t__ BN_is_odd(int /*<<< orphan*/ const *);
int /*<<< orphan*/ test_fail_bignum_mono_message(int /*<<< orphan*/ *,
                                                 char const *, int, char *,
                                                 char *, char *, char const *,
                                                 int /*<<< orphan*/ const *);
int test_BN_odd(const char *file, int line, const char *s, const BIGNUM *a) {
  if (a != NULL && BN_is_odd(a))
    return 1;
  test_fail_bignum_mono_message(NULL, file, line, "BIGNUM", "ODD(", ")", s, a);
  return 0;
}


x86 assembly (clang, -O0):
<test_BN_odd>:
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     1161 <test_BN_odd+0x41>
mov    -0x28(%rbp),%rdi
call   1040 <BN_is_odd@plt>
cmp    $0x0,%rax
je     1161 <test_BN_odd+0x41>
movl   $0x1,-0x4(%rbp)
jmp    119e <test_BN_odd+0x7e>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%r10
mov    -0x28(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edi
lea    0xe85(%rip),%rcx
lea    0xe85(%rip),%r8
lea    0xe83(%rip),%r9
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <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_odd>:
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     114b <test_BN_odd+0x2b>
mov    %rbx,%rdi
call   1040 <BN_is_odd@plt>
mov    $0x1,%ebp
test   %rax,%rax
jne    1176 <test_BN_odd+0x56>
lea    0xeae(%rip),%rcx
lea    0xeae(%rip),%r8
lea    0xeac(%rip),%r9
xor    %ebp,%ebp
xor    %edi,%edi
mov    %r12,%rsi
mov    %r15d,%edx
push   %rbx
push   %r14
call   1030 <test_fail_bignum_mono_message@plt>
add    $0x10,%rsp
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 = [5 x i8] c"ODD(\00"
@.str.2 = [2 x i8] c")\00"
define i32 @test_BN_odd(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 i64 @BN_is_odd(i32* %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %17
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* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* %20, 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 = [5 x i8] c"ODD(\00"
@.str.2 = [2 x i8] c")\00"
define i32 @test_BN_odd(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 i64 @BN_is_odd(i32* %3)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %11
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* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* %2, i32* %3)
br label %11
11: ; preds = %6, %9
%12 = phi i32 [ 0, %9 ], [ 1, %6 ]
ret i32 %12
}