#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*/ ocb_crypt(unsigned char *, unsigned char *, unsigned char *,
                             unsigned char *, unsigned long long,
                             unsigned char *, unsigned long long, int);
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) {
  *clen = mlen + 16;
  ocb_crypt(c, (unsigned char *)k, (unsigned char *)npub, (unsigned char *)ad,
            adlen, (unsigned char *)m, mlen, 1);
  return 0;
}


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

x86 assembly (clang, -O2):
<crypto_aead_encrypt>:
push   %rax
mov    %rcx,%rax
mov    %rdx,%r10
mov    0x20(%rsp),%r11
mov    0x18(%rsp),%rdx
add    $0x10,%rcx
mov    %rcx,(%rsi)
mov    %r11,%rsi
mov    %r8,%rcx
mov    %r9,%r8
mov    %r10,%r9
push   $0x1
push   %rax
call   1030 <ocb_crypt@plt>
add    $0x10,%rsp
xor    %eax,%eax
pop    %rcx
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*
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
%19 = load i64, i64* %13
%20 = add i64 %19, 16
%21 = load i64*, i64** %11
store i64 %20, i64* %21
%22 = load i8*, i8** %10
%23 = load i8*, i8** %18
%24 = load i8*, i8** %17
%25 = load i8*, i8** %14
%26 = load i64, i64* %15
%27 = load i8*, i8** %12
%28 = load i64, i64* %13
%29 = call i32 @ocb_crypt(i8* %22, i8* %23, i8* %24, i8* %25, i64 %26, i8* %27, i64 %28, i32 1)
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 = add i64 %3, 16
store i64 %10, i64* %1
%11 = tail call i32 @ocb_crypt(i8* %0, i8* %8, i8* %7, i8* %4, i64 %5, i8* %2, i64 %3, i32 1)
ret i32 0
}