#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 /*<<< orphan*/ kiasu_aead_encrypt(unsigned char const *, unsigned long long,
                                      unsigned char const *, unsigned long long,
                                      unsigned char const *,
                                      unsigned char const *, unsigned char *,
                                      size_t *);
int crypto_aead_encrypt(unsigned char *c, unsigned long long *clen,
                        const unsigned char *m, unsigned long long mlen,
                        const unsigned char *ad, unsigned long long adlen,
                        const unsigned char *nsec, const unsigned char *npub,
                        const unsigned char *k) {
  size_t outlen = 0;
  kiasu_aead_encrypt(ad, adlen, m, mlen, k, npub, c, &outlen);
  *clen = outlen;
  (void)nsec;
  return 0;
}


x86 assembly (clang, -O0):
<crypto_aead_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%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)
movq   $0x0,-0x38(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    0x20(%rbp),%r8
mov    0x18(%rbp),%r9
mov    -0x8(%rbp),%r10
lea    -0x38(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <kiasu_aead_encrypt@plt>
mov    -0x38(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crypto_aead_encrypt>:
push   %r14
push   %rbx
push   %rax
mov    %r9,%rax
mov    %r8,%rbx
mov    %rsi,%r14
mov    %rdi,%r10
mov    0x30(%rsp),%r8
mov    0x28(%rsp),%r9
movq   $0x0,(%rsp)
mov    %rsp,%r11
mov    %rbx,%rdi
mov    %rax,%rsi
push   %r11
push   %r10
call   1030 <kiasu_aead_encrypt@plt>
add    $0x10,%rsp
mov    (%rsp),%rax
mov    %rax,(%r14)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @crypto_aead_encrypt(i8* %0, i64* %1, i8* %2, i64 %3, i8* %4, i64 %5, i8* %6, i8* %7, i8* %8) {
%10 = alloca i8*
%11 = alloca i64*
%12 = alloca i8*
%13 = alloca i64
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i64
store i8* %0, i8** %10
store i64* %1, i64** %11
store i8* %2, i8** %12
store i64 %3, i64* %13
store i8* %4, i8** %14
store i64 %5, i64* %15
store i8* %6, i8** %16
store i8* %7, i8** %17
store i8* %8, i8** %18
store i64 0, i64* %19
%20 = load i8*, i8** %14
%21 = load i64, i64* %15
%22 = load i8*, i8** %12
%23 = load i64, i64* %13
%24 = load i8*, i8** %18
%25 = load i8*, i8** %17
%26 = load i8*, i8** %10
%27 = call i32 @kiasu_aead_encrypt(i8* %20, i64 %21, i8* %22, i64 %23, i8* %24, i8* %25, i8* %26, i64* %19)
%28 = load i64, i64* %19
%29 = load i64*, i64** %11
store i64 %28, i64* %29
%30 = load i8*, i8** %16
ret i32 0
}

LLVM IR (-O2):
define i32 @crypto_aead_encrypt(i8* %0, i64* nocapture writeonly %1, i8* %2, i64 %3, i8* %4, i64 %5, i8* nocapture readnone %6, i8* %7, i8* %8) {
%10 = alloca i64
%11 = bitcast i64* %10 to i8*
store i64 0, i64* %10
%12 = call i32 @kiasu_aead_encrypt(i8* %4, i64 %5, i8* %2, i64 %3, i8* %8, i8* %7, i8* %0, i64* %10)
%13 = load i64, i64* %10
store i64 %13, i64* %1
ret i32 0
}