#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(int);
int /*<<< orphan*/ MixColumns();
int /*<<< orphan*/ ShiftRows();
int /*<<< orphan*/ SubBytes();
void AES_encrypt(void) {
  unsigned char round = 0;
  AddRoundKey(0);
  for (round = 1; round < 10; ++round) {
    SubBytes();
    ShiftRows();
    MixColumns();
    AddRoundKey(round);
  }
  SubBytes();
  ShiftRows();
  AddRoundKey(10);
}


x86 assembly (clang, -O0):
<AES_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x0,-0x1(%rbp)
xor    %edi,%edi
call   1040 <AddRoundKey@plt>
movb   $0x1,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cmp    $0xa,%eax
jge    118f <AES_encrypt+0x4f>
mov    $0x0,%al
call   1050 <SubBytes@plt>
mov    $0x0,%al
call   1030 <ShiftRows@plt>
mov    $0x0,%al
call   1060 <MixColumns@plt>
movzbl -0x1(%rbp),%edi
call   1040 <AddRoundKey@plt>
mov    -0x1(%rbp),%al
add    $0x1,%al
mov    %al,-0x1(%rbp)
jmp    1157 <AES_encrypt+0x17>
mov    $0x0,%al
call   1050 <SubBytes@plt>
mov    $0x0,%al
call   1030 <ShiftRows@plt>
mov    $0xa,%edi
call   1040 <AddRoundKey@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @AES_encrypt() {
%1 = alloca i8
store i8 0, i8* %1
%2 = call i32 @AddRoundKey(i32 0)
store i8 1, i8* %1
br label %3
3: ; preds = %14, %0
%4 = load i8, i8* %1
%5 = zext i8 %4 to i32
%6 = icmp slt i32 %5, 10
br i1 %6, label %7, label %17
7: ; preds = %3
%8 = call i32 (...) @SubBytes()
%9 = call i32 (...) @ShiftRows()
%10 = call i32 (...) @MixColumns()
%11 = load i8, i8* %1
%12 = zext i8 %11 to i32
%13 = call i32 @AddRoundKey(i32 %12)
br label %14
14: ; preds = %7
%15 = load i8, i8* %1
%16 = add i8 %15, 1
store i8 %16, i8* %1
br label %3
17: ; preds = %3
%18 = call i32 (...) @SubBytes()
%19 = call i32 (...) @ShiftRows()
%20 = call i32 @AddRoundKey(i32 10)
ret void
}

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