#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 const *, int *, int *);
int /*<<< orphan*/ aesTweakEncrypt(int *, int const *, 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);
void XLS(const uint8_t isDirect, uint8_t message[], const uint32_t s,
         uint8_t *tweak, const uint8_t *key, const uint32_t l,
         uint8_t *cipher) {
  uint8_t M1[16];
  uint8_t M2[16];
  uint8_t X1[16];
  uint8_t X1ns[16];
  uint8_t X1s[16];
  uint8_t Xp1ns[16];
  uint8_t Xp1s[16];
  uint8_t X2[16];
  uint8_t Xp1[16];
  uint8_t Y1[16];
  uint8_t Y1ns[16];
  uint8_t Y1s[16];
  uint8_t Yp1ns[16];
  uint8_t Yp1s[16];
  uint8_t Yp1[16];
  uint8_t C1[16];
  uint8_t C2[16];
  memcpy(M1, message, 16);
  memcpy(M2, message + 16, s);
  set_stage_in_tweak(tweak, (0x8 << 4));
  set_block_number_in_tweak(tweak, l);
  if (isDirect)
    aesTweakEncrypt(M1, key, tweak, X1);
  else
    aesTweakDecrypt(M1, key, tweak, X1);
  memcpy(X1ns, X1, 16 - s);
  memcpy(X1s, X1 + 16 - s, s);
  memcpy(Xp1ns, X1ns, 16 - s);
  Xp1ns[16 - s - 1] ^= 1;
  mix(X1s, M2, s, Xp1s, X2);
  memcpy(Xp1, Xp1ns, 16 - s);
  memcpy(Xp1 + 16 - s, Xp1s, s);
  set_stage_in_tweak(tweak, (0x9 << 4));
  if (isDirect)
    aesTweakEncrypt(Xp1, key, tweak, Y1);
  else
    aesTweakDecrypt(Xp1, key, tweak, Y1);
  memcpy(Y1ns, Y1, 16 - s);
  memcpy(Y1s, Y1 + 16 - s, s);
  memcpy(Yp1ns, Y1ns, 16 - s);
  Yp1ns[16 - s - 1] ^= 1;
  mix(Y1s, X2, s, Yp1s, C2);
  memcpy(Yp1, Yp1ns, 16 - s);
  memcpy(Yp1 + 16 - s, Yp1s, s);
  set_stage_in_tweak(tweak, (0x8 << 4));
  if (isDirect)
    aesTweakEncrypt(Yp1, key, tweak, C1);
  else
    aesTweakDecrypt(Yp1, key, tweak, C1);
  memcpy(cipher, C1, 16);
  memcpy(cipher + 16, C2, s);
}


