#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 */

/* Variables and functions */
int /*<<< orphan*/ addRoundKey(unsigned char *const, unsigned char const *);
int /*<<< orphan*/ invMixColumns(unsigned char *const);
int /*<<< orphan*/ invShiftRows(unsigned char *const);
int /*<<< orphan*/ invSubBytes(unsigned char *const, int);
void decryptBlock(unsigned char *const block,
                  const unsigned char *const expandedKey) {
  int keyIndex = 10;
  int i;
  addRoundKey(block, &expandedKey[(keyIndex--) * 16]);
  for (i = 0; i < 9; i++) {
    invShiftRows(block);
    invSubBytes(block, 16);
    addRoundKey(block, &expandedKey[(keyIndex--) * 16]);
    invMixColumns(block);
  }
  invShiftRows(block);
  invSubBytes(block, 16);
  addRoundKey(block, &expandedKey[(keyIndex--) * 16]);
}


x86 assembly (clang, -O0):
<decryptBlock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
shl    $0x4,%eax
cltq
add    %rax,%rsi
call   1040 <addRoundKey@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x9,-0x18(%rbp)
jge    11d6 <decryptBlock+0x96>
mov    -0x8(%rbp),%rdi
call   1050 <invShiftRows@plt>
mov    -0x8(%rbp),%rdi
mov    $0x10,%esi
call   1060 <invSubBytes@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
shl    $0x4,%eax
cltq
add    %rax,%rsi
call   1040 <addRoundKey@plt>
mov    -0x8(%rbp),%rdi
call   1030 <invMixColumns@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    117e <decryptBlock+0x3e>
mov    -0x8(%rbp),%rdi
call   1050 <invShiftRows@plt>
mov    -0x8(%rbp),%rdi
mov    $0x10,%esi
call   1060 <invSubBytes@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
shl    $0x4,%eax
cltq
add    %rax,%rsi
call   1040 <addRoundKey@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decryptBlock>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0xa0,%rsi
call   1040 <addRoundKey@plt>
mov    %rbx,%rdi
call   1050 <invShiftRows@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1060 <invSubBytes@plt>
lea    0x90(%r14),%rsi
mov    %rbx,%rdi
call   1040 <addRoundKey@plt>
mov    %rbx,%rdi
call   1030 <invMixColumns@plt>
mov    %rbx,%rdi
call   1050 <invShiftRows@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1060 <invSubBytes@plt>
lea    0x80(%r14),%rsi
mov    %rbx,%rdi
call   1040 <addRoundKey@plt>
mov    %rbx,%rdi
call   1030 <invMixColumns@plt>
mov    %rbx,%rdi
call   1050 <invShiftRows@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1060 <invSubBytes@plt>
lea    0x70(%r14),%rsi
mov    %rbx,%rdi
call   1040 <addRoundKey@plt>
mov    %rbx,%rdi
call   1030 <invMixColumns@plt>
mov    %rbx,%rdi
call   1050 <invShiftRows@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1060 <invSubBytes@plt>
lea    0x60(%r14),%rsi
mov    %rbx,%rdi
call   1040 <addRoundKey@plt>
mov    %rbx,%rdi
call   1030 <invMixColumns@plt>
mov    %rbx,%rdi
call   1050 <invShiftRows@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1060 <invSubBytes@plt>
lea    0x50(%r14),%rsi
mov    %rbx,%rdi
call   1040 <addRoundKey@plt>
mov    %rbx,%rdi
call   1030 <invMixColumns@plt>
mov    %rbx,%rdi
call   1050 <invShiftRows@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1060 <invSubBytes@plt>
lea    0x40(%r14),%rsi
mov    %rbx,%rdi
call   1040 <addRoundKey@plt>
mov    %rbx,%rdi
call   1030 <invMixColumns@plt>
mov    %rbx,%rdi
call   1050 <invShiftRows@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1060 <invSubBytes@plt>
lea    0x30(%r14),%rsi
mov    %rbx,%rdi
call   1040 <addRoundKey@plt>
mov    %rbx,%rdi
call   1030 <invMixColumns@plt>
mov    %rbx,%rdi
call   1050 <invShiftRows@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1060 <invSubBytes@plt>
lea    0x20(%r14),%rsi
mov    %rbx,%rdi
call   1040 <addRoundKey@plt>
mov    %rbx,%rdi
call   1030 <invMixColumns@plt>
mov    %rbx,%rdi
call   1050 <invShiftRows@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1060 <invSubBytes@plt>
lea    0x10(%r14),%rsi
mov    %rbx,%rdi
call   1040 <addRoundKey@plt>
mov    %rbx,%rdi
call   1030 <invMixColumns@plt>
mov    %rbx,%rdi
call   1050 <invShiftRows@plt>
mov    %rbx,%rdi
mov    $0x10,%esi
call   1060 <invSubBytes@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <addRoundKey@plt>

