#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*/ const BIGNUM;

/* Variables and functions */
int BN_crt(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *,
           int /*<<< orphan*/ const *, int /*<<< orphan*/ const *,
           int /*<<< orphan*/ const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ BN_free(int /*<<< orphan*/ const *);
int BN_mod(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *,
           int /*<<< orphan*/ const *, int /*<<< orphan*/ *);
int BN_mod_exp(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *,
               int /*<<< orphan*/ const *, int /*<<< orphan*/ const *,
               int /*<<< orphan*/ *);
int BN_mod_mul(int /*<<< orphan*/ const *, int /*<<< orphan*/ const *,
               int /*<<< orphan*/ const *, int /*<<< orphan*/ const *,
               int /*<<< orphan*/ *);
int /*<<< orphan*/ const *BN_new();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
int Finv(BIGNUM *r, const BIGNUM *c, const BIGNUM *y, const BIGNUM *p,
         const BIGNUM *q, const BIGNUM *up, const BIGNUM *uq, const BIGNUM *vp,
         const BIGNUM *vq, BN_CTX *bn_ctx) {
  int ret, ok;
  BIGNUM *yp = NULL, *yq = NULL, *t1 = NULL, *t2 = NULL, *xp = NULL, *xq = NULL;
  if ((yp = BN_new()) == NULL) {
    fprintf(stderr, "@@@ %s:%d @@@\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/dstebila/daps/refs/heads/master/"
            "daps_h2_mr.c",
            207);
    fflush(stderr);
    ;
    goto err;
  };
  if ((yq = BN_new()) == NULL) {
    fprintf(stderr, "@@@ %s:%d @@@\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/dstebila/daps/refs/heads/master/"
            "daps_h2_mr.c",
            208);
    fflush(stderr);
    ;
    goto err;
  };
  if ((t1 = BN_new()) == NULL) {
    fprintf(stderr, "@@@ %s:%d @@@\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/dstebila/daps/refs/heads/master/"
            "daps_h2_mr.c",
            209);
    fflush(stderr);
    ;
    goto err;
  };
  if ((t2 = BN_new()) == NULL) {
    fprintf(stderr, "@@@ %s:%d @@@\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/dstebila/daps/refs/heads/master/"
            "daps_h2_mr.c",
            210);
    fflush(stderr);
    ;
    goto err;
  };
  if ((xp = BN_new()) == NULL) {
    fprintf(stderr, "@@@ %s:%d @@@\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/dstebila/daps/refs/heads/master/"
            "daps_h2_mr.c",
            211);
    fflush(stderr);
    ;
    goto err;
  };
  if ((xq = BN_new()) == NULL) {
    fprintf(stderr, "@@@ %s:%d @@@\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/dstebila/daps/refs/heads/master/"
            "daps_h2_mr.c",
            212);
    fflush(stderr);
    ;
    goto err;
  };
  ok = (BN_mod(yp, y, p, bn_ctx));
  if (ok != 1) {
    fprintf(stderr, "@@@ %s:%d @@@\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/dstebila/daps/refs/heads/master/"
            "daps_h2_mr.c",
            213);
    fflush(stderr);
    ;
    goto err;
  };
  ok = (BN_mod(yq, y, q, bn_ctx));
  if (ok != 1) {
    fprintf(stderr, "@@@ %s:%d @@@\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/dstebila/daps/refs/heads/master/"
            "daps_h2_mr.c",
            214);
    fflush(stderr);
    ;
    goto err;
  };
  ok = (BN_mod_exp(t1, yp, vp, p, bn_ctx));
  if (ok != 1) {
    fprintf(stderr, "@@@ %s:%d @@@\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/dstebila/daps/refs/heads/master/"
            "daps_h2_mr.c",
            216);
    fflush(stderr);
    ;
    goto err;
  };
  ok = (BN_mod_exp(t2, up, c, p, bn_ctx));
  if (ok != 1) {
    fprintf(stderr, "@@@ %s:%d @@@\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/dstebila/daps/refs/heads/master/"
            "daps_h2_mr.c",
            217);
    fflush(stderr);
    ;
    goto err;
  };
  ok = (BN_mod_mul(xp, t1, t2, p, bn_ctx));
  if (ok != 1) {
    fprintf(stderr, "@@@ %s:%d @@@\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/dstebila/daps/refs/heads/master/"
            "daps_h2_mr.c",
            218);
    fflush(stderr);
    ;
    goto err;
  };
  ok = (BN_mod_exp(t1, yq, vq, q, bn_ctx));
  if (ok != 1) {
    fprintf(stderr, "@@@ %s:%d @@@\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/dstebila/daps/refs/heads/master/"
            "daps_h2_mr.c",
            220);
    fflush(stderr);
    ;
    goto err;
  };
  ok = (BN_mod_exp(t2, uq, c, q, bn_ctx));
  if (ok != 1) {
    fprintf(stderr, "@@@ %s:%d @@@\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/dstebila/daps/refs/heads/master/"
            "daps_h2_mr.c",
            221);
    fflush(stderr);
    ;
    goto err;
  };
  ok = (BN_mod_mul(xq, t1, t2, q, bn_ctx));
  if (ok != 1) {
    fprintf(stderr, "@@@ %s:%d @@@\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/dstebila/daps/refs/heads/master/"
            "daps_h2_mr.c",
            222);
    fflush(stderr);
    ;
    goto err;
  };
  ok = (BN_crt(r, xp, p, xq, q, bn_ctx));
  if (ok != 1) {
    fprintf(stderr, "@@@ %s:%d @@@\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/dstebila/daps/refs/heads/master/"
            "daps_h2_mr.c",
            224);
    fflush(stderr);
    ;
    goto err;
  };
  ret = 1;
  goto cleanup;
err:
  ret = 0;
cleanup:
  BN_free(yp);
  BN_free(yq);
  BN_free(t1);
  BN_free(t2);
  BN_free(xp);
  BN_free(xq);
  return ret;
}


x86 assembly (clang, -O0):
<Finv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movq   $0x0,-0x40(%rbp)
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
movq   $0x0,-0x60(%rbp)
movq   $0x0,-0x68(%rbp)
mov    $0x0,%al
call   1030 <BN_new@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
jne    1229 <Finv+0xa9>
mov    0x2de4(%rip),%rax
mov    (%rax),%edi
lea    0xdfb(%rip),%rsi
lea    0xe03(%rip),%rdx
mov    $0xcf,%ecx
call   1050 <fprintf@plt>
mov    0x2dc3(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    16c8 <Finv+0x548>
mov    $0x0,%al
call   1030 <BN_new@plt>
mov    %rax,-0x48(%rbp)
cmp    $0x0,%rax
jne    1272 <Finv+0xf2>
mov    0x2d9b(%rip),%rax
mov    (%rax),%edi
lea    0xdb2(%rip),%rsi
lea    0xdba(%rip),%rdx
mov    $0xd0,%ecx
call   1050 <fprintf@plt>
mov    0x2d7a(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    16c8 <Finv+0x548>
mov    $0x0,%al
call   1030 <BN_new@plt>
mov    %rax,-0x50(%rbp)
cmp    $0x0,%rax
jne    12bb <Finv+0x13b>
mov    0x2d52(%rip),%rax
mov    (%rax),%edi
lea    0xd69(%rip),%rsi
lea    0xd71(%rip),%rdx
mov    $0xd1,%ecx
call   1050 <fprintf@plt>
mov    0x2d31(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    16c8 <Finv+0x548>
mov    $0x0,%al
call   1030 <BN_new@plt>
mov    %rax,-0x58(%rbp)
cmp    $0x0,%rax
jne    1304 <Finv+0x184>
mov    0x2d09(%rip),%rax
mov    (%rax),%edi
lea    0xd20(%rip),%rsi
lea    0xd28(%rip),%rdx
mov    $0xd2,%ecx
call   1050 <fprintf@plt>
mov    0x2ce8(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    16c8 <Finv+0x548>
mov    $0x0,%al
call   1030 <BN_new@plt>
mov    %rax,-0x60(%rbp)
cmp    $0x0,%rax
jne    134d <Finv+0x1cd>
mov    0x2cc0(%rip),%rax
mov    (%rax),%edi
lea    0xcd7(%rip),%rsi
lea    0xcdf(%rip),%rdx
mov    $0xd3,%ecx
call   1050 <fprintf@plt>
mov    0x2c9f(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    16c8 <Finv+0x548>
mov    $0x0,%al
call   1030 <BN_new@plt>
mov    %rax,-0x68(%rbp)
cmp    $0x0,%rax
jne    1396 <Finv+0x216>
mov    0x2c77(%rip),%rax
mov    (%rax),%edi
lea    0xc8e(%rip),%rsi
lea    0xc96(%rip),%rdx
mov    $0xd4,%ecx
call   1050 <fprintf@plt>
mov    0x2c56(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    16c8 <Finv+0x548>
mov    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    0x28(%rbp),%rcx
call   1090 <BN_mod@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x1,-0x38(%rbp)
je     13ec <Finv+0x26c>
mov    0x2c21(%rip),%rax
mov    (%rax),%edi
lea    0xc38(%rip),%rsi
lea    0xc40(%rip),%rdx
mov    $0xd5,%ecx
call   1050 <fprintf@plt>
mov    0x2c00(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    16c8 <Finv+0x548>
mov    -0x48(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    0x28(%rbp),%rcx
call   1090 <BN_mod@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x1,-0x38(%rbp)
je     1442 <Finv+0x2c2>
mov    0x2bcb(%rip),%rax
mov    (%rax),%edi
lea    0xbe2(%rip),%rsi
lea    0xbea(%rip),%rdx
mov    $0xd6,%ecx
call   1050 <fprintf@plt>
mov    0x2baa(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    16c8 <Finv+0x548>
mov    -0x50(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    0x28(%rbp),%r8
call   1060 <BN_mod_exp@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x1,-0x38(%rbp)
je     149c <Finv+0x31c>
mov    0x2b71(%rip),%rax
mov    (%rax),%edi
lea    0xb88(%rip),%rsi
lea    0xb90(%rip),%rdx
mov    $0xd8,%ecx
call   1050 <fprintf@plt>
mov    0x2b50(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    16c8 <Finv+0x548>
mov    -0x58(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    0x28(%rbp),%r8
call   1060 <BN_mod_exp@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x1,-0x38(%rbp)
je     14f6 <Finv+0x376>
mov    0x2b17(%rip),%rax
mov    (%rax),%edi
lea    0xb2e(%rip),%rsi
lea    0xb36(%rip),%rdx
mov    $0xd9,%ecx
call   1050 <fprintf@plt>
mov    0x2af6(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    16c8 <Finv+0x548>
mov    -0x60(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    -0x58(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    0x28(%rbp),%r8
call   1080 <BN_mod_mul@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x1,-0x38(%rbp)
je     1550 <Finv+0x3d0>
mov    0x2abd(%rip),%rax
mov    (%rax),%edi
lea    0xad4(%rip),%rsi
lea    0xadc(%rip),%rdx
mov    $0xda,%ecx
call   1050 <fprintf@plt>
mov    0x2a9c(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    16c8 <Finv+0x548>
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    0x28(%rbp),%r8
call   1060 <BN_mod_exp@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x1,-0x38(%rbp)
je     15aa <Finv+0x42a>
mov    0x2a63(%rip),%rax
mov    (%rax),%edi
lea    0xa7a(%rip),%rsi
lea    0xa82(%rip),%rdx
mov    $0xdc,%ecx
call   1050 <fprintf@plt>
mov    0x2a42(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    16c8 <Finv+0x548>
mov    -0x58(%rbp),%rdi
mov    0x10(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    0x28(%rbp),%r8
call   1060 <BN_mod_exp@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x1,-0x38(%rbp)
je     1604 <Finv+0x484>
mov    0x2a09(%rip),%rax
mov    (%rax),%edi
lea    0xa20(%rip),%rsi
lea    0xa28(%rip),%rdx
mov    $0xdd,%ecx
call   1050 <fprintf@plt>
mov    0x29e8(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    16c8 <Finv+0x548>
mov    -0x68(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    -0x58(%rbp),%rdx
mov    -0x28(%rbp),%rcx
mov    0x28(%rbp),%r8
call   1080 <BN_mod_mul@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x1,-0x38(%rbp)
je     165e <Finv+0x4de>
mov    0x29af(%rip),%rax
mov    (%rax),%edi
lea    0x9c6(%rip),%rsi
lea    0x9ce(%rip),%rdx
mov    $0xde,%ecx
call   1050 <fprintf@plt>
mov    0x298e(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    16c8 <Finv+0x548>
mov    -0x8(%rbp),%rdi
mov    -0x60(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x68(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    0x28(%rbp),%r9
call   10a0 <BN_crt@plt>
mov    %eax,-0x38(%rbp)
cmpl   $0x1,-0x38(%rbp)
je     16bc <Finv+0x53c>
mov    0x2951(%rip),%rax
mov    (%rax),%edi
lea    0x968(%rip),%rsi
lea    0x970(%rip),%rdx
mov    $0xe0,%ecx
call   1050 <fprintf@plt>
mov    0x2930(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
jmp    16c8 <Finv+0x548>
movl   $0x1,-0x34(%rbp)
jmp    16cf <Finv+0x54f>
movl   $0x0,-0x34(%rbp)
mov    -0x40(%rbp),%rdi
call   1040 <BN_free@plt>
mov    -0x48(%rbp),%rdi
call   1040 <BN_free@plt>
mov    -0x50(%rbp),%rdi
call   1040 <BN_free@plt>
mov    -0x58(%rbp),%rdi
call   1040 <BN_free@plt>
mov    -0x60(%rbp),%rdi
call   1040 <BN_free@plt>
mov    -0x68(%rbp),%rdi
call   1040 <BN_free@plt>
mov    -0x34(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Finv>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9,0x20(%rsp)
mov    %r8,%r14
mov    %rcx,%rbx
mov    %rdx,%r13
mov    %rsi,0x28(%rsp)
mov    %rdi,%rbp
xor    %r12d,%r12d
xor    %eax,%eax
call   1030 <BN_new@plt>
mov    %rax,%r15
test   %rax,%rax
je     13b3 <Finv+0x233>
mov    %rbp,0x30(%rsp)
xor    %eax,%eax
call   1030 <BN_new@plt>
test   %rax,%rax
je     13bd <Finv+0x23d>
mov    %rax,%r12
mov    %rbx,0x18(%rsp)
mov    %r14,0x10(%rsp)
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <BN_new@plt>
test   %rax,%rax
je     143c <Finv+0x2bc>
mov    %rax,%rbp
xor    %eax,%eax
call   1030 <BN_new@plt>
test   %rax,%rax
je     1446 <Finv+0x2c6>
mov    %rax,%rbx
xor    %eax,%eax
call   1030 <BN_new@plt>
mov    %rax,0x8(%rsp)
test   %rax,%rax
je     145e <Finv+0x2de>
xor    %eax,%eax
call   1030 <BN_new@plt>
test   %rax,%rax
je     1481 <Finv+0x301>
mov    %rax,(%rsp)
mov    0x88(%rsp),%r14
mov    %r15,%rdi
mov    %r13,%rsi
mov    0x18(%rsp),%rdx
mov    %r14,%rcx
call   1090 <BN_mod@plt>
mov    $0xd5,%ecx
cmp    $0x1,%eax
jne    1474 <Finv+0x2f4>
mov    %r12,%rdi
mov    %r13,%rsi
mov    0x10(%rsp),%rdx
mov    %r14,%rcx
call   1090 <BN_mod@plt>
mov    $0xd6,%ecx
cmp    $0x1,%eax
jne    1474 <Finv+0x2f4>
mov    0x78(%rsp),%rdx
mov    %r14,%r8
mov    %rbp,%r14
mov    %rbp,%rdi
mov    %r15,%rsi
mov    0x18(%rsp),%rbp
mov    %rbp,%rcx
call   1060 <BN_mod_exp@plt>
mov    $0xd8,%ecx
cmp    $0x1,%eax
mov    0x8(%rsp),%r13
jne    13d3 <Finv+0x253>
mov    %rbx,%rdi
mov    0x20(%rsp),%rsi
mov    0x28(%rsp),%rdx
mov    %rbp,%rcx
mov    0x88(%rsp),%r8
call   1060 <BN_mod_exp@plt>
mov    $0xd9,%ecx
cmp    $0x1,%eax
jne    13d3 <Finv+0x253>
mov    %r13,%rdi
mov    %r14,%rsi
mov    %r14,0x20(%rsp)
mov    %rbx,%rdx
mov    %rbp,%rcx
mov    0x88(%rsp),%r8
call   1080 <BN_mod_mul@plt>
mov    $0xda,%ecx
cmp    $0x1,%eax
jne    13d3 <Finv+0x253>
mov    0x80(%rsp),%rdx
mov    0x20(%rsp),%rdi
mov    %r12,%rsi
mov    0x10(%rsp),%rbp
mov    %rbp,%rcx
mov    0x88(%rsp),%r8
call   1060 <BN_mod_exp@plt>
mov    $0xdc,%ecx
cmp    $0x1,%eax
jne    13d3 <Finv+0x253>
mov    0x70(%rsp),%rsi
mov    %rbx,%rdi
mov    0x28(%rsp),%rdx
mov    %rbp,%rcx
mov    0x88(%rsp),%r8
call   1060 <BN_mod_exp@plt>
mov    $0xdd,%ecx
cmp    $0x1,%eax
jne    13d3 <Finv+0x253>
mov    %rbp,%rcx
mov    (%rsp),%rbp
mov    %rbp,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    0x88(%rsp),%r8
call   1080 <BN_mod_mul@plt>
mov    $0xde,%ecx
cmp    $0x1,%eax
jne    13d3 <Finv+0x253>
mov    0x30(%rsp),%rdi
mov    %r13,%rsi
mov    0x18(%rsp),%rdx
mov    %rbp,%rcx
mov    0x10(%rsp),%r8
mov    0x88(%rsp),%r9
call   10a0 <BN_crt@plt>
mov    $0xe0,%ecx
mov    $0x1,%ebp
cmp    $0x1,%eax
jne    13d3 <Finv+0x253>
jmp    13fa <Finv+0x27a>
mov    $0xcf,%ecx
xor    %r14d,%r14d
jmp    13c8 <Finv+0x248>
xor    %r14d,%r14d
mov    $0xd0,%ecx
xor    %r12d,%r12d
xor    %ebx,%ebx
xor    %r13d,%r13d
xor    %eax,%eax
mov    %rax,(%rsp)
mov    0x2c06(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xc1c(%rip),%rsi
lea    0xc24(%rip),%rdx
call   1050 <fprintf@plt>
mov    0x0(%rbp),%edi
call   1070 <fflush@plt>
xor    %ebp,%ebp
mov    %r15,%rdi
call   1040 <BN_free@plt>
mov    %r12,%rdi
call   1040 <BN_free@plt>
mov    %r14,%rdi
call   1040 <BN_free@plt>
mov    %rbx,%rdi
call   1040 <BN_free@plt>
mov    %r13,%rdi
call   1040 <BN_free@plt>
mov    (%rsp),%rdi
call   1040 <BN_free@plt>
mov    %ebp,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0xd1,%ecx
xor    %r14d,%r14d
jmp    13ca <Finv+0x24a>
mov    %rbp,%r14
mov    $0xd2,%ecx
xor    %ebx,%ebx
xor    %eax,%eax
mov    %rax,(%rsp)
xor    %r13d,%r13d
jmp    13d3 <Finv+0x253>
mov    %rbp,%r14
xor    %eax,%eax
mov    %rax,(%rsp)
mov    $0xd3,%ecx
xor    %r13d,%r13d
jmp    13d3 <Finv+0x253>
mov    %rbp,%r14
mov    0x8(%rsp),%r13
jmp    13d3 <Finv+0x253>
mov    %rbp,%r14
mov    $0xd4,%ecx
xor    %eax,%eax
mov    %rax,(%rsp)
mov    0x8(%rsp),%r13
jmp    13d3 <Finv+0x253>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [15 x i8] c"@@@ %s:%d @@@\0A\00"
@.str.1 = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/dstebila/daps/refs/heads/master/daps_h2_mr.c\00"
define i32 @Finv(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9) {
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i32*
%19 = alloca i32*
%20 = alloca i32*
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32*
%24 = alloca i32*
%25 = alloca i32*
%26 = alloca i32*
%27 = alloca i32*
%28 = alloca i32*
store i32* %0, i32** %11
store i32* %1, i32** %12
store i32* %2, i32** %13
store i32* %3, i32** %14
store i32* %4, i32** %15
store i32* %5, i32** %16
store i32* %6, i32** %17
store i32* %7, i32** %18
store i32* %8, i32** %19
store i32* %9, i32** %20
store i32* null, i32** %23
store i32* null, i32** %24
store i32* null, i32** %25
store i32* null, i32** %26
store i32* null, i32** %27
store i32* null, i32** %28
%29 = call i32* (...) @BN_new()
store i32* %29, i32** %23
%30 = icmp eq i32* %29, null
br i1 %30, label %31, label %36
31: ; preds = %10
%32 = load i32, i32* @stderr
%33 = call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 207)
%34 = load i32, i32* @stderr
%35 = call i32 @fflush(i32 %34)
br label %202
36: ; preds = %10
%37 = call i32* (...) @BN_new()
store i32* %37, i32** %24
%38 = icmp eq i32* %37, null
br i1 %38, label %39, label %44
39: ; preds = %36
%40 = load i32, i32* @stderr
%41 = call i32 @fprintf(i32 %40, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 208)
%42 = load i32, i32* @stderr
%43 = call i32 @fflush(i32 %42)
br label %202
44: ; preds = %36
%45 = call i32* (...) @BN_new()
store i32* %45, i32** %25
%46 = icmp eq i32* %45, null
br i1 %46, label %47, label %52
47: ; preds = %44
%48 = load i32, i32* @stderr
%49 = call i32 @fprintf(i32 %48, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 209)
%50 = load i32, i32* @stderr
%51 = call i32 @fflush(i32 %50)
br label %202
52: ; preds = %44
%53 = call i32* (...) @BN_new()
store i32* %53, i32** %26
%54 = icmp eq i32* %53, null
br i1 %54, label %55, label %60
55: ; preds = %52
%56 = load i32, i32* @stderr
%57 = call i32 @fprintf(i32 %56, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 210)
%58 = load i32, i32* @stderr
%59 = call i32 @fflush(i32 %58)
br label %202
60: ; preds = %52
%61 = call i32* (...) @BN_new()
store i32* %61, i32** %27
%62 = icmp eq i32* %61, null
br i1 %62, label %63, label %68
63: ; preds = %60
%64 = load i32, i32* @stderr
%65 = call i32 @fprintf(i32 %64, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 211)
%66 = load i32, i32* @stderr
%67 = call i32 @fflush(i32 %66)
br label %202
68: ; preds = %60
%69 = call i32* (...) @BN_new()
store i32* %69, i32** %28
%70 = icmp eq i32* %69, null
br i1 %70, label %71, label %76
71: ; preds = %68
%72 = load i32, i32* @stderr
%73 = call i32 @fprintf(i32 %72, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 212)
%74 = load i32, i32* @stderr
%75 = call i32 @fflush(i32 %74)
br label %202
76: ; preds = %68
%77 = load i32*, i32** %23
%78 = load i32*, i32** %13
%79 = load i32*, i32** %14
%80 = load i32*, i32** %20
%81 = call i32 @BN_mod(i32* %77, i32* %78, i32* %79, i32* %80)
store i32 %81, i32* %22
%82 = load i32, i32* %22
%83 = icmp ne i32 %82, 1
br i1 %83, label %84, label %89
84: ; preds = %76
%85 = load i32, i32* @stderr
%86 = call i32 @fprintf(i32 %85, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 213)
%87 = load i32, i32* @stderr
%88 = call i32 @fflush(i32 %87)
br label %202
89: ; preds = %76
%90 = load i32*, i32** %24
%91 = load i32*, i32** %13
%92 = load i32*, i32** %15
%93 = load i32*, i32** %20
%94 = call i32 @BN_mod(i32* %90, i32* %91, i32* %92, i32* %93)
store i32 %94, i32* %22
%95 = load i32, i32* %22
%96 = icmp ne i32 %95, 1
br i1 %96, label %97, label %102
97: ; preds = %89
%98 = load i32, i32* @stderr
%99 = call i32 @fprintf(i32 %98, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 214)
%100 = load i32, i32* @stderr
%101 = call i32 @fflush(i32 %100)
br label %202
102: ; preds = %89
%103 = load i32*, i32** %25
%104 = load i32*, i32** %23
%105 = load i32*, i32** %18
%106 = load i32*, i32** %14
%107 = load i32*, i32** %20
%108 = call i32 @BN_mod_exp(i32* %103, i32* %104, i32* %105, i32* %106, i32* %107)
store i32 %108, i32* %22
%109 = load i32, i32* %22
%110 = icmp ne i32 %109, 1
br i1 %110, label %111, label %116
111: ; preds = %102
%112 = load i32, i32* @stderr
%113 = call i32 @fprintf(i32 %112, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 216)
%114 = load i32, i32* @stderr
%115 = call i32 @fflush(i32 %114)
br label %202
116: ; preds = %102
%117 = load i32*, i32** %26
%118 = load i32*, i32** %16
%119 = load i32*, i32** %12
%120 = load i32*, i32** %14
%121 = load i32*, i32** %20
%122 = call i32 @BN_mod_exp(i32* %117, i32* %118, i32* %119, i32* %120, i32* %121)
store i32 %122, i32* %22
%123 = load i32, i32* %22
%124 = icmp ne i32 %123, 1
br i1 %124, label %125, label %130
125: ; preds = %116
%126 = load i32, i32* @stderr
%127 = call i32 @fprintf(i32 %126, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 217)
%128 = load i32, i32* @stderr
%129 = call i32 @fflush(i32 %128)
br label %202
130: ; preds = %116
%131 = load i32*, i32** %27
%132 = load i32*, i32** %25
%133 = load i32*, i32** %26
%134 = load i32*, i32** %14
%135 = load i32*, i32** %20
%136 = call i32 @BN_mod_mul(i32* %131, i32* %132, i32* %133, i32* %134, i32* %135)
store i32 %136, i32* %22
%137 = load i32, i32* %22
%138 = icmp ne i32 %137, 1
br i1 %138, label %139, label %144
139: ; preds = %130
%140 = load i32, i32* @stderr
%141 = call i32 @fprintf(i32 %140, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 218)
%142 = load i32, i32* @stderr
%143 = call i32 @fflush(i32 %142)
br label %202
144: ; preds = %130
%145 = load i32*, i32** %25
%146 = load i32*, i32** %24
%147 = load i32*, i32** %19
%148 = load i32*, i32** %15
%149 = load i32*, i32** %20
%150 = call i32 @BN_mod_exp(i32* %145, i32* %146, i32* %147, i32* %148, i32* %149)
store i32 %150, i32* %22
%151 = load i32, i32* %22
%152 = icmp ne i32 %151, 1
br i1 %152, label %153, label %158
153: ; preds = %144
%154 = load i32, i32* @stderr
%155 = call i32 @fprintf(i32 %154, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 220)
%156 = load i32, i32* @stderr
%157 = call i32 @fflush(i32 %156)
br label %202
158: ; preds = %144
%159 = load i32*, i32** %26
%160 = load i32*, i32** %17
%161 = load i32*, i32** %12
%162 = load i32*, i32** %15
%163 = load i32*, i32** %20
%164 = call i32 @BN_mod_exp(i32* %159, i32* %160, i32* %161, i32* %162, i32* %163)
store i32 %164, i32* %22
%165 = load i32, i32* %22
%166 = icmp ne i32 %165, 1
br i1 %166, label %167, label %172
167: ; preds = %158
%168 = load i32, i32* @stderr
%169 = call i32 @fprintf(i32 %168, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 221)
%170 = load i32, i32* @stderr
%171 = call i32 @fflush(i32 %170)
br label %202
172: ; preds = %158
%173 = load i32*, i32** %28
%174 = load i32*, i32** %25
%175 = load i32*, i32** %26
%176 = load i32*, i32** %15
%177 = load i32*, i32** %20
%178 = call i32 @BN_mod_mul(i32* %173, i32* %174, i32* %175, i32* %176, i32* %177)
store i32 %178, i32* %22
%179 = load i32, i32* %22
%180 = icmp ne i32 %179, 1
br i1 %180, label %181, label %186
181: ; preds = %172
%182 = load i32, i32* @stderr
%183 = call i32 @fprintf(i32 %182, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 222)
%184 = load i32, i32* @stderr
%185 = call i32 @fflush(i32 %184)
br label %202
186: ; preds = %172
%187 = load i32*, i32** %11
%188 = load i32*, i32** %27
%189 = load i32*, i32** %14
%190 = load i32*, i32** %28
%191 = load i32*, i32** %15
%192 = load i32*, i32** %20
%193 = call i32 @BN_crt(i32* %187, i32* %188, i32* %189, i32* %190, i32* %191, i32* %192)
store i32 %193, i32* %22
%194 = load i32, i32* %22
%195 = icmp ne i32 %194, 1
br i1 %195, label %196, label %201
196: ; preds = %186
%197 = load i32, i32* @stderr
%198 = call i32 @fprintf(i32 %197, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 224)
%199 = load i32, i32* @stderr
%200 = call i32 @fflush(i32 %199)
br label %202
201: ; preds = %186
store i32 1, i32* %21
br label %203
202: ; preds = %196, %181, %167, %153, %139, %125, %111, %97, %84, %71, %63, %55, %47, %39, %31
store i32 0, i32* %21
br label %203
203: ; preds = %202, %201
%204 = load i32*, i32** %23
%205 = call i32 @BN_free(i32* %204)
%206 = load i32*, i32** %24
%207 = call i32 @BN_free(i32* %206)
%208 = load i32*, i32** %25
%209 = call i32 @BN_free(i32* %208)
%210 = load i32*, i32** %26
%211 = call i32 @BN_free(i32* %210)
%212 = load i32*, i32** %27
%213 = call i32 @BN_free(i32* %212)
%214 = load i32*, i32** %28
%215 = call i32 @BN_free(i32* %214)
%216 = load i32, i32* %21
ret i32 %216
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [15 x i8] c"@@@ %s:%d @@@\0A\00"
@.str.1 = [135 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/dstebila/daps/refs/heads/master/daps_h2_mr.c\00"
define i32 @Finv(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6, i32* %7, i32* %8, i32* %9) {
%11 = tail call i32* (...) @BN_new()
%12 = icmp eq i32* %11, null
br i1 %12, label %55, label %13
13: ; preds = %10
%14 = tail call i32* (...) @BN_new()
%15 = icmp eq i32* %14, null
br i1 %15, label %55, label %16
16: ; preds = %13
%17 = tail call i32* (...) @BN_new()
%18 = icmp eq i32* %17, null
br i1 %18, label %55, label %19
19: ; preds = %16
%20 = tail call i32* (...) @BN_new()
%21 = icmp eq i32* %20, null
br i1 %21, label %55, label %22
22: ; preds = %19
%23 = tail call i32* (...) @BN_new()
%24 = icmp eq i32* %23, null
br i1 %24, label %55, label %25
25: ; preds = %22
%26 = tail call i32* (...) @BN_new()
%27 = icmp eq i32* %26, null
br i1 %27, label %55, label %28
28: ; preds = %25
%29 = tail call i32 @BN_mod(i32* %11, i32* %2, i32* %3, i32* %9)
%30 = icmp eq i32 %29, 1
br i1 %30, label %31, label %55
31: ; preds = %28
%32 = tail call i32 @BN_mod(i32* %14, i32* %2, i32* %4, i32* %9)
%33 = icmp eq i32 %32, 1
br i1 %33, label %34, label %55
34: ; preds = %31
%35 = tail call i32 @BN_mod_exp(i32* %17, i32* %11, i32* %7, i32* %3, i32* %9)
%36 = icmp eq i32 %35, 1
br i1 %36, label %37, label %55
37: ; preds = %34
%38 = tail call i32 @BN_mod_exp(i32* %20, i32* %5, i32* %1, i32* %3, i32* %9)
%39 = icmp eq i32 %38, 1
br i1 %39, label %40, label %55
40: ; preds = %37
%41 = tail call i32 @BN_mod_mul(i32* %23, i32* %17, i32* %20, i32* %3, i32* %9)
%42 = icmp eq i32 %41, 1
br i1 %42, label %43, label %55
43: ; preds = %40
%44 = tail call i32 @BN_mod_exp(i32* %17, i32* %14, i32* %8, i32* %4, i32* %9)
%45 = icmp eq i32 %44, 1
br i1 %45, label %46, label %55
46: ; preds = %43
%47 = tail call i32 @BN_mod_exp(i32* %20, i32* %6, i32* %1, i32* %4, i32* %9)
%48 = icmp eq i32 %47, 1
br i1 %48, label %49, label %55
49: ; preds = %46
%50 = tail call i32 @BN_mod_mul(i32* %26, i32* %17, i32* %20, i32* %4, i32* %9)
%51 = icmp eq i32 %50, 1
br i1 %51, label %52, label %55
52: ; preds = %49
%53 = tail call i32 @BN_crt(i32* %0, i32* %23, i32* %3, i32* %26, i32* %4, i32* %9)
%54 = icmp eq i32 %53, 1
br i1 %54, label %66, label %55
55: ; preds = %52, %49, %46, %43, %40, %37, %34, %31, %28, %25, %22, %19, %16, %13, %10
%56 = phi i32 [ 207, %10 ], [ 208, %13 ], [ 209, %16 ], [ 210, %19 ], [ 211, %22 ], [ 212, %25 ], [ 213, %28 ], [ 214, %31 ], [ 216, %34 ], [ 217, %37 ], [ 218, %40 ], [ 220, %43 ], [ 221, %46 ], [ 222, %49 ], [ 224, %52 ]
%57 = phi i32* [ null, %10 ], [ null, %13 ], [ %14, %16 ], [ %14, %19 ], [ %14, %22 ], [ %14, %25 ], [ %14, %28 ], [ %14, %31 ], [ %14, %34 ], [ %14, %37 ], [ %14, %40 ], [ %14, %43 ], [ %14, %46 ], [ %14, %49 ], [ %14, %52 ]
%58 = phi i32* [ null, %10 ], [ null, %13 ], [ null, %16 ], [ %17, %19 ], [ %17, %22 ], [ %17, %25 ], [ %17, %28 ], [ %17, %31 ], [ %17, %34 ], [ %17, %37 ], [ %17, %40 ], [ %17, %43 ], [ %17, %46 ], [ %17, %49 ], [ %17, %52 ]
%59 = phi i32* [ null, %10 ], [ null, %13 ], [ null, %16 ], [ null, %19 ], [ %20, %22 ], [ %20, %25 ], [ %20, %28 ], [ %20, %31 ], [ %20, %34 ], [ %20, %37 ], [ %20, %40 ], [ %20, %43 ], [ %20, %46 ], [ %20, %49 ], [ %20, %52 ]
%60 = phi i32* [ null, %10 ], [ null, %13 ], [ null, %16 ], [ null, %19 ], [ null, %22 ], [ %23, %25 ], [ %23, %28 ], [ %23, %31 ], [ %23, %34 ], [ %23, %37 ], [ %23, %40 ], [ %23, %43 ], [ %23, %46 ], [ %23, %49 ], [ %23, %52 ]
%61 = phi i32* [ null, %10 ], [ null, %13 ], [ null, %16 ], [ null, %19 ], [ null, %22 ], [ null, %25 ], [ %26, %28 ], [ %26, %31 ], [ %26, %34 ], [ %26, %37 ], [ %26, %40 ], [ %26, %43 ], [ %26, %46 ], [ %26, %49 ], [ %26, %52 ]
%62 = load i32, i32* @stderr
%63 = tail call i32 @fprintf(i32 %62, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([135 x i8], [135 x i8]* @.str.1, i64 0, i64 0), i32 %56)
%64 = load i32, i32* @stderr
%65 = tail call i32 @fflush(i32 %64)
br label %66
66: ; preds = %55, %52
%67 = phi i32 [ 1, %52 ], [ 0, %55 ]
%68 = phi i32* [ %14, %52 ], [ %57, %55 ]
%69 = phi i32* [ %17, %52 ], [ %58, %55 ]
%70 = phi i32* [ %20, %52 ], [ %59, %55 ]
%71 = phi i32* [ %23, %52 ], [ %60, %55 ]
%72 = phi i32* [ %26, %52 ], [ %61, %55 ]
%73 = tail call i32 @BN_free(i32* %11)
%74 = tail call i32 @BN_free(i32* %68)
%75 = tail call i32 @BN_free(i32* %69)
%76 = tail call i32 @BN_free(i32* %70)
%77 = tail call i32 @BN_free(i32* %71)
%78 = tail call i32 @BN_free(i32* %72)
ret i32 %67
}