#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_error(char *, int, char *, char const *);
int /*<<< orphan*/ test_output_bignum(char *, int /*<<< orphan*/ const *);
int a_is_zero_mod_one(const char *method, const BIGNUM *r, const BIGNUM *a) {
  if (!BN_is_zero(r)) {
    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/exptest.c",
               34, "%s failed: a ** 0 mod 1 = r (should be 0)", method);
    test_output_bignum("a", a);
    test_output_bignum("r", r);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<a_is_zero_mod_one>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <BN_is_zero@plt>
cmp    $0x0,%eax
jne    119e <a_is_zero_mod_one+0x6e>
mov    -0x10(%rbp),%rcx
lea    0xe9f(%rip),%rdi
mov    $0x22,%esi
lea    0xf3e(%rip),%rdx
call   1050 <test_error@plt>
mov    -0x20(%rbp),%rsi
lea    0xf58(%rip),%rdi
call   1030 <test_output_bignum@plt>
mov    -0x18(%rbp),%rsi
lea    0xf4a(%rip),%rdi
call   1030 <test_output_bignum@plt>
movl   $0x0,-0x4(%rbp)
jmp    11a5 <a_is_zero_mod_one+0x75>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_is_zero_mod_one>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1040 <BN_is_zero@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
jne    118c <a_is_zero_mod_one+0x5c>
lea    0xea8(%rip),%rdi
lea    0xf4c(%rip),%rdx
mov    $0x22,%esi
mov    %r15,%rcx
call   1050 <test_error@plt>
lea    0xf62(%rip),%rdi
mov    %r14,%rsi
call   1030 <test_output_bignum@plt>
lea    0xf55(%rip),%rdi
mov    %rbx,%rsi
call   1030 <test_output_bignum@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [171 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/exptest.c\00"
@.str.1 = [42 x i8] c"%s failed: a ** 0 mod 1 = r (should be 0)\00"
@.str.2 = [2 x i8] c"a\00"
@.str.3 = [2 x i8] c"r\00"
define i32 @a_is_zero_mod_one(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 = call i32 @BN_is_zero(i32* %8)
%10 = icmp ne i32 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %3
%12 = load i8*, i8** %5
%13 = call i32 @test_error(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 34, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = load i32*, i32** %7
%15 = call i32 @test_output_bignum(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32* %14)
%16 = load i32*, i32** %6
%17 = call i32 @test_output_bignum(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32* %16)
store i32 0, i32* %4
br label %19
18: ; preds = %3
store i32 1, i32* %4
br label %19
19: ; preds = %18, %11
%20 = load i32, i32* %4
ret i32 %20
}

LLVM IR (-O2):
@.str = [171 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/exptest.c\00"
@.str.1 = [42 x i8] c"%s failed: a ** 0 mod 1 = r (should be 0)\00"
@.str.2 = [2 x i8] c"a\00"
@.str.3 = [2 x i8] c"r\00"
define i32 @a_is_zero_mod_one(i8* %0, i32* %1, i32* %2) {
%4 = tail call i32 @BN_is_zero(i32* %1)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i32 @test_error(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 34, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%8 = tail call i32 @test_output_bignum(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%9 = tail call i32 @test_output_bignum(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32* %1)
br label %10
10: ; preds = %3, %6
%11 = phi i32 [ 0, %6 ], [ 1, %3 ]
ret i32 %11
}