#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;

/* Variables and functions */
int READ_ROUND_KEY_BYTE(int);
int /*<<< orphan*/ rrr_enc_dec_round(int *, int *, int, int *,
                                     int /*<<< orphan*/);
void Encrypt(uint8_t *block, uint8_t *roundKeys) {
  uint8_t i, temp[4] = {0};
  temp[0] = 4;
  for (i = 0; i < 4; i++)
    block[i] ^= READ_ROUND_KEY_BYTE(roundKeys[i]);
  for (i = 12; i > 0; i--) {
    rrr_enc_dec_round(block, roundKeys, i, temp, 0);
  }
  for (i = 0; i < 4; i++)
    temp[i] = block[i];
  for (i = 0; i < 4; i++)
    block[i] = block[i + 4] ^ READ_ROUND_KEY_BYTE(roundKeys[i + 4]);
  for (i = 0; i < 4; i++)
    block[i + 4] = temp[i];
}


x86 assembly (clang, -O0):
<Encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
movl   $0x4,-0x30(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1196 <Encrypt+0x66>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1050 <READ_ROUND_KEY_BYTE@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
xor    (%rax,%rcx,4),%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115e <Encrypt+0x2e>
movl   $0xc,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    11cc <Encrypt+0x9c>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    -0x30(%rbp),%rcx
xor    %r8d,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    119d <Encrypt+0x6d>
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    11fe <Encrypt+0xce>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
movslq -0x14(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11d3 <Encrypt+0xa3>
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1255 <Encrypt+0x125>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edi
call   1050 <READ_ROUND_KEY_BYTE@plt>
mov    -0x34(%rbp),%edx
xor    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1205 <Encrypt+0xd5>
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    128c <Encrypt+0x15c>
movslq -0x14(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%edx
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x4,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    125c <Encrypt+0x12c>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Encrypt>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movl   $0x4,(%rsp)
mov    (%rsi),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,(%rbx)
mov    0x4(%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x4(%rbx)
mov    0x8(%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x8(%rbx)
mov    0xc(%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0xc(%rbx)
mov    %rsp,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xc,%edx
mov    %r15,%rcx
xor    %r8d,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xb,%edx
mov    %r15,%rcx
xor    %r8d,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
mov    %r15,%rcx
xor    %r8d,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x9,%edx
mov    %r15,%rcx
xor    %r8d,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
mov    %r15,%rcx
xor    %r8d,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x7,%edx
mov    %r15,%rcx
xor    %r8d,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x6,%edx
mov    %r15,%rcx
xor    %r8d,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
mov    %r15,%rcx
xor    %r8d,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
mov    %r15,%rcx
xor    %r8d,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
mov    %r15,%rcx
xor    %r8d,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
mov    %r15,%rcx
xor    %r8d,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    %r15,%rcx
xor    %r8d,%r8d
call   1030 <rrr_enc_dec_round@plt>
movups (%rbx),%xmm0
movaps %xmm0,(%rsp)
mov    0x10(%rbx),%ebp
mov    0x10(%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
mov    %eax,(%rbx)
mov    0x14(%rbx),%ebp
mov    0x14(%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
mov    %eax,0x4(%rbx)
mov    0x18(%rbx),%ebp
mov    0x18(%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
mov    %eax,0x8(%rbx)
mov    0x1c(%rbx),%ebp
mov    0x1c(%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
mov    %eax,0xc(%rbx)
movaps (%rsp),%xmm0
movups %xmm0,0x10(%rbx)
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @Encrypt(i32* %0, i32* %1) {
%3 = bitcast i32* %0 to i8*
%4 = alloca [4 x i32]
%5 = bitcast [4 x i32]* %4 to i8*
%6 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
store i32 4, i32* %6
%7 = load i32, i32* %1
%8 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %7)
%9 = load i32, i32* %0
%10 = xor i32 %9, %8
store i32 %10, i32* %0
%11 = getelementptr inbounds i32, i32* %1, i64 1
%12 = load i32, i32* %11
%13 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %12)
%14 = getelementptr inbounds i32, i32* %0, i64 1
%15 = load i32, i32* %14
%16 = xor i32 %15, %13
store i32 %16, i32* %14
%17 = getelementptr inbounds i32, i32* %1, i64 2
%18 = load i32, i32* %17
%19 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %18)
%20 = getelementptr inbounds i32, i32* %0, i64 2
%21 = load i32, i32* %20
%22 = xor i32 %21, %19
store i32 %22, i32* %20
%23 = getelementptr inbounds i32, i32* %1, i64 3
%24 = load i32, i32* %23
%25 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %24)
%26 = getelementptr inbounds i32, i32* %0, i64 3
%27 = load i32, i32* %26
%28 = xor i32 %27, %25
store i32 %28, i32* %26
%29 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 12, i32* %6, i32 0)
%30 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 11, i32* %6, i32 0)
%31 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 10, i32* %6, i32 0)
%32 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 9, i32* %6, i32 0)
%33 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 8, i32* %6, i32 0)
%34 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 7, i32* %6, i32 0)
%35 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 6, i32* %6, i32 0)
%36 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 5, i32* %6, i32 0)
%37 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 4, i32* %6, i32 0)
%38 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 3, i32* %6, i32 0)
%39 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 2, i32* %6, i32 0)
%40 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 1, i32* %6, i32 0)
%41 = getelementptr i32, i32* %0, i64 4
%42 = load i32, i32* %41
%43 = getelementptr inbounds i32, i32* %1, i64 4
%44 = load i32, i32* %43
%45 = call i32 @READ_ROUND_KEY_BYTE(i32 %44)
%46 = xor i32 %45, %42
store i32 %46, i32* %0
%47 = getelementptr inbounds i32, i32* %0, i64 5
%48 = load i32, i32* %47
%49 = getelementptr inbounds i32, i32* %1, i64 5
%50 = load i32, i32* %49
%51 = call i32 @READ_ROUND_KEY_BYTE(i32 %50)
%52 = xor i32 %51, %48
store i32 %52, i32* %14
%53 = getelementptr inbounds i32, i32* %0, i64 6
%54 = load i32, i32* %53
%55 = getelementptr inbounds i32, i32* %1, i64 6
%56 = load i32, i32* %55
%57 = call i32 @READ_ROUND_KEY_BYTE(i32 %56)
%58 = xor i32 %57, %54
store i32 %58, i32* %20
%59 = getelementptr inbounds i32, i32* %0, i64 7
%60 = load i32, i32* %59
%61 = getelementptr inbounds i32, i32* %1, i64 7
%62 = load i32, i32* %61
%63 = call i32 @READ_ROUND_KEY_BYTE(i32 %62)
%64 = xor i32 %63, %60
store i32 %64, i32* %26
%65 = bitcast i32* %41 to i8*
ret void
}