x86 assembly (clang, -O0):
<XLS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x470,%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    -0x70(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x10,%edx
call   1070 <memcpy@plt>
lea    -0xb0(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x40,%rsi
mov    -0x14(%rbp),%edx
call   1070 <memcpy@plt>
mov    -0x20(%rbp),%rdi
mov    $0x80,%esi
call   1040 <set_stage_in_tweak@plt>
mov    -0x20(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   1080 <set_block_number_in_tweak@plt>
cmpl   $0x0,-0x4(%rbp)
je     11ef <XLS+0x8f>
lea    -0x70(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0xf0(%rbp),%rcx
call   1060 <aesTweakEncrypt@plt>
jmp    1207 <XLS+0xa7>
lea    -0x70(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0xf0(%rbp),%rcx
call   1030 <aesTweakDecrypt@plt>
lea    -0x130(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
mov    $0x10,%edx
sub    -0x14(%rbp),%edx
call   1070 <memcpy@plt>
lea    -0x170(%rbp),%rdi
lea    -0xf0(%rbp),%rsi
add    $0x40,%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    -0x1b0(%rbp),%rdi
lea    -0x130(%rbp),%rsi
mov    $0x10,%edx
sub    -0x14(%rbp),%edx
call   1070 <memcpy@plt>
mov    $0x10,%eax
sub    -0x14(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x1b0(%rbp,%rax,4),%ecx
xor    $0x1,%ecx
mov    %ecx,-0x1b0(%rbp,%rax,4)
lea    -0x170(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    -0x1f0(%rbp),%rcx
lea    -0x230(%rbp),%r8
call   1050 <mix@plt>
lea    -0x270(%rbp),%rdi
lea    -0x1b0(%rbp),%rsi
mov    $0x10,%edx
sub    -0x14(%rbp),%edx
call   1070 <memcpy@plt>
lea    -0x270(%rbp),%rdi
add    $0x40,%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    -0x20(%rbp),%rdi
mov    $0x90,%esi
call   1040 <set_stage_in_tweak@plt>
cmpl   $0x0,-0x4(%rbp)
je     1326 <XLS+0x1c6>
lea    -0x270(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x2b0(%rbp),%rcx
call   1060 <aesTweakEncrypt@plt>
jmp    1341 <XLS+0x1e1>
lea    -0x270(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x2b0(%rbp),%rcx
call   1030 <aesTweakDecrypt@plt>
lea    -0x2f0(%rbp),%rdi
lea    -0x2b0(%rbp),%rsi
mov    $0x10,%edx
sub    -0x14(%rbp),%edx
call   1070 <memcpy@plt>
lea    -0x330(%rbp),%rdi
lea    -0x2b0(%rbp),%rsi
add    $0x40,%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    -0x370(%rbp),%rdi
lea    -0x2f0(%rbp),%rsi
mov    $0x10,%edx
sub    -0x14(%rbp),%edx
call   1070 <memcpy@plt>
mov    $0x10,%eax
sub    -0x14(%rbp),%eax
sub    $0x1,%eax
cltq
mov    -0x370(%rbp,%rax,4),%ecx
xor    $0x1,%ecx
mov    %ecx,-0x370(%rbp,%rax,4)
lea    -0x330(%rbp),%rdi
lea    -0x230(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    -0x3b0(%rbp),%rcx
lea    -0x470(%rbp),%r8
call   1050 <mix@plt>
lea    -0x3f0(%rbp),%rdi
lea    -0x370(%rbp),%rsi
mov    $0x10,%edx
sub    -0x14(%rbp),%edx
call   1070 <memcpy@plt>
lea    -0x3f0(%rbp),%rdi
add    $0x40,%rdi
movslq -0x14(%rbp),%rcx
xor    %eax,%eax
sub    %rcx,%rax
shl    $0x2,%rax
add    %rax,%rdi
lea    -0x3b0(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1070 <memcpy@plt>
mov    -0x20(%rbp),%rdi
mov    $0x80,%esi
call   1040 <set_stage_in_tweak@plt>
cmpl   $0x0,-0x4(%rbp)
je     1460 <XLS+0x300>
lea    -0x3f0(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x430(%rbp),%rcx
call   1060 <aesTweakEncrypt@plt>
jmp    147b <XLS+0x31b>
lea    -0x3f0(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
lea    -0x430(%rbp),%rcx
call   1030 <aesTweakDecrypt@plt>
mov    0x10(%rbp),%rdi
lea    -0x430(%rbp),%rsi
mov    $0x10,%edx
call   1070 <memcpy@plt>
mov    0x10(%rbp),%rdi
add    $0x40,%rdi
lea    -0x470(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1070 <memcpy@plt>
add    $0x470,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<XLS>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x468,%rsp
mov    %r9d,%r13d
mov    %r8,%r14
mov    %rcx,%rbx
mov    %edx,%r12d
mov    %rsi,%rbp
mov    %edi,%r15d
lea    0x1e0(%rsp),%rdi
mov    $0x10,%edx
call   1070 <memcpy@plt>
add    $0x40,%rbp
lea    0x2e0(%rsp),%rdi
mov    %rbp,%rsi
mov    %r12d,%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   1080 <set_block_number_in_tweak@plt>
mov    %r15d,0x4(%rsp)
test   %r15d,%r15d
mov    %rbx,0x10(%rsp)
mov    %r14,0x8(%rsp)
lea    0x1e0(%rsp),%rdi
lea    0x1a0(%rsp),%rcx
mov    %r14,%rsi
mov    %rbx,%rdx
je     11f5 <XLS+0x95>
call   1060 <aesTweakEncrypt@plt>
jmp    11fa <XLS+0x9a>
call   1030 <aesTweakDecrypt@plt>
mov    $0x10,%ebp
sub    %r12d,%ebp
lea    0x2a0(%rsp),%rdi
lea    0x1a0(%rsp),%r15
mov    %r15,%rsi
mov    %ebp,%edx
call   1070 <memcpy@plt>
movslq %r12d,%r14
lea    0x0(,%r14,4),%r13
sub    %r13,%r15
neg    %r14
add    $0x40,%r15
lea    0x420(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12d,%edx
call   1070 <memcpy@plt>
lea    0x160(%rsp),%rdi
lea    0x2a0(%rsp),%rsi
mov    %ebp,%edx
call   1070 <memcpy@plt>
mov    $0xf,%eax
sub    %r12d,%eax
cltq
mov    %rax,0x18(%rsp)
xorb   $0x1,0x160(%rsp,%rax,4)
01
lea    0x2e0(%rsp),%rsi
lea    0x3e0(%rsp),%r15
lea    0x260(%rsp),%r8
mov    %rbx,%rdi
mov    %r12d,%edx
mov    %r15,%rcx
call   1050 <mix@plt>
lea    0x120(%rsp),%rbx
mov    %rbx,%rdi
lea    0x160(%rsp),%rsi
mov    %ebp,%edx
call   1070 <memcpy@plt>
sub    %r13,%rbx
add    $0x40,%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12d,%edx
call   1070 <memcpy@plt>
mov    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x90,%esi
call   1040 <set_stage_in_tweak@plt>
cmpl   $0x0,0x4(%rsp)
je     12ff <XLS+0x19f>
lea    0x120(%rsp),%rdi
lea    0x60(%rsp),%rcx
mov    0x8(%rsp),%rsi
mov    %rbx,%rdx
call   1060 <aesTweakEncrypt@plt>
jmp    1319 <XLS+0x1b9>
lea    0x120(%rsp),%rdi
lea    0x60(%rsp),%rcx
mov    0x8(%rsp),%rsi
mov    %rbx,%rdx
call   1030 <aesTweakDecrypt@plt>
mov    0x4a0(%rsp),%r13
lea    0x3a0(%rsp),%rbx
lea    0x60(%rsp),%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
call   1070 <memcpy@plt>
lea    (%rsp,%r14,4),%rsi
add    $0xa0,%rsi
lea    0x360(%rsp),%r15
mov    %r15,%rdi
mov    %r12d,%edx
call   1070 <memcpy@plt>
lea    0xe0(%rsp),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
call   1070 <memcpy@plt>
mov    0x18(%rsp),%rax
xorb   $0x1,0xe0(%rsp,%rax,4)
01
lea    0x260(%rsp),%rsi
lea    0x320(%rsp),%rbx
lea    0x220(%rsp),%r8
mov    %r15,%rdi
mov    %r12d,%edx
mov    %rbx,%rcx
call   1050 <mix@plt>
lea    0x20(%rsp),%rdi
lea    0xe0(%rsp),%rsi
mov    %ebp,%edx
call   1070 <memcpy@plt>
lea    (%rsp,%r14,4),%rdi
add    $0x60,%rdi
mov    %rbx,%rsi
mov    %r12d,%edx
call   1070 <memcpy@plt>
mov    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
call   1040 <set_stage_in_tweak@plt>
cmpl   $0x0,0x4(%rsp)
je     13f7 <XLS+0x297>
lea    0x20(%rsp),%rdi
lea    0xa0(%rsp),%rcx
mov    0x8(%rsp),%rsi
mov    %rbx,%rdx
call   1060 <aesTweakEncrypt@plt>
jmp    1411 <XLS+0x2b1>
lea    0x20(%rsp),%rdi
lea    0xa0(%rsp),%rcx
mov    0x8(%rsp),%rsi
mov    %rbx,%rdx
call   1030 <aesTweakDecrypt@plt>
lea    0xa0(%rsp),%rsi
mov    %r13,%rdi
mov    $0x10,%edx
call   1070 <memcpy@plt>
add    $0x40,%r13
lea    0x220(%rsp),%rsi
mov    %r13,%rdi
mov    %r12d,%edx
call   1070 <memcpy@plt>
add    $0x468,%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 [16 x i32]
%16 = alloca [16 x i32]
%17 = alloca [16 x i32]
%18 = alloca [16 x i32]
%19 = alloca [16 x i32]
%20 = alloca [16 x i32]
%21 = alloca [16 x i32]
%22 = alloca [16 x i32]
%23 = alloca [16 x i32]
%24 = alloca [16 x i32]
%25 = alloca [16 x i32]
%26 = alloca [16 x i32]
%27 = alloca [16 x i32]
%28 = alloca [16 x i32]
%29 = alloca [16 x i32]
%30 = alloca [16 x i32]
%31 = alloca [16 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 [16 x i32], [16 x i32]* %15, i64 0, i64 0
%33 = load i32*, i32** %9
%34 = call i32 @memcpy(i32* %32, i32* %33, i32 16)
%35 = getelementptr inbounds [16 x i32], [16 x i32]* %16, i64 0, i64 0
%36 = load i32*, i32** %9
%37 = getelementptr inbounds i32, i32* %36, i64 16
%38 = load i32, i32* %10
%39 = call i32 @memcpy(i32* %35, i32* %37, i32 %38)
%40 = load i32*, i32** %11
%41 = call i32 @set_stage_in_tweak(i32* %40, i32 128)
%42 = load i32*, i32** %11
%43 = load i32, i32* %13
%44 = call i32 @set_block_number_in_tweak(i32* %42, i32 %43)
%45 = load i32, i32* %8
%46 = icmp ne i32 %45, 0
br i1 %46, label %47, label %53
47: ; preds = %7
%48 = getelementptr inbounds [16 x i32], [16 x i32]* %15, i64 0, i64 0
%49 = load i32*, i32** %12
%50 = load i32*, i32** %11
%51 = getelementptr inbounds [16 x i32], [16 x i32]* %17, i64 0, i64 0
%52 = call i32 @aesTweakEncrypt(i32* %48, i32* %49, i32* %50, i32* %51)
br label %59
53: ; preds = %7
%54 = getelementptr inbounds [16 x i32], [16 x i32]* %15, i64 0, i64 0
%55 = load i32*, i32** %12
%56 = load i32*, i32** %11
%57 = getelementptr inbounds [16 x i32], [16 x i32]* %17, i64 0, i64 0
%58 = call i32 @aesTweakDecrypt(i32* %54, i32* %55, i32* %56, i32* %57)
br label %59
59: ; preds = %53, %47
%60 = getelementptr inbounds [16 x i32], [16 x i32]* %18, i64 0, i64 0
%61 = getelementptr inbounds [16 x i32], [16 x i32]* %17, i64 0, i64 0
%62 = load i32, i32* %10
%63 = sub nsw i32 16, %62
%64 = call i32 @memcpy(i32* %60, i32* %61, i32 %63)
%65 = getelementptr inbounds [16 x i32], [16 x i32]* %19, i64 0, i64 0
%66 = getelementptr inbounds [16 x i32], [16 x i32]* %17, i64 0, i64 0
%67 = getelementptr inbounds i32, i32* %66, i64 16
%68 = load i32, i32* %10
%69 = sext i32 %68 to i64
%70 = sub i64 0, %69
%71 = getelementptr inbounds i32, i32* %67, i64 %70
%72 = load i32, i32* %10
%73 = call i32 @memcpy(i32* %65, i32* %71, i32 %72)
%74 = getelementptr inbounds [16 x i32], [16 x i32]* %20, i64 0, i64 0
%75 = getelementptr inbounds [16 x i32], [16 x i32]* %18, i64 0, i64 0
%76 = load i32, i32* %10
%77 = sub nsw i32 16, %76
%78 = call i32 @memcpy(i32* %74, i32* %75, i32 %77)
%79 = load i32, i32* %10
%80 = sub nsw i32 16, %79
%81 = sub nsw i32 %80, 1
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [16 x i32], [16 x i32]* %20, i64 0, i64 %82
%84 = load i32, i32* %83
%85 = xor i32 %84, 1
store i32 %85, i32* %83
%86 = getelementptr inbounds [16 x i32], [16 x i32]* %19, i64 0, i64 0
%87 = getelementptr inbounds [16 x i32], [16 x i32]* %16, i64 0, i64 0
%88 = load i32, i32* %10
%89 = getelementptr inbounds [16 x i32], [16 x i32]* %21, i64 0, i64 0
%90 = getelementptr inbounds [16 x i32], [16 x i32]* %22, i64 0, i64 0
%91 = call i32 @mix(i32* %86, i32* %87, i32 %88, i32* %89, i32* %90)
%92 = getelementptr inbounds [16 x i32], [16 x i32]* %23, i64 0, i64 0
%93 = getelementptr inbounds [16 x i32], [16 x i32]* %20, i64 0, i64 0
%94 = load i32, i32* %10
%95 = sub nsw i32 16, %94
%96 = call i32 @memcpy(i32* %92, i32* %93, i32 %95)
%97 = getelementptr inbounds [16 x i32], [16 x i32]* %23, i64 0, i64 0
%98 = getelementptr inbounds i32, i32* %97, i64 16
%99 = load i32, i32* %10
%100 = sext i32 %99 to i64
%101 = sub i64 0, %100
%102 = getelementptr inbounds i32, i32* %98, i64 %101
%103 = getelementptr inbounds [16 x i32], [16 x i32]* %21, i64 0, i64 0
%104 = load i32, i32* %10
%105 = call i32 @memcpy(i32* %102, i32* %103, i32 %104)
%106 = load i32*, i32** %11
%107 = call i32 @set_stage_in_tweak(i32* %106, i32 144)
%108 = load i32, i32* %8
%109 = icmp ne i32 %108, 0
br i1 %109, label %110, label %116
110: ; preds = %59
%111 = getelementptr inbounds [16 x i32], [16 x i32]* %23, i64 0, i64 0
%112 = load i32*, i32** %12
%113 = load i32*, i32** %11
%114 = getelementptr inbounds [16 x i32], [16 x i32]* %24, i64 0, i64 0
%115 = call i32 @aesTweakEncrypt(i32* %111, i32* %112, i32* %113, i32* %114)
br label %122
116: ; preds = %59
%117 = getelementptr inbounds [16 x i32], [16 x i32]* %23, i64 0, i64 0
%118 = load i32*, i32** %12
%119 = load i32*, i32** %11
%120 = getelementptr inbounds [16 x i32], [16 x i32]* %24, i64 0, i64 0
%121 = call i32 @aesTweakDecrypt(i32* %117, i32* %118, i32* %119, i32* %120)
br label %122
122: ; preds = %116, %110
%123 = getelementptr inbounds [16 x i32], [16 x i32]* %25, i64 0, i64 0
%124 = getelementptr inbounds [16 x i32], [16 x i32]* %24, i64 0, i64 0
%125 = load i32, i32* %10
%126 = sub nsw i32 16, %125
%127 = call i32 @memcpy(i32* %123, i32* %124, i32 %126)
%128 = getelementptr inbounds [16 x i32], [16 x i32]* %26, i64 0, i64 0
%129 = getelementptr inbounds [16 x i32], [16 x i32]* %24, i64 0, i64 0
%130 = getelementptr inbounds i32, i32* %129, i64 16
%131 = load i32, i32* %10
%132 = sext i32 %131 to i64
%133 = sub i64 0, %132
%134 = getelementptr inbounds i32, i32* %130, i64 %133
%135 = load i32, i32* %10
%136 = call i32 @memcpy(i32* %128, i32* %134, i32 %135)
%137 = getelementptr inbounds [16 x i32], [16 x i32]* %27, i64 0, i64 0
%138 = getelementptr inbounds [16 x i32], [16 x i32]* %25, i64 0, i64 0
%139 = load i32, i32* %10
%140 = sub nsw i32 16, %139
%141 = call i32 @memcpy(i32* %137, i32* %138, i32 %140)
%142 = load i32, i32* %10
%143 = sub nsw i32 16, %142
%144 = sub nsw i32 %143, 1
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds [16 x i32], [16 x i32]* %27, i64 0, i64 %145
%147 = load i32, i32* %146
%148 = xor i32 %147, 1
store i32 %148, i32* %146
%149 = getelementptr inbounds [16 x i32], [16 x i32]* %26, i64 0, i64 0
%150 = getelementptr inbounds [16 x i32], [16 x i32]* %22, i64 0, i64 0
%151 = load i32, i32* %10
%152 = getelementptr inbounds [16 x i32], [16 x i32]* %28, i64 0, i64 0
%153 = getelementptr inbounds [16 x i32], [16 x i32]* %31, i64 0, i64 0
%154 = call i32 @mix(i32* %149, i32* %150, i32 %151, i32* %152, i32* %153)
%155 = getelementptr inbounds [16 x i32], [16 x i32]* %29, i64 0, i64 0
%156 = getelementptr inbounds [16 x i32], [16 x i32]* %27, i64 0, i64 0
%157 = load i32, i32* %10
%158 = sub nsw i32 16, %157
%159 = call i32 @memcpy(i32* %155, i32* %156, i32 %158)
%160 = getelementptr inbounds [16 x i32], [16 x i32]* %29, i64 0, i64 0
%161 = getelementptr inbounds i32, i32* %160, i64 16
%162 = load i32, i32* %10
%163 = sext i32 %162 to i64
%164 = sub i64 0, %163
%165 = getelementptr inbounds i32, i32* %161, i64 %164
%166 = getelementptr inbounds [16 x i32], [16 x i32]* %28, i64 0, i64 0
%167 = load i32, i32* %10
%168 = call i32 @memcpy(i32* %165, i32* %166, i32 %167)
%169 = load i32*, i32** %11
%170 = call i32 @set_stage_in_tweak(i32* %169, i32 128)
%171 = load i32, i32* %8
%172 = icmp ne i32 %171, 0
br i1 %172, label %173, label %179
173: ; preds = %122
%174 = getelementptr inbounds [16 x i32], [16 x i32]* %29, i64 0, i64 0
%175 = load i32*, i32** %12
%176 = load i32*, i32** %11
%177 = getelementptr inbounds [16 x i32], [16 x i32]* %30, i64 0, i64 0
%178 = call i32 @aesTweakEncrypt(i32* %174, i32* %175, i32* %176, i32* %177)
br label %185
179: ; preds = %122
%180 = getelementptr inbounds [16 x i32], [16 x i32]* %29, i64 0, i64 0
%181 = load i32*, i32** %12
%182 = load i32*, i32** %11
%183 = getelementptr inbounds [16 x i32], [16 x i32]* %30, i64 0, i64 0
%184 = call i32 @aesTweakDecrypt(i32* %180, i32* %181, i32* %182, i32* %183)
br label %185
185: ; preds = %179, %173
%186 = load i32*, i32** %14
%187 = getelementptr inbounds [16 x i32], [16 x i32]* %30, i64 0, i64 0
%188 = call i32 @memcpy(i32* %186, i32* %187, i32 16)
%189 = load i32*, i32** %14
%190 = getelementptr inbounds i32, i32* %189, i64 16
%191 = getelementptr inbounds [16 x i32], [16 x i32]* %31, i64 0, i64 0
%192 = load i32, i32* %10
%193 = call i32 @memcpy(i32* %190, i32* %191, i32 %192)
ret void
}

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