#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 **, int);
int /*<<< orphan*/ InvByteSub(unsigned char **);
int /*<<< orphan*/ InvMixColumn(unsigned char **);
int /*<<< orphan*/ InvShiftRow(unsigned char **);
void Decrypt(unsigned char State[4][4]) {
  int i, j;
  AddRoundKey(State, 10);
  InvShiftRow(State);
  InvByteSub(State);
  for (i = 9; i > 0; i--) {
    AddRoundKey(State, i);
    InvMixColumn(State);
    InvShiftRow(State);
    InvByteSub(State);
  }
  AddRoundKey(State, 0);
}


x86 assembly (clang, -O0):
<Decrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xa,%esi
call   1030 <AddRoundKey@plt>
mov    -0x8(%rbp),%rdi
call   1050 <InvShiftRow@plt>
mov    -0x8(%rbp),%rdi
call   1060 <InvByteSub@plt>
movl   $0x9,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jle    11b2 <Decrypt+0x72>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <AddRoundKey@plt>
mov    -0x8(%rbp),%rdi
call   1040 <InvMixColumn@plt>
mov    -0x8(%rbp),%rdi
call   1050 <InvShiftRow@plt>
mov    -0x8(%rbp),%rdi
call   1060 <InvByteSub@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1173 <Decrypt+0x33>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <AddRoundKey@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Decrypt>:
push   %rbx
mov    %rdi,%rbx
mov    $0xa,%esi
call   1030 <AddRoundKey@plt>
mov    %rbx,%rdi
call   1050 <InvShiftRow@plt>
mov    %rbx,%rdi
call   1060 <InvByteSub@plt>
mov    %rbx,%rdi
mov    $0x9,%esi
call   1030 <AddRoundKey@plt>
mov    %rbx,%rdi
call   1040 <InvMixColumn@plt>
mov    %rbx,%rdi
call   1050 <InvShiftRow@plt>
mov    %rbx,%rdi
call   1060 <InvByteSub@plt>
mov    %rbx,%rdi
mov    $0x8,%esi
call   1030 <AddRoundKey@plt>
mov    %rbx,%rdi
call   1040 <InvMixColumn@plt>
mov    %rbx,%rdi
call   1050 <InvShiftRow@plt>
mov    %rbx,%rdi
call   1060 <InvByteSub@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
call   1030 <AddRoundKey@plt>
mov    %rbx,%rdi
call   1040 <InvMixColumn@plt>
mov    %rbx,%rdi
call   1050 <InvShiftRow@plt>
mov    %rbx,%rdi
call   1060 <InvByteSub@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
call   1030 <AddRoundKey@plt>
mov    %rbx,%rdi
call   1040 <InvMixColumn@plt>
mov    %rbx,%rdi
call   1050 <InvShiftRow@plt>
mov    %rbx,%rdi
call   1060 <InvByteSub@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <AddRoundKey@plt>
mov    %rbx,%rdi
call   1040 <InvMixColumn@plt>
mov    %rbx,%rdi
call   1050 <InvShiftRow@plt>
mov    %rbx,%rdi
call   1060 <InvByteSub@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <AddRoundKey@plt>
mov    %rbx,%rdi
call   1040 <InvMixColumn@plt>
mov    %rbx,%rdi
call   1050 <InvShiftRow@plt>
mov    %rbx,%rdi
call   1060 <InvByteSub@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
call   1030 <AddRoundKey@plt>
mov    %rbx,%rdi
call   1040 <InvMixColumn@plt>
mov    %rbx,%rdi
call   1050 <InvShiftRow@plt>
mov    %rbx,%rdi
call   1060 <InvByteSub@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
call   1030 <AddRoundKey@plt>
mov    %rbx,%rdi
call   1040 <InvMixColumn@plt>
mov    %rbx,%rdi
call   1050 <InvShiftRow@plt>
mov    %rbx,%rdi
call   1060 <InvByteSub@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <AddRoundKey@plt>
mov    %rbx,%rdi
call   1040 <InvMixColumn@plt>
mov    %rbx,%rdi
call   1050 <InvShiftRow@plt>
mov    %rbx,%rdi
call   1060 <InvByteSub@plt>
mov    %rbx,%rdi
xor    %esi,%esi
pop    %rbx
jmp    1030 <AddRoundKey@plt>

