#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 /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_aesenc_si128(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_aesenclast_si128(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_xor_si128(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i encrypt_block(__m128i p, __m128i *x, __m128i *y, __m128i *k,
                      __m128i *lt, __m128i *lb) {
  *x = _mm_xor_si128(*x, p);
  p = _mm_xor_si128(*x, k[0]);
  *x = _mm_xor_si128(*x, lt[0]);
  *y = _mm_xor_si128(*y, lb[0]);
  unsigned j;
  for (j = 1; j <= 4; ++j) {
    p = _mm_aesenc_si128(p, k[j]);
    *x = _mm_aesenc_si128(*x, lt[j]);
    *y = _mm_aesenc_si128(*y, lb[j]);
  }
  for (j = 4 + 1; j < 10; ++j) {
    p = _mm_aesenc_si128(p, k[j]);
  }
  p = _mm_aesenclast_si128(p, k[10]);
  p = _mm_xor_si128(p, *y);
  *y = _mm_xor_si128(*y, p);
  return p;
}


x86 assembly (clang, -O0):
<encrypt_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    (%rax),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rax
mov    (%rax),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rax
mov    (%rax),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x34(%rbp)
cmpl   $0x4,-0x34(%rbp)
ja     1219 <encrypt_block+0xe9>
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
mov    (%rax,%rcx,4),%esi
call   1040 <_mm_aesenc_si128@plt>
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x28(%rbp),%rax
mov    -0x34(%rbp),%ecx
mov    (%rax,%rcx,4),%esi
call   1040 <_mm_aesenc_si128@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rax
mov    -0x34(%rbp),%ecx
mov    (%rax,%rcx,4),%esi
call   1040 <_mm_aesenc_si128@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11b2 <encrypt_block+0x82>
movl   $0x5,-0x34(%rbp)
cmpl   $0xa,-0x34(%rbp)
jae    124d <encrypt_block+0x11d>
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rax
mov    -0x34(%rbp),%ecx
mov    (%rax,%rcx,4),%esi
call   1040 <_mm_aesenc_si128@plt>
mov    %eax,-0x4(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1220 <encrypt_block+0xf0>
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rax
mov    0x28(%rax),%esi
call   1030 <_mm_aesenclast_si128@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,-0x4(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<encrypt_block>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r15
mov    %r8,%r13
mov    %rcx,%r14
mov    %rdx,%r12
mov    %rsi,%rbx
mov    %edi,%esi
mov    (%rbx),%edi
call   1050 <_mm_xor_si128@plt>
mov    %eax,(%rbx)
mov    (%r14),%esi
mov    %eax,%edi
call   1050 <_mm_xor_si128@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
mov    0x0(%r13),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,(%rbx)
mov    (%r12),%edi
mov    (%r15),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,(%r12)
mov    0x4(%r14),%esi
mov    %ebp,%edi
call   1040 <_mm_aesenc_si128@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
mov    0x4(%r13),%esi
call   1040 <_mm_aesenc_si128@plt>
mov    %eax,(%rbx)
mov    (%r12),%edi
mov    0x4(%r15),%esi
call   1040 <_mm_aesenc_si128@plt>
mov    %eax,(%r12)
mov    0x8(%r14),%esi
mov    %ebp,%edi
call   1040 <_mm_aesenc_si128@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
mov    0x8(%r13),%esi
call   1040 <_mm_aesenc_si128@plt>
mov    %eax,(%rbx)
mov    (%r12),%edi
mov    0x8(%r15),%esi
call   1040 <_mm_aesenc_si128@plt>
mov    %eax,(%r12)
mov    0xc(%r14),%esi
mov    %ebp,%edi
call   1040 <_mm_aesenc_si128@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
mov    0xc(%r13),%esi
call   1040 <_mm_aesenc_si128@plt>
mov    %eax,(%rbx)
mov    (%r12),%edi
mov    0xc(%r15),%esi
call   1040 <_mm_aesenc_si128@plt>
mov    %eax,(%r12)
mov    0x10(%r14),%esi
mov    %ebp,%edi
call   1040 <_mm_aesenc_si128@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
mov    0x10(%r13),%esi
call   1040 <_mm_aesenc_si128@plt>
mov    %eax,(%rbx)
mov    (%r12),%edi
mov    0x10(%r15),%esi
call   1040 <_mm_aesenc_si128@plt>
mov    %eax,(%r12)
mov    0x14(%r14),%esi
mov    %ebp,%edi
call   1040 <_mm_aesenc_si128@plt>
mov    0x18(%r14),%esi
mov    %eax,%edi
call   1040 <_mm_aesenc_si128@plt>
mov    0x1c(%r14),%esi
mov    %eax,%edi
call   1040 <_mm_aesenc_si128@plt>
mov    0x20(%r14),%esi
mov    %eax,%edi
call   1040 <_mm_aesenc_si128@plt>
mov    0x24(%r14),%esi
mov    %eax,%edi
call   1040 <_mm_aesenc_si128@plt>
mov    0x28(%r14),%esi
mov    %eax,%edi
call   1030 <_mm_aesenclast_si128@plt>
mov    (%r12),%esi
mov    %eax,%edi
call   1050 <_mm_xor_si128@plt>
mov    %eax,%ebx
mov    (%r12),%edi
mov    %eax,%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,(%r12)
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @encrypt_block(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i32
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32
store i32 %0, i32* %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
%14 = load i32*, i32** %8
%15 = load i32, i32* %14
%16 = load i32, i32* %7
%17 = call i32 @_mm_xor_si128(i32 %15, i32 %16)
%18 = load i32*, i32** %8
store i32 %17, i32* %18
%19 = load i32*, i32** %8
%20 = load i32, i32* %19
%21 = load i32*, i32** %10
%22 = getelementptr inbounds i32, i32* %21, i64 0
%23 = load i32, i32* %22
%24 = call i32 @_mm_xor_si128(i32 %20, i32 %23)
store i32 %24, i32* %7
%25 = load i32*, i32** %8
%26 = load i32, i32* %25
%27 = load i32*, i32** %11
%28 = getelementptr inbounds i32, i32* %27, i64 0
%29 = load i32, i32* %28
%30 = call i32 @_mm_xor_si128(i32 %26, i32 %29)
%31 = load i32*, i32** %8
store i32 %30, i32* %31
%32 = load i32*, i32** %9
%33 = load i32, i32* %32
%34 = load i32*, i32** %12
%35 = getelementptr inbounds i32, i32* %34, i64 0
%36 = load i32, i32* %35
%37 = call i32 @_mm_xor_si128(i32 %33, i32 %36)
%38 = load i32*, i32** %9
store i32 %37, i32* %38
store i32 1, i32* %13
br label %39
39: ; preds = %68, %6
%40 = load i32, i32* %13
%41 = icmp ule i32 %40, 4
br i1 %41, label %42, label %71
42: ; preds = %39
%43 = load i32, i32* %7
%44 = load i32*, i32** %10
%45 = load i32, i32* %13
%46 = zext i32 %45 to i64
%47 = getelementptr inbounds i32, i32* %44, i64 %46
%48 = load i32, i32* %47
%49 = call i32 @_mm_aesenc_si128(i32 %43, i32 %48)
store i32 %49, i32* %7
%50 = load i32*, i32** %8
%51 = load i32, i32* %50
%52 = load i32*, i32** %11
%53 = load i32, i32* %13
%54 = zext i32 %53 to i64
%55 = getelementptr inbounds i32, i32* %52, i64 %54
%56 = load i32, i32* %55
%57 = call i32 @_mm_aesenc_si128(i32 %51, i32 %56)
%58 = load i32*, i32** %8
store i32 %57, i32* %58
%59 = load i32*, i32** %9
%60 = load i32, i32* %59
%61 = load i32*, i32** %12
%62 = load i32, i32* %13
%63 = zext i32 %62 to i64
%64 = getelementptr inbounds i32, i32* %61, i64 %63
%65 = load i32, i32* %64
%66 = call i32 @_mm_aesenc_si128(i32 %60, i32 %65)
%67 = load i32*, i32** %9
store i32 %66, i32* %67
br label %68
68: ; preds = %42
%69 = load i32, i32* %13
%70 = add i32 %69, 1
store i32 %70, i32* %13
br label %39
71: ; preds = %39
store i32 5, i32* %13
br label %72
72: ; preds = %83, %71
%73 = load i32, i32* %13
%74 = icmp ult i32 %73, 10
br i1 %74, label %75, label %86
75: ; preds = %72
%76 = load i32, i32* %7
%77 = load i32*, i32** %10
%78 = load i32, i32* %13
%79 = zext i32 %78 to i64
%80 = getelementptr inbounds i32, i32* %77, i64 %79
%81 = load i32, i32* %80
%82 = call i32 @_mm_aesenc_si128(i32 %76, i32 %81)
store i32 %82, i32* %7
br label %83
83: ; preds = %75
%84 = load i32, i32* %13
%85 = add i32 %84, 1
store i32 %85, i32* %13
br label %72
86: ; preds = %72
%87 = load i32, i32* %7
%88 = load i32*, i32** %10
%89 = getelementptr inbounds i32, i32* %88, i64 10
%90 = load i32, i32* %89
%91 = call i32 @_mm_aesenclast_si128(i32 %87, i32 %90)
store i32 %91, i32* %7
%92 = load i32, i32* %7
%93 = load i32*, i32** %9
%94 = load i32, i32* %93
%95 = call i32 @_mm_xor_si128(i32 %92, i32 %94)
store i32 %95, i32* %7
%96 = load i32*, i32** %9
%97 = load i32, i32* %96
%98 = load i32, i32* %7
%99 = call i32 @_mm_xor_si128(i32 %97, i32 %98)
%100 = load i32*, i32** %9
store i32 %99, i32* %100
%101 = load i32, i32* %7
ret i32 %101
}

LLVM IR (-O2):
define i32 @encrypt_block(i32 %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4, i32* nocapture %5) {
%7 = load i32, i32* %1
%8 = tail call i32 @_mm_xor_si128(i32 %7, i32 %0)
store i32 %8, i32* %1
%9 = load i32, i32* %3
%10 = tail call i32 @_mm_xor_si128(i32 %8, i32 %9)
%11 = load i32, i32* %1
%12 = load i32, i32* %4
%13 = tail call i32 @_mm_xor_si128(i32 %11, i32 %12)
store i32 %13, i32* %1
%14 = load i32, i32* %2
%15 = load i32, i32* %5
%16 = tail call i32 @_mm_xor_si128(i32 %14, i32 %15)
store i32 %16, i32* %2
%17 = getelementptr inbounds i32, i32* %3, i64 1
%18 = load i32, i32* %17
%19 = tail call i32 @_mm_aesenc_si128(i32 %10, i32 %18)
%20 = load i32, i32* %1
%21 = getelementptr inbounds i32, i32* %4, i64 1
%22 = load i32, i32* %21
%23 = tail call i32 @_mm_aesenc_si128(i32 %20, i32 %22)
store i32 %23, i32* %1
%24 = load i32, i32* %2
%25 = getelementptr inbounds i32, i32* %5, i64 1
%26 = load i32, i32* %25
%27 = tail call i32 @_mm_aesenc_si128(i32 %24, i32 %26)
store i32 %27, i32* %2
%28 = getelementptr inbounds i32, i32* %3, i64 2
%29 = load i32, i32* %28
%30 = tail call i32 @_mm_aesenc_si128(i32 %19, i32 %29)
%31 = load i32, i32* %1
%32 = getelementptr inbounds i32, i32* %4, i64 2
%33 = load i32, i32* %32
%34 = tail call i32 @_mm_aesenc_si128(i32 %31, i32 %33)
store i32 %34, i32* %1
%35 = load i32, i32* %2
%36 = getelementptr inbounds i32, i32* %5, i64 2
%37 = load i32, i32* %36
%38 = tail call i32 @_mm_aesenc_si128(i32 %35, i32 %37)
store i32 %38, i32* %2
%39 = getelementptr inbounds i32, i32* %3, i64 3
%40 = load i32, i32* %39
%41 = tail call i32 @_mm_aesenc_si128(i32 %30, i32 %40)
%42 = load i32, i32* %1
%43 = getelementptr inbounds i32, i32* %4, i64 3
%44 = load i32, i32* %43
%45 = tail call i32 @_mm_aesenc_si128(i32 %42, i32 %44)
store i32 %45, i32* %1
%46 = load i32, i32* %2
%47 = getelementptr inbounds i32, i32* %5, i64 3
%48 = load i32, i32* %47
%49 = tail call i32 @_mm_aesenc_si128(i32 %46, i32 %48)
store i32 %49, i32* %2
%50 = getelementptr inbounds i32, i32* %3, i64 4
%51 = load i32, i32* %50
%52 = tail call i32 @_mm_aesenc_si128(i32 %41, i32 %51)
%53 = load i32, i32* %1
%54 = getelementptr inbounds i32, i32* %4, i64 4
%55 = load i32, i32* %54
%56 = tail call i32 @_mm_aesenc_si128(i32 %53, i32 %55)
store i32 %56, i32* %1
%57 = load i32, i32* %2
%58 = getelementptr inbounds i32, i32* %5, i64 4
%59 = load i32, i32* %58
%60 = tail call i32 @_mm_aesenc_si128(i32 %57, i32 %59)
store i32 %60, i32* %2
%61 = getelementptr inbounds i32, i32* %3, i64 5
%62 = load i32, i32* %61
%63 = tail call i32 @_mm_aesenc_si128(i32 %52, i32 %62)
%64 = getelementptr inbounds i32, i32* %3, i64 6
%65 = load i32, i32* %64
%66 = tail call i32 @_mm_aesenc_si128(i32 %63, i32 %65)
%67 = getelementptr inbounds i32, i32* %3, i64 7
%68 = load i32, i32* %67
%69 = tail call i32 @_mm_aesenc_si128(i32 %66, i32 %68)
%70 = getelementptr inbounds i32, i32* %3, i64 8
%71 = load i32, i32* %70
%72 = tail call i32 @_mm_aesenc_si128(i32 %69, i32 %71)
%73 = getelementptr inbounds i32, i32* %3, i64 9
%74 = load i32, i32* %73
%75 = tail call i32 @_mm_aesenc_si128(i32 %72, i32 %74)
%76 = getelementptr inbounds i32, i32* %3, i64 10
%77 = load i32, i32* %76
%78 = tail call i32 @_mm_aesenclast_si128(i32 %75, i32 %77)
%79 = load i32, i32* %2
%80 = tail call i32 @_mm_xor_si128(i32 %78, i32 %79)
%81 = load i32, i32* %2
%82 = tail call i32 @_mm_xor_si128(i32 %81, i32 %80)
store i32 %82, i32* %2
ret i32 %80
}