#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*/ *);
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_set_negative(int /*<<< orphan*/ *, int);
scalar_t__ BN_set_word(int /*<<< orphan*/ *, int);
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_expmodone(void) {
  int ret = 0, i;
  BIGNUM *r = BN_new();
  BIGNUM *a = BN_new();
  BIGNUM *p = BN_new();
  BIGNUM *m = BN_new();
  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",
                2132, "r", r) ||
      !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",
                2133, "a", a) ||
      !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",
                2134, "p", p) ||
      !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",
                2135, "p", p) ||
      !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",
                2136, "m", m) ||
      !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",
          2137, "BN_set_word(a, 1)", (BN_set_word(a, 1)) != 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/bntest.c",
          2138, "BN_set_word(p, 0)", (BN_set_word(p, 0)) != 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/bntest.c",
          2139, "BN_set_word(m, 1)", (BN_set_word(m, 1)) != 0))
    goto err;
  for (i = 0; i < 2; i++) {
    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",
            2144, "BN_mod_exp(r, a, p, m, NULL)",
            (BN_mod_exp(r, a, p, m, 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",
            2145, "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",
            2146, "BN_mod_exp_mont(r, a, p, m, NULL, NULL)",
            (BN_mod_exp_mont(r, a, p, m, 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",
            2147, "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",
            2148, "BN_mod_exp_mont_consttime(r, a, p, m, NULL, NULL)",
            (BN_mod_exp_mont_consttime(r, a, p, m, 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",
            2149, "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",
            2150, "BN_mod_exp_mont_word(r, 1, p, m, NULL, NULL)",
            (BN_mod_exp_mont_word(r, 1, p, m, 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",
            2151, "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",
            2152, "BN_mod_exp_simple(r, a, p, m, NULL)",
            (BN_mod_exp_simple(r, a, p, m, 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",
            2153, "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",
            2154, "BN_mod_exp_recp(r, a, p, m, NULL)",
            (BN_mod_exp_recp(r, a, p, m, 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",
            2155, "r", r))
      goto err;
    if (i == 0)
      BN_set_negative(m, 1);
  }
  ret = 1;
err:
  BN_free(r);
  BN_free(a);
  BN_free(p);
  BN_free(m);
  return ret;
}


x86 assembly (clang, -O0):
<test_expmodone>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <BN_new@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <BN_new@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1060 <BN_new@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   1060 <BN_new@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rcx
lea    0xdea(%rip),%rdi
mov    $0x854,%esi
lea    0xe88(%rip),%rdx
call   1080 <test_ptr@plt>
cmp    $0x0,%eax
je     1372 <test_expmodone+0x1a2>
mov    -0x18(%rbp),%rcx
lea    0xdc5(%rip),%rdi
mov    $0x855,%esi
lea    0xe65(%rip),%rdx
call   1080 <test_ptr@plt>
cmp    $0x0,%eax
je     1372 <test_expmodone+0x1a2>
mov    -0x20(%rbp),%rcx
lea    0xda0(%rip),%rdi
mov    $0x856,%esi
lea    0xe42(%rip),%rdx
call   1080 <test_ptr@plt>
cmp    $0x0,%eax
je     1372 <test_expmodone+0x1a2>
mov    -0x20(%rbp),%rcx
lea    0xd7b(%rip),%rdi
mov    $0x857,%esi
lea    0xe1d(%rip),%rdx
call   1080 <test_ptr@plt>
cmp    $0x0,%eax
je     1372 <test_expmodone+0x1a2>
mov    -0x28(%rbp),%rcx
lea    0xd56(%rip),%rdi
mov    $0x858,%esi
lea    0xdfa(%rip),%rdx
call   1080 <test_ptr@plt>
cmp    $0x0,%eax
je     1372 <test_expmodone+0x1a2>
mov    -0x18(%rbp),%rdi
mov    $0x1,%esi
call   1050 <BN_set_word@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xd1b(%rip),%rdi
mov    $0x859,%esi
lea    0xdc1(%rip),%rdx
call   1040 <test_true@plt>
cmp    $0x0,%eax
je     1372 <test_expmodone+0x1a2>
mov    -0x20(%rbp),%rdi
xor    %esi,%esi
call   1050 <BN_set_word@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xce3(%rip),%rdi
mov    $0x85a,%esi
lea    0xd9b(%rip),%rdx
call   1040 <test_true@plt>
cmp    $0x0,%eax
je     1372 <test_expmodone+0x1a2>
mov    -0x28(%rbp),%rdi
mov    $0x1,%esi
call   1050 <BN_set_word@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xca8(%rip),%rdi
mov    $0x85b,%esi
lea    0xd72(%rip),%rdx
call   1040 <test_true@plt>
cmp    $0x0,%eax
jne    1377 <test_expmodone+0x1a7>
jmp    1651 <test_expmodone+0x481>
movl   $0x0,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    164a <test_expmodone+0x47a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   10c0 <BN_mod_exp@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xc4b(%rip),%rdi
mov    $0x860,%esi
lea    0xd27(%rip),%rdx
call   1040 <test_true@plt>
cmp    $0x0,%eax
je     161a <test_expmodone+0x44a>
mov    -0x10(%rbp),%rcx
lea    0xc26(%rip),%rdi
mov    $0x861,%esi
lea    0xcc4(%rip),%rdx
call   1070 <test_BN_eq_zero@plt>
cmp    $0x0,%eax
je     161a <test_expmodone+0x44a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
call   10f0 <BN_mod_exp_mont@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xbdc(%rip),%rdi
mov    $0x862,%esi
lea    0xcd5(%rip),%rdx
call   1040 <test_true@plt>
cmp    $0x0,%eax
je     161a <test_expmodone+0x44a>
mov    -0x10(%rbp),%rcx
lea    0xbb7(%rip),%rdi
mov    $0x863,%esi
lea    0xc55(%rip),%rdx
call   1070 <test_BN_eq_zero@plt>
cmp    $0x0,%eax
je     161a <test_expmodone+0x44a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
call   10d0 <BN_mod_exp_mont_consttime@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xb6d(%rip),%rdi
mov    $0x864,%esi
lea    0xc8e(%rip),%rdx
call   1040 <test_true@plt>
cmp    $0x0,%eax
je     161a <test_expmodone+0x44a>
mov    -0x10(%rbp),%rcx
lea    0xb48(%rip),%rdi
mov    $0x865,%esi
lea    0xbe6(%rip),%rdx
call   1070 <test_BN_eq_zero@plt>
cmp    $0x0,%eax
je     161a <test_expmodone+0x44a>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    $0x1,%esi
xor    %eax,%eax
mov    %eax,%r9d
mov    %r9,%r8
call   10e0 <BN_mod_exp_mont_word@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xafd(%rip),%rdi
mov    $0x866,%esi
lea    0xc50(%rip),%rdx
call   1040 <test_true@plt>
cmp    $0x0,%eax
je     161a <test_expmodone+0x44a>
mov    -0x10(%rbp),%rcx
lea    0xad8(%rip),%rdi
mov    $0x867,%esi
lea    0xb76(%rip),%rdx
call   1070 <test_BN_eq_zero@plt>
cmp    $0x0,%eax
je     161a <test_expmodone+0x44a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   10a0 <BN_mod_exp_simple@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xa91(%rip),%rdi
mov    $0x868,%esi
lea    0xc11(%rip),%rdx
call   1040 <test_true@plt>
cmp    $0x0,%eax
je     161a <test_expmodone+0x44a>
mov    -0x10(%rbp),%rcx
lea    0xa6c(%rip),%rdi
mov    $0x869,%esi
lea    0xb0a(%rip),%rdx
call   1070 <test_BN_eq_zero@plt>
cmp    $0x0,%eax
je     161a <test_expmodone+0x44a>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <BN_mod_exp_recp@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xa25(%rip),%rdi
mov    $0x86a,%esi
lea    0xbc9(%rip),%rdx
call   1040 <test_true@plt>
cmp    $0x0,%eax
je     161a <test_expmodone+0x44a>
mov    -0x10(%rbp),%rcx
lea    0xa00(%rip),%rdi
mov    $0x86b,%esi
lea    0xa9e(%rip),%rdx
call   1070 <test_BN_eq_zero@plt>
cmp    $0x0,%eax
jne    161f <test_expmodone+0x44f>
jmp    1651 <test_expmodone+0x481>
cmpl   $0x0,-0x8(%rbp)
jne    1637 <test_expmodone+0x467>
mov    -0x28(%rbp),%rdi
mov    $0x1,%esi
call   1090 <BN_set_negative@plt>
jmp    163c <test_expmodone+0x46c>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    137e <test_expmodone+0x1ae>
movl   $0x1,-0x4(%rbp)
mov    -0x10(%rbp),%rdi
call   10b0 <BN_free@plt>
mov    -0x18(%rbp),%rdi
call   10b0 <BN_free@plt>
mov    -0x20(%rbp),%rdi
call   10b0 <BN_free@plt>
mov    -0x28(%rbp),%rdi
call   10b0 <BN_free@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_expmodone>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %r13d,%r13d
xor    %eax,%eax
call   1060 <BN_new@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <BN_new@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1060 <BN_new@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1060 <BN_new@plt>
mov    %rax,%r12
lea    0xdf3(%rip),%rdi
lea    0xe96(%rip),%rdx
mov    $0x854,%esi
mov    %rbx,%rcx
call   1080 <test_ptr@plt>
test   %eax,%eax
je     15e9 <test_expmodone+0x419>
lea    0xdd0(%rip),%rdi
lea    0xe75(%rip),%rdx
mov    $0x855,%esi
mov    %r14,%rcx
call   1080 <test_ptr@plt>
test   %eax,%eax
je     15e9 <test_expmodone+0x419>
lea    0xdad(%rip),%rdi
lea    0xe54(%rip),%rdx
mov    $0x856,%esi
mov    %r15,%rcx
call   1080 <test_ptr@plt>
test   %eax,%eax
je     15e9 <test_expmodone+0x419>
lea    0xd8a(%rip),%rdi
lea    0xe31(%rip),%rdx
mov    $0x857,%esi
mov    %r15,%rcx
call   1080 <test_ptr@plt>
test   %eax,%eax
je     15e9 <test_expmodone+0x419>
lea    0xd67(%rip),%rdi
lea    0xe10(%rip),%rdx
mov    $0x858,%esi
mov    %r12,%rcx
call   1080 <test_ptr@plt>
test   %eax,%eax
je     15e9 <test_expmodone+0x419>
mov    %r14,%rdi
mov    $0x1,%esi
call   1050 <BN_set_word@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0xd2f(%rip),%rdi
lea    0xdda(%rip),%rdx
mov    $0x859,%esi
call   1040 <test_true@plt>
test   %eax,%eax
je     15e9 <test_expmodone+0x419>
xor    %r13d,%r13d
mov    %r15,%rdi
xor    %esi,%esi
call   1050 <BN_set_word@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0xcfa(%rip),%rdi
lea    0xdb7(%rip),%rdx
mov    $0x85a,%esi
call   1040 <test_true@plt>
test   %eax,%eax
je     15e9 <test_expmodone+0x419>
mov    %r12,%rdi
mov    $0x1,%esi
call   1050 <BN_set_word@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0xcc5(%rip),%rdi
lea    0xd94(%rip),%rdx
mov    $0x85b,%esi
call   1040 <test_true@plt>
test   %eax,%eax
je     15e9 <test_expmodone+0x419>
xor    %r13d,%r13d
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
xor    %r8d,%r8d
call   10c0 <BN_mod_exp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0xc86(%rip),%rdi
lea    0xd67(%rip),%rdx
mov    $0x860,%esi
call   1040 <test_true@plt>
test   %eax,%eax
je     15e9 <test_expmodone+0x419>
movl   $0x0,0x4(%rsp)
lea    0xc5e(%rip),%rbp
mov    %rbp,%rdi
mov    $0x861,%esi
lea    0xcf9(%rip),%rdx
mov    %rbx,%rcx
call   1070 <test_BN_eq_zero@plt>
xor    %r13d,%r13d
test   %eax,%eax
je     15e9 <test_expmodone+0x419>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   10f0 <BN_mod_exp_mont@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %rbp,%rdi
mov    $0x862,%esi
lea    0xd13(%rip),%rdx
call   1040 <test_true@plt>
test   %eax,%eax
je     15e9 <test_expmodone+0x419>
mov    %rbp,%rdi
mov    $0x863,%esi
lea    0xc9c(%rip),%rdx
mov    %rbx,%rcx
call   1070 <test_BN_eq_zero@plt>
test   %eax,%eax
je     15e9 <test_expmodone+0x419>
xor    %r13d,%r13d
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   10d0 <BN_mod_exp_mont_consttime@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %rbp,%rdi
mov    $0x864,%esi
lea    0xcde(%rip),%rdx
call   1040 <test_true@plt>
test   %eax,%eax
je     15e9 <test_expmodone+0x419>
mov    %rbp,%rdi
mov    $0x865,%esi
lea    0xc3f(%rip),%rdx
mov    %rbx,%rcx
call   1070 <test_BN_eq_zero@plt>
test   %eax,%eax
je     15e9 <test_expmodone+0x419>
xor    %r13d,%r13d
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %r15,%rdx
mov    %r12,%rcx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   10e0 <BN_mod_exp_mont_word@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %rbp,%rdi
mov    $0x866,%esi
lea    0xcb1(%rip),%rdx
call   1040 <test_true@plt>
test   %eax,%eax
je     15e9 <test_expmodone+0x419>
mov    %rbp,%rdi
mov    $0x867,%esi
lea    0xbe0(%rip),%rdx
mov    %rbx,%rcx
call   1070 <test_BN_eq_zero@plt>
test   %eax,%eax
je     15e9 <test_expmodone+0x419>
xor    %r13d,%r13d
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
xor    %r8d,%r8d
call   10a0 <BN_mod_exp_simple@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %rbp,%rdi
mov    $0x868,%esi
lea    0xc84(%rip),%rdx
call   1040 <test_true@plt>
test   %eax,%eax
je     15e9 <test_expmodone+0x419>
mov    %rbp,%rdi
mov    $0x869,%esi
lea    0xb86(%rip),%rdx
mov    %rbx,%rcx
call   1070 <test_BN_eq_zero@plt>
test   %eax,%eax
je     15e9 <test_expmodone+0x419>
xor    %r13d,%r13d
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
xor    %r8d,%r8d
call   1030 <BN_mod_exp_recp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %rbp,%rdi
mov    $0x86a,%esi
lea    0xc4e(%rip),%rdx
call   1040 <test_true@plt>
test   %eax,%eax
je     15e9 <test_expmodone+0x419>
mov    %rbp,%rdi
mov    $0x86b,%esi
lea    0xb30(%rip),%rdx
mov    %rbx,%rcx
call   1070 <test_BN_eq_zero@plt>
test   %eax,%eax
sete   %cl
or     0x4(%rsp),%cl
test   $0x1,%cl
jne    15e0 <test_expmodone+0x410>
mov    %r12,%rdi
mov    $0x1,%esi
call   1090 <BN_set_negative@plt>
xor    %r13d,%r13d
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
mov    %r12,%rcx
xor    %r8d,%r8d
call   10c0 <BN_mod_exp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %rbp,%rdi
mov    $0x860,%esi
lea    0xb1d(%rip),%rdx
call   1040 <test_true@plt>
mov    $0x1,%cl
mov    %ecx,0x4(%rsp)
test   %eax,%eax
jne    13a2 <test_expmodone+0x1d2>
jmp    15e9 <test_expmodone+0x419>
xor    %r13d,%r13d
test   %eax,%eax
setne  %r13b
mov    %rbx,%rdi
call   10b0 <BN_free@plt>
mov    %r14,%rdi
call   10b0 <BN_free@plt>
mov    %r15,%rdi
call   10b0 <BN_free@plt>
mov    %r12,%rdi
call   10b0 <BN_free@plt>
mov    %r13d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
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 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"a\00"
@.str.3 = [2 x i8] c"p\00"
@.str.4 = [2 x i8] c"m\00"
@.str.5 = [18 x i8] c"BN_set_word(a, 1)\00"
@.str.6 = [18 x i8] c"BN_set_word(p, 0)\00"
@.str.7 = [18 x i8] c"BN_set_word(m, 1)\00"
@.str.8 = [29 x i8] c"BN_mod_exp(r, a, p, m, NULL)\00"
@.str.9 = [40 x i8] c"BN_mod_exp_mont(r, a, p, m, NULL, NULL)\00"
@.str.10 = [50 x i8] c"BN_mod_exp_mont_consttime(r, a, p, m, NULL, NULL)\00"
@.str.11 = [45 x i8] c"BN_mod_exp_mont_word(r, 1, p, m, NULL, NULL)\00"
@.str.12 = [36 x i8] c"BN_mod_exp_simple(r, a, p, m, NULL)\00"
@.str.13 = [34 x i8] c"BN_mod_exp_recp(r, a, p, m, NULL)\00"
define i32 @test_expmodone() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
store i32 0, i32* %1
%7 = call i32* (...) @BN_new()
store i32* %7, i32** %3
%8 = call i32* (...) @BN_new()
store i32* %8, i32** %4
%9 = call i32* (...) @BN_new()
store i32* %9, i32** %5
%10 = call i32* (...) @BN_new()
store i32* %10, i32** %6
%11 = load i32*, i32** %3
%12 = call i32 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2132, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %11)
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %51
14: ; preds = %0
%15 = load i32*, i32** %4
%16 = call i32 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2133, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32* %15)
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %51
18: ; preds = %14
%19 = load i32*, i32** %5
%20 = call i32 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2134, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32* %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %51
22: ; preds = %18
%23 = load i32*, i32** %5
%24 = call i32 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2135, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32* %23)
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %51
26: ; preds = %22
%27 = load i32*, i32** %6
%28 = call i32 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2136, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i32* %27)
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %51
30: ; preds = %26
%31 = load i32*, i32** %4
%32 = call i64 @BN_set_word(i32* %31, i32 1)
%33 = icmp ne i64 %32, 0
%34 = zext i1 %33 to i32
%35 = call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2137, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %34)
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %51
37: ; preds = %30
%38 = load i32*, i32** %5
%39 = call i64 @BN_set_word(i32* %38, i32 0)
%40 = icmp ne i64 %39, 0
%41 = zext i1 %40 to i32
%42 = call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2138, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32 %41)
%43 = icmp ne i32 %42, 0
br i1 %43, label %44, label %51
44: ; preds = %37
%45 = load i32*, i32** %6
%46 = call i64 @BN_set_word(i32* %45, i32 1)
%47 = icmp ne i64 %46, 0
%48 = zext i1 %47 to i32
%49 = call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2139, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i32 %48)
%50 = icmp ne i32 %49, 0
br i1 %50, label %52, label %51
51: ; preds = %44, %37, %30, %26, %22, %18, %14, %0
br label %151
52: ; preds = %44
store i32 0, i32* %2
br label %53
53: ; preds = %147, %52
%54 = load i32, i32* %2
%55 = icmp slt i32 %54, 2
br i1 %55, label %56, label %150
56: ; preds = %53
%57 = load i32*, i32** %3
%58 = load i32*, i32** %4
%59 = load i32*, i32** %5
%60 = load i32*, i32** %6
%61 = call i64 @BN_mod_exp(i32* %57, i32* %58, i32* %59, i32* %60, i32* null)
%62 = icmp ne i64 %61, 0
%63 = zext i1 %62 to i32
%64 = call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2144, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 %63)
%65 = icmp ne i32 %64, 0
br i1 %65, label %66, label %139
66: ; preds = %56
%67 = load i32*, i32** %3
%68 = call i32 @test_BN_eq_zero(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2145, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %67)
%69 = icmp ne i32 %68, 0
br i1 %69, label %70, label %139
70: ; preds = %66
%71 = load i32*, i32** %3
%72 = load i32*, i32** %4
%73 = load i32*, i32** %5
%74 = load i32*, i32** %6
%75 = call i64 @BN_mod_exp_mont(i32* %71, i32* %72, i32* %73, i32* %74, i32* null, i32* null)
%76 = icmp ne i64 %75, 0
%77 = zext i1 %76 to i32
%78 = call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2146, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), i32 %77)
%79 = icmp ne i32 %78, 0
br i1 %79, label %80, label %139
80: ; preds = %70
%81 = load i32*, i32** %3
%82 = call i32 @test_BN_eq_zero(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2147, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %81)
%83 = icmp ne i32 %82, 0
br i1 %83, label %84, label %139
84: ; preds = %80
%85 = load i32*, i32** %3
%86 = load i32*, i32** %4
%87 = load i32*, i32** %5
%88 = load i32*, i32** %6
%89 = call i64 @BN_mod_exp_mont_consttime(i32* %85, i32* %86, i32* %87, i32* %88, i32* null, i32* null)
%90 = icmp ne i64 %89, 0
%91 = zext i1 %90 to i32
%92 = call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2148, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.10, i64 0, i64 0), i32 %91)
%93 = icmp ne i32 %92, 0
br i1 %93, label %94, label %139
94: ; preds = %84
%95 = load i32*, i32** %3
%96 = call i32 @test_BN_eq_zero(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2149, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %95)
%97 = icmp ne i32 %96, 0
br i1 %97, label %98, label %139
98: ; preds = %94
%99 = load i32*, i32** %3
%100 = load i32*, i32** %5
%101 = load i32*, i32** %6
%102 = call i64 @BN_mod_exp_mont_word(i32* %99, i32 1, i32* %100, i32* %101, i32* null, i32* null)
%103 = icmp ne i64 %102, 0
%104 = zext i1 %103 to i32
%105 = call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2150, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.11, i64 0, i64 0), i32 %104)
%106 = icmp ne i32 %105, 0
br i1 %106, label %107, label %139
107: ; preds = %98
%108 = load i32*, i32** %3
%109 = call i32 @test_BN_eq_zero(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2151, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %108)
%110 = icmp ne i32 %109, 0
br i1 %110, label %111, label %139
111: ; preds = %107
%112 = load i32*, i32** %3
%113 = load i32*, i32** %4
%114 = load i32*, i32** %5
%115 = load i32*, i32** %6
%116 = call i64 @BN_mod_exp_simple(i32* %112, i32* %113, i32* %114, i32* %115, i32* null)
%117 = icmp ne i64 %116, 0
%118 = zext i1 %117 to i32
%119 = call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2152, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.12, i64 0, i64 0), i32 %118)
%120 = icmp ne i32 %119, 0
br i1 %120, label %121, label %139
121: ; preds = %111
%122 = load i32*, i32** %3
%123 = call i32 @test_BN_eq_zero(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2153, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %122)
%124 = icmp ne i32 %123, 0
br i1 %124, label %125, label %139
125: ; preds = %121
%126 = load i32*, i32** %3
%127 = load i32*, i32** %4
%128 = load i32*, i32** %5
%129 = load i32*, i32** %6
%130 = call i64 @BN_mod_exp_recp(i32* %126, i32* %127, i32* %128, i32* %129, i32* null)
%131 = icmp ne i64 %130, 0
%132 = zext i1 %131 to i32
%133 = call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2154, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i32 %132)
%134 = icmp ne i32 %133, 0
br i1 %134, label %135, label %139
135: ; preds = %125
%136 = load i32*, i32** %3
%137 = call i32 @test_BN_eq_zero(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2155, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %136)
%138 = icmp ne i32 %137, 0
br i1 %138, label %140, label %139
139: ; preds = %135, %125, %121, %111, %107, %98, %94, %84, %80, %70, %66, %56
br label %151
140: ; preds = %135
%141 = load i32, i32* %2
%142 = icmp eq i32 %141, 0
br i1 %142, label %143, label %146
143: ; preds = %140
%144 = load i32*, i32** %6
%145 = call i32 @BN_set_negative(i32* %144, i32 1)
br label %146
146: ; preds = %143, %140
br label %147
147: ; preds = %146
%148 = load i32, i32* %2
%149 = add nsw i32 %148, 1
store i32 %149, i32* %2
br label %53
150: ; preds = %53
store i32 1, i32* %1
br label %151
151: ; preds = %150, %139, %51
%152 = load i32*, i32** %3
%153 = call i32 @BN_free(i32* %152)
%154 = load i32*, i32** %4
%155 = call i32 @BN_free(i32* %154)
%156 = load i32*, i32** %5
%157 = call i32 @BN_free(i32* %156)
%158 = load i32*, i32** %6
%159 = call i32 @BN_free(i32* %158)
%160 = load i32, i32* %1
ret i32 %160
}

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 = [2 x i8] c"r\00"
@.str.2 = [2 x i8] c"a\00"
@.str.3 = [2 x i8] c"p\00"
@.str.4 = [2 x i8] c"m\00"
@.str.5 = [18 x i8] c"BN_set_word(a, 1)\00"
@.str.6 = [18 x i8] c"BN_set_word(p, 0)\00"
@.str.7 = [18 x i8] c"BN_set_word(m, 1)\00"
@.str.8 = [29 x i8] c"BN_mod_exp(r, a, p, m, NULL)\00"
@.str.9 = [40 x i8] c"BN_mod_exp_mont(r, a, p, m, NULL, NULL)\00"
@.str.10 = [50 x i8] c"BN_mod_exp_mont_consttime(r, a, p, m, NULL, NULL)\00"
@.str.11 = [45 x i8] c"BN_mod_exp_mont_word(r, 1, p, m, NULL, NULL)\00"
@.str.12 = [36 x i8] c"BN_mod_exp_simple(r, a, p, m, NULL)\00"
@.str.13 = [34 x i8] c"BN_mod_exp_recp(r, a, p, m, NULL)\00"
define i32 @test_expmodone() {
%1 = tail call i32* (...) @BN_new()
%2 = tail call i32* (...) @BN_new()
%3 = tail call i32* (...) @BN_new()
%4 = tail call i32* (...) @BN_new()
%5 = tail call i32 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2132, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %103, label %7
7: ; preds = %0
%8 = tail call i32 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2133, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%9 = icmp eq i32 %8, 0
br i1 %9, label %103, label %10
10: ; preds = %7
%11 = tail call i32 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2134, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%12 = icmp eq i32 %11, 0
br i1 %12, label %103, label %13
13: ; preds = %10
%14 = tail call i32 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2135, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%15 = icmp eq i32 %14, 0
br i1 %15, label %103, label %16
16: ; preds = %13
%17 = tail call i32 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2136, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0), i32* %4)
%18 = icmp eq i32 %17, 0
br i1 %18, label %103, label %19
19: ; preds = %16
%20 = tail call i64 @BN_set_word(i32* %2, i32 1)
%21 = icmp ne i64 %20, 0
%22 = zext i1 %21 to i32
%23 = tail call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2137, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i32 %22)
%24 = icmp eq i32 %23, 0
br i1 %24, label %103, label %25
25: ; preds = %19
%26 = tail call i64 @BN_set_word(i32* %3, i32 0)
%27 = icmp ne i64 %26, 0
%28 = zext i1 %27 to i32
%29 = tail call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2138, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32 %28)
%30 = icmp eq i32 %29, 0
br i1 %30, label %103, label %31
31: ; preds = %25
%32 = tail call i64 @BN_set_word(i32* %4, i32 1)
%33 = icmp ne i64 %32, 0
%34 = zext i1 %33 to i32
%35 = tail call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2139, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i32 %34)
%36 = icmp eq i32 %35, 0
br i1 %36, label %103, label %37
37: ; preds = %31
%38 = tail call i64 @BN_mod_exp(i32* %1, i32* %2, i32* %3, i32* %4, i32* null)
%39 = icmp ne i64 %38, 0
%40 = zext i1 %39 to i32
%41 = tail call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2144, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 %40)
%42 = icmp eq i32 %41, 0
br i1 %42, label %103, label %43
43: ; preds = %37, %93
%44 = phi i1 [ true, %93 ], [ false, %37 ]
%45 = tail call i32 @test_BN_eq_zero(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2145, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%46 = icmp eq i32 %45, 0
br i1 %46, label %103, label %47
47: ; preds = %43
%48 = tail call i64 @BN_mod_exp_mont(i32* %1, i32* %2, i32* %3, i32* %4, i32* null, i32* null)
%49 = icmp ne i64 %48, 0
%50 = zext i1 %49 to i32
%51 = tail call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2146, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.9, i64 0, i64 0), i32 %50)
%52 = icmp eq i32 %51, 0
br i1 %52, label %103, label %53
53: ; preds = %47
%54 = tail call i32 @test_BN_eq_zero(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2147, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%55 = icmp eq i32 %54, 0
br i1 %55, label %103, label %56
56: ; preds = %53
%57 = tail call i64 @BN_mod_exp_mont_consttime(i32* %1, i32* %2, i32* %3, i32* %4, i32* null, i32* null)
%58 = icmp ne i64 %57, 0
%59 = zext i1 %58 to i32
%60 = tail call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2148, i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.10, i64 0, i64 0), i32 %59)
%61 = icmp eq i32 %60, 0
br i1 %61, label %103, label %62
62: ; preds = %56
%63 = tail call i32 @test_BN_eq_zero(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2149, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%64 = icmp eq i32 %63, 0
br i1 %64, label %103, label %65
65: ; preds = %62
%66 = tail call i64 @BN_mod_exp_mont_word(i32* %1, i32 1, i32* %3, i32* %4, i32* null, i32* null)
%67 = icmp ne i64 %66, 0
%68 = zext i1 %67 to i32
%69 = tail call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2150, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.11, i64 0, i64 0), i32 %68)
%70 = icmp eq i32 %69, 0
br i1 %70, label %103, label %71
71: ; preds = %65
%72 = tail call i32 @test_BN_eq_zero(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2151, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%73 = icmp eq i32 %72, 0
br i1 %73, label %103, label %74
74: ; preds = %71
%75 = tail call i64 @BN_mod_exp_simple(i32* %1, i32* %2, i32* %3, i32* %4, i32* null)
%76 = icmp ne i64 %75, 0
%77 = zext i1 %76 to i32
%78 = tail call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2152, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.12, i64 0, i64 0), i32 %77)
%79 = icmp eq i32 %78, 0
br i1 %79, label %103, label %80
80: ; preds = %74
%81 = tail call i32 @test_BN_eq_zero(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2153, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%82 = icmp eq i32 %81, 0
br i1 %82, label %103, label %83
83: ; preds = %80
%84 = tail call i64 @BN_mod_exp_recp(i32* %1, i32* %2, i32* %3, i32* %4, i32* null)
%85 = icmp ne i64 %84, 0
%86 = zext i1 %85 to i32
%87 = tail call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2154, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i32 %86)
%88 = icmp eq i32 %87, 0
br i1 %88, label %103, label %89
89: ; preds = %83
%90 = tail call i32 @test_BN_eq_zero(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2155, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%91 = icmp eq i32 %90, 0
%92 = or i1 %91, %44
br i1 %92, label %100, label %93
93: ; preds = %89
%94 = tail call i32 @BN_set_negative(i32* %4, i32 1)
%95 = tail call i64 @BN_mod_exp(i32* %1, i32* %2, i32* %3, i32* %4, i32* null)
%96 = icmp ne i64 %95, 0
%97 = zext i1 %96 to i32
%98 = tail call i32 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 2144, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 %97)
%99 = icmp eq i32 %98, 0
br i1 %99, label %103, label %43
100: ; preds = %89
%101 = xor i1 %91, true
%102 = zext i1 %101 to i32
br label %103
103: ; preds = %100, %93, %43, %47, %53, %56, %62, %65, %71, %74, %80, %83, %37, %0, %7, %10, %13, %16, %19, %25, %31
%104 = phi i32 [ 0, %31 ], [ 0, %25 ], [ 0, %19 ], [ 0, %16 ], [ 0, %13 ], [ 0, %10 ], [ 0, %7 ], [ 0, %0 ], [ 0, %37 ], [ %102, %100 ], [ 0, %93 ], [ 0, %43 ], [ 0, %47 ], [ 0, %53 ], [ 0, %56 ], [ 0, %62 ], [ 0, %65 ], [ 0, %71 ], [ 0, %74 ], [ 0, %80 ], [ 0, %83 ]
%105 = tail call i32 @BN_free(i32* %1)
%106 = tail call i32 @BN_free(i32* %2)
%107 = tail call i32 @BN_free(i32* %3)
%108 = tail call i32 @BN_free(i32* %4)
ret i32 %104
}