#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*/ AESROUND(unsigned char *, unsigned char *, unsigned char *);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char *, unsigned char);
void aegis128L_tag_generation(unsigned long msglen, unsigned long adlen,
                              unsigned char maclen, unsigned char *mac,
                              unsigned char *state) {
  int i;
  unsigned char tmp[16];
  unsigned char msgtmp[16];
  ((unsigned long long *)msgtmp)[0] = adlen << 3;
  ((unsigned long long *)msgtmp)[1] = msglen << 3;
  {
    ((unsigned long long *)(msgtmp))[0] =
        ((unsigned long long *)(msgtmp))[0] ^
        ((unsigned long long *)(state + 32))[0];
    ((unsigned long long *)(msgtmp))[1] =
        ((unsigned long long *)(msgtmp))[1] ^
        ((unsigned long long *)(state + 32))[1];
  };
  for (i = 0; i < 7; i++) {
    memcpy(tmp, state + 112, 16);
    AESROUND(state + 112, state + 96, state + 112);
    AESROUND(state + 96, state + 80, state + 96);
    AESROUND(state + 80, state + 64, state + 80);
    AESROUND(state + 64, state + 48, state + 64);
    AESROUND(state + 48, state + 32, state + 48);
    AESROUND(state + 32, state + 16, state + 32);
    AESROUND(state + 16, state + 0, state + 16);
    AESROUND(state + 0, tmp, state + 0);
    {
      ((unsigned long long *)(state))[0] = ((unsigned long long *)(state))[0] ^
                                           ((unsigned long long *)(msgtmp))[0];
      ((unsigned long long *)(state))[1] = ((unsigned long long *)(state))[1] ^
                                           ((unsigned long long *)(msgtmp))[1];
    };
    {
      ((unsigned long long *)(state + 64))[0] =
          ((unsigned long long *)(state + 64))[0] ^
          ((unsigned long long *)(msgtmp))[0];
      ((unsigned long long *)(state + 64))[1] =
          ((unsigned long long *)(state + 64))[1] ^
          ((unsigned long long *)(msgtmp))[1];
    };
  }
  {
    ((unsigned long long *)(state + 96))[0] =
        ((unsigned long long *)(state + 96))[0] ^
        ((unsigned long long *)(state + 80))[0];
    ((unsigned long long *)(state + 96))[1] =
        ((unsigned long long *)(state + 96))[1] ^
        ((unsigned long long *)(state + 80))[1];
  };
  {
    ((unsigned long long *)(state + 96))[0] =
        ((unsigned long long *)(state + 96))[0] ^
        ((unsigned long long *)(state + 64))[0];
    ((unsigned long long *)(state + 96))[1] =
        ((unsigned long long *)(state + 96))[1] ^
        ((unsigned long long *)(state + 64))[1];
  };
  {
    ((unsigned long long *)(state + 96))[0] =
        ((unsigned long long *)(state + 96))[0] ^
        ((unsigned long long *)(state + 48))[0];
    ((unsigned long long *)(state + 96))[1] =
        ((unsigned long long *)(state + 96))[1] ^
        ((unsigned long long *)(state + 48))[1];
  };
  {
    ((unsigned long long *)(state + 96))[0] =
        ((unsigned long long *)(state + 96))[0] ^
        ((unsigned long long *)(state + 32))[0];
    ((unsigned long long *)(state + 96))[1] =
        ((unsigned long long *)(state + 96))[1] ^
        ((unsigned long long *)(state + 32))[1];
  };
  {
    ((unsigned long long *)(state + 96))[0] =
        ((unsigned long long *)(state + 96))[0] ^
        ((unsigned long long *)(state + 16))[0];
    ((unsigned long long *)(state + 96))[1] =
        ((unsigned long long *)(state + 96))[1] ^
        ((unsigned long long *)(state + 16))[1];
  };
  {
    ((unsigned long long *)(state + 96))[0] =
        ((unsigned long long *)(state + 96))[0] ^
        ((unsigned long long *)(state + 0))[0];
    ((unsigned long long *)(state + 96))[1] =
        ((unsigned long long *)(state + 96))[1] ^
        ((unsigned long long *)(state + 0))[1];
  };
  memcpy(mac, state + 96, maclen);
}


