#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_cmp(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *);
int /*<<< orphan*/ test_BN_eq(char *, int, char *, char *,
                              int /*<<< orphan*/ const *,
                              int /*<<< orphan*/ const *);
int /*<<< orphan*/ test_error(char *, int, char *, char const *);
int equalBN(const char *op, const BIGNUM *expected, const BIGNUM *actual) {
  if (BN_cmp(expected, actual) == 0)
    return 1;
  test_error("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/"
             "master/Src/OSF/OpenSSL-111/test/bntest.c",
             135, "unexpected %s value", op);
  test_BN_eq("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
             "2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/"
             "master/Src/OSF/OpenSSL-111/test/bntest.c",
             136, "expected", "actual", expected, actual);
  return 0;
}


x86 assembly (clang, -O0):
<equalBN>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <BN_cmp@plt>
cmp    $0x0,%rax
jne    1167 <equalBN+0x37>
movl   $0x1,-0x4(%rbp)
jmp    11b1 <equalBN+0x81>
mov    -0x10(%rbp),%rcx
lea    0xe8e(%rip),%rdi
mov    $0x87,%esi
lea    0xf2c(%rip),%rdx
call   1050 <test_error@plt>
mov    -0x18(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0xe6e(%rip),%rdi
mov    $0x88,%esi
lea    0xf20(%rip),%rdx
lea    0xf22(%rip),%rcx
call   1030 <test_BN_eq@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equalBN>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
mov    %rdx,%rsi
call   1040 <BN_cmp@plt>
test   %rax,%rax
je     1194 <equalBN+0x64>
lea    0xea8(%rip),%r12
lea    0xf4b(%rip),%rdx
mov    %r12,%rdi
mov    $0x87,%esi
mov    %r15,%rcx
call   1050 <test_error@plt>
lea    0xf48(%rip),%rdx
lea    0xf4a(%rip),%rcx
mov    %r12,%rdi
mov    $0x88,%esi
mov    %rbx,%r8
mov    %r14,%r9
call   1030 <test_BN_eq@plt>
xor    %eax,%eax
jmp    1199 <equalBN+0x69>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [170 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/master/Src/OSF/OpenSSL-111/test/bntest.c\00"
@.str.1 = [20 x i8] c"unexpected %s value\00"
@.str.2 = [9 x i8] c"expected\00"
@.str.3 = [7 x i8] c"actual\00"
define i32 @equalBN(i8* %0, i32* %1, i32* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32*
store i8* %0, i8** %5
store i32* %1, i32** %6
store i32* %2, i32** %7
%8 = load i32*, i32** %6
%9 = load i32*, i32** %7
%10 = call i64 @BN_cmp(i32* %8, i32* %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %3
store i32 1, i32* %4
br label %19
13: ; preds = %3
%14 = load i8*, i8** %5
%15 = call i32 @test_error(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 135, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = load i32*, i32** %6
%17 = load i32*, i32** %7
%18 = call i32 @test_BN_eq(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 136, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32* %16, i32* %17)
store i32 0, i32* %4
br label %19
19: ; preds = %13, %12
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@.str = [170 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/refs/heads/master/Src/OSF/OpenSSL-111/test/bntest.c\00"
@.str.1 = [20 x i8] c"unexpected %s value\00"
@.str.2 = [9 x i8] c"expected\00"
@.str.3 = [7 x i8] c"actual\00"
define i32 @equalBN(i8* %0, i32* %1, i32* %2) {
%4 = tail call i64 @BN_cmp(i32* %1, i32* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = tail call i32 @test_error(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 135, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%8 = tail call i32 @test_BN_eq(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 136, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32* %1, i32* %2)
br label %9
9: ; preds = %3, %6
%10 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %10
}