#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 */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ aesTweakDecrypt(int, int *, int *, int *);
int /*<<< orphan*/ aesTweakEncrypt(int, int *, int *, int *);
int /*<<< orphan*/ memcpy(int *, int *, int const);
int /*<<< orphan*/ mix(int *, int *, int const, int *, int *);
int /*<<< orphan*/ set_block_number_in_tweak(int *, int const);
int /*<<< orphan*/ set_stage_in_tweak(int *, int);
int /*<<< orphan*/ set_tweak_in_tweakey(int *, int *);
void XLS(const uint8_t isDirect, uint8_t message[], const uint32_t s,
         uint8_t *tweakey, uint8_t *tweak, const uint32_t l, uint8_t *cipher) {
  uint8_t M1[8];
  uint8_t M2[8];
  uint8_t X1[8];
  uint8_t X1ns[8];
  uint8_t X1s[8];
  uint8_t Xp1ns[8];
  uint8_t Xp1s[8];
  uint8_t X2[8];
  uint8_t Xp1[8];
  uint8_t Y1[8];
  uint8_t Y1ns[8];
  uint8_t Y1s[8];
  uint8_t Yp1ns[8];
  uint8_t Yp1s[8];
  uint8_t Yp1[8];
  uint8_t C1[8];
  uint8_t C2[8];
  memcpy(M1, message, 8);
  memcpy(M2, message + 8, s);
  set_stage_in_tweak(tweak, (0x8 << 4));
  set_block_number_in_tweak(tweak, l);
  set_tweak_in_tweakey(tweakey, tweak);
  if (isDirect)
    aesTweakEncrypt(192, M1, tweakey, X1);
  else
    aesTweakDecrypt(192, M1, tweakey, X1);
  memcpy(X1ns, X1, 8 - s);
  memcpy(X1s, X1 + 8 - s, s);
  memcpy(Xp1ns, X1ns, 8 - s);
  Xp1ns[8 - s - 1] ^= 1;
  mix(X1s, M2, s, Xp1s, X2);
  memcpy(Xp1, Xp1ns, 8 - s);
  memcpy(Xp1 + 8 - s, Xp1s, s);
  set_stage_in_tweak(tweak, (0x9 << 4));
  set_tweak_in_tweakey(tweakey, tweak);
  if (isDirect)
    aesTweakEncrypt(192, Xp1, tweakey, Y1);
  else
    aesTweakDecrypt(192, Xp1, tweakey, Y1);
  memcpy(Y1ns, Y1, 8 - s);
  memcpy(Y1s, Y1 + 8 - s, s);
  memcpy(Yp1ns, Y1ns, 8 - s);
  Yp1ns[8 - s - 1] ^= 1;
  mix(Y1s, X2, s, Yp1s, C2);
  memcpy(Yp1, Yp1ns, 8 - s);
  memcpy(Yp1 + 8 - s, Yp1s, s);
  set_stage_in_tweak(tweak, (0x8 << 4));
  set_tweak_in_tweakey(tweakey, tweak);
  if (isDirect)
    aesTweakEncrypt(192, Yp1, tweakey, C1);
  else
    aesTweakDecrypt(192, Yp1, tweakey, C1);
  memcpy(cipher, C1, 8);
  memcpy(cipher + 8, C2, s);
}