LLVM IR (-O0):
define void @Decrypt([4 x i8]* %0) {
%2 = alloca [4 x i8]*
%3 = alloca i32
%4 = alloca i32
store [4 x i8]* %0, [4 x i8]** %2
%5 = load [4 x i8]*, [4 x i8]** %2
%6 = bitcast [4 x i8]* %5 to i8**
%7 = call i32 @AddRoundKey(i8** %6, i32 10)
%8 = load [4 x i8]*, [4 x i8]** %2
%9 = bitcast [4 x i8]* %8 to i8**
%10 = call i32 @InvShiftRow(i8** %9)
%11 = load [4 x i8]*, [4 x i8]** %2
%12 = bitcast [4 x i8]* %11 to i8**
%13 = call i32 @InvByteSub(i8** %12)
store i32 9, i32* %3
br label %14
14: ; preds = %31, %1
%15 = load i32, i32* %3
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %34
17: ; preds = %14
%18 = load [4 x i8]*, [4 x i8]** %2
%19 = bitcast [4 x i8]* %18 to i8**
%20 = load i32, i32* %3
%21 = call i32 @AddRoundKey(i8** %19, i32 %20)
%22 = load [4 x i8]*, [4 x i8]** %2
%23 = bitcast [4 x i8]* %22 to i8**
%24 = call i32 @InvMixColumn(i8** %23)
%25 = load [4 x i8]*, [4 x i8]** %2
%26 = bitcast [4 x i8]* %25 to i8**
%27 = call i32 @InvShiftRow(i8** %26)
%28 = load [4 x i8]*, [4 x i8]** %2
%29 = bitcast [4 x i8]* %28 to i8**
%30 = call i32 @InvByteSub(i8** %29)
br label %31
31: ; preds = %17
%32 = load i32, i32* %3
%33 = add nsw i32 %32, -1
store i32 %33, i32* %3
br label %14
34: ; preds = %14
%35 = load [4 x i8]*, [4 x i8]** %2
%36 = bitcast [4 x i8]* %35 to i8**
%37 = call i32 @AddRoundKey(i8** %36, i32 0)
ret void
}

LLVM IR (-O2):
define void @Decrypt([4 x i8]* %0) {
%2 = bitcast [4 x i8]* %0 to i8**
%3 = tail call i32 @AddRoundKey(i8** %2, i32 10)
%4 = tail call i32 @InvShiftRow(i8** %2)
%5 = tail call i32 @InvByteSub(i8** %2)
%6 = tail call i32 @AddRoundKey(i8** %2, i32 9)
%7 = tail call i32 @InvMixColumn(i8** %2)
%8 = tail call i32 @InvShiftRow(i8** %2)
%9 = tail call i32 @InvByteSub(i8** %2)
%10 = tail call i32 @AddRoundKey(i8** %2, i32 8)
%11 = tail call i32 @InvMixColumn(i8** %2)
%12 = tail call i32 @InvShiftRow(i8** %2)
%13 = tail call i32 @InvByteSub(i8** %2)
%14 = tail call i32 @AddRoundKey(i8** %2, i32 7)
%15 = tail call i32 @InvMixColumn(i8** %2)
%16 = tail call i32 @InvShiftRow(i8** %2)
%17 = tail call i32 @InvByteSub(i8** %2)
%18 = tail call i32 @AddRoundKey(i8** %2, i32 6)
%19 = tail call i32 @InvMixColumn(i8** %2)
%20 = tail call i32 @InvShiftRow(i8** %2)
%21 = tail call i32 @InvByteSub(i8** %2)
%22 = tail call i32 @AddRoundKey(i8** %2, i32 5)
%23 = tail call i32 @InvMixColumn(i8** %2)
%24 = tail call i32 @InvShiftRow(i8** %2)
%25 = tail call i32 @InvByteSub(i8** %2)
%26 = tail call i32 @AddRoundKey(i8** %2, i32 4)
%27 = tail call i32 @InvMixColumn(i8** %2)
%28 = tail call i32 @InvShiftRow(i8** %2)
%29 = tail call i32 @InvByteSub(i8** %2)
%30 = tail call i32 @AddRoundKey(i8** %2, i32 3)
%31 = tail call i32 @InvMixColumn(i8** %2)
%32 = tail call i32 @InvShiftRow(i8** %2)
%33 = tail call i32 @InvByteSub(i8** %2)
%34 = tail call i32 @AddRoundKey(i8** %2, i32 2)
%35 = tail call i32 @InvMixColumn(i8** %2)
%36 = tail call i32 @InvShiftRow(i8** %2)
%37 = tail call i32 @InvByteSub(i8** %2)
%38 = tail call i32 @AddRoundKey(i8** %2, i32 1)
%39 = tail call i32 @InvMixColumn(i8** %2)
%40 = tail call i32 @InvShiftRow(i8** %2)
%41 = tail call i32 @InvByteSub(i8** %2)
%42 = tail call i32 @AddRoundKey(i8** %2, i32 0)
ret void
}