x86 assembly (clang, -O0):
<aegis128L_tag_generation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
mov    %rax,-0x50(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x3,%rax
mov    %rax,-0x48(%rbp)
mov    -0x50(%rbp),%rax
mov    -0x28(%rbp),%rcx
xor    0x20(%rcx),%rax
mov    %rax,-0x50(%rbp)
mov    -0x48(%rbp),%rax
mov    -0x28(%rbp),%rcx
xor    0x28(%rcx),%rax
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x7,-0x2c(%rbp)
jge    12d0 <aegis128L_tag_generation+0x1b0>
lea    -0x40(%rbp),%rdi
mov    -0x28(%rbp),%rsi
add    $0x70,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
mov    -0x28(%rbp),%rdi
add    $0x70,%rdi
mov    -0x28(%rbp),%rsi
add    $0x60,%rsi
mov    -0x28(%rbp),%rdx
add    $0x70,%rdx
call   1040 <AESROUND@plt>
mov    -0x28(%rbp),%rdi
add    $0x60,%rdi
mov    -0x28(%rbp),%rsi
add    $0x50,%rsi
mov    -0x28(%rbp),%rdx
add    $0x60,%rdx
call   1040 <AESROUND@plt>
mov    -0x28(%rbp),%rdi
add    $0x50,%rdi
mov    -0x28(%rbp),%rsi
add    $0x40,%rsi
mov    -0x28(%rbp),%rdx
add    $0x50,%rdx
call   1040 <AESROUND@plt>
mov    -0x28(%rbp),%rdi
add    $0x40,%rdi
mov    -0x28(%rbp),%rsi
add    $0x30,%rsi
mov    -0x28(%rbp),%rdx
add    $0x40,%rdx
call   1040 <AESROUND@plt>
mov    -0x28(%rbp),%rdi
add    $0x30,%rdi
mov    -0x28(%rbp),%rsi
add    $0x20,%rsi
mov    -0x28(%rbp),%rdx
add    $0x30,%rdx
call   1040 <AESROUND@plt>
mov    -0x28(%rbp),%rdi
add    $0x20,%rdi
mov    -0x28(%rbp),%rsi
add    $0x10,%rsi
mov    -0x28(%rbp),%rdx
add    $0x20,%rdx
call   1040 <AESROUND@plt>
mov    -0x28(%rbp),%rdi
add    $0x10,%rdi
mov    -0x28(%rbp),%rsi
mov    -0x28(%rbp),%rdx
add    $0x10,%rdx
call   1040 <AESROUND@plt>
mov    -0x28(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1040 <AESROUND@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%rcx
xor    -0x50(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rcx
xor    -0x48(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x8(%rax)
mov    -0x28(%rbp),%rax
mov    0x40(%rax),%rcx
xor    -0x50(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x40(%rax)
mov    -0x28(%rbp),%rax
mov    0x48(%rax),%rcx
xor    -0x48(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x48(%rax)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    117c <aegis128L_tag_generation+0x5c>
mov    -0x28(%rbp),%rax
mov    0x60(%rax),%rcx
mov    -0x28(%rbp),%rax
xor    0x50(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x60(%rax)
mov    -0x28(%rbp),%rax
mov    0x68(%rax),%rcx
mov    -0x28(%rbp),%rax
xor    0x58(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x68(%rax)
mov    -0x28(%rbp),%rax
mov    0x60(%rax),%rcx
mov    -0x28(%rbp),%rax
xor    0x40(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x60(%rax)
mov    -0x28(%rbp),%rax
mov    0x68(%rax),%rcx
mov    -0x28(%rbp),%rax
xor    0x48(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x68(%rax)
mov    -0x28(%rbp),%rax
mov    0x60(%rax),%rcx
mov    -0x28(%rbp),%rax
xor    0x30(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x60(%rax)
mov    -0x28(%rbp),%rax
mov    0x68(%rax),%rcx
mov    -0x28(%rbp),%rax
xor    0x38(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x68(%rax)
mov    -0x28(%rbp),%rax
mov    0x60(%rax),%rcx
mov    -0x28(%rbp),%rax
xor    0x20(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x60(%rax)
mov    -0x28(%rbp),%rax
mov    0x68(%rax),%rcx
mov    -0x28(%rbp),%rax
xor    0x28(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x68(%rax)
mov    -0x28(%rbp),%rax
mov    0x60(%rax),%rcx
mov    -0x28(%rbp),%rax
xor    0x10(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x60(%rax)
mov    -0x28(%rbp),%rax
mov    0x68(%rax),%rcx
mov    -0x28(%rbp),%rax
xor    0x18(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x68(%rax)
mov    -0x28(%rbp),%rax
mov    0x60(%rax),%rcx
mov    -0x28(%rbp),%rax
xor    (%rax),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x60(%rax)
mov    -0x28(%rbp),%rax
mov    0x68(%rax),%rcx
mov    -0x28(%rbp),%rax
xor    0x8(%rax),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,0x68(%rax)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
add    $0x60,%rsi
mov    -0x11(%rbp),%al
movzbl %al,%edx
call   1030 <memcpy@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aegis128L_tag_generation>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r8,%r12
mov    %rcx,0x30(%rsp)
mov    %edx,0x4(%rsp)
movq   %rdi,%xmm0
movq   %rsi,%xmm1
punpcklqdq %xmm0,%xmm1
psllq  $0x3,%xmm1
lea    0x20(%r8),%rax
mov    %rax,0x20(%rsp)
movdqu 0x20(%r8),%xmm0
pxor   %xmm1,%xmm0
movdqa %xmm0,0x40(%rsp)
lea    0x70(%r8),%rax
mov    %rax,0x38(%rsp)
lea    0x60(%r8),%rax
mov    %rax,0x28(%rsp)
lea    0x50(%r8),%rax
mov    %rax,0x8(%rsp)
lea    0x40(%r8),%r13
lea    0x30(%r8),%rax
mov    %rax,0x10(%rsp)
lea    0x10(%r8),%rax
mov    %rax,0x18(%rsp)
mov    $0x7,%r15d
mov    0x28(%rsp),%r14
mov    0x20(%rsp),%rbp
nopw   0x0(%rax,%rax,1)
lea    0x50(%rsp),%rdi
mov    0x38(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x10,%edx
call   1030 <memcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <AESROUND@plt>
mov    %r14,%rdi
mov    0x8(%rsp),%rbx
mov    %rbx,%rsi
mov    %r14,%rdx
call   1040 <AESROUND@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbx,%rdx
call   1040 <AESROUND@plt>
mov    %r13,%rdi
mov    0x10(%rsp),%rbx
mov    %rbx,%rsi
mov    %r13,%rdx
call   1040 <AESROUND@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
call   1040 <AESROUND@plt>
mov    %rbp,%rdi
mov    0x18(%rsp),%rbx
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1040 <AESROUND@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <AESROUND@plt>
mov    %r12,%rdi
lea    0x50(%rsp),%rsi
mov    %r12,%rdx
call   1040 <AESROUND@plt>
movdqu (%r12),%xmm0
movdqu 0x40(%r12),%xmm1
movdqa 0x40(%rsp),%xmm2
pxor   %xmm2,%xmm0
movdqu %xmm0,(%r12)
pxor   %xmm2,%xmm1
movdqu %xmm1,0x40(%r12)
add    $0xffffffff,%r15d
jne    11b0 <aegis128L_tag_generation+0x90>
mov    0x28(%rsp),%rsi
movdqu (%rsi),%xmm2
mov    0x8(%rsp),%rax
movdqu (%rax),%xmm3
pxor   %xmm2,%xmm3
pxor   %xmm3,%xmm1
mov    0x10(%rsp),%rax
movdqu (%rax),%xmm2
mov    0x20(%rsp),%rax
movdqu (%rax),%xmm3
pxor   %xmm2,%xmm3
mov    0x18(%rsp),%rax
movdqu (%rax),%xmm2
pxor   %xmm3,%xmm2
pxor   %xmm1,%xmm2
pxor   %xmm2,%xmm0
movdqu %xmm0,(%rsi)
movzbl 0x4(%rsp),%edx
mov    0x30(%rsp),%rdi
call   1030 <memcpy@plt>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @aegis128L_tag_generation(i64 %0, i64 %1, i8 zeroext %2, i8* %3, i8* %4) {
%6 = alloca i64
%7 = alloca i64
%8 = alloca i8
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca [16 x i8]
%13 = alloca [16 x i8]
store i64 %0, i64* %6
store i64 %1, i64* %7
store i8 %2, i8* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%14 = load i64, i64* %7
%15 = shl i64 %14, 3
%16 = getelementptr inbounds [16 x i8], [16 x i8]* %13, i64 0, i64 0
%17 = bitcast i8* %16 to i64*
%18 = getelementptr inbounds i64, i64* %17, i64 0
store i64 %15, i64* %18
%19 = load i64, i64* %6
%20 = shl i64 %19, 3
%21 = getelementptr inbounds [16 x i8], [16 x i8]* %13, i64 0, i64 0
%22 = bitcast i8* %21 to i64*
%23 = getelementptr inbounds i64, i64* %22, i64 1
store i64 %20, i64* %23
%24 = getelementptr inbounds [16 x i8], [16 x i8]* %13, i64 0, i64 0
%25 = bitcast i8* %24 to i64*
%26 = getelementptr inbounds i64, i64* %25, i64 0
%27 = load i64, i64* %26
%28 = load i8*, i8** %10
%29 = getelementptr inbounds i8, i8* %28, i64 32
%30 = bitcast i8* %29 to i64*
%31 = getelementptr inbounds i64, i64* %30, i64 0
%32 = load i64, i64* %31
%33 = xor i64 %27, %32
%34 = getelementptr inbounds [16 x i8], [16 x i8]* %13, i64 0, i64 0
%35 = bitcast i8* %34 to i64*
%36 = getelementptr inbounds i64, i64* %35, i64 0
store i64 %33, i64* %36
%37 = getelementptr inbounds [16 x i8], [16 x i8]* %13, i64 0, i64 0
%38 = bitcast i8* %37 to i64*
%39 = getelementptr inbounds i64, i64* %38, i64 1
%40 = load i64, i64* %39
%41 = load i8*, i8** %10
%42 = getelementptr inbounds i8, i8* %41, i64 32
%43 = bitcast i8* %42 to i64*
%44 = getelementptr inbounds i64, i64* %43, i64 1
%45 = load i64, i64* %44
%46 = xor i64 %40, %45
%47 = getelementptr inbounds [16 x i8], [16 x i8]* %13, i64 0, i64 0
%48 = bitcast i8* %47 to i64*
%49 = getelementptr inbounds i64, i64* %48, i64 1
store i64 %46, i64* %49
store i32 0, i32* %11
br label %50
50: ; preds = %165, %5
%51 = load i32, i32* %11
%52 = icmp slt i32 %51, 7
br i1 %52, label %53, label %168
53: ; preds = %50
%54 = getelementptr inbounds [16 x i8], [16 x i8]* %12, i64 0, i64 0
%55 = load i8*, i8** %10
%56 = getelementptr inbounds i8, i8* %55, i64 112
%57 = call i32 @memcpy(i8* %54, i8* %56, i8 zeroext 16)
%58 = load i8*, i8** %10
%59 = getelementptr inbounds i8, i8* %58, i64 112
%60 = load i8*, i8** %10
%61 = getelementptr inbounds i8, i8* %60, i64 96
%62 = load i8*, i8** %10
%63 = getelementptr inbounds i8, i8* %62, i64 112
%64 = call i32 @AESROUND(i8* %59, i8* %61, i8* %63)
%65 = load i8*, i8** %10
%66 = getelementptr inbounds i8, i8* %65, i64 96
%67 = load i8*, i8** %10
%68 = getelementptr inbounds i8, i8* %67, i64 80
%69 = load i8*, i8** %10
%70 = getelementptr inbounds i8, i8* %69, i64 96
%71 = call i32 @AESROUND(i8* %66, i8* %68, i8* %70)
%72 = load i8*, i8** %10
%73 = getelementptr inbounds i8, i8* %72, i64 80
%74 = load i8*, i8** %10
%75 = getelementptr inbounds i8, i8* %74, i64 64
%76 = load i8*, i8** %10
%77 = getelementptr inbounds i8, i8* %76, i64 80
%78 = call i32 @AESROUND(i8* %73, i8* %75, i8* %77)
%79 = load i8*, i8** %10
%80 = getelementptr inbounds i8, i8* %79, i64 64
%81 = load i8*, i8** %10
%82 = getelementptr inbounds i8, i8* %81, i64 48
%83 = load i8*, i8** %10
%84 = getelementptr inbounds i8, i8* %83, i64 64
%85 = call i32 @AESROUND(i8* %80, i8* %82, i8* %84)
%86 = load i8*, i8** %10
%87 = getelementptr inbounds i8, i8* %86, i64 48
%88 = load i8*, i8** %10
%89 = getelementptr inbounds i8, i8* %88, i64 32
%90 = load i8*, i8** %10
%91 = getelementptr inbounds i8, i8* %90, i64 48
%92 = call i32 @AESROUND(i8* %87, i8* %89, i8* %91)
%93 = load i8*, i8** %10
%94 = getelementptr inbounds i8, i8* %93, i64 32
%95 = load i8*, i8** %10
%96 = getelementptr inbounds i8, i8* %95, i64 16
%97 = load i8*, i8** %10
%98 = getelementptr inbounds i8, i8* %97, i64 32
%99 = call i32 @AESROUND(i8* %94, i8* %96, i8* %98)
%100 = load i8*, i8** %10
%101 = getelementptr inbounds i8, i8* %100, i64 16
%102 = load i8*, i8** %10
%103 = getelementptr inbounds i8, i8* %102, i64 0
%104 = load i8*, i8** %10
%105 = getelementptr inbounds i8, i8* %104, i64 16
%106 = call i32 @AESROUND(i8* %101, i8* %103, i8* %105)
%107 = load i8*, i8** %10
%108 = getelementptr inbounds i8, i8* %107, i64 0
%109 = getelementptr inbounds [16 x i8], [16 x i8]* %12, i64 0, i64 0
%110 = load i8*, i8** %10
%111 = getelementptr inbounds i8, i8* %110, i64 0
%112 = call i32 @AESROUND(i8* %108, i8* %109, i8* %111)
%113 = load i8*, i8** %10
%114 = bitcast i8* %113 to i64*
%115 = getelementptr inbounds i64, i64* %114, i64 0
%116 = load i64, i64* %115
%117 = getelementptr inbounds [16 x i8], [16 x i8]* %13, i64 0, i64 0
%118 = bitcast i8* %117 to i64*
%119 = getelementptr inbounds i64, i64* %118, i64 0
%120 = load i64, i64* %119
%121 = xor i64 %116, %120
%122 = load i8*, i8** %10
%123 = bitcast i8* %122 to i64*
%124 = getelementptr inbounds i64, i64* %123, i64 0
store i64 %121, i64* %124
%125 = load i8*, i8** %10
%126 = bitcast i8* %125 to i64*
%127 = getelementptr inbounds i64, i64* %126, i64 1
%128 = load i64, i64* %127
%129 = getelementptr inbounds [16 x i8], [16 x i8]* %13, i64 0, i64 0
%130 = bitcast i8* %129 to i64*
%131 = getelementptr inbounds i64, i64* %130, i64 1
%132 = load i64, i64* %131
%133 = xor i64 %128, %132
%134 = load i8*, i8** %10
%135 = bitcast i8* %134 to i64*
%136 = getelementptr inbounds i64, i64* %135, i64 1
store i64 %133, i64* %136
%137 = load i8*, i8** %10
%138 = getelementptr inbounds i8, i8* %137, i64 64
%139 = bitcast i8* %138 to i64*
%140 = getelementptr inbounds i64, i64* %139, i64 0
%141 = load i64, i64* %140
%142 = getelementptr inbounds [16 x i8], [16 x i8]* %13, i64 0, i64 0
%143 = bitcast i8* %142 to i64*
%144 = getelementptr inbounds i64, i64* %143, i64 0
%145 = load i64, i64* %144
%146 = xor i64 %141, %145
%147 = load i8*, i8** %10
%148 = getelementptr inbounds i8, i8* %147, i64 64
%149 = bitcast i8* %148 to i64*
%150 = getelementptr inbounds i64, i64* %149, i64 0
store i64 %146, i64* %150
%151 = load i8*, i8** %10
%152 = getelementptr inbounds i8, i8* %151, i64 64
%153 = bitcast i8* %152 to i64*
%154 = getelementptr inbounds i64, i64* %153, i64 1
%155 = load i64, i64* %154
%156 = getelementptr inbounds [16 x i8], [16 x i8]* %13, i64 0, i64 0
%157 = bitcast i8* %156 to i64*
%158 = getelementptr inbounds i64, i64* %157, i64 1
%159 = load i64, i64* %158
%160 = xor i64 %155, %159
%161 = load i8*, i8** %10
%162 = getelementptr inbounds i8, i8* %161, i64 64
%163 = bitcast i8* %162 to i64*
%164 = getelementptr inbounds i64, i64* %163, i64 1
store i64 %160, i64* %164
br label %165
165: ; preds = %53
%166 = load i32, i32* %11
%167 = add nsw i32 %166, 1
store i32 %167, i32* %11
br label %50
168: ; preds = %50
%169 = load i8*, i8** %10
%170 = getelementptr inbounds i8, i8* %169, i64 96
%171 = bitcast i8* %170 to i64*
%172 = getelementptr inbounds i64, i64* %171, i64 0
%173 = load i64, i64* %172
%174 = load i8*, i8** %10
%175 = getelementptr inbounds i8, i8* %174, i64 80
%176 = bitcast i8* %175 to i64*
%177 = getelementptr inbounds i64, i64* %176, i64 0
%178 = load i64, i64* %177
%179 = xor i64 %173, %178
%180 = load i8*, i8** %10
%181 = getelementptr inbounds i8, i8* %180, i64 96
%182 = bitcast i8* %181 to i64*
%183 = getelementptr inbounds i64, i64* %182, i64 0
store i64 %179, i64* %183
%184 = load i8*, i8** %10
%185 = getelementptr inbounds i8, i8* %184, i64 96
%186 = bitcast i8* %185 to i64*
%187 = getelementptr inbounds i64, i64* %186, i64 1
%188 = load i64, i64* %187
%189 = load i8*, i8** %10
%190 = getelementptr inbounds i8, i8* %189, i64 80
%191 = bitcast i8* %190 to i64*
%192 = getelementptr inbounds i64, i64* %191, i64 1
%193 = load i64, i64* %192
%194 = xor i64 %188, %193
%195 = load i8*, i8** %10
%196 = getelementptr inbounds i8, i8* %195, i64 96
%197 = bitcast i8* %196 to i64*
%198 = getelementptr inbounds i64, i64* %197, i64 1
store i64 %194, i64* %198
%199 = load i8*, i8** %10
%200 = getelementptr inbounds i8, i8* %199, i64 96
%201 = bitcast i8* %200 to i64*
%202 = getelementptr inbounds i64, i64* %201, i64 0
%203 = load i64, i64* %202
%204 = load i8*, i8** %10
%205 = getelementptr inbounds i8, i8* %204, i64 64
%206 = bitcast i8* %205 to i64*
%207 = getelementptr inbounds i64, i64* %206, i64 0
%208 = load i64, i64* %207
%209 = xor i64 %203, %208
%210 = load i8*, i8** %10
%211 = getelementptr inbounds i8, i8* %210, i64 96
%212 = bitcast i8* %211 to i64*
%213 = getelementptr inbounds i64, i64* %212, i64 0
store i64 %209, i64* %213
%214 = load i8*, i8** %10
%215 = getelementptr inbounds i8, i8* %214, i64 96
%216 = bitcast i8* %215 to i64*
%217 = getelementptr inbounds i64, i64* %216, i64 1
%218 = load i64, i64* %217
%219 = load i8*, i8** %10
%220 = getelementptr inbounds i8, i8* %219, i64 64
%221 = bitcast i8* %220 to i64*
%222 = getelementptr inbounds i64, i64* %221, i64 1
%223 = load i64, i64* %222
%224 = xor i64 %218, %223
%225 = load i8*, i8** %10
%226 = getelementptr inbounds i8, i8* %225, i64 96
%227 = bitcast i8* %226 to i64*
%228 = getelementptr inbounds i64, i64* %227, i64 1
store i64 %224, i64* %228
%229 = load i8*, i8** %10
%230 = getelementptr inbounds i8, i8* %229, i64 96
%231 = bitcast i8* %230 to i64*
%232 = getelementptr inbounds i64, i64* %231, i64 0
%233 = load i64, i64* %232
%234 = load i8*, i8** %10
%235 = getelementptr inbounds i8, i8* %234, i64 48
%236 = bitcast i8* %235 to i64*
%237 = getelementptr inbounds i64, i64* %236, i64 0
%238 = load i64, i64* %237
%239 = xor i64 %233, %238
%240 = load i8*, i8** %10
%241 = getelementptr inbounds i8, i8* %240, i64 96
%242 = bitcast i8* %241 to i64*
%243 = getelementptr inbounds i64, i64* %242, i64 0
store i64 %239, i64* %243
%244 = load i8*, i8** %10
%245 = getelementptr inbounds i8, i8* %244, i64 96
%246 = bitcast i8* %245 to i64*
%247 = getelementptr inbounds i64, i64* %246, i64 1
%248 = load i64, i64* %247
%249 = load i8*, i8** %10
%250 = getelementptr inbounds i8, i8* %249, i64 48
%251 = bitcast i8* %250 to i64*
%252 = getelementptr inbounds i64, i64* %251, i64 1
%253 = load i64, i64* %252
%254 = xor i64 %248, %253
%255 = load i8*, i8** %10
%256 = getelementptr inbounds i8, i8* %255, i64 96
%257 = bitcast i8* %256 to i64*
%258 = getelementptr inbounds i64, i64* %257, i64 1
store i64 %254, i64* %258
%259 = load i8*, i8** %10
%260 = getelementptr inbounds i8, i8* %259, i64 96
%261 = bitcast i8* %260 to i64*
%262 = getelementptr inbounds i64, i64* %261, i64 0
%263 = load i64, i64* %262
%264 = load i8*, i8** %10
%265 = getelementptr inbounds i8, i8* %264, i64 32
%266 = bitcast i8* %265 to i64*
%267 = getelementptr inbounds i64, i64* %266, i64 0
%268 = load i64, i64* %267
%269 = xor i64 %263, %268
%270 = load i8*, i8** %10
%271 = getelementptr inbounds i8, i8* %270, i64 96
%272 = bitcast i8* %271 to i64*
%273 = getelementptr inbounds i64, i64* %272, i64 0
store i64 %269, i64* %273
%274 = load i8*, i8** %10
%275 = getelementptr inbounds i8, i8* %274, i64 96
%276 = bitcast i8* %275 to i64*
%277 = getelementptr inbounds i64, i64* %276, i64 1
%278 = load i64, i64* %277
%279 = load i8*, i8** %10
%280 = getelementptr inbounds i8, i8* %279, i64 32
%281 = bitcast i8* %280 to i64*
%282 = getelementptr inbounds i64, i64* %281, i64 1
%283 = load i64, i64* %282
%284 = xor i64 %278, %283
%285 = load i8*, i8** %10
%286 = getelementptr inbounds i8, i8* %285, i64 96
%287 = bitcast i8* %286 to i64*
%288 = getelementptr inbounds i64, i64* %287, i64 1
store i64 %284, i64* %288
%289 = load i8*, i8** %10
%290 = getelementptr inbounds i8, i8* %289, i64 96
%291 = bitcast i8* %290 to i64*
%292 = getelementptr inbounds i64, i64* %291, i64 0
%293 = load i64, i64* %292
%294 = load i8*, i8** %10
%295 = getelementptr inbounds i8, i8* %294, i64 16
%296 = bitcast i8* %295 to i64*
%297 = getelementptr inbounds i64, i64* %296, i64 0
%298 = load i64, i64* %297
%299 = xor i64 %293, %298
%300 = load i8*, i8** %10
%301 = getelementptr inbounds i8, i8* %300, i64 96
%302 = bitcast i8* %301 to i64*
%303 = getelementptr inbounds i64, i64* %302, i64 0
store i64 %299, i64* %303
%304 = load i8*, i8** %10
%305 = getelementptr inbounds i8, i8* %304, i64 96
%306 = bitcast i8* %305 to i64*
%307 = getelementptr inbounds i64, i64* %306, i64 1
%308 = load i64, i64* %307
%309 = load i8*, i8** %10
%310 = getelementptr inbounds i8, i8* %309, i64 16
%311 = bitcast i8* %310 to i64*
%312 = getelementptr inbounds i64, i64* %311, i64 1
%313 = load i64, i64* %312
%314 = xor i64 %308, %313
%315 = load i8*, i8** %10
%316 = getelementptr inbounds i8, i8* %315, i64 96
%317 = bitcast i8* %316 to i64*
%318 = getelementptr inbounds i64, i64* %317, i64 1
store i64 %314, i64* %318
%319 = load i8*, i8** %10
%320 = getelementptr inbounds i8, i8* %319, i64 96
%321 = bitcast i8* %320 to i64*
%322 = getelementptr inbounds i64, i64* %321, i64 0
%323 = load i64, i64* %322
%324 = load i8*, i8** %10
%325 = getelementptr inbounds i8, i8* %324, i64 0
%326 = bitcast i8* %325 to i64*
%327 = getelementptr inbounds i64, i64* %326, i64 0
%328 = load i64, i64* %327
%329 = xor i64 %323, %328
%330 = load i8*, i8** %10
%331 = getelementptr inbounds i8, i8* %330, i64 96
%332 = bitcast i8* %331 to i64*
%333 = getelementptr inbounds i64, i64* %332, i64 0
store i64 %329, i64* %333
%334 = load i8*, i8** %10
%335 = getelementptr inbounds i8, i8* %334, i64 96
%336 = bitcast i8* %335 to i64*
%337 = getelementptr inbounds i64, i64* %336, i64 1
%338 = load i64, i64* %337
%339 = load i8*, i8** %10
%340 = getelementptr inbounds i8, i8* %339, i64 0
%341 = bitcast i8* %340 to i64*
%342 = getelementptr inbounds i64, i64* %341, i64 1
%343 = load i64, i64* %342
%344 = xor i64 %338, %343
%345 = load i8*, i8** %10
%346 = getelementptr inbounds i8, i8* %345, i64 96
%347 = bitcast i8* %346 to i64*
%348 = getelementptr inbounds i64, i64* %347, i64 1
store i64 %344, i64* %348
%349 = load i8*, i8** %9
%350 = load i8*, i8** %10
%351 = getelementptr inbounds i8, i8* %350, i64 96
%352 = load i8, i8* %8
%353 = call i32 @memcpy(i8* %349, i8* %351, i8 zeroext %352)
ret void
}

LLVM IR (-O2):
define void @aegis128L_tag_generation(i64 %0, i64 %1, i8 zeroext %2, i8* %3, i8* %4) {
%6 = alloca [16 x i8]
%7 = getelementptr inbounds [16 x i8], [16 x i8]* %6, i64 0, i64 0
%8 = insertelement <2 x i64> poison, i64 %1, i64 0
%9 = insertelement <2 x i64> %8, i64 %0, i64 1
%10 = shl <2 x i64> %9, <i64 3, i64 3>
%11 = getelementptr inbounds i8, i8* %4, i64 32
%12 = bitcast i8* %11 to <2 x i64>*
%13 = load <2 x i64>, <2 x i64>* %12
%14 = xor <2 x i64> %13, %10
%15 = getelementptr inbounds i8, i8* %4, i64 112
%16 = getelementptr inbounds i8, i8* %4, i64 96
%17 = getelementptr inbounds i8, i8* %4, i64 80
%18 = getelementptr inbounds i8, i8* %4, i64 64
%19 = getelementptr inbounds i8, i8* %4, i64 48
%20 = getelementptr inbounds i8, i8* %4, i64 16
%21 = bitcast i8* %4 to <2 x i64>*
%22 = bitcast i8* %4 to <2 x i64>*
%23 = bitcast i8* %18 to <2 x i64>*
%24 = bitcast i8* %18 to <2 x i64>*
br label %25
25: ; preds = %5, %25
%26 = phi i32 [ 0, %5 ], [ %40, %25 ]
%27 = call i32 @memcpy(i8* %7, i8* %15, i8 zeroext 16)
%28 = call i32 @AESROUND(i8* %15, i8* %16, i8* %15)
%29 = call i32 @AESROUND(i8* %16, i8* %17, i8* %16)
%30 = call i32 @AESROUND(i8* %17, i8* %18, i8* %17)
%31 = call i32 @AESROUND(i8* %18, i8* %19, i8* %18)
%32 = call i32 @AESROUND(i8* %19, i8* %11, i8* %19)
%33 = call i32 @AESROUND(i8* %11, i8* %20, i8* %11)
%34 = call i32 @AESROUND(i8* %20, i8* %4, i8* %20)
%35 = call i32 @AESROUND(i8* %4, i8* %7, i8* %4)
%36 = load <2 x i64>, <2 x i64>* %21
%37 = xor <2 x i64> %36, %14
store <2 x i64> %37, <2 x i64>* %22
%38 = load <2 x i64>, <2 x i64>* %23
%39 = xor <2 x i64> %38, %14
store <2 x i64> %39, <2 x i64>* %24
%40 = add nuw nsw i32 %26, 1
%41 = icmp eq i32 %40, 7
br i1 %41, label %42, label %25
42: ; preds = %25
%43 = bitcast i8* %16 to <2 x i64>*
%44 = load <2 x i64>, <2 x i64>* %43
%45 = bitcast i8* %17 to <2 x i64>*
%46 = load <2 x i64>, <2 x i64>* %45
%47 = xor <2 x i64> %46, %44
%48 = xor <2 x i64> %39, %47
%49 = bitcast i8* %19 to <2 x i64>*
%50 = load <2 x i64>, <2 x i64>* %49
%51 = xor <2 x i64> %50, %48
%52 = bitcast i8* %11 to <2 x i64>*
%53 = load <2 x i64>, <2 x i64>* %52
%54 = xor <2 x i64> %53, %51
%55 = bitcast i8* %20 to <2 x i64>*
%56 = load <2 x i64>, <2 x i64>* %55
%57 = xor <2 x i64> %56, %54
%58 = xor <2 x i64> %37, %57
%59 = bitcast i8* %16 to <2 x i64>*
store <2 x i64> %58, <2 x i64>* %59
%60 = call i32 @memcpy(i8* %3, i8* %16, i8 zeroext %2)
ret void
}