#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 /*<<< orphan*/ AddRoundKey(int);
int /*<<< orphan*/ InvMixColumns();
int /*<<< orphan*/ InvShiftRows();
int /*<<< orphan*/ InvSubBytes();
void InvCipher(void) {
  uint8_t round = 0;
  AddRoundKey(10);
  for (round = (10 - 1); round > 0; --round) {
    InvShiftRows();
    InvSubBytes();
    AddRoundKey(round);
    InvMixColumns();
  }
  InvShiftRows();
  InvSubBytes();
  AddRoundKey(0);
}


x86 assembly (clang, -O0):
<InvCipher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xa,%edi
call   1040 <AddRoundKey@plt>
movl   $0x9,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1195 <InvCipher+0x55>
mov    $0x0,%al
call   1050 <InvShiftRows@plt>
mov    $0x0,%al
call   1060 <InvSubBytes@plt>
mov    -0x4(%rbp),%edi
call   1040 <AddRoundKey@plt>
mov    $0x0,%al
call   1030 <InvMixColumns@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1160 <InvCipher+0x20>
mov    $0x0,%al
call   1050 <InvShiftRows@plt>
mov    $0x0,%al
call   1060 <InvSubBytes@plt>
xor    %edi,%edi
call   1040 <AddRoundKey@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<InvCipher>:
push   %rax
mov    $0xa,%edi
call   1040 <AddRoundKey@plt>
xor    %eax,%eax
call   1050 <InvShiftRows@plt>
xor    %eax,%eax
call   1060 <InvSubBytes@plt>
mov    $0x9,%edi
call   1040 <AddRoundKey@plt>
xor    %eax,%eax
call   1030 <InvMixColumns@plt>
xor    %eax,%eax
call   1050 <InvShiftRows@plt>
xor    %eax,%eax
call   1060 <InvSubBytes@plt>
mov    $0x8,%edi
call   1040 <AddRoundKey@plt>
xor    %eax,%eax
call   1030 <InvMixColumns@plt>
xor    %eax,%eax
call   1050 <InvShiftRows@plt>
xor    %eax,%eax
call   1060 <InvSubBytes@plt>
mov    $0x7,%edi
call   1040 <AddRoundKey@plt>
xor    %eax,%eax
call   1030 <InvMixColumns@plt>
xor    %eax,%eax
call   1050 <InvShiftRows@plt>
xor    %eax,%eax
call   1060 <InvSubBytes@plt>
mov    $0x6,%edi
call   1040 <AddRoundKey@plt>
xor    %eax,%eax
call   1030 <InvMixColumns@plt>
xor    %eax,%eax
call   1050 <InvShiftRows@plt>
xor    %eax,%eax
call   1060 <InvSubBytes@plt>
mov    $0x5,%edi
call   1040 <AddRoundKey@plt>
xor    %eax,%eax
call   1030 <InvMixColumns@plt>
xor    %eax,%eax
call   1050 <InvShiftRows@plt>
xor    %eax,%eax
call   1060 <InvSubBytes@plt>
mov    $0x4,%edi
call   1040 <AddRoundKey@plt>
xor    %eax,%eax
call   1030 <InvMixColumns@plt>
xor    %eax,%eax
call   1050 <InvShiftRows@plt>
xor    %eax,%eax
call   1060 <InvSubBytes@plt>
mov    $0x3,%edi
call   1040 <AddRoundKey@plt>
xor    %eax,%eax
call   1030 <InvMixColumns@plt>
xor    %eax,%eax
call   1050 <InvShiftRows@plt>
xor    %eax,%eax
call   1060 <InvSubBytes@plt>
mov    $0x2,%edi
call   1040 <AddRoundKey@plt>
xor    %eax,%eax
call   1030 <InvMixColumns@plt>
xor    %eax,%eax
call   1050 <InvShiftRows@plt>
xor    %eax,%eax
call   1060 <InvSubBytes@plt>
mov    $0x1,%edi
call   1040 <AddRoundKey@plt>
xor    %eax,%eax
call   1030 <InvMixColumns@plt>
xor    %eax,%eax
call   1050 <InvShiftRows@plt>
xor    %eax,%eax
call   1060 <InvSubBytes@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <AddRoundKey@plt>

LLVM IR (-O0):
define void @InvCipher() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @AddRoundKey(i32 10)
store i32 9, i32* %1
br label %3
3: ; preds = %12, %0
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = call i32 (...) @InvShiftRows()
%8 = call i32 (...) @InvSubBytes()
%9 = load i32, i32* %1
%10 = call i32 @AddRoundKey(i32 %9)
%11 = call i32 (...) @InvMixColumns()
br label %12
12: ; preds = %6
%13 = load i32, i32* %1
%14 = add nsw i32 %13, -1
store i32 %14, i32* %1
br label %3
15: ; preds = %3
%16 = call i32 (...) @InvShiftRows()
%17 = call i32 (...) @InvSubBytes()
%18 = call i32 @AddRoundKey(i32 0)
ret void
}

LLVM IR (-O2):
define void @InvCipher() {
%1 = tail call i32 @AddRoundKey(i32 10)
%2 = tail call i32 (...) @InvShiftRows()
%3 = tail call i32 (...) @InvSubBytes()
%4 = tail call i32 @AddRoundKey(i32 9)
%5 = tail call i32 (...) @InvMixColumns()
%6 = tail call i32 (...) @InvShiftRows()
%7 = tail call i32 (...) @InvSubBytes()
%8 = tail call i32 @AddRoundKey(i32 8)
%9 = tail call i32 (...) @InvMixColumns()
%10 = tail call i32 (...) @InvShiftRows()
%11 = tail call i32 (...) @InvSubBytes()
%12 = tail call i32 @AddRoundKey(i32 7)
%13 = tail call i32 (...) @InvMixColumns()
%14 = tail call i32 (...) @InvShiftRows()
%15 = tail call i32 (...) @InvSubBytes()
%16 = tail call i32 @AddRoundKey(i32 6)
%17 = tail call i32 (...) @InvMixColumns()
%18 = tail call i32 (...) @InvShiftRows()
%19 = tail call i32 (...) @InvSubBytes()
%20 = tail call i32 @AddRoundKey(i32 5)
%21 = tail call i32 (...) @InvMixColumns()
%22 = tail call i32 (...) @InvShiftRows()
%23 = tail call i32 (...) @InvSubBytes()
%24 = tail call i32 @AddRoundKey(i32 4)
%25 = tail call i32 (...) @InvMixColumns()
%26 = tail call i32 (...) @InvShiftRows()
%27 = tail call i32 (...) @InvSubBytes()
%28 = tail call i32 @AddRoundKey(i32 3)
%29 = tail call i32 (...) @InvMixColumns()
%30 = tail call i32 (...) @InvShiftRows()
%31 = tail call i32 (...) @InvSubBytes()
%32 = tail call i32 @AddRoundKey(i32 2)
%33 = tail call i32 (...) @InvMixColumns()
%34 = tail call i32 (...) @InvShiftRows()
%35 = tail call i32 (...) @InvSubBytes()
%36 = tail call i32 @AddRoundKey(i32 1)
%37 = tail call i32 (...) @InvMixColumns()
%38 = tail call i32 (...) @InvShiftRows()
%39 = tail call i32 (...) @InvSubBytes()
%40 = tail call i32 @AddRoundKey(i32 0)
ret void
}