#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*/ BN_CTX;
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
unsigned char BN_BITS;
unsigned char BN_BITS2;
int /*<<< orphan*/ BN_CTX_free(int /*<<< orphan*/ *);
int /*<<< orphan*/ *BN_CTX_new();
int /*<<< orphan*/ BN_RAND_BOTTOM_ANY;
int /*<<< orphan*/ BN_RAND_BOTTOM_ODD;
int /*<<< orphan*/ BN_RAND_TOP_ONE;
scalar_t__ BN_cmp(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ BN_free(int /*<<< orphan*/ *);
scalar_t__ BN_mod(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_recp(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                           int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                           int /*<<< orphan*/ *);
scalar_t__ BN_mod_exp_simple(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                             int /*<<< orphan*/ *);
int /*<<< orphan*/ *BN_new();
int /*<<< orphan*/ BN_rand(int /*<<< orphan*/ *, unsigned char,
                           int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ RAND_bytes(unsigned char *, int);
int /*<<< orphan*/ test_BN_eq(char *, int, char *, char *, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ *);
int /*<<< orphan*/ test_info(char *, int, char *);
int /*<<< orphan*/ test_output_bignum(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ test_ptr(char *, int, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ test_true(char *, int, char *, int);
int test_mod_exp(int round) {
  BN_CTX *ctx;
  unsigned char c;
  int ret = 0;
  BIGNUM *r_mont = NULL;
  BIGNUM *r_mont_const = NULL;
  BIGNUM *r_recp = NULL;
  BIGNUM *r_simple = NULL;
  BIGNUM *a = NULL;
  BIGNUM *b = NULL;
  BIGNUM *m = NULL;
  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/exptest.c",
                134, "ctx = BN_CTX_new()", ctx = BN_CTX_new()))
    goto err;
  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/exptest.c",
                137, "r_mont = BN_new()", r_mont = 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/exptest.c",
                138, "r_mont_const = BN_new()", r_mont_const = 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/exptest.c",
                139, "r_recp = BN_new()", r_recp = 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/exptest.c",
                140, "r_simple = BN_new()", r_simple = 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/exptest.c",
                141, "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/exptest.c",
                142, "b = BN_new()", b = 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/exptest.c",
                143, "m = BN_new()", m = BN_new()))
    goto err;
  RAND_bytes(&c, 1);
  c = (c % BN_BITS) - BN_BITS2;
  BN_rand(a, (BN_BITS2 * 4) + c, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY);
  RAND_bytes(&c, 1);
  c = (c % BN_BITS) - BN_BITS2;
  BN_rand(b, (BN_BITS2 * 4) + c, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ANY);
  RAND_bytes(&c, 1);
  c = (c % BN_BITS) - BN_BITS2;
  BN_rand(m, (BN_BITS2 * 4) + c, BN_RAND_TOP_ONE, BN_RAND_BOTTOM_ODD);
  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/exptest.c",
          158, "BN_mod(a, a, m, ctx)", (BN_mod(a, a, m, ctx)) != 0) ||
      !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/exptest.c",
          159, "BN_mod(b, b, m, ctx)", (BN_mod(b, b, m, ctx)) != 0) ||
      !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/exptest.c",
          160, "BN_mod_exp_mont(r_mont, a, b, m, ctx, NULL)",
          (BN_mod_exp_mont(r_mont, a, b, m, ctx, NULL)) != 0) ||
      !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/exptest.c",
          161, "BN_mod_exp_recp(r_recp, a, b, m, ctx)",
          (BN_mod_exp_recp(r_recp, a, b, m, ctx)) != 0) ||
      !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/exptest.c",
          162, "BN_mod_exp_simple(r_simple, a, b, m, ctx)",
          (BN_mod_exp_simple(r_simple, a, b, m, ctx)) != 0) ||
      !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/exptest.c",
          163, "BN_mod_exp_mont_consttime(r_mont_const, a, b, m, ctx, NULL)",
          (BN_mod_exp_mont_consttime(r_mont_const, a, b, m, ctx, NULL)) != 0))
    goto err;
  if (!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/exptest.c",
          166, "r_simple", "r_mont", r_simple, r_mont) ||
      !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/exptest.c",
          167, "r_simple", "r_recp", r_simple, r_recp) ||
      !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/exptest.c",
          168, "r_simple", "r_mont_const", r_simple, r_mont_const)) {
    if (BN_cmp(r_simple, r_mont) != 0)
      test_info("/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",
                170, "simple and mont results differ");
    if (BN_cmp(r_simple, r_mont_const) != 0)
      test_info("/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",
                172, "simple and mont const time results differ");
    if (BN_cmp(r_simple, r_recp) != 0)
      test_info("/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",
                174, "simple and recp results differ");
    test_output_bignum("a", a);
    test_output_bignum("b", b);
    test_output_bignum("m", m);
    test_output_bignum("r_simple", r_simple);
    test_output_bignum("r_recp", r_recp);
    test_output_bignum("r_mont", r_mont);
    test_output_bignum("r_mont_const", r_mont_const);
    goto err;
  }
  ret = 1;
err:
  BN_free(r_mont);
  BN_free(r_mont_const);
  BN_free(r_recp);
  BN_free(r_simple);
  BN_free(a);
  BN_free(b);
  BN_free(m);
  BN_CTX_free(ctx);
  return ret;
}


