#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 */

/* Variables and functions */
int jhae_decryption_verification(unsigned char *, unsigned long long *,
                                 unsigned char const *, unsigned char const *,
                                 unsigned char const *, unsigned long long,
                                 unsigned char const *, unsigned long long,
                                 unsigned char const *);
int crypto_aead_decrypt(unsigned char *m, unsigned long long *mlen,
                        unsigned char *nsec, const unsigned char *c,
                        unsigned long long clen, const unsigned char *ad,
                        unsigned long long adlen, const unsigned char *npub,
                        const unsigned char *k) {
  int ret;
  const unsigned char *tag = c + clen - 32;
  unsigned long long myclen = clen - 32;
  ret =
      jhae_decryption_verification(m, mlen, k, npub, c, myclen, ad, adlen, tag);
  return ret;
}


x86 assembly (clang, -O0):
<crypto_aead_decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
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)
mov    -0x20(%rbp),%rax
add    -0x28(%rbp),%rax
add    $0xffffffffffffffe0,%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
sub    $0x20,%rax
mov    %rax,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x20(%rbp),%rdx
mov    0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
mov    -0x48(%rbp),%r9
mov    -0x30(%rbp),%r11
mov    0x10(%rbp),%r10
mov    -0x40(%rbp),%rax
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <jhae_decryption_verification@plt>
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_aead_decrypt>:
push   %rax
mov    %r9,%r10
mov    %rcx,%rax
mov    0x20(%rsp),%rdx
mov    0x18(%rsp),%rcx
lea    (%rax,%r8,1),%r11
add    $0xffffffffffffffe0,%r11
lea    -0x20(%r8),%r9
sub    $0x8,%rsp
mov    %rax,%r8
push   %r11
push   0x20(%rsp)
push   %r10
call   1030 <jhae_decryption_verification@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
define i32 @crypto_aead_decrypt(i8* %0, i64* %1, i8* %2, i8* %3, i64 %4, i8* %5, i64 %6, i8* %7, i8* %8) {
%10 = alloca i8*
%11 = alloca i64*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i64
%15 = alloca i8*
%16 = alloca i64
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i32
%20 = alloca i8*
%21 = alloca i64
store i8* %0, i8** %10
store i64* %1, i64** %11
store i8* %2, i8** %12
store i8* %3, i8** %13
store i64 %4, i64* %14
store i8* %5, i8** %15
store i64 %6, i64* %16
store i8* %7, i8** %17
store i8* %8, i8** %18
%22 = load i8*, i8** %13
%23 = load i64, i64* %14
%24 = getelementptr inbounds i8, i8* %22, i64 %23
%25 = getelementptr inbounds i8, i8* %24, i64 -32
store i8* %25, i8** %20
%26 = load i64, i64* %14
%27 = sub i64 %26, 32
store i64 %27, i64* %21
%28 = load i8*, i8** %10
%29 = load i64*, i64** %11
%30 = load i8*, i8** %18
%31 = load i8*, i8** %17
%32 = load i8*, i8** %13
%33 = load i64, i64* %21
%34 = load i8*, i8** %15
%35 = load i64, i64* %16
%36 = load i8*, i8** %20
%37 = call i32 @jhae_decryption_verification(i8* %28, i64* %29, i8* %30, i8* %31, i8* %32, i64 %33, i8* %34, i64 %35, i8* %36)
store i32 %37, i32* %19
%38 = load i32, i32* %19
ret i32 %38
}

LLVM IR (-O2):
define i32 @crypto_aead_decrypt(i8* %0, i64* %1, i8* nocapture readnone %2, i8* %3, i64 %4, i8* %5, i64 %6, i8* %7, i8* %8) {
%10 = getelementptr inbounds i8, i8* %3, i64 %4
%11 = getelementptr inbounds i8, i8* %10, i64 -32
%12 = add i64 %4, -32
%13 = tail call i32 @jhae_decryption_verification(i8* %0, i64* %1, i8* %8, i8* %7, i8* %3, i64 %12, i8* %5, i64 %6, i8* %11)
ret i32 %13
}