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


x86 assembly (clang, -O0):
<Cipher>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x9,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x10,%edx
call   1040 <XORBytes@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x10,%esi
call   1050 <SubBytes@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ShiftRows@plt>
mov    -0x8(%rbp),%rdi
call   1060 <MixColumns@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x10,%edx
call   1040 <XORBytes@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
mov    -0x11(%rbp),%al
add    $0xff,%al
mov    %al,-0x11(%rbp)
cmp    $0x0,%al
jne    1172 <Cipher+0x32>
mov    -0x8(%rbp),%rdi
mov    $0x10,%esi
call   1050 <SubBytes@plt>
mov    -0x8(%rbp),%rdi
call   1030 <ShiftRows@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x10,%edx
call   1040 <XORBytes@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Cipher(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** %3
%7 = load i8*, i8** %4
%8 = call i32 @XORBytes(i8* %6, i8* %7, i32 16)
%9 = load i8*, i8** %4
%10 = getelementptr inbounds i8, i8* %9, i64 16
store i8* %10, i8** %4
br label %11
11: ; preds = %23, %2
%12 = load i8*, i8** %3
%13 = call i32 @SubBytes(i8* %12, i32 16)
%14 = load i8*, i8** %3
%15 = call i32 @ShiftRows(i8* %14)
%16 = load i8*, i8** %3
%17 = call i32 @MixColumns(i8* %16)
%18 = load i8*, i8** %3
%19 = load i8*, i8** %4
%20 = call i32 @XORBytes(i8* %18, i8* %19, i32 16)
%21 = load i8*, i8** %4
%22 = getelementptr inbounds i8, i8* %21, i64 16
store i8* %22, i8** %4
br label %23
23: ; preds = %11
%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 %11, label %27
27: ; preds = %23
%28 = load i8*, i8** %3
%29 = call i32 @SubBytes(i8* %28, i32 16)
%30 = load i8*, i8** %3
%31 = call i32 @ShiftRows(i8* %30)
%32 = load i8*, i8** %3
%33 = load i8*, i8** %4
%34 = call i32 @XORBytes(i8* %32, i8* %33, i32 16)
ret void
}

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