x86 assembly (clang, -O0):
<test_mod_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
mov    $0x0,%al
call   10e0 <BN_CTX_new@plt>
mov    %rax,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xd91(%rip),%rdi
mov    $0x86,%esi
lea    0xe30(%rip),%rdx
call   10a0 <test_ptr@plt>
cmp    $0x0,%eax
jne    128e <test_mod_exp+0x7e>
jmp    1843 <test_mod_exp+0x633>
mov    $0x0,%al
call   1070 <BN_new@plt>
mov    %rax,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xd5d(%rip),%rdi
mov    $0x89,%esi
lea    0xe0f(%rip),%rdx
call   10a0 <test_ptr@plt>
cmp    $0x0,%eax
je     13d7 <test_mod_exp+0x1c7>
mov    $0x0,%al
call   1070 <BN_new@plt>
mov    %rax,%rcx
mov    %rcx,-0x28(%rbp)
lea    0xd2e(%rip),%rdi
mov    $0x8a,%esi
lea    0xdf2(%rip),%rdx
call   10a0 <test_ptr@plt>
cmp    $0x0,%eax
je     13d7 <test_mod_exp+0x1c7>
mov    $0x0,%al
call   1070 <BN_new@plt>
mov    %rax,%rcx
mov    %rcx,-0x30(%rbp)
lea    0xcff(%rip),%rdi
mov    $0x8b,%esi
lea    0xddb(%rip),%rdx
call   10a0 <test_ptr@plt>
cmp    $0x0,%eax
je     13d7 <test_mod_exp+0x1c7>
mov    $0x0,%al
call   1070 <BN_new@plt>
mov    %rax,%rcx
mov    %rcx,-0x38(%rbp)
lea    0xcd0(%rip),%rdi
mov    $0x8c,%esi
lea    0xdbe(%rip),%rdx
call   10a0 <test_ptr@plt>
cmp    $0x0,%eax
je     13d7 <test_mod_exp+0x1c7>
mov    $0x0,%al
call   1070 <BN_new@plt>
mov    %rax,%rcx
mov    %rcx,-0x40(%rbp)
lea    0xca1(%rip),%rdi
mov    $0x8d,%esi
lea    0xda3(%rip),%rdx
call   10a0 <test_ptr@plt>
cmp    $0x0,%eax
je     13d7 <test_mod_exp+0x1c7>
mov    $0x0,%al
call   1070 <BN_new@plt>
mov    %rax,%rcx
mov    %rcx,-0x48(%rbp)
lea    0xc72(%rip),%rdi
mov    $0x8e,%esi
lea    0xd81(%rip),%rdx
call   10a0 <test_ptr@plt>
cmp    $0x0,%eax
je     13d7 <test_mod_exp+0x1c7>
mov    $0x0,%al
call   1070 <BN_new@plt>
mov    %rax,%rcx
mov    %rcx,-0x50(%rbp)
lea    0xc43(%rip),%rdi
mov    $0x8f,%esi
lea    0xd5f(%rip),%rdx
call   10a0 <test_ptr@plt>
cmp    $0x0,%eax
jne    13dc <test_mod_exp+0x1cc>
jmp    1843 <test_mod_exp+0x633>
lea    -0x11(%rbp),%rdi
mov    $0x1,%esi
call   1090 <RAND_bytes@plt>
movzbl -0x11(%rbp),%eax
mov    0x2be3(%rip),%rcx
movzbl (%rcx),%ecx
cltd
idiv   %ecx
mov    0x2bc6(%rip),%rax
movzbl (%rax),%eax
sub    %eax,%edx
mov    %dl,%al
mov    %al,-0x11(%rbp)
mov    -0x40(%rbp),%rdi
mov    0x2bb1(%rip),%rax
movzbl (%rax),%eax
shl    $0x2,%eax
movzbl -0x11(%rbp),%ecx
add    %ecx,%eax
mov    0x2bb6(%rip),%rcx
mov    (%rcx),%edx
mov    0x2b8d(%rip),%rcx
mov    (%rcx),%ecx
movzbl %al,%esi
call   1030 <BN_rand@plt>
lea    -0x11(%rbp),%rdi
mov    $0x1,%esi
call   1090 <RAND_bytes@plt>
movzbl -0x11(%rbp),%eax
mov    0x2b82(%rip),%rcx
movzbl (%rcx),%ecx
cltd
idiv   %ecx
mov    0x2b65(%rip),%rax
movzbl (%rax),%eax
sub    %eax,%edx
mov    %dl,%al
mov    %al,-0x11(%rbp)
mov    -0x48(%rbp),%rdi
mov    0x2b50(%rip),%rax
movzbl (%rax),%eax
shl    $0x2,%eax
movzbl -0x11(%rbp),%ecx
add    %ecx,%eax
mov    0x2b55(%rip),%rcx
mov    (%rcx),%edx
mov    0x2b2c(%rip),%rcx
mov    (%rcx),%ecx
movzbl %al,%esi
call   1030 <BN_rand@plt>
lea    -0x11(%rbp),%rdi
mov    $0x1,%esi
call   1090 <RAND_bytes@plt>
movzbl -0x11(%rbp),%eax
mov    0x2b21(%rip),%rcx
movzbl (%rcx),%ecx
cltd
idiv   %ecx
mov    0x2b04(%rip),%rax
movzbl (%rax),%eax
sub    %eax,%edx
mov    %dl,%al
mov    %al,-0x11(%rbp)
mov    -0x50(%rbp),%rdi
mov    0x2aef(%rip),%rax
movzbl (%rax),%eax
shl    $0x2,%eax
movzbl -0x11(%rbp),%ecx
add    %ecx,%eax
mov    0x2af4(%rip),%rcx
mov    (%rcx),%edx
mov    0x2b03(%rip),%rcx
mov    (%rcx),%ecx
movzbl %al,%esi
call   1030 <BN_rand@plt>
mov    -0x40(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x50(%rbp),%rdx
mov    -0x10(%rbp),%rcx
call   10f0 <BN_mod@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xad9(%rip),%rdi
mov    $0x9e,%esi
lea    0xc02(%rip),%rdx
call   1050 <test_true@plt>
cmp    $0x0,%eax
je     16a5 <test_mod_exp+0x495>
mov    -0x48(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x50(%rbp),%rdx
mov    -0x10(%rbp),%rcx
call   10f0 <BN_mod@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xa97(%rip),%rdi
mov    $0x9f,%esi
lea    0xbd5(%rip),%rdx
call   1050 <test_true@plt>
cmp    $0x0,%eax
je     16a5 <test_mod_exp+0x495>
mov    -0x20(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x50(%rbp),%rcx
mov    -0x10(%rbp),%r8
xor    %eax,%eax
mov    %eax,%r9d
call   1130 <BN_mod_exp_mont@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xa4c(%rip),%rdi
mov    $0xa0,%esi
lea    0xb9f(%rip),%rdx
call   1050 <test_true@plt>
cmp    $0x0,%eax
je     16a5 <test_mod_exp+0x495>
mov    -0x30(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x50(%rbp),%rcx
mov    -0x10(%rbp),%r8
call   1040 <BN_mod_exp_recp@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xa06(%rip),%rdi
mov    $0xa1,%esi
lea    0xb85(%rip),%rdx
call   1050 <test_true@plt>
cmp    $0x0,%eax
je     16a5 <test_mod_exp+0x495>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x50(%rbp),%rcx
mov    -0x10(%rbp),%r8
call   10c0 <BN_mod_exp_simple@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0x9c0(%rip),%rdi
mov    $0xa2,%esi
lea    0xb65(%rip),%rdx
call   1050 <test_true@plt>
cmp    $0x0,%eax
je     16a5 <test_mod_exp+0x495>
mov    -0x28(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    -0x48(%rbp),%rdx
mov    -0x50(%rbp),%rcx
mov    -0x10(%rbp),%r8
xor    %eax,%eax
mov    %eax,%r9d
call   1120 <BN_mod_exp_mont_consttime@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0x975(%rip),%rdi
mov    $0xa3,%esi
lea    0xb44(%rip),%rdx
call   1050 <test_true@plt>
cmp    $0x0,%eax
jne    16aa <test_mod_exp+0x49a>
jmp    1843 <test_mod_exp+0x633>
mov    -0x38(%rbp),%r8
mov    -0x20(%rbp),%r9
lea    0x947(%rip),%rdi
mov    $0xa6,%esi
lea    0xb52(%rip),%rdx
lea    0xb54(%rip),%rcx
call   1080 <test_BN_eq@plt>
cmp    $0x0,%eax
je     173a <test_mod_exp+0x52a>
mov    -0x38(%rbp),%r8
mov    -0x30(%rbp),%r9
lea    0x917(%rip),%rdi
mov    $0xa7,%esi
lea    0xb22(%rip),%rdx
lea    0xb2b(%rip),%rcx
call   1080 <test_BN_eq@plt>
cmp    $0x0,%eax
je     173a <test_mod_exp+0x52a>
mov    -0x38(%rbp),%r8
mov    -0x28(%rbp),%r9
lea    0x8e7(%rip),%rdi
mov    $0xa8,%esi
lea    0xaf2(%rip),%rdx
lea    0xb02(%rip),%rcx
call   1080 <test_BN_eq@plt>
cmp    $0x0,%eax
jne    183c <test_mod_exp+0x62c>
mov    -0x38(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1110 <BN_cmp@plt>
cmp    $0x0,%rax
je     1769 <test_mod_exp+0x559>
lea    0x8a8(%rip),%rdi
mov    $0xaa,%esi
lea    0xad7(%rip),%rdx
call   1100 <test_info@plt>
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1110 <BN_cmp@plt>
cmp    $0x0,%rax
je     1798 <test_mod_exp+0x588>
lea    0x879(%rip),%rdi
mov    $0xac,%esi
lea    0xac7(%rip),%rdx
call   1100 <test_info@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1110 <BN_cmp@plt>
cmp    $0x0,%rax
je     17c7 <test_mod_exp+0x5b7>
lea    0x84a(%rip),%rdi
mov    $0xae,%esi
lea    0xac2(%rip),%rdx
call   1100 <test_info@plt>
mov    -0x40(%rbp),%rsi
lea    0xad1(%rip),%rdi
call   1060 <test_output_bignum@plt>
mov    -0x48(%rbp),%rsi
lea    0xac3(%rip),%rdi
call   1060 <test_output_bignum@plt>
mov    -0x50(%rbp),%rsi
lea    0xab5(%rip),%rdi
call   1060 <test_output_bignum@plt>
mov    -0x38(%rbp),%rsi
lea    0xa15(%rip),%rdi
call   1060 <test_output_bignum@plt>
mov    -0x30(%rbp),%rsi
lea    0xa15(%rip),%rdi
call   1060 <test_output_bignum@plt>
mov    -0x20(%rbp),%rsi
lea    0x9fe(%rip),%rdi
call   1060 <test_output_bignum@plt>
mov    -0x28(%rbp),%rsi
lea    0x9fc(%rip),%rdi
call   1060 <test_output_bignum@plt>
jmp    1843 <test_mod_exp+0x633>
movl   $0x1,-0x18(%rbp)
mov    -0x20(%rbp),%rdi
call   10d0 <BN_free@plt>
mov    -0x28(%rbp),%rdi
call   10d0 <BN_free@plt>
mov    -0x30(%rbp),%rdi
call   10d0 <BN_free@plt>
mov    -0x38(%rbp),%rdi
call   10d0 <BN_free@plt>
mov    -0x40(%rbp),%rdi
call   10d0 <BN_free@plt>
mov    -0x48(%rbp),%rdi
call   10d0 <BN_free@plt>
mov    -0x50(%rbp),%rdi
call   10d0 <BN_free@plt>
mov    -0x10(%rbp),%rdi
call   10b0 <BN_CTX_free@plt>
mov    -0x18(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mod_exp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
xor    %eax,%eax
call   10e0 <BN_CTX_new@plt>
mov    %rax,%rbx
lea    0xdd1(%rip),%rdi
lea    0xe75(%rip),%rdx
mov    $0x86,%esi
mov    %rax,%rcx
call   10a0 <test_ptr@plt>
test   %eax,%eax
mov    %rbx,0x30(%rsp)
je     16c5 <test_mod_exp+0x4b5>
xor    %eax,%eax
call   1070 <BN_new@plt>
lea    0xda2(%rip),%rdi
lea    0xe59(%rip),%rdx
mov    $0x89,%esi
mov    %rax,0x8(%rsp)
mov    %rax,%rcx
call   10a0 <test_ptr@plt>
test   %eax,%eax
je     16e0 <test_mod_exp+0x4d0>
xor    %eax,%eax
call   1070 <BN_new@plt>
mov    %rax,%rbp
lea    0xd70(%rip),%rdi
lea    0xe39(%rip),%rdx
mov    $0x8a,%esi
mov    %rax,%rcx
call   10a0 <test_ptr@plt>
test   %eax,%eax
je     16eb <test_mod_exp+0x4db>
xor    %eax,%eax
call   1070 <BN_new@plt>
lea    0xd46(%rip),%rdi
lea    0xe27(%rip),%rdx
mov    $0x8b,%esi
mov    %rax,%r13
mov    %rax,%rcx
call   10a0 <test_ptr@plt>
test   %eax,%eax
je     1758 <test_mod_exp+0x548>
xor    %eax,%eax
call   1070 <BN_new@plt>
lea    0xd19(%rip),%rdi
lea    0xe0c(%rip),%rdx
mov    $0x8c,%esi
mov    %rax,%r15
mov    %rax,%rcx
call   10a0 <test_ptr@plt>
test   %eax,%eax
je     1761 <test_mod_exp+0x551>
xor    %eax,%eax
call   1070 <BN_new@plt>
lea    0xcec(%rip),%rdi
lea    0xdf3(%rip),%rdx
mov    $0x8d,%esi
mov    %rax,0x20(%rsp)
mov    %rax,%rcx
call   10a0 <test_ptr@plt>
test   %eax,%eax
je     176a <test_mod_exp+0x55a>
mov    %rbp,0x10(%rsp)
xor    %eax,%eax
call   1070 <BN_new@plt>
mov    %rax,%rbp
lea    0xcb5(%rip),%rdi
lea    0xdc9(%rip),%rdx
mov    $0x8e,%esi
mov    %rax,%rcx
call   10a0 <test_ptr@plt>
test   %eax,%eax
je     1778 <test_mod_exp+0x568>
xor    %eax,%eax
call   1070 <BN_new@plt>
mov    %rax,%r14
lea    0xc88(%rip),%rdi
lea    0xda9(%rip),%rdx
mov    $0x8f,%esi
mov    %rax,%rcx
call   10a0 <test_ptr@plt>
test   %eax,%eax
je     179a <test_mod_exp+0x58a>
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1090 <RAND_bytes@plt>
mov    0x2c2e(%rip),%rcx
movzbl 0x7(%rsp),%eax
divb   (%rcx)
movzbl %ah,%ecx
mov    0x2c0d(%rip),%rax
mov    (%rax),%al
sub    %al,%cl
mov    %cl,0x7(%rsp)
shl    $0x2,%al
add    %cl,%al
mov    0x2c11(%rip),%rcx
mov    (%rcx),%edx
mov    0x2be8(%rip),%rcx
mov    (%rcx),%ecx
movzbl %al,%esi
mov    0x20(%rsp),%r12
mov    %r12,%rdi
call   1030 <BN_rand@plt>
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1090 <RAND_bytes@plt>
movzbl 0x7(%rsp),%eax
mov    0x2bd3(%rip),%rcx
divb   (%rcx)
movzbl %ah,%ecx
mov    0x2bb7(%rip),%rax
mov    (%rax),%al
sub    %al,%cl
mov    %cl,0x7(%rsp)
shl    $0x2,%al
add    %cl,%al
mov    0x2bbb(%rip),%rcx
mov    (%rcx),%edx
mov    0x2b92(%rip),%rcx
mov    (%rcx),%ecx
movzbl %al,%esi
mov    %rbp,%rdi
call   1030 <BN_rand@plt>
lea    0x7(%rsp),%rdi
mov    $0x1,%esi
call   1090 <RAND_bytes@plt>
movzbl 0x7(%rsp),%eax
mov    0x2b82(%rip),%rcx
divb   (%rcx)
movzbl %ah,%ecx
mov    0x2b66(%rip),%rax
mov    (%rax),%al
sub    %al,%cl
mov    %cl,0x7(%rsp)
shl    $0x2,%al
add    %cl,%al
mov    0x2b6a(%rip),%rcx
mov    (%rcx),%edx
mov    0x2b79(%rip),%rcx
mov    (%rcx),%ecx
movzbl %al,%esi
mov    %r14,%rdi
call   1030 <BN_rand@plt>
mov    %r12,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
call   10f0 <BN_mod@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0xb54(%rip),%rdi
lea    0xc82(%rip),%rdx
mov    $0x9e,%esi
call   1050 <test_true@plt>
test   %eax,%eax
je     1783 <test_mod_exp+0x573>
mov    %rbp,%rdi
mov    %rbp,%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
call   10f0 <BN_mod@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0xb1b(%rip),%rdi
lea    0xc5e(%rip),%rdx
mov    $0x9f,%esi
call   1050 <test_true@plt>
test   %eax,%eax
je     1783 <test_mod_exp+0x573>
xor    %eax,%eax
mov    %rax,0x18(%rsp)
mov    0x8(%rsp),%rdi
mov    %r12,%rsi
mov    %rbp,%rdx
mov    %r14,%rcx
mov    %rbx,%r8
xor    %r9d,%r9d
call   1130 <BN_mod_exp_mont@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0xad3(%rip),%rdi
lea    0xc2b(%rip),%rdx
mov    $0xa0,%esi
call   1050 <test_true@plt>
test   %eax,%eax
mov    %rbx,%r8
mov    %r14,%rbx
mov    %rbp,%r14
je     17be <test_mod_exp+0x5ae>
mov    %r13,%rbp
mov    %r13,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
mov    %r8,%r13
call   1040 <BN_mod_exp_recp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0xa8b(%rip),%rdi
lea    0xc0f(%rip),%rdx
mov    $0xa1,%esi
call   1050 <test_true@plt>
test   %eax,%eax
je     17bb <test_mod_exp+0x5ab>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
mov    %rbx,%rcx
mov    %r13,%r8
call   10c0 <BN_mod_exp_simple@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0xa4f(%rip),%rdi
lea    0xbf9(%rip),%rdx
mov    $0xa2,%esi
call   1050 <test_true@plt>
test   %eax,%eax
je     17bb <test_mod_exp+0x5ab>
xor    %eax,%eax
mov    %rax,0x18(%rsp)
mov    0x10(%rsp),%rdi
mov    %r12,%rsi
mov    %r14,0x28(%rsp)
mov    %r14,%rdx
mov    %rbx,%rcx
mov    %r13,%r8
xor    %r9d,%r9d
call   1120 <BN_mod_exp_mont_consttime@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0xa02(%rip),%rdi
lea    0xbd6(%rip),%rdx
mov    $0xa3,%esi
call   1050 <test_true@plt>
test   %eax,%eax
je     16ac <test_mod_exp+0x49c>
lea    0x9e2(%rip),%rdi
lea    0xbf2(%rip),%rdx
lea    0xbf4(%rip),%rcx
mov    $0xa6,%esi
mov    %r15,%r8
mov    0x8(%rsp),%r9
call   1080 <test_BN_eq@plt>
test   %eax,%eax
je     17c8 <test_mod_exp+0x5b8>
lea    0x9b3(%rip),%rdi
lea    0xbc3(%rip),%rdx
lea    0xbcc(%rip),%rcx
mov    $0xa7,%esi
mov    %r15,%r8
mov    %rbp,%r9
call   1080 <test_BN_eq@plt>
test   %eax,%eax
je     17c8 <test_mod_exp+0x5b8>
lea    0x986(%rip),%rdi
lea    0xb96(%rip),%rdx
lea    0xba6(%rip),%rcx
mov    $0xa8,%esi
mov    %r15,%r8
mov    0x10(%rsp),%r9
call   1080 <test_BN_eq@plt>
test   %eax,%eax
je     17c8 <test_mod_exp+0x5b8>
mov    $0x1,%eax
mov    %rax,0x18(%rsp)
mov    %rbp,%r13
mov    0x10(%rsp),%rbp
mov    0x8(%rsp),%rdi
mov    0x20(%rsp),%r12
mov    0x28(%rsp),%r14
jmp    1705 <test_mod_exp+0x4f5>
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %edi,%edi
xor    %ebp,%ebp
xor    %r13d,%r13d
xor    %r15d,%r15d
xor    %r12d,%r12d
xor    %r14d,%r14d
xor    %ebx,%ebx
jmp    1705 <test_mod_exp+0x4f5>
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %ebp,%ebp
jmp    16f2 <test_mod_exp+0x4e2>
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %r13d,%r13d
xor    %r15d,%r15d
xor    %r12d,%r12d
xor    %r14d,%r14d
xor    %ebx,%ebx
mov    0x8(%rsp),%rdi
call   10d0 <BN_free@plt>
mov    %rbp,%rdi
call   10d0 <BN_free@plt>
mov    %r13,%rdi
call   10d0 <BN_free@plt>
mov    %r15,%rdi
call   10d0 <BN_free@plt>
mov    %r12,%rdi
call   10d0 <BN_free@plt>
mov    %r14,%rdi
call   10d0 <BN_free@plt>
mov    %rbx,%rdi
call   10d0 <BN_free@plt>
mov    0x30(%rsp),%rdi
call   10b0 <BN_CTX_free@plt>
mov    0x18(%rsp),%rax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
mov    %rax,0x18(%rsp)
jmp    16f5 <test_mod_exp+0x4e5>
xor    %eax,%eax
mov    %rax,0x18(%rsp)
jmp    16f8 <test_mod_exp+0x4e8>
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %r14d,%r14d
xor    %ebx,%ebx
jmp    17ac <test_mod_exp+0x59c>
xor    %eax,%eax
mov    %rax,0x18(%rsp)
xor    %ebx,%ebx
jmp    17a4 <test_mod_exp+0x594>
xor    %eax,%eax
mov    %rax,0x18(%rsp)
mov    %r14,%rbx
mov    %rbp,%r14
mov    0x10(%rsp),%rbp
jmp    1700 <test_mod_exp+0x4f0>
xor    %eax,%eax
mov    %rax,0x18(%rsp)
mov    %r14,%rbx
mov    %rbp,%r14
mov    0x10(%rsp),%rbp
mov    0x8(%rsp),%rdi
mov    0x20(%rsp),%r12
jmp    1705 <test_mod_exp+0x4f5>
mov    %rbp,%r13
mov    0x10(%rsp),%rbp
jmp    1700 <test_mod_exp+0x4f0>
mov    %r15,%rdi
mov    0x8(%rsp),%rsi
call   1110 <BN_cmp@plt>
test   %rax,%rax
je     17f2 <test_mod_exp+0x5e2>
lea    0x81f(%rip),%rdi
lea    0xa53(%rip),%rdx
mov    $0xaa,%esi
call   1100 <test_info@plt>
mov    %r15,%rdi
mov    0x10(%rsp),%rsi
call   1110 <BN_cmp@plt>
test   %rax,%rax
je     181c <test_mod_exp+0x60c>
lea    0x7f5(%rip),%rdi
lea    0xa48(%rip),%rdx
mov    $0xac,%esi
call   1100 <test_info@plt>
mov    %r15,%rdi
mov    %rbp,%rsi
call   1110 <BN_cmp@plt>
test   %rax,%rax
je     1844 <test_mod_exp+0x634>
lea    0x7cd(%rip),%rdi
lea    0xa4a(%rip),%rdx
mov    $0xae,%esi
call   1100 <test_info@plt>
lea    0xa58(%rip),%rdi
mov    0x20(%rsp),%r12
mov    %r12,%rsi
call   1060 <test_output_bignum@plt>
lea    0xa46(%rip),%rdi
mov    0x28(%rsp),%r14
mov    %r14,%rsi
call   1060 <test_output_bignum@plt>
lea    0xa34(%rip),%rdi
mov    %rbx,%rsi
call   1060 <test_output_bignum@plt>
lea    0x995(%rip),%rdi
mov    %r15,%rsi
call   1060 <test_output_bignum@plt>
lea    0x996(%rip),%rdi
mov    %rbp,%rsi
call   1060 <test_output_bignum@plt>
lea    0x980(%rip),%rdi
mov    0x8(%rsp),%rsi
call   1060 <test_output_bignum@plt>
lea    0x97d(%rip),%rdi
mov    %rbp,%r13
mov    0x10(%rsp),%rbp
mov    %rbp,%rsi
call   1060 <test_output_bignum@plt>
jmp    1700 <test_mod_exp+0x4f0>

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 = [19 x i8] c"ctx = BN_CTX_new()\00"
@.str.2 = [18 x i8] c"r_mont = BN_new()\00"
@.str.3 = [24 x i8] c"r_mont_const = BN_new()\00"
@.str.4 = [18 x i8] c"r_recp = BN_new()\00"
@.str.5 = [20 x i8] c"r_simple = BN_new()\00"
@.str.6 = [13 x i8] c"a = BN_new()\00"
@.str.7 = [13 x i8] c"b = BN_new()\00"
@.str.8 = [13 x i8] c"m = BN_new()\00"
@BN_BITS = global i8 0
@BN_BITS2 = global i8 0
@BN_RAND_TOP_ONE = global i32 0
@BN_RAND_BOTTOM_ANY = global i32 0
@BN_RAND_BOTTOM_ODD = global i32 0
@.str.9 = [21 x i8] c"BN_mod(a, a, m, ctx)\00"
@.str.10 = [21 x i8] c"BN_mod(b, b, m, ctx)\00"
@.str.11 = [44 x i8] c"BN_mod_exp_mont(r_mont, a, b, m, ctx, NULL)\00"
@.str.12 = [38 x i8] c"BN_mod_exp_recp(r_recp, a, b, m, ctx)\00"
@.str.13 = [42 x i8] c"BN_mod_exp_simple(r_simple, a, b, m, ctx)\00"
@.str.14 = [60 x i8] c"BN_mod_exp_mont_consttime(r_mont_const, a, b, m, ctx, NULL)\00"
@.str.15 = [9 x i8] c"r_simple\00"
@.str.16 = [7 x i8] c"r_mont\00"
@.str.17 = [7 x i8] c"r_recp\00"
@.str.18 = [13 x i8] c"r_mont_const\00"
@.str.19 = [31 x i8] c"simple and mont results differ\00"
@.str.20 = [42 x i8] c"simple and mont const time results differ\00"
@.str.21 = [31 x i8] c"simple and recp results differ\00"
@.str.22 = [2 x i8] c"a\00"
@.str.23 = [2 x i8] c"b\00"
@.str.24 = [2 x i8] c"m\00"
define i32 @test_mod_exp(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
store i32 %0, i32* %2
store i32 0, i32* %5
store i32* null, i32** %6
store i32* null, i32** %7
store i32* null, i32** %8
store i32* null, i32** %9
store i32* null, i32** %10
store i32* null, i32** %11
store i32* null, i32** %12
%13 = call i32* (...) @BN_CTX_new()
store i32* %13, i32** %3
%14 = call i32 @test_ptr(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 134, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32* %13)
%15 = icmp ne i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %1
br label %226
17: ; preds = %1
%18 = call i32* (...) @BN_new()
store i32* %18, i32** %6
%19 = call i32 @test_ptr(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 137, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32* %18)
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %45
21: ; preds = %17
%22 = call i32* (...) @BN_new()
store i32* %22, i32** %7
%23 = call i32 @test_ptr(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 138, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32* %22)
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %45
25: ; preds = %21
%26 = call i32* (...) @BN_new()
store i32* %26, i32** %8
%27 = call i32 @test_ptr(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 139, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32* %26)
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %45
29: ; preds = %25
%30 = call i32* (...) @BN_new()
store i32* %30, i32** %9
%31 = call i32 @test_ptr(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 140, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32* %30)
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %45
33: ; preds = %29
%34 = call i32* (...) @BN_new()
store i32* %34, i32** %10
%35 = call i32 @test_ptr(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 141, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32* %34)
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %45
37: ; preds = %33
%38 = call i32* (...) @BN_new()
store i32* %38, i32** %11
%39 = call i32 @test_ptr(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 142, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32* %38)
%40 = icmp ne i32 %39, 0
br i1 %40, label %41, label %45
41: ; preds = %37
%42 = call i32* (...) @BN_new()
store i32* %42, i32** %12
%43 = call i32 @test_ptr(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 143, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32* %42)
%44 = icmp ne i32 %43, 0
br i1 %44, label %46, label %45
45: ; preds = %41, %37, %33, %29, %25, %21, %17
br label %226
46: ; preds = %41
%47 = call i32 @RAND_bytes(i8* %4, i32 1)
%48 = load i8, i8* %4
%49 = zext i8 %48 to i32
%50 = load i8, i8* @BN_BITS
%51 = zext i8 %50 to i32
%52 = srem i32 %49, %51
%53 = load i8, i8* @BN_BITS2
%54 = zext i8 %53 to i32
%55 = sub nsw i32 %52, %54
%56 = trunc i32 %55 to i8
store i8 %56, i8* %4
%57 = load i32*, i32** %10
%58 = load i8, i8* @BN_BITS2
%59 = zext i8 %58 to i32
%60 = mul nsw i32 %59, 4
%61 = load i8, i8* %4
%62 = zext i8 %61 to i32
%63 = add nsw i32 %60, %62
%64 = trunc i32 %63 to i8
%65 = load i32, i32* @BN_RAND_TOP_ONE
%66 = load i32, i32* @BN_RAND_BOTTOM_ANY
%67 = call i32 @BN_rand(i32* %57, i8 zeroext %64, i32 %65, i32 %66)
%68 = call i32 @RAND_bytes(i8* %4, i32 1)
%69 = load i8, i8* %4
%70 = zext i8 %69 to i32
%71 = load i8, i8* @BN_BITS
%72 = zext i8 %71 to i32
%73 = srem i32 %70, %72
%74 = load i8, i8* @BN_BITS2
%75 = zext i8 %74 to i32
%76 = sub nsw i32 %73, %75
%77 = trunc i32 %76 to i8
store i8 %77, i8* %4
%78 = load i32*, i32** %11
%79 = load i8, i8* @BN_BITS2
%80 = zext i8 %79 to i32
%81 = mul nsw i32 %80, 4
%82 = load i8, i8* %4
%83 = zext i8 %82 to i32
%84 = add nsw i32 %81, %83
%85 = trunc i32 %84 to i8
%86 = load i32, i32* @BN_RAND_TOP_ONE
%87 = load i32, i32* @BN_RAND_BOTTOM_ANY
%88 = call i32 @BN_rand(i32* %78, i8 zeroext %85, i32 %86, i32 %87)
%89 = call i32 @RAND_bytes(i8* %4, i32 1)
%90 = load i8, i8* %4
%91 = zext i8 %90 to i32
%92 = load i8, i8* @BN_BITS
%93 = zext i8 %92 to i32
%94 = srem i32 %91, %93
%95 = load i8, i8* @BN_BITS2
%96 = zext i8 %95 to i32
%97 = sub nsw i32 %94, %96
%98 = trunc i32 %97 to i8
store i8 %98, i8* %4
%99 = load i32*, i32** %12
%100 = load i8, i8* @BN_BITS2
%101 = zext i8 %100 to i32
%102 = mul nsw i32 %101, 4
%103 = load i8, i8* %4
%104 = zext i8 %103 to i32
%105 = add nsw i32 %102, %104
%106 = trunc i32 %105 to i8
%107 = load i32, i32* @BN_RAND_TOP_ONE
%108 = load i32, i32* @BN_RAND_BOTTOM_ODD
%109 = call i32 @BN_rand(i32* %99, i8 zeroext %106, i32 %107, i32 %108)
%110 = load i32*, i32** %10
%111 = load i32*, i32** %10
%112 = load i32*, i32** %12
%113 = load i32*, i32** %3
%114 = call i64 @BN_mod(i32* %110, i32* %111, i32* %112, i32* %113)
%115 = icmp ne i64 %114, 0
%116 = zext i1 %115 to i32
%117 = call i32 @test_true(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 158, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i32 %116)
%118 = icmp ne i32 %117, 0
br i1 %118, label %119, label %173
119: ; preds = %46
%120 = load i32*, i32** %11
%121 = load i32*, i32** %11
%122 = load i32*, i32** %12
%123 = load i32*, i32** %3
%124 = call i64 @BN_mod(i32* %120, i32* %121, i32* %122, i32* %123)
%125 = icmp ne i64 %124, 0
%126 = zext i1 %125 to i32
%127 = call i32 @test_true(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 159, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0), i32 %126)
%128 = icmp ne i32 %127, 0
br i1 %128, label %129, label %173
129: ; preds = %119
%130 = load i32*, i32** %6
%131 = load i32*, i32** %10
%132 = load i32*, i32** %11
%133 = load i32*, i32** %12
%134 = load i32*, i32** %3
%135 = call i64 @BN_mod_exp_mont(i32* %130, i32* %131, i32* %132, i32* %133, i32* %134, i32* null)
%136 = icmp ne i64 %135, 0
%137 = zext i1 %136 to i32
%138 = call i32 @test_true(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 160, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.11, i64 0, i64 0), i32 %137)
%139 = icmp ne i32 %138, 0
br i1 %139, label %140, label %173
140: ; preds = %129
%141 = load i32*, i32** %8
%142 = load i32*, i32** %10
%143 = load i32*, i32** %11
%144 = load i32*, i32** %12
%145 = load i32*, i32** %3
%146 = call i64 @BN_mod_exp_recp(i32* %141, i32* %142, i32* %143, i32* %144, i32* %145)
%147 = icmp ne i64 %146, 0
%148 = zext i1 %147 to i32
%149 = call i32 @test_true(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 161, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i64 0, i64 0), i32 %148)
%150 = icmp ne i32 %149, 0
br i1 %150, label %151, label %173
151: ; preds = %140
%152 = load i32*, i32** %9
%153 = load i32*, i32** %10
%154 = load i32*, i32** %11
%155 = load i32*, i32** %12
%156 = load i32*, i32** %3
%157 = call i64 @BN_mod_exp_simple(i32* %152, i32* %153, i32* %154, i32* %155, i32* %156)
%158 = icmp ne i64 %157, 0
%159 = zext i1 %158 to i32
%160 = call i32 @test_true(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 162, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.13, i64 0, i64 0), i32 %159)
%161 = icmp ne i32 %160, 0
br i1 %161, label %162, label %173
162: ; preds = %151
%163 = load i32*, i32** %7
%164 = load i32*, i32** %10
%165 = load i32*, i32** %11
%166 = load i32*, i32** %12
%167 = load i32*, i32** %3
%168 = call i64 @BN_mod_exp_mont_consttime(i32* %163, i32* %164, i32* %165, i32* %166, i32* %167, i32* null)
%169 = icmp ne i64 %168, 0
%170 = zext i1 %169 to i32
%171 = call i32 @test_true(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 163, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.14, i64 0, i64 0), i32 %170)
%172 = icmp ne i32 %171, 0
br i1 %172, label %174, label %173
173: ; preds = %162, %151, %140, %129, %119, %46
br label %226
174: ; preds = %162
%175 = load i32*, i32** %9
%176 = load i32*, i32** %6
%177 = call i32 @test_BN_eq(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 166, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i32* %175, i32* %176)
%178 = icmp ne i32 %177, 0
br i1 %178, label %179, label %189
179: ; preds = %174
%180 = load i32*, i32** %9
%181 = load i32*, i32** %8
%182 = call i32 @test_BN_eq(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 167, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i32* %180, i32* %181)
%183 = icmp ne i32 %182, 0
br i1 %183, label %184, label %189
184: ; preds = %179
%185 = load i32*, i32** %9
%186 = load i32*, i32** %7
%187 = call i32 @test_BN_eq(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 168, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.18, i64 0, i64 0), i32* %185, i32* %186)
%188 = icmp ne i32 %187, 0
br i1 %188, label %225, label %189
189: ; preds = %184, %179, %174
%190 = load i32*, i32** %9
%191 = load i32*, i32** %6
%192 = call i64 @BN_cmp(i32* %190, i32* %191)
%193 = icmp ne i64 %192, 0
br i1 %193, label %194, label %196
194: ; preds = %189
%195 = call i32 @test_info(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 170, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.19, i64 0, i64 0))
br label %196
196: ; preds = %194, %189
%197 = load i32*, i32** %9
%198 = load i32*, i32** %7
%199 = call i64 @BN_cmp(i32* %197, i32* %198)
%200 = icmp ne i64 %199, 0
br i1 %200, label %201, label %203
201: ; preds = %196
%202 = call i32 @test_info(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 172, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.20, i64 0, i64 0))
br label %203
203: ; preds = %201, %196
%204 = load i32*, i32** %9
%205 = load i32*, i32** %8
%206 = call i64 @BN_cmp(i32* %204, i32* %205)
%207 = icmp ne i64 %206, 0
br i1 %207, label %208, label %210
208: ; preds = %203
%209 = call i32 @test_info(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 174, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.21, i64 0, i64 0))
br label %210
210: ; preds = %208, %203
%211 = load i32*, i32** %10
%212 = call i32 @test_output_bignum(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.22, i64 0, i64 0), i32* %211)
%213 = load i32*, i32** %11
%214 = call i32 @test_output_bignum(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0), i32* %213)
%215 = load i32*, i32** %12
%216 = call i32 @test_output_bignum(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.24, i64 0, i64 0), i32* %215)
%217 = load i32*, i32** %9
%218 = call i32 @test_output_bignum(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i32* %217)
%219 = load i32*, i32** %8
%220 = call i32 @test_output_bignum(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i32* %219)
%221 = load i32*, i32** %6
%222 = call i32 @test_output_bignum(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i32* %221)
%223 = load i32*, i32** %7
%224 = call i32 @test_output_bignum(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.18, i64 0, i64 0), i32* %223)
br label %226
225: ; preds = %184
store i32 1, i32* %5
br label %226
226: ; preds = %225, %210, %173, %45, %16
%227 = load i32*, i32** %6
%228 = call i32 @BN_free(i32* %227)
%229 = load i32*, i32** %7
%230 = call i32 @BN_free(i32* %229)
%231 = load i32*, i32** %8
%232 = call i32 @BN_free(i32* %231)
%233 = load i32*, i32** %9
%234 = call i32 @BN_free(i32* %233)
%235 = load i32*, i32** %10
%236 = call i32 @BN_free(i32* %235)
%237 = load i32*, i32** %11
%238 = call i32 @BN_free(i32* %237)
%239 = load i32*, i32** %12
%240 = call i32 @BN_free(i32* %239)
%241 = load i32*, i32** %3
%242 = call i32 @BN_CTX_free(i32* %241)
%243 = load i32, i32* %5
ret i32 %243
}

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 = [19 x i8] c"ctx = BN_CTX_new()\00"
@.str.2 = [18 x i8] c"r_mont = BN_new()\00"
@.str.3 = [24 x i8] c"r_mont_const = BN_new()\00"
@.str.4 = [18 x i8] c"r_recp = BN_new()\00"
@.str.5 = [20 x i8] c"r_simple = BN_new()\00"
@.str.6 = [13 x i8] c"a = BN_new()\00"
@.str.7 = [13 x i8] c"b = BN_new()\00"
@.str.8 = [13 x i8] c"m = BN_new()\00"
@BN_BITS = global i8 0
@BN_BITS2 = global i8 0
@BN_RAND_TOP_ONE = global i32 0
@BN_RAND_BOTTOM_ANY = global i32 0
@BN_RAND_BOTTOM_ODD = global i32 0
@.str.9 = [21 x i8] c"BN_mod(a, a, m, ctx)\00"
@.str.10 = [21 x i8] c"BN_mod(b, b, m, ctx)\00"
@.str.11 = [44 x i8] c"BN_mod_exp_mont(r_mont, a, b, m, ctx, NULL)\00"
@.str.12 = [38 x i8] c"BN_mod_exp_recp(r_recp, a, b, m, ctx)\00"
@.str.13 = [42 x i8] c"BN_mod_exp_simple(r_simple, a, b, m, ctx)\00"
@.str.14 = [60 x i8] c"BN_mod_exp_mont_consttime(r_mont_const, a, b, m, ctx, NULL)\00"
@.str.15 = [9 x i8] c"r_simple\00"
@.str.16 = [7 x i8] c"r_mont\00"
@.str.17 = [7 x i8] c"r_recp\00"
@.str.18 = [13 x i8] c"r_mont_const\00"
@.str.19 = [31 x i8] c"simple and mont results differ\00"
@.str.20 = [42 x i8] c"simple and mont const time results differ\00"
@.str.21 = [31 x i8] c"simple and recp results differ\00"
@.str.22 = [2 x i8] c"a\00"
@.str.23 = [2 x i8] c"b\00"
@.str.24 = [2 x i8] c"m\00"
define i32 @test_mod_exp(i32 %0) {
%2 = alloca i8
%3 = tail call i32* (...) @BN_CTX_new()
%4 = tail call i32 @test_ptr(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 134, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %135, label %6
6: ; preds = %1
%7 = tail call i32* (...) @BN_new()
%8 = tail call i32 @test_ptr(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 137, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32* %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %135, label %10
10: ; preds = %6
%11 = tail call i32* (...) @BN_new()
%12 = tail call i32 @test_ptr(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 138, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i32* %11)
%13 = icmp eq i32 %12, 0
br i1 %13, label %135, label %14
14: ; preds = %10
%15 = tail call i32* (...) @BN_new()
%16 = tail call i32 @test_ptr(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 139, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i32* %15)
%17 = icmp eq i32 %16, 0
br i1 %17, label %135, label %18
18: ; preds = %14
%19 = tail call i32* (...) @BN_new()
%20 = tail call i32 @test_ptr(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 140, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32* %19)
%21 = icmp eq i32 %20, 0
br i1 %21, label %135, label %22
22: ; preds = %18
%23 = tail call i32* (...) @BN_new()
%24 = tail call i32 @test_ptr(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 141, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32* %23)
%25 = icmp eq i32 %24, 0
br i1 %25, label %135, label %26
26: ; preds = %22
%27 = tail call i32* (...) @BN_new()
%28 = tail call i32 @test_ptr(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 142, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32* %27)
%29 = icmp eq i32 %28, 0
br i1 %29, label %135, label %30
30: ; preds = %26
%31 = tail call i32* (...) @BN_new()
%32 = tail call i32 @test_ptr(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 143, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.8, i64 0, i64 0), i32* %31)
%33 = icmp eq i32 %32, 0
br i1 %33, label %135, label %34
34: ; preds = %30
%35 = call i32 @RAND_bytes(i8* %2, i32 1)
%36 = load i8, i8* %2
%37 = load i8, i8* @BN_BITS
%38 = urem i8 %36, %37
%39 = load i8, i8* @BN_BITS2
%40 = sub i8 %38, %39
store i8 %40, i8* %2
%41 = shl i8 %39, 2
%42 = add i8 %41, %40
%43 = load i32, i32* @BN_RAND_TOP_ONE
%44 = load i32, i32* @BN_RAND_BOTTOM_ANY
%45 = call i32 @BN_rand(i32* %23, i8 zeroext %42, i32 %43, i32 %44)
%46 = call i32 @RAND_bytes(i8* %2, i32 1)
%47 = load i8, i8* %2
%48 = load i8, i8* @BN_BITS
%49 = urem i8 %47, %48
%50 = load i8, i8* @BN_BITS2
%51 = sub i8 %49, %50
store i8 %51, i8* %2
%52 = shl i8 %50, 2
%53 = add i8 %52, %51
%54 = load i32, i32* @BN_RAND_TOP_ONE
%55 = load i32, i32* @BN_RAND_BOTTOM_ANY
%56 = call i32 @BN_rand(i32* %27, i8 zeroext %53, i32 %54, i32 %55)
%57 = call i32 @RAND_bytes(i8* %2, i32 1)
%58 = load i8, i8* %2
%59 = load i8, i8* @BN_BITS
%60 = urem i8 %58, %59
%61 = load i8, i8* @BN_BITS2
%62 = sub i8 %60, %61
store i8 %62, i8* %2
%63 = shl i8 %61, 2
%64 = add i8 %63, %62
%65 = load i32, i32* @BN_RAND_TOP_ONE
%66 = load i32, i32* @BN_RAND_BOTTOM_ODD
%67 = call i32 @BN_rand(i32* %31, i8 zeroext %64, i32 %65, i32 %66)
%68 = call i64 @BN_mod(i32* %23, i32* %23, i32* %31, i32* %3)
%69 = icmp ne i64 %68, 0
%70 = zext i1 %69 to i32
%71 = call i32 @test_true(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 158, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i32 %70)
%72 = icmp eq i32 %71, 0
br i1 %72, label %135, label %73
73: ; preds = %34
%74 = call i64 @BN_mod(i32* %27, i32* %27, i32* %31, i32* %3)
%75 = icmp ne i64 %74, 0
%76 = zext i1 %75 to i32
%77 = call i32 @test_true(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 159, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.10, i64 0, i64 0), i32 %76)
%78 = icmp eq i32 %77, 0
br i1 %78, label %135, label %79
79: ; preds = %73
%80 = call i64 @BN_mod_exp_mont(i32* %7, i32* %23, i32* %27, i32* %31, i32* %3, i32* null)
%81 = icmp ne i64 %80, 0
%82 = zext i1 %81 to i32
%83 = call i32 @test_true(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 160, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.11, i64 0, i64 0), i32 %82)
%84 = icmp eq i32 %83, 0
br i1 %84, label %135, label %85
85: ; preds = %79
%86 = call i64 @BN_mod_exp_recp(i32* %15, i32* %23, i32* %27, i32* %31, i32* %3)
%87 = icmp ne i64 %86, 0
%88 = zext i1 %87 to i32
%89 = call i32 @test_true(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 161, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.12, i64 0, i64 0), i32 %88)
%90 = icmp eq i32 %89, 0
br i1 %90, label %135, label %91
91: ; preds = %85
%92 = call i64 @BN_mod_exp_simple(i32* %19, i32* %23, i32* %27, i32* %31, i32* %3)
%93 = icmp ne i64 %92, 0
%94 = zext i1 %93 to i32
%95 = call i32 @test_true(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 162, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.13, i64 0, i64 0), i32 %94)
%96 = icmp eq i32 %95, 0
br i1 %96, label %135, label %97
97: ; preds = %91
%98 = call i64 @BN_mod_exp_mont_consttime(i32* %11, i32* %23, i32* %27, i32* %31, i32* %3, i32* null)
%99 = icmp ne i64 %98, 0
%100 = zext i1 %99 to i32
%101 = call i32 @test_true(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 163, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.14, i64 0, i64 0), i32 %100)
%102 = icmp eq i32 %101, 0
br i1 %102, label %135, label %103
103: ; preds = %97
%104 = call i32 @test_BN_eq(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 166, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i32* %19, i32* %7)
%105 = icmp eq i32 %104, 0
br i1 %105, label %112, label %106
106: ; preds = %103
%107 = call i32 @test_BN_eq(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 167, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i32* %19, i32* %15)
%108 = icmp eq i32 %107, 0
br i1 %108, label %112, label %109
109: ; preds = %106
%110 = call i32 @test_BN_eq(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 168, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.18, i64 0, i64 0), i32* %19, i32* %11)
%111 = icmp eq i32 %110, 0
br i1 %111, label %112, label %135
112: ; preds = %109, %106, %103
%113 = call i64 @BN_cmp(i32* %19, i32* %7)
%114 = icmp eq i64 %113, 0
br i1 %114, label %117, label %115
115: ; preds = %112
%116 = call i32 @test_info(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 170, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.19, i64 0, i64 0))
br label %117
117: ; preds = %115, %112
%118 = call i64 @BN_cmp(i32* %19, i32* %11)
%119 = icmp eq i64 %118, 0
br i1 %119, label %122, label %120
120: ; preds = %117
%121 = call i32 @test_info(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 172, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.20, i64 0, i64 0))
br label %122
122: ; preds = %120, %117
%123 = call i64 @BN_cmp(i32* %19, i32* %15)
%124 = icmp eq i64 %123, 0
br i1 %124, label %127, label %125
125: ; preds = %122
%126 = call i32 @test_info(i8* getelementptr inbounds ([171 x i8], [171 x i8]* @.str, i64 0, i64 0), i32 174, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.21, i64 0, i64 0))
br label %127
127: ; preds = %125, %122
%128 = call i32 @test_output_bignum(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.22, i64 0, i64 0), i32* %23)
%129 = call i32 @test_output_bignum(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.23, i64 0, i64 0), i32* %27)
%130 = call i32 @test_output_bignum(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.24, i64 0, i64 0), i32* %31)
%131 = call i32 @test_output_bignum(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.15, i64 0, i64 0), i32* %19)
%132 = call i32 @test_output_bignum(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.17, i64 0, i64 0), i32* %15)
%133 = call i32 @test_output_bignum(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0), i32* %7)
%134 = call i32 @test_output_bignum(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.18, i64 0, i64 0), i32* %11)
br label %135
135: ; preds = %109, %34, %73, %79, %85, %91, %97, %6, %10, %14, %18, %22, %26, %30, %1, %127
%136 = phi i32 [ 0, %127 ], [ 0, %97 ], [ 0, %91 ], [ 0, %85 ], [ 0, %79 ], [ 0, %73 ], [ 0, %34 ], [ 0, %30 ], [ 0, %26 ], [ 0, %22 ], [ 0, %18 ], [ 0, %14 ], [ 0, %10 ], [ 0, %6 ], [ 0, %1 ], [ 1, %109 ]
%137 = phi i32* [ %7, %127 ], [ %7, %97 ], [ %7, %91 ], [ %7, %85 ], [ %7, %79 ], [ %7, %73 ], [ %7, %34 ], [ %7, %30 ], [ %7, %26 ], [ %7, %22 ], [ %7, %18 ], [ %7, %14 ], [ %7, %10 ], [ %7, %6 ], [ null, %1 ], [ %7, %109 ]
%138 = phi i32* [ %11, %127 ], [ %11, %97 ], [ %11, %91 ], [ %11, %85 ], [ %11, %79 ], [ %11, %73 ], [ %11, %34 ], [ %11, %30 ], [ %11, %26 ], [ %11, %22 ], [ %11, %18 ], [ %11, %14 ], [ %11, %10 ], [ null, %6 ], [ null, %1 ], [ %11, %109 ]
%139 = phi i32* [ %15, %127 ], [ %15, %97 ], [ %15, %91 ], [ %15, %85 ], [ %15, %79 ], [ %15, %73 ], [ %15, %34 ], [ %15, %30 ], [ %15, %26 ], [ %15, %22 ], [ %15, %18 ], [ %15, %14 ], [ null, %10 ], [ null, %6 ], [ null, %1 ], [ %15, %109 ]
%140 = phi i32* [ %19, %127 ], [ %19, %97 ], [ %19, %91 ], [ %19, %85 ], [ %19, %79 ], [ %19, %73 ], [ %19, %34 ], [ %19, %30 ], [ %19, %26 ], [ %19, %22 ], [ %19, %18 ], [ null, %14 ], [ null, %10 ], [ null, %6 ], [ null, %1 ], [ %19, %109 ]
%141 = phi i32* [ %23, %127 ], [ %23, %97 ], [ %23, %91 ], [ %23, %85 ], [ %23, %79 ], [ %23, %73 ], [ %23, %34 ], [ %23, %30 ], [ %23, %26 ], [ %23, %22 ], [ null, %18 ], [ null, %14 ], [ null, %10 ], [ null, %6 ], [ null, %1 ], [ %23, %109 ]
%142 = phi i32* [ %27, %127 ], [ %27, %97 ], [ %27, %91 ], [ %27, %85 ], [ %27, %79 ], [ %27, %73 ], [ %27, %34 ], [ %27, %30 ], [ %27, %26 ], [ null, %22 ], [ null, %18 ], [ null, %14 ], [ null, %10 ], [ null, %6 ], [ null, %1 ], [ %27, %109 ]
%143 = phi i32* [ %31, %127 ], [ %31, %97 ], [ %31, %91 ], [ %31, %85 ], [ %31, %79 ], [ %31, %73 ], [ %31, %34 ], [ %31, %30 ], [ null, %26 ], [ null, %22 ], [ null, %18 ], [ null, %14 ], [ null, %10 ], [ null, %6 ], [ null, %1 ], [ %31, %109 ]
%144 = call i32 @BN_free(i32* %137)
%145 = call i32 @BN_free(i32* %138)
%146 = call i32 @BN_free(i32* %139)
%147 = call i32 @BN_free(i32* %140)
%148 = call i32 @BN_free(i32* %141)
%149 = call i32 @BN_free(i32* %142)
%150 = call i32 @BN_free(i32* %143)
%151 = call i32 @BN_CTX_free(i32* %3)
ret i32 %136
}