#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*/ InvMixColumns(unsigned char *);
int /*<<< orphan*/ InvShiftRows(unsigned char *);
int /*<<< orphan*/ InvSubBytesAndXOR(unsigned char *, unsigned char *, int);
int /*<<< orphan*/ XORBytes(unsigned char *, unsigned char *, int);
void InvCipher(unsigned char *block, unsigned char *expandedKey) {
  unsigned char round = 10 - 1;
  expandedKey += 16 * 10;
  XORBytes(block, expandedKey, 16);
  expandedKey -= 16;
  do {
    InvShiftRows(block);
    InvSubBytesAndXOR(block, expandedKey, 16);
    expandedKey -= 16;
    InvMixColumns(block);
  } while (--round);
  InvShiftRows(block);
  InvSubBytesAndXOR(block, expandedKey, 16);
}


x86 assembly (clang, -O0):
<InvCipher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x9,-0x11(%rbp)
mov    -0x10(%rbp),%rax
add    $0xa0,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x10,%edx
call   1050 <XORBytes@plt>
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffff0,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <InvShiftRows@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x10,%edx
call   1060 <InvSubBytesAndXOR@plt>
mov    -0x10(%rbp),%rax
add    $0xfffffffffffffff0,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <InvMixColumns@plt>
mov    -0x11(%rbp),%al
add    $0xff,%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
jne    1180 <InvCipher+0x40>
mov    -0x8(%rbp),%rdi
call   1040 <InvShiftRows@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x10,%edx
call   1060 <InvSubBytesAndXOR@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InvCipher>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0xa0,%rsi
mov    $0x10,%edx
call   1050 <XORBytes@plt>
lea    0x90(%r14),%r15
mov    %rbx,%rdi
call   1040 <InvShiftRows@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x10,%edx
call   1060 <InvSubBytesAndXOR@plt>
lea    0x80(%r14),%r15
mov    %rbx,%rdi
call   1030 <InvMixColumns@plt>
mov    %rbx,%rdi
call   1040 <InvShiftRows@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x10,%edx
call   1060 <InvSubBytesAndXOR@plt>
lea    0x70(%r14),%r15
mov    %rbx,%rdi
call   1030 <InvMixColumns@plt>
mov    %rbx,%rdi
call   1040 <InvShiftRows@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x10,%edx
call   1060 <InvSubBytesAndXOR@plt>
lea    0x60(%r14),%r15
mov    %rbx,%rdi
call   1030 <InvMixColumns@plt>
mov    %rbx,%rdi
call   1040 <InvShiftRows@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x10,%edx
call   1060 <InvSubBytesAndXOR@plt>
lea    0x50(%r14),%r15
mov    %rbx,%rdi
call   1030 <InvMixColumns@plt>
mov    %rbx,%rdi
call   1040 <InvShiftRows@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x10,%edx
call   1060 <InvSubBytesAndXOR@plt>
lea    0x40(%r14),%r15
mov    %rbx,%rdi
call   1030 <InvMixColumns@plt>
mov    %rbx,%rdi
call   1040 <InvShiftRows@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x10,%edx
call   1060 <InvSubBytesAndXOR@plt>
lea    0x30(%r14),%r15
mov    %rbx,%rdi
call   1030 <InvMixColumns@plt>
mov    %rbx,%rdi
call   1040 <InvShiftRows@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x10,%edx
call   1060 <InvSubBytesAndXOR@plt>
lea    0x20(%r14),%r15
mov    %rbx,%rdi
call   1030 <InvMixColumns@plt>
mov    %rbx,%rdi
call   1040 <InvShiftRows@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x10,%edx
call   1060 <InvSubBytesAndXOR@plt>
lea    0x10(%r14),%r15
mov    %rbx,%rdi
call   1030 <InvMixColumns@plt>
mov    %rbx,%rdi
call   1040 <InvShiftRows@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    $0x10,%edx
call   1060 <InvSubBytesAndXOR@plt>
mov    %rbx,%rdi
call   1030 <InvMixColumns@plt>
mov    %rbx,%rdi
call   1040 <InvShiftRows@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x10,%edx
pop    %rbx
pop    %r14
pop    %r15
jmp    1060 <InvSubBytesAndXOR@plt>

