#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 BN_BITS2;
int /*<<< orphan*/ BN_FLG_CONSTTIME;
scalar_t__ BN_bntest_rand(int /*<<< orphan*/ *, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ BN_consttime_swap(int, int /*<<< orphan*/ *,
                                     int /*<<< orphan*/ *, int);
int /*<<< orphan*/ *BN_copy(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ BN_free(int /*<<< orphan*/ *);
scalar_t__ BN_get_flags(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ *BN_new();
int BN_num_bits(int /*<<< orphan*/ *);
int /*<<< orphan*/ BN_set_flags(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ BN_swap(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ equalBN(char *, int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ test_false(char *, int, char *, int);
scalar_t__ test_ptr(char *, int, char *, int /*<<< orphan*/ *);
scalar_t__ test_true(char *, int, char *, int);
int test_swap(void) {
  BIGNUM *a = NULL, *b = NULL, *c = NULL, *d = NULL;
  int top, cond, st = 0;
  if (!test_ptr("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/"
                "refs/heads/master/Src/OSF/OpenSSL-111/test/bntest.c",
                156, "a = BN_new()", a = BN_new()) ||
      !test_ptr("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/"
                "refs/heads/master/Src/OSF/OpenSSL-111/test/bntest.c",
                157, "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/bntest.c",
                158, "c = BN_new()", c = BN_new()) ||
      !test_ptr("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                "outputs/2022-01-22/02-19-57/repos/papyrussolution/OpenPapyrus/"
                "refs/heads/master/Src/OSF/OpenSSL-111/test/bntest.c",
                159, "d = BN_new()", d = BN_new()))
    goto err;
  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",
            162, "BN_bntest_rand(a, 1024, 1, 0)",
            (BN_bntest_rand(a, 1024, 1, 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",
            163, "BN_bntest_rand(b, 1024, 1, 0)",
            (BN_bntest_rand(b, 1024, 1, 0)) != 0) &&
        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",
            164, "BN_copy(c, a)", BN_copy(c, 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",
            165, "BN_copy(d, b)", BN_copy(d, b))))
    goto err;
  top = BN_num_bits(a) / BN_BITS2;
  BN_swap(a, b);
  if (!equalBN("swap", a, d) || !equalBN("swap", b, c))
    goto err;
  cond = 1;
  BN_consttime_swap(cond, a, b, top);
  if (!equalBN("cswap true", a, c) || !equalBN("cswap true", b, d))
    goto err;
  cond = 0;
  BN_consttime_swap(cond, a, b, top);
  if (!equalBN("cswap false", a, c) || !equalBN("cswap false", b, d))
    goto err;
  BN_set_flags(a, BN_FLG_CONSTTIME);
  BN_swap(a, b);
  if (!equalBN("swap, flags", a, d) || !equalBN("swap, flags", b, c) ||
      !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",
          195, "BN_get_flags(b, BN_FLG_CONSTTIME)",
          (BN_get_flags(b, BN_FLG_CONSTTIME)) != 0) ||
      !test_false(
          "/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",
          196, "BN_get_flags(a, BN_FLG_CONSTTIME)",
          (BN_get_flags(a, BN_FLG_CONSTTIME)) != 0))
    goto err;
  cond = 1;
  BN_consttime_swap(cond, a, b, top);
  if (!equalBN("cswap true, flags", a, c) ||
      !equalBN("cswap true, flags", b, d) ||
      !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",
          203, "BN_get_flags(a, BN_FLG_CONSTTIME)",
          (BN_get_flags(a, BN_FLG_CONSTTIME)) != 0) ||
      !test_false(
          "/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",
          204, "BN_get_flags(b, BN_FLG_CONSTTIME)",
          (BN_get_flags(b, BN_FLG_CONSTTIME)) != 0))
    goto err;
  cond = 0;
  BN_consttime_swap(cond, a, b, top);
  if (!equalBN("cswap false, flags", a, c) ||
      !equalBN("cswap false, flags", b, d) ||
      !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",
          211, "BN_get_flags(a, BN_FLG_CONSTTIME)",
          (BN_get_flags(a, BN_FLG_CONSTTIME)) != 0) ||
      !test_false(
          "/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",
          212, "BN_get_flags(b, BN_FLG_CONSTTIME)",
          (BN_get_flags(b, BN_FLG_CONSTTIME)) != 0))
    goto err;
  st = 1;
err:
  BN_free(a);
  BN_free(b);
  BN_free(c);
  BN_free(d);
  return st;
}


x86 assembly (clang, -O0):
<test_swap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    $0x0,%al
call   1050 <BN_new@plt>
mov    %rax,%rcx
mov    %rcx,-0x8(%rbp)
lea    0xdec(%rip),%rdi
mov    $0x9c,%esi
lea    0xe8a(%rip),%rdx
call   1090 <test_ptr@plt>
cmp    $0x0,%rax
je     12bf <test_swap+0xef>
mov    $0x0,%al
call   1050 <BN_new@plt>
mov    %rax,%rcx
mov    %rcx,-0x10(%rbp)
lea    0xdbc(%rip),%rdi
mov    $0x9d,%esi
lea    0xe67(%rip),%rdx
call   1090 <test_ptr@plt>
cmp    $0x0,%rax
je     12bf <test_swap+0xef>
mov    $0x0,%al
call   1050 <BN_new@plt>
mov    %rax,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xd8c(%rip),%rdi
mov    $0x9e,%esi
lea    0xe44(%rip),%rdx
call   1090 <test_ptr@plt>
cmp    $0x0,%rax
je     12bf <test_swap+0xef>
mov    $0x0,%al
call   1050 <BN_new@plt>
mov    %rax,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xd5c(%rip),%rdi
mov    $0x9f,%esi
lea    0xe21(%rip),%rdx
call   1090 <test_ptr@plt>
cmp    $0x0,%rax
jne    12c4 <test_swap+0xf4>
jmp    175b <test_swap+0x58b>
mov    -0x8(%rbp),%rdi
mov    $0x400,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1060 <BN_bntest_rand@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xd14(%rip),%rdi
mov    $0xa2,%esi
lea    0xde6(%rip),%rdx
call   1040 <test_true@plt>
cmp    $0x0,%rax
je     13ae <test_swap+0x1de>
mov    -0x10(%rbp),%rdi
mov    $0x400,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1060 <BN_bntest_rand@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xcd1(%rip),%rdi
mov    $0xa3,%esi
lea    0xdc1(%rip),%rdx
call   1040 <test_true@plt>
cmp    $0x0,%rax
je     13ae <test_swap+0x1de>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   10c0 <BN_copy@plt>
mov    %rax,%rcx
lea    0xc9f(%rip),%rdi
mov    $0xa4,%esi
lea    0xdad(%rip),%rdx
call   1090 <test_ptr@plt>
cmp    $0x0,%rax
je     13ae <test_swap+0x1de>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   10c0 <BN_copy@plt>
mov    %rax,%rcx
lea    0xc6d(%rip),%rdi
mov    $0xa5,%esi
lea    0xd89(%rip),%rdx
call   1090 <test_ptr@plt>
cmp    $0x0,%rax
jne    13b3 <test_swap+0x1e3>
jmp    175b <test_swap+0x58b>
mov    -0x8(%rbp),%rdi
call   1070 <BN_num_bits@plt>
mov    0x2c15(%rip),%rcx
cltd
idivl  (%rcx)
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1080 <BN_swap@plt>
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xd51(%rip),%rdi
call   10f0 <equalBN@plt>
cmp    $0x0,%eax
je     1410 <test_swap+0x240>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xd34(%rip),%rdi
call   10f0 <equalBN@plt>
cmp    $0x0,%eax
jne    1415 <test_swap+0x245>
jmp    175b <test_swap+0x58b>
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   10e0 <BN_consttime_swap@plt>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xcfd(%rip),%rdi
call   10f0 <equalBN@plt>
cmp    $0x0,%eax
je     1469 <test_swap+0x299>
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xce0(%rip),%rdi
call   10f0 <equalBN@plt>
cmp    $0x0,%eax
jne    146e <test_swap+0x29e>
jmp    175b <test_swap+0x58b>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   10e0 <BN_consttime_swap@plt>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xcaf(%rip),%rdi
call   10f0 <equalBN@plt>
cmp    $0x0,%eax
je     14c2 <test_swap+0x2f2>
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xc92(%rip),%rdi
call   10f0 <equalBN@plt>
cmp    $0x0,%eax
jne    14c7 <test_swap+0x2f7>
jmp    175b <test_swap+0x58b>
mov    -0x8(%rbp),%rdi
mov    0x2b16(%rip),%rax
mov    (%rax),%esi
call   10d0 <BN_set_flags@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1080 <BN_swap@plt>
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xc5d(%rip),%rdi
call   10f0 <equalBN@plt>
cmp    $0x0,%eax
je     159f <test_swap+0x3cf>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xc40(%rip),%rdi
call   10f0 <equalBN@plt>
cmp    $0x0,%eax
je     159f <test_swap+0x3cf>
mov    -0x10(%rbp),%rdi
mov    0x2abd(%rip),%rax
mov    (%rax),%esi
call   10a0 <BN_get_flags@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xabb(%rip),%rdi
mov    $0xc3,%esi
lea    0xc0d(%rip),%rdx
call   1040 <test_true@plt>
cmp    $0x0,%rax
je     159f <test_swap+0x3cf>
mov    -0x8(%rbp),%rdi
mov    0x2a7d(%rip),%rax
mov    (%rax),%esi
call   10a0 <BN_get_flags@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0xa7b(%rip),%rdi
mov    $0xc4,%esi
lea    0xbef(%rip),%rdx
call   1030 <test_false@plt>
cmp    $0x0,%eax
jne    15a4 <test_swap+0x3d4>
jmp    175b <test_swap+0x58b>
movl   $0x1,-0x28(%rbp)
mov    -0x28(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   10e0 <BN_consttime_swap@plt>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xbd5(%rip),%rdi
call   10f0 <equalBN@plt>
cmp    $0x0,%eax
je     1677 <test_swap+0x4a7>
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xbb8(%rip),%rdi
call   10f0 <equalBN@plt>
cmp    $0x0,%eax
je     1677 <test_swap+0x4a7>
mov    -0x8(%rbp),%rdi
mov    0x29e5(%rip),%rax
mov    (%rax),%esi
call   10a0 <BN_get_flags@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0x9e3(%rip),%rdi
mov    $0xcb,%esi
lea    0xb57(%rip),%rdx
call   1040 <test_true@plt>
cmp    $0x0,%rax
je     1677 <test_swap+0x4a7>
mov    -0x10(%rbp),%rdi
mov    0x29a5(%rip),%rax
mov    (%rax),%esi
call   10a0 <BN_get_flags@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0x9a3(%rip),%rdi
mov    $0xcc,%esi
lea    0xaf5(%rip),%rdx
call   1030 <test_false@plt>
cmp    $0x0,%eax
jne    167c <test_swap+0x4ac>
jmp    175b <test_swap+0x58b>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x24(%rbp),%ecx
call   10e0 <BN_consttime_swap@plt>
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xb0f(%rip),%rdi
call   10f0 <equalBN@plt>
cmp    $0x0,%eax
je     174f <test_swap+0x57f>
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    0xaf2(%rip),%rdi
call   10f0 <equalBN@plt>
cmp    $0x0,%eax
je     174f <test_swap+0x57f>
mov    -0x8(%rbp),%rdi
mov    0x290d(%rip),%rax
mov    (%rax),%esi
call   10a0 <BN_get_flags@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0x90b(%rip),%rdi
mov    $0xd3,%esi
lea    0xa7f(%rip),%rdx
call   1040 <test_true@plt>
cmp    $0x0,%rax
je     174f <test_swap+0x57f>
mov    -0x10(%rbp),%rdi
mov    0x28cd(%rip),%rax
mov    (%rax),%esi
call   10a0 <BN_get_flags@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
lea    0x8cb(%rip),%rdi
mov    $0xd4,%esi
lea    0xa1d(%rip),%rdx
call   1030 <test_false@plt>
cmp    $0x0,%eax
jne    1754 <test_swap+0x584>
jmp    175b <test_swap+0x58b>
movl   $0x1,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
call   10b0 <BN_free@plt>
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    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_swap>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <BN_new@plt>
mov    %rax,%r15
lea    0xe12(%rip),%rdi
lea    0xeb5(%rip),%rdx
mov    $0x9c,%esi
mov    %rax,%rcx
call   1090 <test_ptr@plt>
test   %rax,%rax
je     1682 <test_swap+0x4b2>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <BN_new@plt>
mov    %rax,%r14
lea    0xde2(%rip),%rdi
lea    0xe92(%rip),%rdx
mov    $0x9d,%esi
mov    %rax,%rcx
call   1090 <test_ptr@plt>
test   %rax,%rax
je     1685 <test_swap+0x4b5>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <BN_new@plt>
mov    %rax,%r12
lea    0xdb2(%rip),%rdi
lea    0xe6f(%rip),%rdx
mov    $0x9e,%esi
mov    %rax,%rcx
call   1090 <test_ptr@plt>
test   %rax,%rax
je     1688 <test_swap+0x4b8>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <BN_new@plt>
mov    %rax,%r13
lea    0xd82(%rip),%rdi
lea    0xe4c(%rip),%rdx
mov    $0x9f,%esi
mov    %rax,%rcx
call   1090 <test_ptr@plt>
test   %rax,%rax
je     168b <test_swap+0x4bb>
xor    %ebx,%ebx
mov    %r15,%rdi
mov    $0x400,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1060 <BN_bntest_rand@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0xd40(%rip),%rdi
lea    0xe17(%rip),%rdx
mov    $0xa2,%esi
call   1040 <test_true@plt>
test   %rax,%rax
je     168b <test_swap+0x4bb>
xor    %ebx,%ebx
mov    %r14,%rdi
mov    $0x400,%esi
mov    $0x1,%edx
xor    %ecx,%ecx
call   1060 <BN_bntest_rand@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0xd01(%rip),%rdi
lea    0xdf6(%rip),%rdx
mov    $0xa3,%esi
call   1040 <test_true@plt>
test   %rax,%rax
je     168b <test_swap+0x4bb>
mov    %r12,%rdi
mov    %r15,%rsi
call   10c0 <BN_copy@plt>
lea    0xcd5(%rip),%rdi
lea    0xde8(%rip),%rdx
mov    $0xa4,%esi
mov    %rax,%rcx
call   1090 <test_ptr@plt>
test   %rax,%rax
je     168b <test_swap+0x4bb>
mov    %r13,%rdi
mov    %r14,%rsi
call   10c0 <BN_copy@plt>
lea    0xca6(%rip),%rdi
lea    0xdc7(%rip),%rdx
mov    $0xa5,%esi
mov    %rax,%rcx
call   1090 <test_ptr@plt>
test   %rax,%rax
je     168b <test_swap+0x4bb>
mov    %r15,%rdi
call   1070 <BN_num_bits@plt>
mov    0x2c52(%rip),%rcx
cltd
idivl  (%rcx)
mov    %eax,%ebp
mov    %r15,%rdi
mov    %r14,%rsi
call   1080 <BN_swap@plt>
lea    0xd99(%rip),%rdi
mov    %r15,%rsi
mov    %r13,%rdx
call   10f0 <equalBN@plt>
test   %eax,%eax
je     168b <test_swap+0x4bb>
lea    0xd7f(%rip),%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   10f0 <equalBN@plt>
test   %eax,%eax
je     168b <test_swap+0x4bb>
mov    $0x1,%edi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %ebp,%ecx
call   10e0 <BN_consttime_swap@plt>
lea    0xd58(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   10f0 <equalBN@plt>
test   %eax,%eax
je     168b <test_swap+0x4bb>
lea    0xd3e(%rip),%rdi
mov    %r14,%rsi
mov    %r13,%rdx
call   10f0 <equalBN@plt>
test   %eax,%eax
je     168b <test_swap+0x4bb>
xor    %ebx,%ebx
xor    %edi,%edi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %ebp,%ecx
call   10e0 <BN_consttime_swap@plt>
lea    0xd1e(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   10f0 <equalBN@plt>
test   %eax,%eax
je     168b <test_swap+0x4bb>
lea    0xd04(%rip),%rdi
mov    %r14,%rsi
mov    %r13,%rdx
call   10f0 <equalBN@plt>
test   %eax,%eax
je     168b <test_swap+0x4bb>
mov    0x2b8c(%rip),%rax
mov    (%rax),%esi
mov    %r15,%rdi
call   10d0 <BN_set_flags@plt>
mov    %r15,%rdi
mov    %r14,%rsi
call   1080 <BN_swap@plt>
lea    0xcda(%rip),%rdi
mov    %r15,%rsi
mov    %r13,%rdx
call   10f0 <equalBN@plt>
test   %eax,%eax
je     168b <test_swap+0x4bb>
lea    0xcc0(%rip),%rdi
mov    %r14,%rsi
mov    %r12,%rdx
call   10f0 <equalBN@plt>
test   %eax,%eax
je     168b <test_swap+0x4bb>
mov    0x2b3c(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   10a0 <BN_get_flags@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0xb3b(%rip),%rdi
lea    0xc92(%rip),%rdx
mov    $0xc3,%esi
call   1040 <test_true@plt>
test   %rax,%rax
je     168b <test_swap+0x4bb>
mov    0x2b02(%rip),%rax
mov    (%rax),%esi
mov    %r15,%rdi
call   10a0 <BN_get_flags@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0xb01(%rip),%rdi
lea    0xc7a(%rip),%rdx
mov    $0xc4,%esi
call   1030 <test_false@plt>
test   %eax,%eax
je     168b <test_swap+0x4bb>
mov    $0x1,%edi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %ebp,%ecx
call   10e0 <BN_consttime_swap@plt>
lea    0xc71(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   10f0 <equalBN@plt>
test   %eax,%eax
je     168b <test_swap+0x4bb>
lea    0xc57(%rip),%rdi
mov    %r14,%rsi
mov    %r13,%rdx
call   10f0 <equalBN@plt>
test   %eax,%eax
je     168b <test_swap+0x4bb>
mov    0x2a83(%rip),%rax
mov    (%rax),%esi
mov    %r15,%rdi
call   10a0 <BN_get_flags@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0xa82(%rip),%rdi
lea    0xbfb(%rip),%rdx
mov    $0xcb,%esi
call   1040 <test_true@plt>
test   %rax,%rax
je     168b <test_swap+0x4bb>
mov    0x2a49(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   10a0 <BN_get_flags@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0xa48(%rip),%rdi
lea    0xb9f(%rip),%rdx
mov    $0xcc,%esi
call   1030 <test_false@plt>
test   %eax,%eax
je     168b <test_swap+0x4bb>
xor    %ebx,%ebx
xor    %edi,%edi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %ebp,%ecx
call   10e0 <BN_consttime_swap@plt>
lea    0xbcb(%rip),%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   10f0 <equalBN@plt>
test   %eax,%eax
je     168b <test_swap+0x4bb>
lea    0xbb1(%rip),%rdi
mov    %r14,%rsi
mov    %r13,%rdx
call   10f0 <equalBN@plt>
test   %eax,%eax
je     168b <test_swap+0x4bb>
mov    0x29cf(%rip),%rax
mov    (%rax),%esi
mov    %r15,%rdi
call   10a0 <BN_get_flags@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0x9ce(%rip),%rdi
lea    0xb47(%rip),%rdx
mov    $0xd3,%esi
call   1040 <test_true@plt>
test   %rax,%rax
je     168b <test_swap+0x4bb>
mov    0x2999(%rip),%rax
mov    (%rax),%esi
mov    %r14,%rdi
call   10a0 <BN_get_flags@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    0x998(%rip),%rdi
lea    0xaef(%rip),%rdx
mov    $0xd4,%esi
call   1030 <test_false@plt>
xor    %ebx,%ebx
test   %eax,%eax
setne  %bl
jmp    168b <test_swap+0x4bb>
xor    %r14d,%r14d
xor    %r12d,%r12d
xor    %r13d,%r13d
mov    %r15,%rdi
call   10b0 <BN_free@plt>
mov    %r14,%rdi
call   10b0 <BN_free@plt>
mov    %r12,%rdi
call   10b0 <BN_free@plt>
mov    %r13,%rdi
call   10b0 <BN_free@plt>
mov    %ebx,%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 = [13 x i8] c"a = BN_new()\00"
@.str.2 = [13 x i8] c"b = BN_new()\00"
@.str.3 = [13 x i8] c"c = BN_new()\00"
@.str.4 = [13 x i8] c"d = BN_new()\00"
@.str.5 = [30 x i8] c"BN_bntest_rand(a, 1024, 1, 0)\00"
@.str.6 = [30 x i8] c"BN_bntest_rand(b, 1024, 1, 0)\00"
@.str.7 = [14 x i8] c"BN_copy(c, a)\00"
@.str.8 = [14 x i8] c"BN_copy(d, b)\00"
@BN_BITS2 = global i32 0
@.str.9 = [5 x i8] c"swap\00"
@.str.10 = [11 x i8] c"cswap true\00"
@.str.11 = [12 x i8] c"cswap false\00"
@BN_FLG_CONSTTIME = global i32 0
@.str.12 = [12 x i8] c"swap, flags\00"
@.str.13 = [34 x i8] c"BN_get_flags(b, BN_FLG_CONSTTIME)\00"
@.str.14 = [34 x i8] c"BN_get_flags(a, BN_FLG_CONSTTIME)\00"
@.str.15 = [18 x i8] c"cswap true, flags\00"
@.str.16 = [19 x i8] c"cswap false, flags\00"
define i32 @test_swap() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* null, i32** %1
store i32* null, i32** %2
store i32* null, i32** %3
store i32* null, i32** %4
store i32 0, i32* %7
%8 = call i32* (...) @BN_new()
store i32* %8, i32** %1
%9 = call i64 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 156, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %11, label %23
11: ; preds = %0
%12 = call i32* (...) @BN_new()
store i32* %12, i32** %2
%13 = call i64 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 157, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32* %12)
%14 = icmp ne i64 %13, 0
br i1 %14, label %15, label %23
15: ; preds = %11
%16 = call i32* (...) @BN_new()
store i32* %16, i32** %3
%17 = call i64 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 158, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32* %16)
%18 = icmp ne i64 %17, 0
br i1 %18, label %19, label %23
19: ; preds = %15
%20 = call i32* (...) @BN_new()
store i32* %20, i32** %4
%21 = call i64 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 159, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32* %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %24, label %23
23: ; preds = %19, %15, %11, %0
br label %199
24: ; preds = %19
%25 = load i32*, i32** %1
%26 = call i64 @BN_bntest_rand(i32* %25, i32 1024, i32 1, i32 0)
%27 = icmp ne i64 %26, 0
%28 = zext i1 %27 to i32
%29 = call i64 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 162, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 %28)
%30 = icmp ne i64 %29, 0
br i1 %30, label %31, label %50
31: ; preds = %24
%32 = load i32*, i32** %2
%33 = call i64 @BN_bntest_rand(i32* %32, i32 1024, i32 1, i32 0)
%34 = icmp ne i64 %33, 0
%35 = zext i1 %34 to i32
%36 = call i64 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 163, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %35)
%37 = icmp ne i64 %36, 0
br i1 %37, label %38, label %50
38: ; preds = %31
%39 = load i32*, i32** %3
%40 = load i32*, i32** %1
%41 = call i32* @BN_copy(i32* %39, i32* %40)
%42 = call i64 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 164, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32* %41)
%43 = icmp ne i64 %42, 0
br i1 %43, label %44, label %50
44: ; preds = %38
%45 = load i32*, i32** %4
%46 = load i32*, i32** %2
%47 = call i32* @BN_copy(i32* %45, i32* %46)
%48 = call i64 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 165, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i32* %47)
%49 = icmp ne i64 %48, 0
br i1 %49, label %51, label %50
50: ; preds = %44, %38, %31, %24
br label %199
51: ; preds = %44
%52 = load i32*, i32** %1
%53 = call i32 @BN_num_bits(i32* %52)
%54 = load i32, i32* @BN_BITS2
%55 = sdiv i32 %53, %54
store i32 %55, i32* %5
%56 = load i32*, i32** %1
%57 = load i32*, i32** %2
%58 = call i32 @BN_swap(i32* %56, i32* %57)
%59 = load i32*, i32** %1
%60 = load i32*, i32** %4
%61 = call i32 @equalBN(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32* %59, i32* %60)
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %68
63: ; preds = %51
%64 = load i32*, i32** %2
%65 = load i32*, i32** %3
%66 = call i32 @equalBN(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32* %64, i32* %65)
%67 = icmp ne i32 %66, 0
br i1 %67, label %69, label %68
68: ; preds = %63, %51
br label %199
69: ; preds = %63
store i32 1, i32* %6
%70 = load i32, i32* %6
%71 = load i32*, i32** %1
%72 = load i32*, i32** %2
%73 = load i32, i32* %5
%74 = call i32 @BN_consttime_swap(i32 %70, i32* %71, i32* %72, i32 %73)
%75 = load i32*, i32** %1
%76 = load i32*, i32** %3
%77 = call i32 @equalBN(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i32* %75, i32* %76)
%78 = icmp ne i32 %77, 0
br i1 %78, label %79, label %84
79: ; preds = %69
%80 = load i32*, i32** %2
%81 = load i32*, i32** %4
%82 = call i32 @equalBN(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i32* %80, i32* %81)
%83 = icmp ne i32 %82, 0
br i1 %83, label %85, label %84
84: ; preds = %79, %69
br label %199
85: ; preds = %79
store i32 0, i32* %6
%86 = load i32, i32* %6
%87 = load i32*, i32** %1
%88 = load i32*, i32** %2
%89 = load i32, i32* %5
%90 = call i32 @BN_consttime_swap(i32 %86, i32* %87, i32* %88, i32 %89)
%91 = load i32*, i32** %1
%92 = load i32*, i32** %3
%93 = call i32 @equalBN(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i32* %91, i32* %92)
%94 = icmp ne i32 %93, 0
br i1 %94, label %95, label %100
95: ; preds = %85
%96 = load i32*, i32** %2
%97 = load i32*, i32** %4
%98 = call i32 @equalBN(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i32* %96, i32* %97)
%99 = icmp ne i32 %98, 0
br i1 %99, label %101, label %100
100: ; preds = %95, %85
br label %199
101: ; preds = %95
%102 = load i32*, i32** %1
%103 = load i32, i32* @BN_FLG_CONSTTIME
%104 = call i32 @BN_set_flags(i32* %102, i32 %103)
%105 = load i32*, i32** %1
%106 = load i32*, i32** %2
%107 = call i32 @BN_swap(i32* %105, i32* %106)
%108 = load i32*, i32** %1
%109 = load i32*, i32** %4
%110 = call i32 @equalBN(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0), i32* %108, i32* %109)
%111 = icmp ne i32 %110, 0
br i1 %111, label %112, label %133
112: ; preds = %101
%113 = load i32*, i32** %2
%114 = load i32*, i32** %3
%115 = call i32 @equalBN(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0), i32* %113, i32* %114)
%116 = icmp ne i32 %115, 0
br i1 %116, label %117, label %133
117: ; preds = %112
%118 = load i32*, i32** %2
%119 = load i32, i32* @BN_FLG_CONSTTIME
%120 = call i64 @BN_get_flags(i32* %118, i32 %119)
%121 = icmp ne i64 %120, 0
%122 = zext i1 %121 to i32
%123 = call i64 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 195, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i32 %122)
%124 = icmp ne i64 %123, 0
br i1 %124, label %125, label %133
125: ; preds = %117
%126 = load i32*, i32** %1
%127 = load i32, i32* @BN_FLG_CONSTTIME
%128 = call i64 @BN_get_flags(i32* %126, i32 %127)
%129 = icmp ne i64 %128, 0
%130 = zext i1 %129 to i32
%131 = call i32 @test_false(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 196, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0), i32 %130)
%132 = icmp ne i32 %131, 0
br i1 %132, label %134, label %133
133: ; preds = %125, %117, %112, %101
br label %199
134: ; preds = %125
store i32 1, i32* %6
%135 = load i32, i32* %6
%136 = load i32*, i32** %1
%137 = load i32*, i32** %2
%138 = load i32, i32* %5
%139 = call i32 @BN_consttime_swap(i32 %135, i32* %136, i32* %137, i32 %138)
%140 = load i32*, i32** %1
%141 = load i32*, i32** %3
%142 = call i32 @equalBN(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.15, i64 0, i64 0), i32* %140, i32* %141)
%143 = icmp ne i32 %142, 0
br i1 %143, label %144, label %165
144: ; preds = %134
%145 = load i32*, i32** %2
%146 = load i32*, i32** %4
%147 = call i32 @equalBN(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.15, i64 0, i64 0), i32* %145, i32* %146)
%148 = icmp ne i32 %147, 0
br i1 %148, label %149, label %165
149: ; preds = %144
%150 = load i32*, i32** %1
%151 = load i32, i32* @BN_FLG_CONSTTIME
%152 = call i64 @BN_get_flags(i32* %150, i32 %151)
%153 = icmp ne i64 %152, 0
%154 = zext i1 %153 to i32
%155 = call i64 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 203, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0), i32 %154)
%156 = icmp ne i64 %155, 0
br i1 %156, label %157, label %165
157: ; preds = %149
%158 = load i32*, i32** %2
%159 = load i32, i32* @BN_FLG_CONSTTIME
%160 = call i64 @BN_get_flags(i32* %158, i32 %159)
%161 = icmp ne i64 %160, 0
%162 = zext i1 %161 to i32
%163 = call i32 @test_false(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 204, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i32 %162)
%164 = icmp ne i32 %163, 0
br i1 %164, label %166, label %165
165: ; preds = %157, %149, %144, %134
br label %199
166: ; preds = %157
store i32 0, i32* %6
%167 = load i32, i32* %6
%168 = load i32*, i32** %1
%169 = load i32*, i32** %2
%170 = load i32, i32* %5
%171 = call i32 @BN_consttime_swap(i32 %167, i32* %168, i32* %169, i32 %170)
%172 = load i32*, i32** %1
%173 = load i32*, i32** %3
%174 = call i32 @equalBN(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32* %172, i32* %173)
%175 = icmp ne i32 %174, 0
br i1 %175, label %176, label %197
176: ; preds = %166
%177 = load i32*, i32** %2
%178 = load i32*, i32** %4
%179 = call i32 @equalBN(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32* %177, i32* %178)
%180 = icmp ne i32 %179, 0
br i1 %180, label %181, label %197
181: ; preds = %176
%182 = load i32*, i32** %1
%183 = load i32, i32* @BN_FLG_CONSTTIME
%184 = call i64 @BN_get_flags(i32* %182, i32 %183)
%185 = icmp ne i64 %184, 0
%186 = zext i1 %185 to i32
%187 = call i64 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 211, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0), i32 %186)
%188 = icmp ne i64 %187, 0
br i1 %188, label %189, label %197
189: ; preds = %181
%190 = load i32*, i32** %2
%191 = load i32, i32* @BN_FLG_CONSTTIME
%192 = call i64 @BN_get_flags(i32* %190, i32 %191)
%193 = icmp ne i64 %192, 0
%194 = zext i1 %193 to i32
%195 = call i32 @test_false(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 212, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i32 %194)
%196 = icmp ne i32 %195, 0
br i1 %196, label %198, label %197
197: ; preds = %189, %181, %176, %166
br label %199
198: ; preds = %189
store i32 1, i32* %7
br label %199
199: ; preds = %198, %197, %165, %133, %100, %84, %68, %50, %23
%200 = load i32*, i32** %1
%201 = call i32 @BN_free(i32* %200)
%202 = load i32*, i32** %2
%203 = call i32 @BN_free(i32* %202)
%204 = load i32*, i32** %3
%205 = call i32 @BN_free(i32* %204)
%206 = load i32*, i32** %4
%207 = call i32 @BN_free(i32* %206)
%208 = load i32, i32* %7
ret i32 %208
}

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 = [13 x i8] c"a = BN_new()\00"
@.str.2 = [13 x i8] c"b = BN_new()\00"
@.str.3 = [13 x i8] c"c = BN_new()\00"
@.str.4 = [13 x i8] c"d = BN_new()\00"
@.str.5 = [30 x i8] c"BN_bntest_rand(a, 1024, 1, 0)\00"
@.str.6 = [30 x i8] c"BN_bntest_rand(b, 1024, 1, 0)\00"
@.str.7 = [14 x i8] c"BN_copy(c, a)\00"
@.str.8 = [14 x i8] c"BN_copy(d, b)\00"
@BN_BITS2 = global i32 0
@.str.9 = [5 x i8] c"swap\00"
@.str.10 = [11 x i8] c"cswap true\00"
@.str.11 = [12 x i8] c"cswap false\00"
@BN_FLG_CONSTTIME = global i32 0
@.str.12 = [12 x i8] c"swap, flags\00"
@.str.13 = [34 x i8] c"BN_get_flags(b, BN_FLG_CONSTTIME)\00"
@.str.14 = [34 x i8] c"BN_get_flags(a, BN_FLG_CONSTTIME)\00"
@.str.15 = [18 x i8] c"cswap true, flags\00"
@.str.16 = [19 x i8] c"cswap false, flags\00"
define i32 @test_swap() {
%1 = tail call i32* (...) @BN_new()
%2 = tail call i64 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 156, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%3 = icmp eq i64 %2, 0
br i1 %3, label %126, label %4
4: ; preds = %0
%5 = tail call i32* (...) @BN_new()
%6 = tail call i64 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 157, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %126, label %8
8: ; preds = %4
%9 = tail call i32* (...) @BN_new()
%10 = tail call i64 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 158, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32* %9)
%11 = icmp eq i64 %10, 0
br i1 %11, label %126, label %12
12: ; preds = %8
%13 = tail call i32* (...) @BN_new()
%14 = tail call i64 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 159, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32* %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %126, label %16
16: ; preds = %12
%17 = tail call i64 @BN_bntest_rand(i32* %1, i32 1024, i32 1, i32 0)
%18 = icmp ne i64 %17, 0
%19 = zext i1 %18 to i32
%20 = tail call i64 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 162, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 %19)
%21 = icmp eq i64 %20, 0
br i1 %21, label %126, label %22
22: ; preds = %16
%23 = tail call i64 @BN_bntest_rand(i32* %5, i32 1024, i32 1, i32 0)
%24 = icmp ne i64 %23, 0
%25 = zext i1 %24 to i32
%26 = tail call i64 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 163, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 %25)
%27 = icmp eq i64 %26, 0
br i1 %27, label %126, label %28
28: ; preds = %22
%29 = tail call i32* @BN_copy(i32* %9, i32* %1)
%30 = tail call i64 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 164, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.7, i64 0, i64 0), i32* %29)
%31 = icmp eq i64 %30, 0
br i1 %31, label %126, label %32
32: ; preds = %28
%33 = tail call i32* @BN_copy(i32* %13, i32* %5)
%34 = tail call i64 @test_ptr(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 165, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i32* %33)
%35 = icmp eq i64 %34, 0
br i1 %35, label %126, label %36
36: ; preds = %32
%37 = tail call i32 @BN_num_bits(i32* %1)
%38 = load i32, i32* @BN_BITS2
%39 = sdiv i32 %37, %38
%40 = tail call i32 @BN_swap(i32* %1, i32* %5)
%41 = tail call i32 @equalBN(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32* %1, i32* %13)
%42 = icmp eq i32 %41, 0
br i1 %42, label %126, label %43
43: ; preds = %36
%44 = tail call i32 @equalBN(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0), i32* %5, i32* %9)
%45 = icmp eq i32 %44, 0
br i1 %45, label %126, label %46
46: ; preds = %43
%47 = tail call i32 @BN_consttime_swap(i32 1, i32* %1, i32* %5, i32 %39)
%48 = tail call i32 @equalBN(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i32* %1, i32* %9)
%49 = icmp eq i32 %48, 0
br i1 %49, label %126, label %50
50: ; preds = %46
%51 = tail call i32 @equalBN(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0), i32* %5, i32* %13)
%52 = icmp eq i32 %51, 0
br i1 %52, label %126, label %53
53: ; preds = %50
%54 = tail call i32 @BN_consttime_swap(i32 0, i32* %1, i32* %5, i32 %39)
%55 = tail call i32 @equalBN(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i32* %1, i32* %9)
%56 = icmp eq i32 %55, 0
br i1 %56, label %126, label %57
57: ; preds = %53
%58 = tail call i32 @equalBN(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.11, i64 0, i64 0), i32* %5, i32* %13)
%59 = icmp eq i32 %58, 0
br i1 %59, label %126, label %60
60: ; preds = %57
%61 = load i32, i32* @BN_FLG_CONSTTIME
%62 = tail call i32 @BN_set_flags(i32* %1, i32 %61)
%63 = tail call i32 @BN_swap(i32* %1, i32* %5)
%64 = tail call i32 @equalBN(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0), i32* %1, i32* %13)
%65 = icmp eq i32 %64, 0
br i1 %65, label %126, label %66
66: ; preds = %60
%67 = tail call i32 @equalBN(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.12, i64 0, i64 0), i32* %5, i32* %9)
%68 = icmp eq i32 %67, 0
br i1 %68, label %126, label %69
69: ; preds = %66
%70 = load i32, i32* @BN_FLG_CONSTTIME
%71 = tail call i64 @BN_get_flags(i32* %5, i32 %70)
%72 = icmp ne i64 %71, 0
%73 = zext i1 %72 to i32
%74 = tail call i64 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 195, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i32 %73)
%75 = icmp eq i64 %74, 0
br i1 %75, label %126, label %76
76: ; preds = %69
%77 = load i32, i32* @BN_FLG_CONSTTIME
%78 = tail call i64 @BN_get_flags(i32* %1, i32 %77)
%79 = icmp ne i64 %78, 0
%80 = zext i1 %79 to i32
%81 = tail call i32 @test_false(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 196, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0), i32 %80)
%82 = icmp eq i32 %81, 0
br i1 %82, label %126, label %83
83: ; preds = %76
%84 = tail call i32 @BN_consttime_swap(i32 1, i32* %1, i32* %5, i32 %39)
%85 = tail call i32 @equalBN(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.15, i64 0, i64 0), i32* %1, i32* %9)
%86 = icmp eq i32 %85, 0
br i1 %86, label %126, label %87
87: ; preds = %83
%88 = tail call i32 @equalBN(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.15, i64 0, i64 0), i32* %5, i32* %13)
%89 = icmp eq i32 %88, 0
br i1 %89, label %126, label %90
90: ; preds = %87
%91 = load i32, i32* @BN_FLG_CONSTTIME
%92 = tail call i64 @BN_get_flags(i32* %1, i32 %91)
%93 = icmp ne i64 %92, 0
%94 = zext i1 %93 to i32
%95 = tail call i64 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 203, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0), i32 %94)
%96 = icmp eq i64 %95, 0
br i1 %96, label %126, label %97
97: ; preds = %90
%98 = load i32, i32* @BN_FLG_CONSTTIME
%99 = tail call i64 @BN_get_flags(i32* %5, i32 %98)
%100 = icmp ne i64 %99, 0
%101 = zext i1 %100 to i32
%102 = tail call i32 @test_false(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 204, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i32 %101)
%103 = icmp eq i32 %102, 0
br i1 %103, label %126, label %104
104: ; preds = %97
%105 = tail call i32 @BN_consttime_swap(i32 0, i32* %1, i32* %5, i32 %39)
%106 = tail call i32 @equalBN(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32* %1, i32* %9)
%107 = icmp eq i32 %106, 0
br i1 %107, label %126, label %108
108: ; preds = %104
%109 = tail call i32 @equalBN(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0), i32* %5, i32* %13)
%110 = icmp eq i32 %109, 0
br i1 %110, label %126, label %111
111: ; preds = %108
%112 = load i32, i32* @BN_FLG_CONSTTIME
%113 = tail call i64 @BN_get_flags(i32* %1, i32 %112)
%114 = icmp ne i64 %113, 0
%115 = zext i1 %114 to i32
%116 = tail call i64 @test_true(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 211, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.14, i64 0, i64 0), i32 %115)
%117 = icmp eq i64 %116, 0
br i1 %117, label %126, label %118
118: ; preds = %111
%119 = load i32, i32* @BN_FLG_CONSTTIME
%120 = tail call i64 @BN_get_flags(i32* %5, i32 %119)
%121 = icmp ne i64 %120, 0
%122 = zext i1 %121 to i32
%123 = tail call i32 @test_false(i8* getelementptr inbounds ([170 x i8], [170 x i8]* @.str, i64 0, i64 0), i32 212, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.13, i64 0, i64 0), i32 %122)
%124 = icmp ne i32 %123, 0
%125 = zext i1 %124 to i32
br label %126
126: ; preds = %118, %104, %108, %111, %83, %87, %90, %97, %60, %66, %69, %76, %53, %57, %46, %50, %36, %43, %16, %22, %28, %32, %0, %4, %8, %12
%127 = phi i32* [ %5, %111 ], [ %5, %108 ], [ %5, %104 ], [ %5, %97 ], [ %5, %90 ], [ %5, %87 ], [ %5, %83 ], [ %5, %76 ], [ %5, %69 ], [ %5, %66 ], [ %5, %60 ], [ %5, %57 ], [ %5, %53 ], [ %5, %50 ], [ %5, %46 ], [ %5, %43 ], [ %5, %36 ], [ %5, %32 ], [ %5, %28 ], [ %5, %22 ], [ %5, %16 ], [ %5, %12 ], [ %5, %8 ], [ %5, %4 ], [ null, %0 ], [ %5, %118 ]
%128 = phi i32* [ %9, %111 ], [ %9, %108 ], [ %9, %104 ], [ %9, %97 ], [ %9, %90 ], [ %9, %87 ], [ %9, %83 ], [ %9, %76 ], [ %9, %69 ], [ %9, %66 ], [ %9, %60 ], [ %9, %57 ], [ %9, %53 ], [ %9, %50 ], [ %9, %46 ], [ %9, %43 ], [ %9, %36 ], [ %9, %32 ], [ %9, %28 ], [ %9, %22 ], [ %9, %16 ], [ %9, %12 ], [ %9, %8 ], [ null, %4 ], [ null, %0 ], [ %9, %118 ]
%129 = phi i32* [ %13, %111 ], [ %13, %108 ], [ %13, %104 ], [ %13, %97 ], [ %13, %90 ], [ %13, %87 ], [ %13, %83 ], [ %13, %76 ], [ %13, %69 ], [ %13, %66 ], [ %13, %60 ], [ %13, %57 ], [ %13, %53 ], [ %13, %50 ], [ %13, %46 ], [ %13, %43 ], [ %13, %36 ], [ %13, %32 ], [ %13, %28 ], [ %13, %22 ], [ %13, %16 ], [ %13, %12 ], [ null, %8 ], [ null, %4 ], [ null, %0 ], [ %13, %118 ]
%130 = phi i32 [ 0, %111 ], [ 0, %108 ], [ 0, %104 ], [ 0, %97 ], [ 0, %90 ], [ 0, %87 ], [ 0, %83 ], [ 0, %76 ], [ 0, %69 ], [ 0, %66 ], [ 0, %60 ], [ 0, %57 ], [ 0, %53 ], [ 0, %50 ], [ 0, %46 ], [ 0, %43 ], [ 0, %36 ], [ 0, %32 ], [ 0, %28 ], [ 0, %22 ], [ 0, %16 ], [ 0, %12 ], [ 0, %8 ], [ 0, %4 ], [ 0, %0 ], [ %125, %118 ]
%131 = tail call i32 @BN_free(i32* %1)
%132 = tail call i32 @BN_free(i32* %127)
%133 = tail call i32 @BN_free(i32* %128)
%134 = tail call i32 @BN_free(i32* %129)
ret i32 %130
}