#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 norx_aead_decrypt(unsigned char *, size_t *, unsigned char *, size_t,
                      unsigned char *, size_t, unsigned char *, size_t,
                      unsigned char *, unsigned char *);
int /*<<< orphan*/ norx_aead_encrypt(unsigned char *, size_t *, unsigned char *,
                                     size_t, unsigned char *, size_t,
                                     unsigned char *, size_t, unsigned char *,
                                     unsigned char *);
int /*<<< orphan*/ print_bytes(unsigned char *, size_t);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  unsigned char k[32] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
                         0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F,
                         0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,
                         0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F};
  unsigned char n[32] = {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27,
                         0x28, 0x29, 0x2A, 0x2B, 0x2C, 0x2D, 0x2E, 0x2F,
                         0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37,
                         0x38, 0x39, 0x3A, 0x3B, 0x3C, 0x3D, 0x3E, 0x3F};
  unsigned char a[1024] = {0};
  unsigned char m[1024] = {0};
  unsigned char c[1024 + 32] = {0};
  unsigned char z[1024] = {0};
  size_t alen = 128;
  size_t mlen = 128;
  size_t clen = 0;
  size_t zlen = 128;
  size_t i = 0;
  int result = -1;
  for (i = 0; i < alen; ++i) {
    a[i] = i & 255;
  }
  for (i = 0; i < mlen; ++i) {
    m[i] = i & 255;
  }
  for (i = 0; i < zlen; ++i) {
    z[i] = i & 255;
  }
  printf("========== SETUP ==========\n");
  printf("Key:\n");
  print_bytes(k, (((64 * 4) + 7) / 8));
  printf("Nonce:\n");
  print_bytes(n, (((64 * 4) + 7) / 8));
  printf("Header:\n");
  print_bytes(a, alen);
  printf("Message:\n");
  print_bytes(m, mlen);
  printf("Trailer:\n");
  print_bytes(z, zlen);
  printf("========== ENCRYPTION ==========\n");
  norx_aead_encrypt(c, &clen, a, alen, m, mlen, z, zlen, n, k);
  printf("Ciphertext + tag:\n");
  print_bytes(c, clen);
  printf("========== DECRYPTION ==========\n");
  result = norx_aead_decrypt(m, &mlen, a, alen, c, clen, z, zlen, n, k);
  printf("Decrypted message:\n");
  print_bytes(m, mlen);
  printf("verify: %d\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x10b8,%rsp
movl   $0x0,-0xc(%rbp)
mov    0xe96(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xe93(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xe90(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe8d(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xe8a(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe87(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xe84(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xe81(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    -0x450(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1050 <memset@plt>
lea    -0x850(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1050 <memset@plt>
lea    -0xc70(%rbp),%rdi
xor    %esi,%esi
mov    $0x420,%edx
call   1050 <memset@plt>
lea    -0x1070(%rbp),%rdi
xor    %esi,%esi
mov    $0x400,%edx
call   1050 <memset@plt>
movq   $0x80,-0x1078(%rbp)
movq   $0x80,-0x1080(%rbp)
movq   $0x0,-0x1088(%rbp)
movq   $0x80,-0x1090(%rbp)
movq   $0x0,-0x1098(%rbp)
movl   $0xffffffff,-0x109c(%rbp)
ff ff ff
movq   $0x0,-0x1098(%rbp)
mov    -0x1098(%rbp),%rax
cmp    -0x1078(%rbp),%rax
jae    129b <main+0x14b>
mov    -0x1098(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x1098(%rbp),%rax
mov    %cl,-0x450(%rbp,%rax,1)
mov    -0x1098(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1098(%rbp)
jmp    1253 <main+0x103>
movq   $0x0,-0x1098(%rbp)
mov    -0x1098(%rbp),%rax
cmp    -0x1080(%rbp),%rax
jae    12ee <main+0x19e>
mov    -0x1098(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x1098(%rbp),%rax
mov    %cl,-0x850(%rbp,%rax,1)
mov    -0x1098(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1098(%rbp)
jmp    12a6 <main+0x156>
movq   $0x0,-0x1098(%rbp)
mov    -0x1098(%rbp),%rax
cmp    -0x1090(%rbp),%rax
jae    1341 <main+0x1f1>
mov    -0x1098(%rbp),%rax
and    $0xff,%rax
mov    %al,%cl
mov    -0x1098(%rbp),%rax
mov    %cl,-0x1070(%rbp,%rax,1)
mov    -0x1098(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x1098(%rbp)
jmp    12f9 <main+0x1a9>
lea    0xcf8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd07(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    $0x20,%esi
call   1060 <print_bytes@plt>
lea    0xcf1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    $0x20,%esi
call   1060 <print_bytes@plt>
lea    0xcdd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x450(%rbp),%rdi
mov    -0x1078(%rbp),%rsi
call   1060 <print_bytes@plt>
lea    0xcc5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x850(%rbp),%rdi
mov    -0x1080(%rbp),%rsi
call   1060 <print_bytes@plt>
lea    0xcae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x1070(%rbp),%rdi
mov    -0x1090(%rbp),%rsi
call   1060 <print_bytes@plt>
lea    0xc97(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xc70(%rbp),%rdi
lea    -0x450(%rbp),%rdx
mov    -0x1078(%rbp),%rcx
lea    -0x850(%rbp),%r8
mov    -0x1080(%rbp),%r9
lea    -0x1070(%rbp),%rbx
mov    -0x1090(%rbp),%r11
lea    -0x50(%rbp),%r10
lea    -0x30(%rbp),%rax
lea    -0x1088(%rbp),%rsi
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1030 <norx_aead_encrypt@plt>
lea    0xc53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xc70(%rbp),%rdi
mov    -0x1088(%rbp),%rsi
call   1060 <print_bytes@plt>
lea    0xc45(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x850(%rbp),%rdi
lea    -0x450(%rbp),%rdx
mov    -0x1078(%rbp),%rcx
lea    -0xc70(%rbp),%r8
mov    -0x1088(%rbp),%r9
lea    -0x1070(%rbp),%rbx
mov    -0x1090(%rbp),%r11
lea    -0x50(%rbp),%r10
lea    -0x30(%rbp),%rax
lea    -0x1080(%rbp),%rsi
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1070 <norx_aead_decrypt@plt>
mov    %eax,-0x109c(%rbp)
lea    0xbfb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x850(%rbp),%rdi
mov    -0x1080(%rbp),%rsi
call   1060 <print_bytes@plt>
mov    -0x109c(%rbp),%esi
lea    0xbe8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10b8,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1078,%rsp
movaps 0xf18(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xefc(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xf20(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xf04(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x850(%rsp),%r14
mov    $0x400,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1060 <memset@plt>
lea    0x450(%rsp),%r13
mov    $0x400,%edx
mov    %r13,%rdi
xor    %esi,%esi
call   1060 <memset@plt>
lea    0xc50(%rsp),%r15
mov    $0x420,%edx
mov    %r15,%rdi
xor    %esi,%esi
call   1060 <memset@plt>
lea    0x50(%rsp),%r12
mov    $0x400,%edx
mov    %r12,%rdi
xor    %esi,%esi
call   1060 <memset@plt>
movq   $0x80,0x8(%rsp)
movq   $0x0,(%rsp)
movaps 0xdee(%rip),%xmm0
movaps %xmm0,0x850(%rsp)
movaps 0xdef(%rip),%xmm1
movaps %xmm1,0x860(%rsp)
movaps 0xdf0(%rip),%xmm2
movaps %xmm2,0x870(%rsp)
movaps 0xdf1(%rip),%xmm3
movaps %xmm3,0x880(%rsp)
movaps 0xdf2(%rip),%xmm4
movaps %xmm4,0x890(%rsp)
movaps 0xdf3(%rip),%xmm5
movaps %xmm5,0x8a0(%rsp)
movaps 0xdf4(%rip),%xmm6
movaps %xmm6,0x8b0(%rsp)
movaps 0xdf5(%rip),%xmm7
movaps %xmm7,0x8c0(%rsp)
movaps %xmm0,0x450(%rsp)
movaps %xmm1,0x460(%rsp)
movaps %xmm2,0x470(%rsp)
movaps %xmm3,0x480(%rsp)
movaps %xmm4,0x490(%rsp)
movaps %xmm5,0x4a0(%rsp)
movaps %xmm6,0x4b0(%rsp)
movaps %xmm7,0x4c0(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm1,0x60(%rsp)
movaps %xmm2,0x70(%rsp)
movaps %xmm3,0x80(%rsp)
movaps %xmm4,0x90(%rsp)
movaps %xmm5,0xa0(%rsp)
movaps %xmm6,0xb0(%rsp)
movaps %xmm7,0xc0(%rsp)
lea    0xdcb(%rip),%rdi
call   1030 <puts@plt>
lea    0xddb(%rip),%rdi
call   1030 <puts@plt>
lea    0x30(%rsp),%rbx
mov    $0x20,%esi
mov    %rbx,%rdi
call   1070 <print_bytes@plt>
lea    0xdc2(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%rbp
mov    $0x20,%esi
mov    %rbp,%rdi
call   1070 <print_bytes@plt>
lea    0xdab(%rip),%rdi
call   1030 <puts@plt>
mov    $0x80,%esi
mov    %r14,%rdi
call   1070 <print_bytes@plt>
lea    0xd9a(%rip),%rdi
call   1030 <puts@plt>
mov    $0x80,%esi
mov    %r13,%rdi
call   1070 <print_bytes@plt>
lea    0xd8a(%rip),%rdi
call   1030 <puts@plt>
mov    $0x80,%esi
mov    %r12,%rdi
call   1070 <print_bytes@plt>
lea    0xd7a(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rsi
mov    $0x80,%ecx
mov    $0x80,%r9d
mov    %r15,%rdi
mov    %r14,%rdx
mov    %r13,%r8
push   %rbx
push   %rbp
push   $0x80
push   %r12
call   1040 <norx_aead_encrypt@plt>
add    $0x20,%rsp
lea    0xd66(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%rsi
mov    %r15,%rdi
call   1070 <print_bytes@plt>
lea    0xd60(%rip),%rdi
call   1030 <puts@plt>
mov    (%rsp),%r9
lea    0x8(%rsp),%rsi
mov    $0x80,%ecx
mov    %r13,%rdi
mov    %r14,%rdx
mov    %r15,%r8
push   %rbx
push   %rbp
push   $0x80
push   %r12
call   1080 <norx_aead_decrypt@plt>
add    $0x20,%rsp
mov    %eax,%ebx
lea    0xd4a(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%rsi
mov    %r13,%rdi
call   1070 <print_bytes@plt>
lea    0xc8f(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x1078,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.k = [32 x i8] c"\00\01\02\03\04\05\06\07\08\09\0A\0B\0C\0D\0E\0F\10\11\12\13\14\15\16\17\18\19\1A\1B\1C\1D\1E\1F"
@__const.main.n = [32 x i8] c" !\22#$%&'()*+,-./0123456789:;<=>?"
@.str = [29 x i8] c"========== SETUP ==========\0A\00"
@.str.1 = [6 x i8] c"Key:\0A\00"
@.str.2 = [8 x i8] c"Nonce:\0A\00"
@.str.3 = [9 x i8] c"Header:\0A\00"
@.str.4 = [10 x i8] c"Message:\0A\00"
@.str.5 = [10 x i8] c"Trailer:\0A\00"
@.str.6 = [34 x i8] c"========== ENCRYPTION ==========\0A\00"
@.str.7 = [19 x i8] c"Ciphertext + tag:\0A\00"
@.str.8 = [34 x i8] c"========== DECRYPTION ==========\0A\00"
@.str.9 = [20 x i8] c"Decrypted message:\0A\00"
@.str.10 = [12 x i8] c"verify: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [32 x i8]
%3 = alloca [32 x i8]
%4 = alloca [1024 x i8]
%5 = alloca [1024 x i8]
%6 = alloca [1056 x i8]
%7 = alloca [1024 x i8]
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i32
store i32 0, i32* %1
%14 = bitcast [32 x i8]* %2 to i8*
%15 = bitcast [32 x i8]* %3 to i8*
%16 = bitcast [1024 x i8]* %4 to i8*
%17 = bitcast [1024 x i8]* %5 to i8*
%18 = bitcast [1056 x i8]* %6 to i8*
%19 = bitcast [1024 x i8]* %7 to i8*
store i64 128, i64* %8
store i64 128, i64* %9
store i64 0, i64* %10
store i64 128, i64* %11
store i64 0, i64* %12
store i32 -1, i32* %13
store i64 0, i64* %12
br label %20
20: ; preds = %30, %0
%21 = load i64, i64* %12
%22 = load i64, i64* %8
%23 = icmp ult i64 %21, %22
br i1 %23, label %24, label %33
24: ; preds = %20
%25 = load i64, i64* %12
%26 = and i64 %25, 255
%27 = trunc i64 %26 to i8
%28 = load i64, i64* %12
%29 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %28
store i8 %27, i8* %29
br label %30
30: ; preds = %24
%31 = load i64, i64* %12
%32 = add i64 %31, 1
store i64 %32, i64* %12
br label %20
33: ; preds = %20
store i64 0, i64* %12
br label %34
34: ; preds = %44, %33
%35 = load i64, i64* %12
%36 = load i64, i64* %9
%37 = icmp ult i64 %35, %36
br i1 %37, label %38, label %47
38: ; preds = %34
%39 = load i64, i64* %12
%40 = and i64 %39, 255
%41 = trunc i64 %40 to i8
%42 = load i64, i64* %12
%43 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 %42
store i8 %41, i8* %43
br label %44
44: ; preds = %38
%45 = load i64, i64* %12
%46 = add i64 %45, 1
store i64 %46, i64* %12
br label %34
47: ; preds = %34
store i64 0, i64* %12
br label %48
48: ; preds = %58, %47
%49 = load i64, i64* %12
%50 = load i64, i64* %11
%51 = icmp ult i64 %49, %50
br i1 %51, label %52, label %61
52: ; preds = %48
%53 = load i64, i64* %12
%54 = and i64 %53, 255
%55 = trunc i64 %54 to i8
%56 = load i64, i64* %12
%57 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 %56
store i8 %55, i8* %57
br label %58
58: ; preds = %52
%59 = load i64, i64* %12
%60 = add i64 %59, 1
store i64 %60, i64* %12
br label %48
61: ; preds = %48
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%64 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%65 = call i32 @print_bytes(i8* %64, i64 32)
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%67 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%68 = call i32 @print_bytes(i8* %67, i64 32)
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0))
%70 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%71 = load i64, i64* %8
%72 = call i32 @print_bytes(i8* %70, i64 %71)
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
%74 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%75 = load i64, i64* %9
%76 = call i32 @print_bytes(i8* %74, i64 %75)
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%78 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%79 = load i64, i64* %11
%80 = call i32 @print_bytes(i8* %78, i64 %79)
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0))
%82 = getelementptr inbounds [1056 x i8], [1056 x i8]* %6, i64 0, i64 0
%83 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%84 = load i64, i64* %8
%85 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%86 = load i64, i64* %9
%87 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%88 = load i64, i64* %11
%89 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%90 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%91 = call i32 @norx_aead_encrypt(i8* %82, i64* %10, i8* %83, i64 %84, i8* %85, i64 %86, i8* %87, i64 %88, i8* %89, i8* %90)
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%93 = getelementptr inbounds [1056 x i8], [1056 x i8]* %6, i64 0, i64 0
%94 = load i64, i64* %10
%95 = call i32 @print_bytes(i8* %93, i64 %94)
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.8, i64 0, i64 0))
%97 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%98 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%99 = load i64, i64* %8
%100 = getelementptr inbounds [1056 x i8], [1056 x i8]* %6, i64 0, i64 0
%101 = load i64, i64* %10
%102 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%103 = load i64, i64* %11
%104 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%105 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%106 = call i32 @norx_aead_decrypt(i8* %97, i64* %9, i8* %98, i64 %99, i8* %100, i64 %101, i8* %102, i64 %103, i8* %104, i8* %105)
store i32 %106, i32* %13
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0))
%108 = getelementptr inbounds [1024 x i8], [1024 x i8]* %5, i64 0, i64 0
%109 = load i64, i64* %9
%110 = call i32 @print_bytes(i8* %108, i64 %109)
%111 = load i32, i32* %13
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i32 %111)
ret i32 0
}

LLVM IR (-O2):
@__const.main.k = [32 x i8] c"\00\01\02\03\04\05\06\07\08\09\0A\0B\0C\0D\0E\0F\10\11\12\13\14\15\16\17\18\19\1A\1B\1C\1D\1E\1F"
@__const.main.n = [32 x i8] c" !\22#$%&'()*+,-./0123456789:;<=>?"
@.str.10 = [12 x i8] c"verify: %d\0A\00"
@str = [28 x i8] c"========== SETUP ==========\00"
@str.11 = [5 x i8] c"Key:\00"
@str.12 = [7 x i8] c"Nonce:\00"
@str.13 = [8 x i8] c"Header:\00"
@str.14 = [9 x i8] c"Message:\00"
@str.15 = [9 x i8] c"Trailer:\00"
@str.16 = [33 x i8] c"========== ENCRYPTION ==========\00"
@str.17 = [18 x i8] c"Ciphertext + tag:\00"
@str.18 = [33 x i8] c"========== DECRYPTION ==========\00"
@str.19 = [19 x i8] c"Decrypted message:\00"
define i32 @main() {
%1 = alloca [32 x i8]
%2 = alloca [32 x i8]
%3 = alloca [1024 x i8]
%4 = alloca [1024 x i8]
%5 = alloca [1056 x i8]
%6 = alloca [1024 x i8]
%7 = alloca i64
%8 = alloca i64
%9 = getelementptr inbounds [32 x i8], [32 x i8]* %1, i64 0, i64 0
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %2, i64 0, i64 0
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%13 = getelementptr inbounds [1056 x i8], [1056 x i8]* %5, i64 0, i64 0
%14 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 0
%15 = bitcast i64* %7 to i8*
store i64 128, i64* %7
%16 = bitcast i64* %8 to i8*
store i64 0, i64* %8
%17 = bitcast [1024 x i8]* %3 to <16 x i8>*
store <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, <16 x i8>* %17
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 16
%19 = bitcast i8* %18 to <16 x i8>*
store <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, <16 x i8>* %19
%20 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 32
%21 = bitcast i8* %20 to <16 x i8>*
store <16 x i8> <i8 32, i8 33, i8 34, i8 35, i8 36, i8 37, i8 38, i8 39, i8 40, i8 41, i8 42, i8 43, i8 44, i8 45, i8 46, i8 47>, <16 x i8>* %21
%22 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 48
%23 = bitcast i8* %22 to <16 x i8>*
store <16 x i8> <i8 48, i8 49, i8 50, i8 51, i8 52, i8 53, i8 54, i8 55, i8 56, i8 57, i8 58, i8 59, i8 60, i8 61, i8 62, i8 63>, <16 x i8>* %23
%24 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 64
%25 = bitcast i8* %24 to <16 x i8>*
store <16 x i8> <i8 64, i8 65, i8 66, i8 67, i8 68, i8 69, i8 70, i8 71, i8 72, i8 73, i8 74, i8 75, i8 76, i8 77, i8 78, i8 79>, <16 x i8>* %25
%26 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 80
%27 = bitcast i8* %26 to <16 x i8>*
store <16 x i8> <i8 80, i8 81, i8 82, i8 83, i8 84, i8 85, i8 86, i8 87, i8 88, i8 89, i8 90, i8 91, i8 92, i8 93, i8 94, i8 95>, <16 x i8>* %27
%28 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 96
%29 = bitcast i8* %28 to <16 x i8>*
store <16 x i8> <i8 96, i8 97, i8 98, i8 99, i8 100, i8 101, i8 102, i8 103, i8 104, i8 105, i8 106, i8 107, i8 108, i8 109, i8 110, i8 111>, <16 x i8>* %29
%30 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 112
%31 = bitcast i8* %30 to <16 x i8>*
store <16 x i8> <i8 112, i8 113, i8 114, i8 115, i8 116, i8 117, i8 118, i8 119, i8 120, i8 121, i8 122, i8 123, i8 124, i8 125, i8 126, i8 127>, <16 x i8>* %31
%32 = bitcast [1024 x i8]* %4 to <16 x i8>*
store <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, <16 x i8>* %32
%33 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 16
%34 = bitcast i8* %33 to <16 x i8>*
store <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, <16 x i8>* %34
%35 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 32
%36 = bitcast i8* %35 to <16 x i8>*
store <16 x i8> <i8 32, i8 33, i8 34, i8 35, i8 36, i8 37, i8 38, i8 39, i8 40, i8 41, i8 42, i8 43, i8 44, i8 45, i8 46, i8 47>, <16 x i8>* %36
%37 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 48
%38 = bitcast i8* %37 to <16 x i8>*
store <16 x i8> <i8 48, i8 49, i8 50, i8 51, i8 52, i8 53, i8 54, i8 55, i8 56, i8 57, i8 58, i8 59, i8 60, i8 61, i8 62, i8 63>, <16 x i8>* %38
%39 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 64
%40 = bitcast i8* %39 to <16 x i8>*
store <16 x i8> <i8 64, i8 65, i8 66, i8 67, i8 68, i8 69, i8 70, i8 71, i8 72, i8 73, i8 74, i8 75, i8 76, i8 77, i8 78, i8 79>, <16 x i8>* %40
%41 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 80
%42 = bitcast i8* %41 to <16 x i8>*
store <16 x i8> <i8 80, i8 81, i8 82, i8 83, i8 84, i8 85, i8 86, i8 87, i8 88, i8 89, i8 90, i8 91, i8 92, i8 93, i8 94, i8 95>, <16 x i8>* %42
%43 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 96
%44 = bitcast i8* %43 to <16 x i8>*
store <16 x i8> <i8 96, i8 97, i8 98, i8 99, i8 100, i8 101, i8 102, i8 103, i8 104, i8 105, i8 106, i8 107, i8 108, i8 109, i8 110, i8 111>, <16 x i8>* %44
%45 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 112
%46 = bitcast i8* %45 to <16 x i8>*
store <16 x i8> <i8 112, i8 113, i8 114, i8 115, i8 116, i8 117, i8 118, i8 119, i8 120, i8 121, i8 122, i8 123, i8 124, i8 125, i8 126, i8 127>, <16 x i8>* %46
%47 = bitcast [1024 x i8]* %6 to <16 x i8>*
store <16 x i8> <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, <16 x i8>* %47
%48 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 16
%49 = bitcast i8* %48 to <16 x i8>*
store <16 x i8> <i8 16, i8 17, i8 18, i8 19, i8 20, i8 21, i8 22, i8 23, i8 24, i8 25, i8 26, i8 27, i8 28, i8 29, i8 30, i8 31>, <16 x i8>* %49
%50 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 32
%51 = bitcast i8* %50 to <16 x i8>*
store <16 x i8> <i8 32, i8 33, i8 34, i8 35, i8 36, i8 37, i8 38, i8 39, i8 40, i8 41, i8 42, i8 43, i8 44, i8 45, i8 46, i8 47>, <16 x i8>* %51
%52 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 48
%53 = bitcast i8* %52 to <16 x i8>*
store <16 x i8> <i8 48, i8 49, i8 50, i8 51, i8 52, i8 53, i8 54, i8 55, i8 56, i8 57, i8 58, i8 59, i8 60, i8 61, i8 62, i8 63>, <16 x i8>* %53
%54 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 64
%55 = bitcast i8* %54 to <16 x i8>*
store <16 x i8> <i8 64, i8 65, i8 66, i8 67, i8 68, i8 69, i8 70, i8 71, i8 72, i8 73, i8 74, i8 75, i8 76, i8 77, i8 78, i8 79>, <16 x i8>* %55
%56 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 80
%57 = bitcast i8* %56 to <16 x i8>*
store <16 x i8> <i8 80, i8 81, i8 82, i8 83, i8 84, i8 85, i8 86, i8 87, i8 88, i8 89, i8 90, i8 91, i8 92, i8 93, i8 94, i8 95>, <16 x i8>* %57
%58 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 96
%59 = bitcast i8* %58 to <16 x i8>*
store <16 x i8> <i8 96, i8 97, i8 98, i8 99, i8 100, i8 101, i8 102, i8 103, i8 104, i8 105, i8 106, i8 107, i8 108, i8 109, i8 110, i8 111>, <16 x i8>* %59
%60 = getelementptr inbounds [1024 x i8], [1024 x i8]* %6, i64 0, i64 112
%61 = bitcast i8* %60 to <16 x i8>*
store <16 x i8> <i8 112, i8 113, i8 114, i8 115, i8 116, i8 117, i8 118, i8 119, i8 120, i8 121, i8 122, i8 123, i8 124, i8 125, i8 126, i8 127>, <16 x i8>* %61
%62 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%63 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.11, i64 0, i64 0))
%64 = call i32 @print_bytes(i8* %9, i64 32)
%65 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.12, i64 0, i64 0))
%66 = call i32 @print_bytes(i8* %10, i64 32)
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.13, i64 0, i64 0))
%68 = call i32 @print_bytes(i8* %11, i64 128)
%69 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.14, i64 0, i64 0))
%70 = call i32 @print_bytes(i8* %12, i64 128)
%71 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.15, i64 0, i64 0))
%72 = call i32 @print_bytes(i8* %14, i64 128)
%73 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.16, i64 0, i64 0))
%74 = call i32 @norx_aead_encrypt(i8* %13, i64* %8, i8* %11, i64 128, i8* %12, i64 128, i8* %14, i64 128, i8* %10, i8* %9)
%75 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.17, i64 0, i64 0))
%76 = load i64, i64* %8
%77 = call i32 @print_bytes(i8* %13, i64 %76)
%78 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.18, i64 0, i64 0))
%79 = load i64, i64* %8
%80 = call i32 @norx_aead_decrypt(i8* %12, i64* %7, i8* %11, i64 128, i8* %13, i64 %79, i8* %14, i64 128, i8* %10, i8* %9)
%81 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.19, i64 0, i64 0))
%82 = load i64, i64* %7
%83 = call i32 @print_bytes(i8* %12, i64 %82)
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i32 %80)
ret i32 0
}