x86 assembly (clang, -O0):
<XLS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x250,%rsp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x8,%edx
call   1070 <memcpy@plt>
lea    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x20,%rsi
mov    -0x14(%rbp),%edx
call   1070 <memcpy@plt>
mov    -0x28(%rbp),%rdi
mov    $0x80,%esi
call   1040 <set_stage_in_tweak@plt>
mov    -0x28(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   1090 <set_block_number_in_tweak@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1080 <set_tweak_in_tweakey@plt>
cmpl   $0x0,-0x4(%rbp)
je     120a <XLS+0x9a>
lea    -0x50(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x90(%rbp),%rcx
mov    $0xc0,%edi
call   1060 <aesTweakEncrypt@plt>
jmp    1223 <XLS+0xb3>
lea    -0x50(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x90(%rbp),%rcx
mov    $0xc0,%edi
call   1030 <aesTweakDecrypt@plt>
lea    -0xb0(%rbp),%rdi
lea    -0x90(%rbp),%rsi
mov    $0x8,%edx
sub    -0x14(%rbp),%edx
call   1070 <memcpy@plt>
lea    -0xd0(%rbp),%rdi
lea    -0x90(%rbp),%rsi
add    $0x20,%rsi
movslq -0x14(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x14(%rbp),%edx
call   1070 <memcpy@plt>
lea    -0xf0(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
mov    $0x8,%edx
sub    -0x14(%rbp),%edx
call   1070 <memcpy@plt>
mov    $0x8,%eax
sub    -0x14(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0xf0(%rbp,%rax,4),%ecx
xor    $0x1,%ecx
mov    %ecx,-0xf0(%rbp,%rax,4)
lea    -0xd0(%rbp),%rdi
lea    -0x70(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    -0x110(%rbp),%rcx
lea    -0x130(%rbp),%r8
call   1050 <mix@plt>
lea    -0x150(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
mov    $0x8,%edx
sub    -0x14(%rbp),%edx
call   1070 <memcpy@plt>
lea    -0x150(%rbp),%rdi
add    $0x20,%rdi
movslq -0x14(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
shl    $0x2,%rax
add    %rax,%rdi
lea    -0x110(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1070 <memcpy@plt>
mov    -0x28(%rbp),%rdi
mov    $0x90,%esi
call   1040 <set_stage_in_tweak@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1080 <set_tweak_in_tweakey@plt>
cmpl   $0x0,-0x4(%rbp)
je     134d <XLS+0x1dd>
lea    -0x150(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x170(%rbp),%rcx
mov    $0xc0,%edi
call   1060 <aesTweakEncrypt@plt>
jmp    1369 <XLS+0x1f9>
lea    -0x150(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x170(%rbp),%rcx
mov    $0xc0,%edi
call   1030 <aesTweakDecrypt@plt>
lea    -0x190(%rbp),%rdi
lea    -0x170(%rbp),%rsi
mov    $0x8,%edx
sub    -0x14(%rbp),%edx
call   1070 <memcpy@plt>
lea    -0x1b0(%rbp),%rdi
lea    -0x170(%rbp),%rsi
add    $0x20,%rsi
movslq -0x14(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x14(%rbp),%edx
call   1070 <memcpy@plt>
lea    -0x1d0(%rbp),%rdi
lea    -0x190(%rbp),%rsi
mov    $0x8,%edx
sub    -0x14(%rbp),%edx
call   1070 <memcpy@plt>
mov    $0x8,%eax
sub    -0x14(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x1d0(%rbp,%rax,4),%ecx
xor    $0x1,%ecx
mov    %ecx,-0x1d0(%rbp,%rax,4)
lea    -0x1b0(%rbp),%rdi
lea    -0x130(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    -0x1f0(%rbp),%rcx
lea    -0x250(%rbp),%r8
call   1050 <mix@plt>
lea    -0x210(%rbp),%rdi
lea    -0x1d0(%rbp),%rsi
mov    $0x8,%edx
sub    -0x14(%rbp),%edx
call   1070 <memcpy@plt>
lea    -0x210(%rbp),%rdi
add    $0x20,%rdi
movslq -0x14(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
shl    $0x2,%rax
add    %rax,%rdi
lea    -0x1f0(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1070 <memcpy@plt>
mov    -0x28(%rbp),%rdi
mov    $0x80,%esi
call   1040 <set_stage_in_tweak@plt>
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1080 <set_tweak_in_tweakey@plt>
cmpl   $0x0,-0x4(%rbp)
je     1496 <XLS+0x326>
lea    -0x210(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x230(%rbp),%rcx
mov    $0xc0,%edi
call   1060 <aesTweakEncrypt@plt>
jmp    14b2 <XLS+0x342>
lea    -0x210(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x230(%rbp),%rcx
mov    $0xc0,%edi
call   1030 <aesTweakDecrypt@plt>
mov    0x10(%rbp),%rdi
lea    -0x230(%rbp),%rsi
mov    $0x8,%edx
call   1070 <memcpy@plt>
mov    0x10(%rbp),%rdi
add    $0x20,%rdi
lea    -0x250(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1070 <memcpy@plt>
add    $0x250,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XLS>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x258,%rsp
mov    %r9d,%r13d
mov    %r8,%rbx
mov    %rcx,%r14
mov    %edx,%r15d
mov    %rsi,%rbp
mov    %edi,%r12d
lea    0x110(%rsp),%rdi
mov    $0x8,%edx
call   1070 <memcpy@plt>
add    $0x20,%rbp
lea    0x170(%rsp),%rdi
mov    %rbp,%rsi
mov    %r15d,%edx
call   1070 <memcpy@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
call   1040 <set_stage_in_tweak@plt>
mov    %rbx,%rdi
mov    %r13d,%esi
call   1090 <set_block_number_in_tweak@plt>
mov    %r14,%rdi
mov    %rbx,0x10(%rsp)
mov    %rbx,%rsi
call   1080 <set_tweak_in_tweakey@plt>
mov    %r12d,0xc(%rsp)
test   %r12d,%r12d
mov    %r14,0x18(%rsp)
lea    0x110(%rsp),%rsi
lea    0xf0(%rsp),%rcx
mov    $0xc0,%edi
mov    %r14,%rdx
je     1212 <XLS+0xa2>
call   1060 <aesTweakEncrypt@plt>
jmp    1217 <XLS+0xa7>
call   1030 <aesTweakDecrypt@plt>
mov    $0x8,%r14d
sub    %r15d,%r14d
lea    0x230(%rsp),%rbp
lea    0xf0(%rsp),%r12
mov    %rbp,%rdi
mov    %r12,%rsi
mov    %r14d,%edx
call   1070 <memcpy@plt>
movslq %r15d,%rax
lea    0x0(,%rax,4),%r13
sub    %r13,%r12
neg    %rax
mov    %rax,0x28(%rsp)
add    $0x20,%r12
lea    0x210(%rsp),%rbx
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15d,%edx
call   1070 <memcpy@plt>
lea    0xd0(%rsp),%rdi
mov    %rbp,%rsi
mov    %r14d,%edx
call   1070 <memcpy@plt>
mov    $0x7,%eax
sub    %r15d,%eax
cltq
mov    %rax,0x20(%rsp)
xorb   $0x1,0xd0(%rsp,%rax,4)
01
lea    0x170(%rsp),%rsi
lea    0x1f0(%rsp),%r12
lea    0x150(%rsp),%r8
mov    %rbx,%rdi
mov    %r15d,%edx
mov    %r12,%rcx
call   1050 <mix@plt>
lea    0xb0(%rsp),%rbx
mov    %rbx,%rdi
lea    0xd0(%rsp),%rsi
mov    %r14d,%edx
call   1070 <memcpy@plt>
sub    %r13,%rbx
add    $0x20,%rbx
mov    %rbx,%rdi
mov    %r12,%rsi
mov    %r15d,%edx
call   1070 <memcpy@plt>
mov    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x90,%esi
call   1040 <set_stage_in_tweak@plt>
mov    0x18(%rsp),%rbx
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1080 <set_tweak_in_tweakey@plt>
cmpl   $0x0,0xc(%rsp)
je     1333 <XLS+0x1c3>
lea    0xb0(%rsp),%rsi
lea    0x50(%rsp),%rcx
mov    $0xc0,%edi
mov    %rbx,%rdx
call   1060 <aesTweakEncrypt@plt>
jmp    134d <XLS+0x1dd>
lea    0xb0(%rsp),%rsi
lea    0x50(%rsp),%rcx
mov    $0xc0,%edi
mov    %rbx,%rdx
call   1030 <aesTweakDecrypt@plt>
mov    0x290(%rsp),%r13
lea    0x1d0(%rsp),%rbx
lea    0x50(%rsp),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
call   1070 <memcpy@plt>
mov    0x28(%rsp),%rbp
lea    (%rsp,%rbp,4),%rsi
add    $0x70,%rsi
lea    0x1b0(%rsp),%r12
mov    %r12,%rdi
mov    %r15d,%edx
call   1070 <memcpy@plt>
lea    0x90(%rsp),%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1070 <memcpy@plt>
mov    0x20(%rsp),%rax
xorb   $0x1,0x90(%rsp,%rax,4)
01
lea    0x150(%rsp),%rsi
lea    0x190(%rsp),%rbx
lea    0x130(%rsp),%r8
mov    %r12,%rdi
mov    %r15d,%edx
mov    %rbx,%rcx
call   1050 <mix@plt>
lea    0x30(%rsp),%rdi
lea    0x90(%rsp),%rsi
mov    %r14d,%edx
call   1070 <memcpy@plt>
lea    (%rsp,%rbp,4),%rdi
add    $0x50,%rdi
mov    %rbx,%rsi
mov    %r15d,%edx
call   1070 <memcpy@plt>
mov    0x10(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x80,%esi
call   1040 <set_stage_in_tweak@plt>
mov    0x18(%rsp),%rbx
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1080 <set_tweak_in_tweakey@plt>
cmpl   $0x0,0xc(%rsp)
je     143d <XLS+0x2cd>
lea    0x30(%rsp),%rsi
lea    0x70(%rsp),%rcx
mov    $0xc0,%edi
mov    %rbx,%rdx
call   1060 <aesTweakEncrypt@plt>
jmp    1454 <XLS+0x2e4>
lea    0x30(%rsp),%rsi
lea    0x70(%rsp),%rcx
mov    $0xc0,%edi
mov    %rbx,%rdx
call   1030 <aesTweakDecrypt@plt>
lea    0x70(%rsp),%rsi
mov    %r13,%rdi
mov    $0x8,%edx
call   1070 <memcpy@plt>
add    $0x20,%r13
lea    0x130(%rsp),%rsi
mov    %r13,%rdi
mov    %r15d,%edx
call   1070 <memcpy@plt>
add    $0x258,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @XLS(i32 %0, i32* %1, i32 %2, i32* %3, i32* %4, i32 %5, i32* %6) {
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32*
%15 = alloca [8 x i32]
%16 = alloca [8 x i32]
%17 = alloca [8 x i32]
%18 = alloca [8 x i32]
%19 = alloca [8 x i32]
%20 = alloca [8 x i32]
%21 = alloca [8 x i32]
%22 = alloca [8 x i32]
%23 = alloca [8 x i32]
%24 = alloca [8 x i32]
%25 = alloca [8 x i32]
%26 = alloca [8 x i32]
%27 = alloca [8 x i32]
%28 = alloca [8 x i32]
%29 = alloca [8 x i32]
%30 = alloca [8 x i32]
%31 = alloca [8 x i32]
store i32 %0, i32* %8
store i32* %1, i32** %9
store i32 %2, i32* %10
store i32* %3, i32** %11
store i32* %4, i32** %12
store i32 %5, i32* %13
store i32* %6, i32** %14
%32 = getelementptr inbounds [8 x i32], [8 x i32]* %15, i64 0, i64 0
%33 = load i32*, i32** %9
%34 = call i32 @memcpy(i32* %32, i32* %33, i32 8)
%35 = getelementptr inbounds [8 x i32], [8 x i32]* %16, i64 0, i64 0
%36 = load i32*, i32** %9
%37 = getelementptr inbounds i32, i32* %36, i64 8
%38 = load i32, i32* %10
%39 = call i32 @memcpy(i32* %35, i32* %37, i32 %38)
%40 = load i32*, i32** %12
%41 = call i32 @set_stage_in_tweak(i32* %40, i32 128)
%42 = load i32*, i32** %12
%43 = load i32, i32* %13
%44 = call i32 @set_block_number_in_tweak(i32* %42, i32 %43)
%45 = load i32*, i32** %11
%46 = load i32*, i32** %12
%47 = call i32 @set_tweak_in_tweakey(i32* %45, i32* %46)
%48 = load i32, i32* %8
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %55
50: ; preds = %7
%51 = getelementptr inbounds [8 x i32], [8 x i32]* %15, i64 0, i64 0
%52 = load i32*, i32** %11
%53 = getelementptr inbounds [8 x i32], [8 x i32]* %17, i64 0, i64 0
%54 = call i32 @aesTweakEncrypt(i32 192, i32* %51, i32* %52, i32* %53)
br label %60
55: ; preds = %7
%56 = getelementptr inbounds [8 x i32], [8 x i32]* %15, i64 0, i64 0
%57 = load i32*, i32** %11
%58 = getelementptr inbounds [8 x i32], [8 x i32]* %17, i64 0, i64 0
%59 = call i32 @aesTweakDecrypt(i32 192, i32* %56, i32* %57, i32* %58)
br label %60
60: ; preds = %55, %50
%61 = getelementptr inbounds [8 x i32], [8 x i32]* %18, i64 0, i64 0
%62 = getelementptr inbounds [8 x i32], [8 x i32]* %17, i64 0, i64 0
%63 = load i32, i32* %10
%64 = sub nsw i32 8, %63
%65 = call i32 @memcpy(i32* %61, i32* %62, i32 %64)
%66 = getelementptr inbounds [8 x i32], [8 x i32]* %19, i64 0, i64 0
%67 = getelementptr inbounds [8 x i32], [8 x i32]* %17, i64 0, i64 0
%68 = getelementptr inbounds i32, i32* %67, i64 8
%69 = load i32, i32* %10
%70 = sext i32 %69 to i64
%71 = sub i64 0, %70
%72 = getelementptr inbounds i32, i32* %68, i64 %71
%73 = load i32, i32* %10
%74 = call i32 @memcpy(i32* %66, i32* %72, i32 %73)
%75 = getelementptr inbounds [8 x i32], [8 x i32]* %20, i64 0, i64 0
%76 = getelementptr inbounds [8 x i32], [8 x i32]* %18, i64 0, i64 0
%77 = load i32, i32* %10
%78 = sub nsw i32 8, %77
%79 = call i32 @memcpy(i32* %75, i32* %76, i32 %78)
%80 = load i32, i32* %10
%81 = sub nsw i32 8, %80
%82 = sub nsw i32 %81, 1
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds [8 x i32], [8 x i32]* %20, i64 0, i64 %83
%85 = load i32, i32* %84
%86 = xor i32 %85, 1
store i32 %86, i32* %84
%87 = getelementptr inbounds [8 x i32], [8 x i32]* %19, i64 0, i64 0
%88 = getelementptr inbounds [8 x i32], [8 x i32]* %16, i64 0, i64 0
%89 = load i32, i32* %10
%90 = getelementptr inbounds [8 x i32], [8 x i32]* %21, i64 0, i64 0
%91 = getelementptr inbounds [8 x i32], [8 x i32]* %22, i64 0, i64 0
%92 = call i32 @mix(i32* %87, i32* %88, i32 %89, i32* %90, i32* %91)
%93 = getelementptr inbounds [8 x i32], [8 x i32]* %23, i64 0, i64 0
%94 = getelementptr inbounds [8 x i32], [8 x i32]* %20, i64 0, i64 0
%95 = load i32, i32* %10
%96 = sub nsw i32 8, %95
%97 = call i32 @memcpy(i32* %93, i32* %94, i32 %96)
%98 = getelementptr inbounds [8 x i32], [8 x i32]* %23, i64 0, i64 0
%99 = getelementptr inbounds i32, i32* %98, i64 8
%100 = load i32, i32* %10
%101 = sext i32 %100 to i64
%102 = sub i64 0, %101
%103 = getelementptr inbounds i32, i32* %99, i64 %102
%104 = getelementptr inbounds [8 x i32], [8 x i32]* %21, i64 0, i64 0
%105 = load i32, i32* %10
%106 = call i32 @memcpy(i32* %103, i32* %104, i32 %105)
%107 = load i32*, i32** %12
%108 = call i32 @set_stage_in_tweak(i32* %107, i32 144)
%109 = load i32*, i32** %11
%110 = load i32*, i32** %12
%111 = call i32 @set_tweak_in_tweakey(i32* %109, i32* %110)
%112 = load i32, i32* %8
%113 = icmp ne i32 %112, 0
br i1 %113, label %114, label %119
114: ; preds = %60
%115 = getelementptr inbounds [8 x i32], [8 x i32]* %23, i64 0, i64 0
%116 = load i32*, i32** %11
%117 = getelementptr inbounds [8 x i32], [8 x i32]* %24, i64 0, i64 0
%118 = call i32 @aesTweakEncrypt(i32 192, i32* %115, i32* %116, i32* %117)
br label %124
119: ; preds = %60
%120 = getelementptr inbounds [8 x i32], [8 x i32]* %23, i64 0, i64 0
%121 = load i32*, i32** %11
%122 = getelementptr inbounds [8 x i32], [8 x i32]* %24, i64 0, i64 0
%123 = call i32 @aesTweakDecrypt(i32 192, i32* %120, i32* %121, i32* %122)
br label %124
124: ; preds = %119, %114
%125 = getelementptr inbounds [8 x i32], [8 x i32]* %25, i64 0, i64 0
%126 = getelementptr inbounds [8 x i32], [8 x i32]* %24, i64 0, i64 0
%127 = load i32, i32* %10
%128 = sub nsw i32 8, %127
%129 = call i32 @memcpy(i32* %125, i32* %126, i32 %128)
%130 = getelementptr inbounds [8 x i32], [8 x i32]* %26, i64 0, i64 0
%131 = getelementptr inbounds [8 x i32], [8 x i32]* %24, i64 0, i64 0
%132 = getelementptr inbounds i32, i32* %131, i64 8
%133 = load i32, i32* %10
%134 = sext i32 %133 to i64
%135 = sub i64 0, %134
%136 = getelementptr inbounds i32, i32* %132, i64 %135
%137 = load i32, i32* %10
%138 = call i32 @memcpy(i32* %130, i32* %136, i32 %137)
%139 = getelementptr inbounds [8 x i32], [8 x i32]* %27, i64 0, i64 0
%140 = getelementptr inbounds [8 x i32], [8 x i32]* %25, i64 0, i64 0
%141 = load i32, i32* %10
%142 = sub nsw i32 8, %141
%143 = call i32 @memcpy(i32* %139, i32* %140, i32 %142)
%144 = load i32, i32* %10
%145 = sub nsw i32 8, %144
%146 = sub nsw i32 %145, 1
%147 = sext i32 %146 to i64
%148 = getelementptr inbounds [8 x i32], [8 x i32]* %27, i64 0, i64 %147
%149 = load i32, i32* %148
%150 = xor i32 %149, 1
store i32 %150, i32* %148
%151 = getelementptr inbounds [8 x i32], [8 x i32]* %26, i64 0, i64 0
%152 = getelementptr inbounds [8 x i32], [8 x i32]* %22, i64 0, i64 0
%153 = load i32, i32* %10
%154 = getelementptr inbounds [8 x i32], [8 x i32]* %28, i64 0, i64 0
%155 = getelementptr inbounds [8 x i32], [8 x i32]* %31, i64 0, i64 0
%156 = call i32 @mix(i32* %151, i32* %152, i32 %153, i32* %154, i32* %155)
%157 = getelementptr inbounds [8 x i32], [8 x i32]* %29, i64 0, i64 0
%158 = getelementptr inbounds [8 x i32], [8 x i32]* %27, i64 0, i64 0
%159 = load i32, i32* %10
%160 = sub nsw i32 8, %159
%161 = call i32 @memcpy(i32* %157, i32* %158, i32 %160)
%162 = getelementptr inbounds [8 x i32], [8 x i32]* %29, i64 0, i64 0
%163 = getelementptr inbounds i32, i32* %162, i64 8
%164 = load i32, i32* %10
%165 = sext i32 %164 to i64
%166 = sub i64 0, %165
%167 = getelementptr inbounds i32, i32* %163, i64 %166
%168 = getelementptr inbounds [8 x i32], [8 x i32]* %28, i64 0, i64 0
%169 = load i32, i32* %10
%170 = call i32 @memcpy(i32* %167, i32* %168, i32 %169)
%171 = load i32*, i32** %12
%172 = call i32 @set_stage_in_tweak(i32* %171, i32 128)
%173 = load i32*, i32** %11
%174 = load i32*, i32** %12
%175 = call i32 @set_tweak_in_tweakey(i32* %173, i32* %174)
%176 = load i32, i32* %8
%177 = icmp ne i32 %176, 0
br i1 %177, label %178, label %183
178: ; preds = %124
%179 = getelementptr inbounds [8 x i32], [8 x i32]* %29, i64 0, i64 0
%180 = load i32*, i32** %11
%181 = getelementptr inbounds [8 x i32], [8 x i32]* %30, i64 0, i64 0
%182 = call i32 @aesTweakEncrypt(i32 192, i32* %179, i32* %180, i32* %181)
br label %188
183: ; preds = %124
%184 = getelementptr inbounds [8 x i32], [8 x i32]* %29, i64 0, i64 0
%185 = load i32*, i32** %11
%186 = getelementptr inbounds [8 x i32], [8 x i32]* %30, i64 0, i64 0
%187 = call i32 @aesTweakDecrypt(i32 192, i32* %184, i32* %185, i32* %186)
br label %188
188: ; preds = %183, %178
%189 = load i32*, i32** %14
%190 = getelementptr inbounds [8 x i32], [8 x i32]* %30, i64 0, i64 0
%191 = call i32 @memcpy(i32* %189, i32* %190, i32 8)
%192 = load i32*, i32** %14
%193 = getelementptr inbounds i32, i32* %192, i64 8
%194 = getelementptr inbounds [8 x i32], [8 x i32]* %31, i64 0, i64 0
%195 = load i32, i32* %10
%196 = call i32 @memcpy(i32* %193, i32* %194, i32 %195)
ret void
}

LLVM IR (-O2):
define void @XLS(i32 %0, i32* %1, i32 %2, i32* %3, i32* %4, i32 %5, i32* %6) {
%8 = alloca [8 x i32]
%9 = alloca [8 x i32]
%10 = alloca [8 x i32]
%11 = alloca [8 x i32]
%12 = alloca [8 x i32]
%13 = alloca [8 x i32]
%14 = alloca [8 x i32]
%15 = alloca [8 x i32]
%16 = alloca [8 x i32]
%17 = alloca [8 x i32]
%18 = alloca [8 x i32]
%19 = alloca [8 x i32]
%20 = alloca [8 x i32]
%21 = alloca [8 x i32]
%22 = alloca [8 x i32]
%23 = alloca [8 x i32]
%24 = alloca [8 x i32]
%25 = bitcast [8 x i32]* %8 to i8*
%26 = bitcast [8 x i32]* %9 to i8*
%27 = bitcast [8 x i32]* %10 to i8*
%28 = bitcast [8 x i32]* %11 to i8*
%29 = bitcast [8 x i32]* %12 to i8*
%30 = bitcast [8 x i32]* %13 to i8*
%31 = bitcast [8 x i32]* %14 to i8*
%32 = bitcast [8 x i32]* %15 to i8*
%33 = bitcast [8 x i32]* %16 to i8*
%34 = bitcast [8 x i32]* %17 to i8*
%35 = bitcast [8 x i32]* %18 to i8*
%36 = bitcast [8 x i32]* %19 to i8*
%37 = bitcast [8 x i32]* %20 to i8*
%38 = bitcast [8 x i32]* %21 to i8*
%39 = bitcast [8 x i32]* %22 to i8*
%40 = bitcast [8 x i32]* %23 to i8*
%41 = bitcast [8 x i32]* %24 to i8*
%42 = getelementptr inbounds [8 x i32], [8 x i32]* %8, i64 0, i64 0
%43 = call i32 @memcpy(i32* %42, i32* %1, i32 8)
%44 = getelementptr inbounds [8 x i32], [8 x i32]* %9, i64 0, i64 0
%45 = getelementptr inbounds i32, i32* %1, i64 8
%46 = call i32 @memcpy(i32* %44, i32* %45, i32 %2)
%47 = call i32 @set_stage_in_tweak(i32* %4, i32 128)
%48 = call i32 @set_block_number_in_tweak(i32* %4, i32 %5)
%49 = call i32 @set_tweak_in_tweakey(i32* %3, i32* %4)
%50 = icmp eq i32 %0, 0
%51 = getelementptr inbounds [8 x i32], [8 x i32]* %10, i64 0, i64 0
br i1 %50, label %54, label %52
52: ; preds = %7
%53 = call i32 @aesTweakEncrypt(i32 192, i32* %42, i32* %3, i32* %51)
br label %56
54: ; preds = %7
%55 = call i32 @aesTweakDecrypt(i32 192, i32* %42, i32* %3, i32* %51)
br label %56
56: ; preds = %54, %52
%57 = getelementptr inbounds [8 x i32], [8 x i32]* %11, i64 0, i64 0
%58 = getelementptr inbounds [8 x i32], [8 x i32]* %10, i64 0, i64 0
%59 = sub nsw i32 8, %2
%60 = call i32 @memcpy(i32* %57, i32* %58, i32 %59)
%61 = getelementptr inbounds [8 x i32], [8 x i32]* %12, i64 0, i64 0
%62 = getelementptr inbounds [8 x i32], [8 x i32]* %10, i64 0, i64 8
%63 = sext i32 %2 to i64
%64 = sub nsw i64 0, %63
%65 = getelementptr inbounds i32, i32* %62, i64 %64
%66 = call i32 @memcpy(i32* %61, i32* %65, i32 %2)
%67 = getelementptr inbounds [8 x i32], [8 x i32]* %13, i64 0, i64 0
%68 = call i32 @memcpy(i32* %67, i32* %57, i32 %59)
%69 = sub i32 7, %2
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds [8 x i32], [8 x i32]* %13, i64 0, i64 %70
%72 = load i32, i32* %71
%73 = xor i32 %72, 1
store i32 %73, i32* %71
%74 = getelementptr inbounds [8 x i32], [8 x i32]* %14, i64 0, i64 0
%75 = getelementptr inbounds [8 x i32], [8 x i32]* %15, i64 0, i64 0
%76 = call i32 @mix(i32* %61, i32* %44, i32 %2, i32* %74, i32* %75)
%77 = getelementptr inbounds [8 x i32], [8 x i32]* %16, i64 0, i64 0
%78 = call i32 @memcpy(i32* %77, i32* %67, i32 %59)
%79 = getelementptr inbounds [8 x i32], [8 x i32]* %16, i64 0, i64 8
%80 = getelementptr inbounds i32, i32* %79, i64 %64
%81 = call i32 @memcpy(i32* %80, i32* %74, i32 %2)
%82 = call i32 @set_stage_in_tweak(i32* %4, i32 144)
%83 = call i32 @set_tweak_in_tweakey(i32* %3, i32* %4)
%84 = getelementptr inbounds [8 x i32], [8 x i32]* %17, i64 0, i64 0
br i1 %50, label %87, label %85
85: ; preds = %56
%86 = call i32 @aesTweakEncrypt(i32 192, i32* %77, i32* %3, i32* %84)
br label %89
87: ; preds = %56
%88 = call i32 @aesTweakDecrypt(i32 192, i32* %77, i32* %3, i32* %84)
br label %89
89: ; preds = %87, %85
%90 = getelementptr inbounds [8 x i32], [8 x i32]* %18, i64 0, i64 0
%91 = getelementptr inbounds [8 x i32], [8 x i32]* %17, i64 0, i64 0
%92 = call i32 @memcpy(i32* %90, i32* %91, i32 %59)
%93 = getelementptr inbounds [8 x i32], [8 x i32]* %19, i64 0, i64 0
%94 = getelementptr inbounds [8 x i32], [8 x i32]* %17, i64 0, i64 8
%95 = getelementptr inbounds i32, i32* %94, i64 %64
%96 = call i32 @memcpy(i32* %93, i32* %95, i32 %2)
%97 = getelementptr inbounds [8 x i32], [8 x i32]* %20, i64 0, i64 0
%98 = call i32 @memcpy(i32* %97, i32* %90, i32 %59)
%99 = getelementptr inbounds [8 x i32], [8 x i32]* %20, i64 0, i64 %70
%100 = load i32, i32* %99
%101 = xor i32 %100, 1
store i32 %101, i32* %99
%102 = getelementptr inbounds [8 x i32], [8 x i32]* %21, i64 0, i64 0
%103 = getelementptr inbounds [8 x i32], [8 x i32]* %24, i64 0, i64 0
%104 = call i32 @mix(i32* %93, i32* %75, i32 %2, i32* %102, i32* %103)
%105 = getelementptr inbounds [8 x i32], [8 x i32]* %22, i64 0, i64 0
%106 = call i32 @memcpy(i32* %105, i32* %97, i32 %59)
%107 = getelementptr inbounds [8 x i32], [8 x i32]* %22, i64 0, i64 8
%108 = getelementptr inbounds i32, i32* %107, i64 %64
%109 = call i32 @memcpy(i32* %108, i32* %102, i32 %2)
%110 = call i32 @set_stage_in_tweak(i32* %4, i32 128)
%111 = call i32 @set_tweak_in_tweakey(i32* %3, i32* %4)
%112 = getelementptr inbounds [8 x i32], [8 x i32]* %23, i64 0, i64 0
br i1 %50, label %115, label %113
113: ; preds = %89
%114 = call i32 @aesTweakEncrypt(i32 192, i32* %105, i32* %3, i32* %112)
br label %117
115: ; preds = %89
%116 = call i32 @aesTweakDecrypt(i32 192, i32* %105, i32* %3, i32* %112)
br label %117
117: ; preds = %115, %113
%118 = getelementptr inbounds [8 x i32], [8 x i32]* %23, i64 0, i64 0
%119 = call i32 @memcpy(i32* %6, i32* %118, i32 8)
%120 = getelementptr inbounds i32, i32* %6, i64 8
%121 = call i32 @memcpy(i32* %120, i32* %103, i32 %2)
ret void
}