#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 test_crypto_aead(unsigned char const *, int, unsigned char const *, int,
                     unsigned char const *, int, unsigned char const *, int,
                     unsigned char const *, int);
int main() {
  const unsigned char *key =
      (const unsigned char *)"\x14\x5e\xa8\xf2\x3d\x87\xd1\x1c\x66\xb0\xfa\x45";
  const unsigned char *nonce =
      (const unsigned char *)"\x15\x70\xcb\x27\x82\xdd\x39\x94\xef\x4b";
  const unsigned char *AD = (const unsigned char *)"\x0c\x78\xe4\x51\xbd\x2a";
  const unsigned char *plaintext =
      (const unsigned char *)"\x0e\x8b\x09\x86\x04\x81\xfe";
  const unsigned char *ciphertext =
      (const unsigned char *)"\xab\x1b\xb0\x94\xf7\x80\x63\xc8\x90\xfc\x8e\xd2"
                             "\x55\xb2\x4c\x24\xb3\xac\x7e";
  return test_crypto_aead(key, 12, nonce, 10, AD, 6, plaintext, 7, ciphertext,
                          12);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xedc(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xedc(%rip),%rax
mov    %rax,-0x20(%rbp)
lea    0xed8(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xed5(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r10
mov    -0x30(%rbp),%rax
mov    $0xc,%esi
mov    $0xa,%ecx
mov    $0x6,%r9d
mov    %r10,(%rsp)
movl   $0x7,0x8(%rsp)
mov    %rax,0x10(%rsp)
movl   $0xc,0x18(%rsp)
call   1030 <test_crypto_aead@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf0f(%rip),%rax
lea    0xf00(%rip),%r10
lea    0xeda(%rip),%rdi
lea    0xee0(%rip),%rdx
lea    0xee4(%rip),%r8
mov    $0xc,%esi
mov    $0xa,%ecx
mov    $0x6,%r9d
push   $0xc
push   %rax
push   $0x7
push   %r10
call   1030 <test_crypto_aead@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"\14^\A8\F2=\87\D1\1Cf\B0\FAE\00"
@.str.1 = [11 x i8] c"\15p\CB'\82\DD9\94\EFK\00"
@.str.2 = [7 x i8] c"\0Cx\E4Q\BD*\00"
@.str.3 = [8 x i8] c"\0E\8B\09\86\04\81\FE\00"
@.str.4 = [20 x i8] c"\AB\1B\B0\94\F7\80c\C8\90\FC\8E\D2U\B2L$\B3\AC~\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8** %3
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8** %4
store i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i8** %5
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i8** %6
%7 = load i8*, i8** %2
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = call i32 @test_crypto_aead(i8* %7, i32 12, i8* %8, i32 10, i8* %9, i32 6, i8* %10, i32 7, i8* %11, i32 12)
ret i32 %12
}

LLVM IR (-O2):
@.str = [13 x i8] c"\14^\A8\F2=\87\D1\1Cf\B0\FAE\00"
@.str.1 = [11 x i8] c"\15p\CB'\82\DD9\94\EFK\00"
@.str.2 = [7 x i8] c"\0Cx\E4Q\BD*\00"
@.str.3 = [8 x i8] c"\0E\8B\09\86\04\81\FE\00"
@.str.4 = [20 x i8] c"\AB\1B\B0\94\F7\80c\C8\90\FC\8E\D2U\B2L$\B3\AC~\00"
define i32 @main() {
%1 = tail call i32 @test_crypto_aead(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 12, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i32 6, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 7, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 12)
ret i32 %1
}