#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);
void Decrypt(uint8_t *block, uint8_t *roundKeys) {
  uint8_t i, temp[4] = {0};
  temp[0] = 8;
  for (i = 0; i < 4; i++)
    block[i] ^= READ_ROUND_KEY_BYTE(roundKeys[i + 4]);
  for (i = 1; i <= 12; i++) {
    rrr_enc_dec_round(block, roundKeys, i, temp, 1);
  }
  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]);
  for (i = 0; i < 4; i++)
    block[i + 4] = temp[i];
}


x86 assembly (clang, -O0):
<Decrypt>:
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   $0x8,-0x30(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    119b <Decrypt+0x6b>
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    %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 <Decrypt+0x2e>
movl   $0x1,-0x14(%rbp)
cmpl   $0xc,-0x14(%rbp)
jg     11d4 <Decrypt+0xa4>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
lea    -0x30(%rbp),%rcx
mov    $0x1,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11a2 <Decrypt+0x72>
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1206 <Decrypt+0xd6>
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    11db <Decrypt+0xab>
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    1258 <Decrypt+0x128>
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
movslq -0x14(%rbp),%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    120d <Decrypt+0xdd>
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    128f <Decrypt+0x15f>
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    125f <Decrypt+0x12f>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Decrypt>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movl   $0x8,(%rsp)
mov    0x10(%rsi),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,(%rbx)
mov    0x14(%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x4(%rbx)
mov    0x18(%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0x8(%rbx)
mov    0x1c(%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %eax,0xc(%rbx)
mov    %rsp,%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
mov    %r15,%rcx
mov    $0x1,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x2,%edx
mov    %r15,%rcx
mov    $0x1,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x3,%edx
mov    %r15,%rcx
mov    $0x1,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x4,%edx
mov    %r15,%rcx
mov    $0x1,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x5,%edx
mov    %r15,%rcx
mov    $0x1,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x6,%edx
mov    %r15,%rcx
mov    $0x1,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x7,%edx
mov    %r15,%rcx
mov    $0x1,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x8,%edx
mov    %r15,%rcx
mov    $0x1,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x9,%edx
mov    %r15,%rcx
mov    $0x1,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xa,%edx
mov    %r15,%rcx
mov    $0x1,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xb,%edx
mov    %r15,%rcx
mov    $0x1,%r8d
call   1030 <rrr_enc_dec_round@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0xc,%edx
mov    %r15,%rcx
mov    $0x1,%r8d
call   1030 <rrr_enc_dec_round@plt>
movups (%rbx),%xmm0
movaps %xmm0,(%rsp)
mov    0x10(%rbx),%ebp
mov    (%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
mov    %eax,(%rbx)
mov    0x14(%rbx),%ebp
mov    0x4(%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
mov    %eax,0x4(%rbx)
mov    0x18(%rbx),%ebp
mov    0x8(%r14),%edi
call   1040 <READ_ROUND_KEY_BYTE@plt>
xor    %ebp,%eax
mov    %eax,0x8(%rbx)
mov    0x1c(%rbx),%ebp
mov    0xc(%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 @Decrypt(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 8, i32* %8
store i32 0, i32* %5
br label %9
9: ; preds = %26, %2
%10 = load i32, i32* %5
%11 = icmp slt i32 %10, 4
br i1 %11, label %12, label %29
12: ; preds = %9
%13 = load i32*, i32** %4
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %13, i64 %16
%18 = load i32, i32* %17
%19 = call i32 @READ_ROUND_KEY_BYTE(i32 %18)
%20 = load i32*, i32** %3
%21 = load i32, i32* %5
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %20, i64 %22
%24 = load i32, i32* %23
%25 = xor i32 %24, %19
store i32 %25, i32* %23
br label %26
26: ; preds = %12
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %9
29: ; preds = %9
store i32 1, i32* %5
br label %30
30: ; preds = %39, %29
%31 = load i32, i32* %5
%32 = icmp sle i32 %31, 12
br i1 %32, label %33, label %42
33: ; preds = %30
%34 = load i32*, i32** %3
%35 = load i32*, i32** %4
%36 = load i32, i32* %5
%37 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%38 = call i32 @rrr_enc_dec_round(i32* %34, i32* %35, i32 %36, i32* %37, i32 1)
br label %39
39: ; preds = %33
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 1
store i32 %41, i32* %5
br label %30
42: ; preds = %30
store i32 0, i32* %5
br label %43
43: ; preds = %55, %42
%44 = load i32, i32* %5
%45 = icmp slt i32 %44, 4
br i1 %45, label %46, label %58
46: ; preds = %43
%47 = load i32*, i32** %3
%48 = load i32, i32* %5
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i32, i32* %47, i64 %49
%51 = load i32, i32* %50
%52 = load i32, i32* %5
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 %53
store i32 %51, i32* %54
br label %55
55: ; preds = %46
%56 = load i32, i32* %5
%57 = add nsw i32 %56, 1
store i32 %57, i32* %5
br label %43
58: ; preds = %43
store i32 0, i32* %5
br label %59
59: ; preds = %80, %58
%60 = load i32, i32* %5
%61 = icmp slt i32 %60, 4
br i1 %61, label %62, label %83
62: ; preds = %59
%63 = load i32*, i32** %3
%64 = load i32, i32* %5
%65 = add nsw i32 %64, 4
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i32, i32* %63, i64 %66
%68 = load i32, i32* %67
%69 = load i32*, i32** %4
%70 = load i32, i32* %5
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds i32, i32* %69, i64 %71
%73 = load i32, i32* %72
%74 = call i32 @READ_ROUND_KEY_BYTE(i32 %73)
%75 = xor i32 %68, %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 = %62
%81 = load i32, i32* %5
%82 = add nsw i32 %81, 1
store i32 %82, i32* %5
br label %59
83: ; preds = %59
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 @Decrypt(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 8, i32* %6
%7 = getelementptr inbounds i32, i32* %1, i64 4
%8 = load i32, i32* %7
%9 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %8)
%10 = load i32, i32* %0
%11 = xor i32 %10, %9
store i32 %11, i32* %0
%12 = getelementptr inbounds i32, i32* %1, i64 5
%13 = load i32, i32* %12
%14 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %13)
%15 = getelementptr inbounds i32, i32* %0, i64 1
%16 = load i32, i32* %15
%17 = xor i32 %16, %14
store i32 %17, i32* %15
%18 = getelementptr inbounds i32, i32* %1, i64 6
%19 = load i32, i32* %18
%20 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %19)
%21 = getelementptr inbounds i32, i32* %0, i64 2
%22 = load i32, i32* %21
%23 = xor i32 %22, %20
store i32 %23, i32* %21
%24 = getelementptr inbounds i32, i32* %1, i64 7
%25 = load i32, i32* %24
%26 = tail call i32 @READ_ROUND_KEY_BYTE(i32 %25)
%27 = getelementptr inbounds i32, i32* %0, i64 3
%28 = load i32, i32* %27
%29 = xor i32 %28, %26
store i32 %29, i32* %27
%30 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 1, i32* %6, i32 1)
%31 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 2, i32* %6, i32 1)
%32 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 3, i32* %6, i32 1)
%33 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 4, i32* %6, i32 1)
%34 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 5, i32* %6, i32 1)
%35 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 6, i32* %6, i32 1)
%36 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 7, i32* %6, i32 1)
%37 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 8, i32* %6, i32 1)
%38 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 9, i32* %6, i32 1)
%39 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 10, i32* %6, i32 1)
%40 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 11, i32* %6, i32 1)
%41 = call i32 @rrr_enc_dec_round(i32* %0, i32* %1, i32 12, i32* %6, i32 1)
%42 = getelementptr i32, i32* %0, i64 4
%43 = load i32, i32* %42
%44 = load i32, i32* %1
%45 = call i32 @READ_ROUND_KEY_BYTE(i32 %44)
%46 = xor i32 %45, %43
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 1
%50 = load i32, i32* %49
%51 = call i32 @READ_ROUND_KEY_BYTE(i32 %50)
%52 = xor i32 %51, %48
store i32 %52, i32* %15
%53 = getelementptr inbounds i32, i32* %0, i64 6
%54 = load i32, i32* %53
%55 = getelementptr inbounds i32, i32* %1, i64 2
%56 = load i32, i32* %55
%57 = call i32 @READ_ROUND_KEY_BYTE(i32 %56)
%58 = xor i32 %57, %54
store i32 %58, i32* %21
%59 = getelementptr inbounds i32, i32* %0, i64 7
%60 = load i32, i32* %59
%61 = getelementptr inbounds i32, i32* %1, i64 3
%62 = load i32, i32* %61
%63 = call i32 @READ_ROUND_KEY_BYTE(i32 %62)
%64 = xor i32 %63, %60
store i32 %64, i32* %27
%65 = bitcast i32* %42 to i8*
ret void
}