LLVM IR (-O0):
define void @decryptBlock(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 10, i32* %5
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = add nsw i32 %9, -1
store i32 %10, i32* %5
%11 = mul nsw i32 %9, 16
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %8, i64 %12
%14 = call i32 @addRoundKey(i8* %7, i8* %13)
store i32 0, i32* %6
br label %15
15: ; preds = %33, %2
%16 = load i32, i32* %6
%17 = icmp slt i32 %16, 9
br i1 %17, label %18, label %36
18: ; preds = %15
%19 = load i8*, i8** %3
%20 = call i32 @invShiftRows(i8* %19)
%21 = load i8*, i8** %3
%22 = call i32 @invSubBytes(i8* %21, i32 16)
%23 = load i8*, i8** %3
%24 = load i8*, i8** %4
%25 = load i32, i32* %5
%26 = add nsw i32 %25, -1
store i32 %26, i32* %5
%27 = mul nsw i32 %25, 16
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %24, i64 %28
%30 = call i32 @addRoundKey(i8* %23, i8* %29)
%31 = load i8*, i8** %3
%32 = call i32 @invMixColumns(i8* %31)
br label %33
33: ; preds = %18
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
store i32 %35, i32* %6
br label %15
36: ; preds = %15
%37 = load i8*, i8** %3
%38 = call i32 @invShiftRows(i8* %37)
%39 = load i8*, i8** %3
%40 = call i32 @invSubBytes(i8* %39, i32 16)
%41 = load i8*, i8** %3
%42 = load i8*, i8** %4
%43 = load i32, i32* %5
%44 = add nsw i32 %43, -1
store i32 %44, i32* %5
%45 = mul nsw i32 %43, 16
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8, i8* %42, i64 %46
%48 = call i32 @addRoundKey(i8* %41, i8* %47)
ret void
}

LLVM IR (-O2):
define void @decryptBlock(i8* %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 160
%4 = tail call i32 @addRoundKey(i8* %0, i8* %3)
%5 = tail call i32 @invShiftRows(i8* %0)
%6 = tail call i32 @invSubBytes(i8* %0, i32 16)
%7 = getelementptr inbounds i8, i8* %1, i64 144
%8 = tail call i32 @addRoundKey(i8* %0, i8* %7)
%9 = tail call i32 @invMixColumns(i8* %0)
%10 = tail call i32 @invShiftRows(i8* %0)
%11 = tail call i32 @invSubBytes(i8* %0, i32 16)
%12 = getelementptr inbounds i8, i8* %1, i64 128
%13 = tail call i32 @addRoundKey(i8* %0, i8* %12)
%14 = tail call i32 @invMixColumns(i8* %0)
%15 = tail call i32 @invShiftRows(i8* %0)
%16 = tail call i32 @invSubBytes(i8* %0, i32 16)
%17 = getelementptr inbounds i8, i8* %1, i64 112
%18 = tail call i32 @addRoundKey(i8* %0, i8* %17)
%19 = tail call i32 @invMixColumns(i8* %0)
%20 = tail call i32 @invShiftRows(i8* %0)
%21 = tail call i32 @invSubBytes(i8* %0, i32 16)
%22 = getelementptr inbounds i8, i8* %1, i64 96
%23 = tail call i32 @addRoundKey(i8* %0, i8* %22)
%24 = tail call i32 @invMixColumns(i8* %0)
%25 = tail call i32 @invShiftRows(i8* %0)
%26 = tail call i32 @invSubBytes(i8* %0, i32 16)
%27 = getelementptr inbounds i8, i8* %1, i64 80
%28 = tail call i32 @addRoundKey(i8* %0, i8* %27)
%29 = tail call i32 @invMixColumns(i8* %0)
%30 = tail call i32 @invShiftRows(i8* %0)
%31 = tail call i32 @invSubBytes(i8* %0, i32 16)
%32 = getelementptr inbounds i8, i8* %1, i64 64
%33 = tail call i32 @addRoundKey(i8* %0, i8* %32)
%34 = tail call i32 @invMixColumns(i8* %0)
%35 = tail call i32 @invShiftRows(i8* %0)
%36 = tail call i32 @invSubBytes(i8* %0, i32 16)
%37 = getelementptr inbounds i8, i8* %1, i64 48
%38 = tail call i32 @addRoundKey(i8* %0, i8* %37)
%39 = tail call i32 @invMixColumns(i8* %0)
%40 = tail call i32 @invShiftRows(i8* %0)
%41 = tail call i32 @invSubBytes(i8* %0, i32 16)
%42 = getelementptr inbounds i8, i8* %1, i64 32
%43 = tail call i32 @addRoundKey(i8* %0, i8* %42)
%44 = tail call i32 @invMixColumns(i8* %0)
%45 = tail call i32 @invShiftRows(i8* %0)
%46 = tail call i32 @invSubBytes(i8* %0, i32 16)
%47 = getelementptr inbounds i8, i8* %1, i64 16
%48 = tail call i32 @addRoundKey(i8* %0, i8* %47)
%49 = tail call i32 @invMixColumns(i8* %0)
%50 = tail call i32 @invShiftRows(i8* %0)
%51 = tail call i32 @invSubBytes(i8* %0, i32 16)
%52 = tail call i32 @addRoundKey(i8* %0, i8* %1)
ret void
}