LLVM IR (-O0):
define void @InvCipher(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
store i8 9, i8* %5
%6 = load i8*, i8** %4
%7 = getelementptr inbounds i8, i8* %6, i64 160
store i8* %7, i8** %4
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call i32 @XORBytes(i8* %8, i8* %9, i32 16)
%11 = load i8*, i8** %4
%12 = getelementptr inbounds i8, i8* %11, i64 -16
store i8* %12, i8** %4
br label %13
13: ; preds = %23, %2
%14 = load i8*, i8** %3
%15 = call i32 @InvShiftRows(i8* %14)
%16 = load i8*, i8** %3
%17 = load i8*, i8** %4
%18 = call i32 @InvSubBytesAndXOR(i8* %16, i8* %17, i32 16)
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i64 -16
store i8* %20, i8** %4
%21 = load i8*, i8** %3
%22 = call i32 @InvMixColumns(i8* %21)
br label %23
23: ; preds = %13
%24 = load i8, i8* %5
%25 = add i8 %24, -1
store i8 %25, i8* %5
%26 = icmp ne i8 %25, 0
br i1 %26, label %13, label %27
27: ; preds = %23
%28 = load i8*, i8** %3
%29 = call i32 @InvShiftRows(i8* %28)
%30 = load i8*, i8** %3
%31 = load i8*, i8** %4
%32 = call i32 @InvSubBytesAndXOR(i8* %30, i8* %31, i32 16)
ret void
}

LLVM IR (-O2):
define void @InvCipher(i8* %0, i8* %1) {
%3 = getelementptr inbounds i8, i8* %1, i64 160
%4 = tail call i32 @XORBytes(i8* %0, i8* %3, i32 16)
%5 = getelementptr inbounds i8, i8* %1, i64 144
%6 = tail call i32 @InvShiftRows(i8* %0)
%7 = tail call i32 @InvSubBytesAndXOR(i8* %0, i8* %5, i32 16)
%8 = getelementptr inbounds i8, i8* %1, i64 128
%9 = tail call i32 @InvMixColumns(i8* %0)
%10 = tail call i32 @InvShiftRows(i8* %0)
%11 = tail call i32 @InvSubBytesAndXOR(i8* %0, i8* %8, i32 16)
%12 = getelementptr inbounds i8, i8* %1, i64 112
%13 = tail call i32 @InvMixColumns(i8* %0)
%14 = tail call i32 @InvShiftRows(i8* %0)
%15 = tail call i32 @InvSubBytesAndXOR(i8* %0, i8* %12, i32 16)
%16 = getelementptr inbounds i8, i8* %1, i64 96
%17 = tail call i32 @InvMixColumns(i8* %0)
%18 = tail call i32 @InvShiftRows(i8* %0)
%19 = tail call i32 @InvSubBytesAndXOR(i8* %0, i8* %16, i32 16)
%20 = getelementptr inbounds i8, i8* %1, i64 80
%21 = tail call i32 @InvMixColumns(i8* %0)
%22 = tail call i32 @InvShiftRows(i8* %0)
%23 = tail call i32 @InvSubBytesAndXOR(i8* %0, i8* %20, i32 16)
%24 = getelementptr inbounds i8, i8* %1, i64 64
%25 = tail call i32 @InvMixColumns(i8* %0)
%26 = tail call i32 @InvShiftRows(i8* %0)
%27 = tail call i32 @InvSubBytesAndXOR(i8* %0, i8* %24, i32 16)
%28 = getelementptr inbounds i8, i8* %1, i64 48
%29 = tail call i32 @InvMixColumns(i8* %0)
%30 = tail call i32 @InvShiftRows(i8* %0)
%31 = tail call i32 @InvSubBytesAndXOR(i8* %0, i8* %28, i32 16)
%32 = getelementptr inbounds i8, i8* %1, i64 32
%33 = tail call i32 @InvMixColumns(i8* %0)
%34 = tail call i32 @InvShiftRows(i8* %0)
%35 = tail call i32 @InvSubBytesAndXOR(i8* %0, i8* %32, i32 16)
%36 = getelementptr inbounds i8, i8* %1, i64 16
%37 = tail call i32 @InvMixColumns(i8* %0)
%38 = tail call i32 @InvShiftRows(i8* %0)
%39 = tail call i32 @InvSubBytesAndXOR(i8* %0, i8* %36, i32 16)
%40 = tail call i32 @InvMixColumns(i8* %0)
%41 = tail call i32 @InvShiftRows(i8* %0)
%42 = tail call i32 @InvSubBytesAndXOR(i8* %0, i8* %1, i32 16)
ret void
}