#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_free(int /*<<< orphan*/ *);
scalar_t__ BN_mod_exp(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                      int /*<<< orphan*/ *, int /*<<< orphan*/,
                      int /*<<< orphan*/ *);
scalar_t__ BN_mod_exp_mont(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                           int /*<<< orphan*/ *, int /*<<< orphan*/,
                           int /*<<< orphan*/ *, int /*<<< orphan*/ *);
scalar_t__ BN_mod_exp_mont_consttime(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ *, int /*<<< orphan*/,
                                     int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ *);
scalar_t__ BN_mod_exp_mont_word(int /*<<< orphan*/ *, int, int /*<<< orphan*/ *,
                                int /*<<< orphan*/, int /*<<< orphan*/ *,
                                int /*<<< orphan*/ *);
int /*<<< orphan*/ *BN_new();
int /*<<< orphan*/ BN_value_one();
int /*<<< orphan*/ BN_zero(int /*<<< orphan*/ *);
int /*<<< orphan*/ test_BN_eq_zero(char *, int, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ test_ptr(char *, int, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ test_true(char *, int, char *, int);
int test_expmodzero(void) {
  BIGNUM *a = NULL, *r = NULL, *zero = NULL;
  int st = 0;
  if (!test_ptr("/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",
                2096, "zero = BN_new()", zero = BN_new()) ||
      !test_ptr("/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",
                2097, "a = BN_new()", a = BN_new()) ||
      !test_ptr("/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",
                2098, "r = BN_new()", r = BN_new()))
    goto err;
  BN_zero(zero);
  if (!test_true(
          "/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",
          2102, "BN_mod_exp(r, a, zero, BN_value_one(), NULL)",
          (BN_mod_exp(r, a, zero, BN_value_one(), NULL)) != 0) ||
      !test_BN_eq_zero(
          "/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",
          2103, "r", r) ||
      !test_true(
          "/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",
          2104, "BN_mod_exp_mont(r, a, zero, BN_value_one(), NULL, NULL)",
          (BN_mod_exp_mont(r, a, zero, BN_value_one(), NULL, NULL)) != 0) ||
      !test_BN_eq_zero(
          "/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",
          2106, "r", r) ||
      !test_true(
          "/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",
          2107,
          "BN_mod_exp_mont_consttime(r, a, zero, BN_value_one(), NULL, NULL)",
          (BN_mod_exp_mont_consttime(r, a, zero, BN_value_one(), NULL, NULL)) !=
              0) ||
      !test_BN_eq_zero(
          "/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",
          2110, "r", r) ||
      !test_true(
          "/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",
          2111, "BN_mod_exp_mont_word(r, 42, zero, BN_value_one(), NULL, NULL)",
          (BN_mod_exp_mont_word(r, 42, zero, BN_value_one(), NULL, NULL)) !=
              0) ||
      !test_BN_eq_zero(
          "/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",
          2113, "r", r))
    goto err;
  st = 1;
err:
  BN_free(zero);
  BN_free(a);
  BN_free(r);
  return st;
}


x86 assembly (clang, -O0):
<test_expmodzero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    $0x0,%al
call   1050 <BN_new@plt>
mov    %rax,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xe11(%rip),%rdi
mov    $0x830,%esi
lea    0xeaf(%rip),%rdx
call   1070 <test_ptr@plt>
cmp    $0x0,%eax
je     1267 <test_expmodzero+0xb7>
mov    $0x0,%al
call   1050 <BN_new@plt>
mov    %rax,%rcx
mov    %rcx,-0x8(%rbp)
lea    0xde2(%rip),%rdi
mov    $0x831,%esi
lea    0xe90(%rip),%rdx
call   1070 <test_ptr@plt>
cmp    $0x0,%eax
je     1267 <test_expmodzero+0xb7>
mov    $0x0,%al
call   1050 <BN_new@plt>
mov    %rax,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xdb3(%rip),%rdi
mov    $0x832,%esi
lea    0xe6e(%rip),%rdx
call   1070 <test_ptr@plt>
cmp    $0x0,%eax
jne    126c <test_expmodzero+0xbc>
jmp    14a7 <test_expmodzero+0x2f7>
mov    -0x18(%rbp),%rdi
call   10a0 <BN_zero@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1030 <BN_value_one@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    %eax,%ecx
xor    %eax,%eax
mov    %eax,%r8d
call   1090 <BN_mod_exp@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xd41(%rip),%rdi
mov    $0x836,%esi
lea    0xe09(%rip),%rdx
call   1040 <test_true@plt>
cmp    $0x0,%eax
je     149b <test_expmodzero+0x2eb>
mov    -0x10(%rbp),%rcx
lea    0xd1c(%rip),%rdi
mov    $0x837,%esi
lea    0xe11(%rip),%rdx
call   1060 <test_BN_eq_zero@plt>
cmp    $0x0,%eax
je     149b <test_expmodzero+0x2eb>
mov    -0x10(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    $0x0,%al
call   1030 <BN_value_one@plt>
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x40(%rbp),%rdx
mov    %eax,%ecx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
call   10d0 <BN_mod_exp_mont@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xcb5(%rip),%rdi
mov    $0x838,%esi
lea    0xdac(%rip),%rdx
call   1040 <test_true@plt>
cmp    $0x0,%eax
je     149b <test_expmodzero+0x2eb>
mov    -0x10(%rbp),%rcx
lea    0xc90(%rip),%rdi
mov    $0x83a,%esi
lea    0xd85(%rip),%rdx
call   1060 <test_BN_eq_zero@plt>
cmp    $0x0,%eax
je     149b <test_expmodzero+0x2eb>
mov    -0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    $0x0,%al
call   1030 <BN_value_one@plt>
mov    -0x68(%rbp),%rdi
mov    -0x60(%rbp),%rsi
mov    -0x58(%rbp),%rdx
mov    %eax,%ecx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
call   10b0 <BN_mod_exp_mont_consttime@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xc29(%rip),%rdi
mov    $0x83b,%esi
lea    0xd58(%rip),%rdx
call   1040 <test_true@plt>
cmp    $0x0,%eax
je     149b <test_expmodzero+0x2eb>
mov    -0x10(%rbp),%rcx
lea    0xc04(%rip),%rdi
mov    $0x83e,%esi
lea    0xcf9(%rip),%rdx
call   1060 <test_BN_eq_zero@plt>
cmp    $0x0,%eax
je     149b <test_expmodzero+0x2eb>
mov    -0x10(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    $0x0,%al
call   1030 <BN_value_one@plt>
mov    -0x78(%rbp),%rdi
mov    -0x70(%rbp),%rdx
mov    %eax,%ecx
mov    $0x2a,%esi
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
call   10c0 <BN_mod_exp_mont_word@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xba4(%rip),%rdi
mov    $0x83f,%esi
lea    0xd15(%rip),%rdx
call   1040 <test_true@plt>
cmp    $0x0,%eax
je     149b <test_expmodzero+0x2eb>
mov    -0x10(%rbp),%rcx
lea    0xb7f(%rip),%rdi
mov    $0x841,%esi
lea    0xc74(%rip),%rdx
call   1060 <test_BN_eq_zero@plt>
cmp    $0x0,%eax
jne    14a0 <test_expmodzero+0x2f0>
jmp    14a7 <test_expmodzero+0x2f7>
movl   $0x1,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
call   1080 <BN_free@plt>
mov    -0x8(%rbp),%rdi
call   1080 <BN_free@plt>
mov    -0x10(%rbp),%rdi
call   1080 <BN_free@plt>
mov    -0x1c(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_expmodzero>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <BN_new@plt>
mov    %rax,%rbx
lea    0xe34(%rip),%rdi
lea    0xed7(%rip),%rdx
mov    $0x830,%esi
mov    %rax,%rcx
call   1070 <test_ptr@plt>
test   %eax,%eax
je     13f6 <test_expmodzero+0x246>
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <BN_new@plt>
mov    %rax,%r15
lea    0xe04(%rip),%rdi
lea    0xeb7(%rip),%rdx
mov    $0x831,%esi
mov    %rax,%rcx
call   1070 <test_ptr@plt>
test   %eax,%eax
je     13f9 <test_expmodzero+0x249>
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <BN_new@plt>
mov    %rax,%r12
lea    0xdd4(%rip),%rdi
lea    0xe94(%rip),%rdx
mov    $0x832,%esi
mov    %rax,%rcx
call   1070 <test_ptr@plt>
test   %eax,%eax
je     13fc <test_expmodzero+0x24c>
mov    %rbx,%rdi
call   10a0 <BN_zero@plt>
xor    %r14d,%r14d
xor    %eax,%eax
call   1030 <BN_value_one@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %r8d,%r8d
call   1090 <BN_mod_exp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0xd84(%rip),%rdi
lea    0xe51(%rip),%rdx
mov    $0x836,%esi
call   1040 <test_true@plt>
test   %eax,%eax
je     13fc <test_expmodzero+0x24c>
lea    0xd64(%rip),%rdi
lea    0xe5e(%rip),%rdx
mov    $0x837,%esi
mov    %r12,%rcx
call   1060 <test_BN_eq_zero@plt>
test   %eax,%eax
je     13fc <test_expmodzero+0x24c>
xor    %r14d,%r14d
xor    %eax,%eax
call   1030 <BN_value_one@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   10d0 <BN_mod_exp_mont@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0xd19(%rip),%rdi
lea    0xe15(%rip),%rdx
mov    $0x838,%esi
call   1040 <test_true@plt>
test   %eax,%eax
je     13fc <test_expmodzero+0x24c>
lea    0xcf9(%rip),%rdi
lea    0xdf3(%rip),%rdx
mov    $0x83a,%esi
mov    %r12,%rcx
call   1060 <test_BN_eq_zero@plt>
test   %eax,%eax
je     13fc <test_expmodzero+0x24c>
xor    %r14d,%r14d
xor    %eax,%eax
call   1030 <BN_value_one@plt>
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   10b0 <BN_mod_exp_mont_consttime@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0xcae(%rip),%rdi
lea    0xde2(%rip),%rdx
mov    $0x83b,%esi
call   1040 <test_true@plt>
test   %eax,%eax
je     13fc <test_expmodzero+0x24c>
lea    0xc8e(%rip),%rdi
lea    0xd88(%rip),%rdx
mov    $0x83e,%esi
mov    %r12,%rcx
call   1060 <test_BN_eq_zero@plt>
test   %eax,%eax
je     13fc <test_expmodzero+0x24c>
xor    %r14d,%r14d
xor    %eax,%eax
call   1030 <BN_value_one@plt>
mov    %r12,%rdi
mov    $0x2a,%esi
mov    %rbx,%rdx
mov    %eax,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   10c0 <BN_mod_exp_mont_word@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0xc45(%rip),%rdi
lea    0xdbb(%rip),%rdx
mov    $0x83f,%esi
call   1040 <test_true@plt>
test   %eax,%eax
je     13fc <test_expmodzero+0x24c>
lea    0xc29(%rip),%rdi
lea    0xd23(%rip),%rdx
mov    $0x841,%esi
mov    %r12,%rcx
call   1060 <test_BN_eq_zero@plt>
xor    %r14d,%r14d
test   %eax,%eax
setne  %r14b
jmp    13fc <test_expmodzero+0x24c>
xor    %r15d,%r15d
xor    %r12d,%r12d
mov    %rbx,%rdi
call   1080 <BN_free@plt>
mov    %r15,%rdi
call   1080 <BN_free@plt>
mov    %r12,%rdi
call   1080 <BN_free@plt>
mov    %r14d,%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 = [16 x i8] c"zero = BN_new()\00"
@.str.2 = [13 x i8] c"a = BN_new()\00"
@.str.3 = [13 x i8] c"r = BN_new()\00"
@.str.4 = [45 x i8] c"BN_mod_exp(r, a, zero, BN_value_one(), NULL)\00"
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [56 x i8] c"BN_mod_exp_mont(r, a, zero, BN_value_one(), NULL, NULL)\00"
@.str.7 = [66 x i8] c"BN_mod_exp_mont_consttime(r, a, zero, BN_value_one(), NULL, NULL)\00"
@.str.8 = [62 x i8] c"BN_mod_exp_mont_word(r, 42, zero, BN_value_one(), NULL, NULL)\00"
define i32 @test_expmodzero() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
store i32* null, i32** %1
store i32* null, i32** %2
store i32* null, i32** %3
store i32 0, i32* %4
%5 = call i32* (...) @BN_new()
store i32* %5, i32** %3
%6 = call i32 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2096, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %0
%9 = call i32* (...) @BN_new()
store i32* %9, i32** %1
%10 = call i32 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2097, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32* %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %16
12: ; preds = %8
%13 = call i32* (...) @BN_new()
store i32* %13, i32** %2
%14 = call i32 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2098, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32* %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %12, %8, %0
br label %76
17: ; preds = %12
%18 = load i32*, i32** %3
%19 = call i32 @BN_zero(i32* %18)
%20 = load i32*, i32** %2
%21 = load i32*, i32** %1
%22 = load i32*, i32** %3
%23 = call i32 (...) @BN_value_one()
%24 = call i64 @BN_mod_exp(i32* %20, i32* %21, i32* %22, i32 %23, i32* null)
%25 = icmp ne i64 %24, 0
%26 = zext i1 %25 to i32
%27 = call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2102, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), i32 %26)
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %74
29: ; preds = %17
%30 = load i32*, i32** %2
%31 = call i32 @test_BN_eq_zero(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2103, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i32* %30)
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %74
33: ; preds = %29
%34 = load i32*, i32** %2
%35 = load i32*, i32** %1
%36 = load i32*, i32** %3
%37 = call i32 (...) @BN_value_one()
%38 = call i64 @BN_mod_exp_mont(i32* %34, i32* %35, i32* %36, i32 %37, i32* null, i32* null)
%39 = icmp ne i64 %38, 0
%40 = zext i1 %39 to i32
%41 = call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2104, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.6, i64 0, i64 0), i32 %40)
%42 = icmp ne i32 %41, 0
br i1 %42, label %43, label %74
43: ; preds = %33
%44 = load i32*, i32** %2
%45 = call i32 @test_BN_eq_zero(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2106, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i32* %44)
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %74
47: ; preds = %43
%48 = load i32*, i32** %2
%49 = load i32*, i32** %1
%50 = load i32*, i32** %3
%51 = call i32 (...) @BN_value_one()
%52 = call i64 @BN_mod_exp_mont_consttime(i32* %48, i32* %49, i32* %50, i32 %51, i32* null, i32* null)
%53 = icmp ne i64 %52, 0
%54 = zext i1 %53 to i32
%55 = call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2107, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.7, i64 0, i64 0), i32 %54)
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %74
57: ; preds = %47
%58 = load i32*, i32** %2
%59 = call i32 @test_BN_eq_zero(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2110, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i32* %58)
%60 = icmp ne i32 %59, 0
br i1 %60, label %61, label %74
61: ; preds = %57
%62 = load i32*, i32** %2
%63 = load i32*, i32** %3
%64 = call i32 (...) @BN_value_one()
%65 = call i64 @BN_mod_exp_mont_word(i32* %62, i32 42, i32* %63, i32 %64, i32* null, i32* null)
%66 = icmp ne i64 %65, 0
%67 = zext i1 %66 to i32
%68 = call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2111, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.8, i64 0, i64 0), i32 %67)
%69 = icmp ne i32 %68, 0
br i1 %69, label %70, label %74
70: ; preds = %61
%71 = load i32*, i32** %2
%72 = call i32 @test_BN_eq_zero(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2113, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i32* %71)
%73 = icmp ne i32 %72, 0
br i1 %73, label %75, label %74
74: ; preds = %70, %61, %57, %47, %43, %33, %29, %17
br label %76
75: ; preds = %70
store i32 1, i32* %4
br label %76
76: ; preds = %75, %74, %16
%77 = load i32*, i32** %3
%78 = call i32 @BN_free(i32* %77)
%79 = load i32*, i32** %1
%80 = call i32 @BN_free(i32* %79)
%81 = load i32*, i32** %2
%82 = call i32 @BN_free(i32* %81)
%83 = load i32, i32* %4
ret i32 %83
}

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 = [16 x i8] c"zero = BN_new()\00"
@.str.2 = [13 x i8] c"a = BN_new()\00"
@.str.3 = [13 x i8] c"r = BN_new()\00"
@.str.4 = [45 x i8] c"BN_mod_exp(r, a, zero, BN_value_one(), NULL)\00"
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [56 x i8] c"BN_mod_exp_mont(r, a, zero, BN_value_one(), NULL, NULL)\00"
@.str.7 = [66 x i8] c"BN_mod_exp_mont_consttime(r, a, zero, BN_value_one(), NULL, NULL)\00"
@.str.8 = [62 x i8] c"BN_mod_exp_mont_word(r, 42, zero, BN_value_one(), NULL, NULL)\00"
define i32 @test_expmodzero() {
%1 = tail call i32* (...) @BN_new()
%2 = tail call i32 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2096, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%3 = icmp eq i32 %2, 0
br i1 %3, label %54, label %4
4: ; preds = %0
%5 = tail call i32* (...) @BN_new()
%6 = tail call i32 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2097, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%7 = icmp eq i32 %6, 0
br i1 %7, label %54, label %8
8: ; preds = %4
%9 = tail call i32* (...) @BN_new()
%10 = tail call i32 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2098, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32* %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %54, label %12
12: ; preds = %8
%13 = tail call i32 @BN_zero(i32* %1)
%14 = tail call i32 (...) @BN_value_one()
%15 = tail call i64 @BN_mod_exp(i32* %9, i32* %5, i32* %1, i32 %14, i32* null)
%16 = icmp ne i64 %15, 0
%17 = zext i1 %16 to i32
%18 = tail call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2102, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.4, i64 0, i64 0), i32 %17)
%19 = icmp eq i32 %18, 0
br i1 %19, label %54, label %20
20: ; preds = %12
%21 = tail call i32 @test_BN_eq_zero(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2103, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i32* %9)
%22 = icmp eq i32 %21, 0
br i1 %22, label %54, label %23
23: ; preds = %20
%24 = tail call i32 (...) @BN_value_one()
%25 = tail call i64 @BN_mod_exp_mont(i32* %9, i32* %5, i32* %1, i32 %24, i32* null, i32* null)
%26 = icmp ne i64 %25, 0
%27 = zext i1 %26 to i32
%28 = tail call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2104, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.6, i64 0, i64 0), i32 %27)
%29 = icmp eq i32 %28, 0
br i1 %29, label %54, label %30
30: ; preds = %23
%31 = tail call i32 @test_BN_eq_zero(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2106, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i32* %9)
%32 = icmp eq i32 %31, 0
br i1 %32, label %54, label %33
33: ; preds = %30
%34 = tail call i32 (...) @BN_value_one()
%35 = tail call i64 @BN_mod_exp_mont_consttime(i32* %9, i32* %5, i32* %1, i32 %34, i32* null, i32* null)
%36 = icmp ne i64 %35, 0
%37 = zext i1 %36 to i32
%38 = tail call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2107, i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.7, i64 0, i64 0), i32 %37)
%39 = icmp eq i32 %38, 0
br i1 %39, label %54, label %40
40: ; preds = %33
%41 = tail call i32 @test_BN_eq_zero(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2110, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i32* %9)
%42 = icmp eq i32 %41, 0
br i1 %42, label %54, label %43
43: ; preds = %40
%44 = tail call i32 (...) @BN_value_one()
%45 = tail call i64 @BN_mod_exp_mont_word(i32* %9, i32 42, i32* %1, i32 %44, i32* null, i32* null)
%46 = icmp ne i64 %45, 0
%47 = zext i1 %46 to i32
%48 = tail call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2111, i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.8, i64 0, i64 0), i32 %47)
%49 = icmp eq i32 %48, 0
br i1 %49, label %54, label %50
50: ; preds = %43
%51 = tail call i32 @test_BN_eq_zero(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2113, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0), i32* %9)
%52 = icmp ne i32 %51, 0
%53 = zext i1 %52 to i32
br label %54
54: ; preds = %50, %12, %20, %23, %30, %33, %40, %43, %0, %4, %8
%55 = phi i32* [ %5, %43 ], [ %5, %40 ], [ %5, %33 ], [ %5, %30 ], [ %5, %23 ], [ %5, %20 ], [ %5, %12 ], [ %5, %8 ], [ %5, %4 ], [ null, %0 ], [ %5, %50 ]
%56 = phi i32* [ %9, %43 ], [ %9, %40 ], [ %9, %33 ], [ %9, %30 ], [ %9, %23 ], [ %9, %20 ], [ %9, %12 ], [ %9, %8 ], [ null, %4 ], [ null, %0 ], [ %9, %50 ]
%57 = phi i32 [ 0, %43 ], [ 0, %40 ], [ 0, %33 ], [ 0, %30 ], [ 0, %23 ], [ 0, %20 ], [ 0, %12 ], [ 0, %8 ], [ 0, %4 ], [ 0, %0 ], [ %53, %50 ]
%58 = tail call i32 @BN_free(i32* %1)
%59 = tail call i32 @BN_free(i32* %55)
%60 = tail call i32 @BN_free(i32* %56)
ret i32 %57
}