#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ BN_CTX;
typedef int /*<<< orphan*/ BIGNUM;

/* Variables and functions */
int /*<<< orphan*/ BN_free(int /*<<< orphan*/ *);
int BN_kronecker(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                 int /*<<< orphan*/ *);
int /*<<< orphan*/ BN_mod_mul(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ const *,
                              int /*<<< orphan*/ const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ BN_mod_sqr(int /*<<< orphan*/ *, int /*<<< orphan*/ *const,
                              int /*<<< orphan*/ const *, int /*<<< orphan*/ *);
int /*<<< orphan*/ BN_mod_sub(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                              int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                              int /*<<< orphan*/ *);
int /*<<< orphan*/ *BN_new();
int gt(const BIGNUM *a, BIGNUM *const *f, const BIGNUM *N, BN_CTX *ctx) {
  BIGNUM *t1 = BN_new();
  BIGNUM *t2 = BN_new();
  BIGNUM *t3 = BN_new();
  BIGNUM *t4 = BN_new();
  int gt_v;
  BN_mod_sqr(t1, f[0], N, ctx);
  BN_mod_sqr(t2, f[1], N, ctx);
  BN_mod_mul(t3, t2, a, N, ctx);
  BN_mod_sub(t4, t1, t3, N, ctx);
  gt_v = BN_kronecker(t4, N, ctx);
  BN_free(t1);
  BN_free(t2);
  BN_free(t3);
  BN_free(t4);
  return gt_v;
}


x86 assembly (clang, -O0):
<gt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    $0x0,%al
call   1040 <BN_new@plt>
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1040 <BN_new@plt>
mov    %rax,-0x30(%rbp)
mov    $0x0,%al
call   1040 <BN_new@plt>
mov    %rax,-0x38(%rbp)
mov    $0x0,%al
call   1040 <BN_new@plt>
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1080 <BN_mod_sqr@plt>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1080 <BN_mod_sqr@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x8(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1070 <BN_mod_mul@plt>
mov    -0x40(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x38(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
call   1050 <BN_mod_sub@plt>
mov    -0x40(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <BN_kronecker@plt>
mov    %eax,-0x44(%rbp)
mov    -0x28(%rbp),%rdi
call   1060 <BN_free@plt>
mov    -0x30(%rbp),%rdi
call   1060 <BN_free@plt>
mov    -0x38(%rbp),%rdi
call   1060 <BN_free@plt>
mov    -0x40(%rbp),%rdi
call   1060 <BN_free@plt>
mov    -0x44(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%r14
mov    %rdx,%r13
mov    %rsi,%r15
mov    %rdi,0x10(%rsp)
xor    %eax,%eax
call   1040 <BN_new@plt>
mov    %rax,%r12
xor    %eax,%eax
call   1040 <BN_new@plt>
mov    %rax,%rbp
xor    %eax,%eax
call   1040 <BN_new@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1040 <BN_new@plt>
mov    %rax,(%rsp)
mov    (%r15),%rsi
mov    %r12,%rdi
mov    %r13,%rdx
mov    %r14,%rcx
call   1080 <BN_mod_sqr@plt>
mov    0x8(%r15),%rsi
mov    %rbp,0x8(%rsp)
mov    %rbp,%rdi
mov    %r13,%rdx
mov    %r14,%rcx
call   1080 <BN_mod_sqr@plt>
mov    %rbx,%r15
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    0x10(%rsp),%rdx
mov    %r13,%rcx
mov    %r14,%r8
call   1070 <BN_mod_mul@plt>
mov    (%rsp),%rbp
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %r13,%rcx
mov    %r14,%r8
call   1050 <BN_mod_sub@plt>
mov    %rbp,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
call   1030 <BN_kronecker@plt>
mov    %eax,%ebx
mov    %r12,%rdi
call   1060 <BN_free@plt>
mov    0x8(%rsp),%rdi
call   1060 <BN_free@plt>
mov    %r15,%rdi
call   1060 <BN_free@plt>
mov    %rbp,%rdi
call   1060 <BN_free@plt>
mov    %ebx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @gt(i32* %0, i32** %1, i32* %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i32**
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32
store i32* %0, i32** %5
store i32** %1, i32*** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%14 = call i32* (...) @BN_new()
store i32* %14, i32** %9
%15 = call i32* (...) @BN_new()
store i32* %15, i32** %10
%16 = call i32* (...) @BN_new()
store i32* %16, i32** %11
%17 = call i32* (...) @BN_new()
store i32* %17, i32** %12
%18 = load i32*, i32** %9
%19 = load i32**, i32*** %6
%20 = getelementptr inbounds i32*, i32** %19, i64 0
%21 = load i32*, i32** %20
%22 = load i32*, i32** %7
%23 = load i32*, i32** %8
%24 = call i32 @BN_mod_sqr(i32* %18, i32* %21, i32* %22, i32* %23)
%25 = load i32*, i32** %10
%26 = load i32**, i32*** %6
%27 = getelementptr inbounds i32*, i32** %26, i64 1
%28 = load i32*, i32** %27
%29 = load i32*, i32** %7
%30 = load i32*, i32** %8
%31 = call i32 @BN_mod_sqr(i32* %25, i32* %28, i32* %29, i32* %30)
%32 = load i32*, i32** %11
%33 = load i32*, i32** %10
%34 = load i32*, i32** %5
%35 = load i32*, i32** %7
%36 = load i32*, i32** %8
%37 = call i32 @BN_mod_mul(i32* %32, i32* %33, i32* %34, i32* %35, i32* %36)
%38 = load i32*, i32** %12
%39 = load i32*, i32** %9
%40 = load i32*, i32** %11
%41 = load i32*, i32** %7
%42 = load i32*, i32** %8
%43 = call i32 @BN_mod_sub(i32* %38, i32* %39, i32* %40, i32* %41, i32* %42)
%44 = load i32*, i32** %12
%45 = load i32*, i32** %7
%46 = load i32*, i32** %8
%47 = call i32 @BN_kronecker(i32* %44, i32* %45, i32* %46)
store i32 %47, i32* %13
%48 = load i32*, i32** %9
%49 = call i32 @BN_free(i32* %48)
%50 = load i32*, i32** %10
%51 = call i32 @BN_free(i32* %50)
%52 = load i32*, i32** %11
%53 = call i32 @BN_free(i32* %52)
%54 = load i32*, i32** %12
%55 = call i32 @BN_free(i32* %54)
%56 = load i32, i32* %13
ret i32 %56
}

LLVM IR (-O2):
define i32 @gt(i32* %0, i32** nocapture %1, i32* %2, i32* %3) {
%5 = tail call i32* (...) @BN_new()
%6 = tail call i32* (...) @BN_new()
%7 = tail call i32* (...) @BN_new()
%8 = tail call i32* (...) @BN_new()
%9 = load i32*, i32** %1
%10 = tail call i32 @BN_mod_sqr(i32* %5, i32* %9, i32* %2, i32* %3)
%11 = getelementptr inbounds i32*, i32** %1, i64 1
%12 = load i32*, i32** %11
%13 = tail call i32 @BN_mod_sqr(i32* %6, i32* %12, i32* %2, i32* %3)
%14 = tail call i32 @BN_mod_mul(i32* %7, i32* %6, i32* %0, i32* %2, i32* %3)
%15 = tail call i32 @BN_mod_sub(i32* %8, i32* %5, i32* %7, i32* %2, i32* %3)
%16 = tail call i32 @BN_kronecker(i32* %8, i32* %2, i32* %3)
%17 = tail call i32 @BN_free(i32* %5)
%18 = tail call i32 @BN_free(i32* %6)
%19 = tail call i32 @BN_free(i32* %7)
%20 = tail call i32 @BN_free(i32* %8)
ret i32 %16
}