#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 */
struct goldilocks_public_key_t {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ abort();
int goldilocks_verify(unsigned char const *, unsigned char const *,
                      unsigned long long,
                      struct goldilocks_public_key_t const *);
int verification(const unsigned char *m, unsigned long long mlen,
                 const unsigned char *sm, unsigned long long smlen,
                 const unsigned char pk[(448 / 8)], unsigned long long pklen) {
  if (pklen != (448 / 8))
    abort();
  int ret = goldilocks_verify(sm, m, mlen,
                              (const struct goldilocks_public_key_t *)pk);
  return ret ? -1 : 0;
}


x86 assembly (clang, -O0):
<verification>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpq   $0x38,-0x30(%rbp)
je     1152 <verification+0x32>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x28(%rbp),%rcx
call   1040 <goldilocks_verify@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verification>:
push   %rax
cmp    $0x38,%r9
jne    1141 <verification+0x21>
mov    %rsi,%rax
mov    %rdi,%rsi
mov    %rdx,%rdi
mov    %rax,%rdx
mov    %r8,%rcx
call   1040 <goldilocks_verify@plt>
neg    %eax
sbb    %eax,%eax
pop    %rcx
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
%struct.goldilocks_public_key_t = type { i32 }
define i32 @verification(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4, i64 %5) {
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i8*
%12 = alloca i64
%13 = alloca i32
store i8* %0, i8** %7
store i64 %1, i64* %8
store i8* %2, i8** %9
store i64 %3, i64* %10
store i8* %4, i8** %11
store i64 %5, i64* %12
%14 = load i64, i64* %12
%15 = icmp ne i64 %14, 56
br i1 %15, label %16, label %18
16: ; preds = %6
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %6
%19 = load i8*, i8** %9
%20 = load i8*, i8** %7
%21 = load i64, i64* %8
%22 = load i8*, i8** %11
%23 = bitcast i8* %22 to %struct.goldilocks_public_key_t*
%24 = call i32 @goldilocks_verify(i8* %19, i8* %20, i64 %21, %struct.goldilocks_public_key_t* %23)
store i32 %24, i32* %13
%25 = load i32, i32* %13
%26 = icmp ne i32 %25, 0
%27 = zext i1 %26 to i64
%28 = select i1 %26, i32 -1, i32 0
ret i32 %28
}

LLVM IR (-O2):
%struct.goldilocks_public_key_t = type { i32 }
define i32 @verification(i8* %0, i64 %1, i8* %2, i64 %3, i8* %4, i64 %5) {
%7 = icmp eq i64 %5, 56
br i1 %7, label %10, label %8
8: ; preds = %6
%9 = tail call i32 (...) @abort()
unreachable
10: ; preds = %6
%11 = bitcast i8* %4 to %struct.goldilocks_public_key_t*
%12 = tail call i32 @goldilocks_verify(i8* %2, i8* %0, i64 %1, %struct.goldilocks_public_key_t* %11)
%13 = icmp ne i32 %12, 0
%14 = sext i1 %13 to i32
ret i32 %14
}