#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 /*<<< orphan*/ uint8_t;

/* Variables and functions */
void aes_ShiftRows(uint8_t state[16]) {
  uint8_t tmp;
  tmp = state[(((0) << 2) + (1))];
  state[(((0) << 2) + (1))] = state[(((1) << 2) + (1))];
  state[(((1) << 2) + (1))] = state[(((2) << 2) + (1))];
  state[(((2) << 2) + (1))] = state[(((3) << 2) + (1))];
  state[(((3) << 2) + (1))] = tmp;
  tmp = state[(((0) << 2) + (2))];
  state[(((0) << 2) + (2))] = state[(((2) << 2) + (2))];
  state[(((2) << 2) + (2))] = tmp;
  tmp = state[(((1) << 2) + (2))];
  state[(((1) << 2) + (2))] = state[(((3) << 2) + (2))];
  state[(((3) << 2) + (2))] = tmp;
  tmp = state[(((0) << 2) + (3))];
  state[(((0) << 2) + (3))] = state[(((3) << 2) + (3))];
  state[(((3) << 2) + (3))] = state[(((2) << 2) + (3))];
  state[(((2) << 2) + (3))] = state[(((1) << 2) + (3))];
  state[(((1) << 2) + (3))] = tmp;
}


x86 assembly (clang, -O0):
<aes_ShiftRows>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0x8(%rbp),%rax
mov    0x34(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x24(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x34(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x28(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x28(%rax)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x18(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x38(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x3c(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x8(%rbp),%rax
mov    0x2c(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x3c(%rax)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x2c(%rax)
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x1c(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<aes_ShiftRows>:
mov    0x14(%rdi),%eax
mov    0x4(%rdi),%ecx
mov    0x8(%rdi),%edx
mov    %eax,0x4(%rdi)
mov    0x24(%rdi),%eax
mov    %eax,0x14(%rdi)
mov    0x34(%rdi),%eax
mov    %eax,0x24(%rdi)
mov    %ecx,0x34(%rdi)
mov    0x28(%rdi),%eax
mov    %eax,0x8(%rdi)
mov    %edx,0x28(%rdi)
mov    0x18(%rdi),%eax
mov    0x38(%rdi),%ecx
mov    %ecx,0x18(%rdi)
mov    %eax,0x38(%rdi)
mov    0xc(%rdi),%eax
mov    0x3c(%rdi),%ecx
mov    %ecx,0xc(%rdi)
mov    0x2c(%rdi),%ecx
mov    %ecx,0x3c(%rdi)
mov    0x1c(%rdi),%ecx
mov    %ecx,0x2c(%rdi)
mov    %eax,0x1c(%rdi)
ret

LLVM IR (-O0):
define void @aes_ShiftRows(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = getelementptr inbounds i32, i32* %4, i64 1
%6 = load i32, i32* %5
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 5
%9 = load i32, i32* %8
%10 = load i32*, i32** %2
%11 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %9, i32* %11
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 9
%14 = load i32, i32* %13
%15 = load i32*, i32** %2
%16 = getelementptr inbounds i32, i32* %15, i64 5
store i32 %14, i32* %16
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 13
%19 = load i32, i32* %18
%20 = load i32*, i32** %2
%21 = getelementptr inbounds i32, i32* %20, i64 9
store i32 %19, i32* %21
%22 = load i32, i32* %3
%23 = load i32*, i32** %2
%24 = getelementptr inbounds i32, i32* %23, i64 13
store i32 %22, i32* %24
%25 = load i32*, i32** %2
%26 = getelementptr inbounds i32, i32* %25, i64 2
%27 = load i32, i32* %26
store i32 %27, i32* %3
%28 = load i32*, i32** %2
%29 = getelementptr inbounds i32, i32* %28, i64 10
%30 = load i32, i32* %29
%31 = load i32*, i32** %2
%32 = getelementptr inbounds i32, i32* %31, i64 2
store i32 %30, i32* %32
%33 = load i32, i32* %3
%34 = load i32*, i32** %2
%35 = getelementptr inbounds i32, i32* %34, i64 10
store i32 %33, i32* %35
%36 = load i32*, i32** %2
%37 = getelementptr inbounds i32, i32* %36, i64 6
%38 = load i32, i32* %37
store i32 %38, i32* %3
%39 = load i32*, i32** %2
%40 = getelementptr inbounds i32, i32* %39, i64 14
%41 = load i32, i32* %40
%42 = load i32*, i32** %2
%43 = getelementptr inbounds i32, i32* %42, i64 6
store i32 %41, i32* %43
%44 = load i32, i32* %3
%45 = load i32*, i32** %2
%46 = getelementptr inbounds i32, i32* %45, i64 14
store i32 %44, i32* %46
%47 = load i32*, i32** %2
%48 = getelementptr inbounds i32, i32* %47, i64 3
%49 = load i32, i32* %48
store i32 %49, i32* %3
%50 = load i32*, i32** %2
%51 = getelementptr inbounds i32, i32* %50, i64 15
%52 = load i32, i32* %51
%53 = load i32*, i32** %2
%54 = getelementptr inbounds i32, i32* %53, i64 3
store i32 %52, i32* %54
%55 = load i32*, i32** %2
%56 = getelementptr inbounds i32, i32* %55, i64 11
%57 = load i32, i32* %56
%58 = load i32*, i32** %2
%59 = getelementptr inbounds i32, i32* %58, i64 15
store i32 %57, i32* %59
%60 = load i32*, i32** %2
%61 = getelementptr inbounds i32, i32* %60, i64 7
%62 = load i32, i32* %61
%63 = load i32*, i32** %2
%64 = getelementptr inbounds i32, i32* %63, i64 11
store i32 %62, i32* %64
%65 = load i32, i32* %3
%66 = load i32*, i32** %2
%67 = getelementptr inbounds i32, i32* %66, i64 7
store i32 %65, i32* %67
ret void
}

LLVM IR (-O2):
define void @aes_ShiftRows(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %0, i64 5
%5 = load i32, i32* %4
store i32 %5, i32* %2
%6 = getelementptr inbounds i32, i32* %0, i64 9
%7 = load i32, i32* %6
store i32 %7, i32* %4
%8 = getelementptr inbounds i32, i32* %0, i64 13
%9 = load i32, i32* %8
store i32 %9, i32* %6
store i32 %3, i32* %8
%10 = getelementptr inbounds i32, i32* %0, i64 2
%11 = load i32, i32* %10
%12 = getelementptr inbounds i32, i32* %0, i64 10
%13 = load i32, i32* %12
store i32 %13, i32* %10
store i32 %11, i32* %12
%14 = getelementptr inbounds i32, i32* %0, i64 6
%15 = load i32, i32* %14
%16 = getelementptr inbounds i32, i32* %0, i64 14
%17 = load i32, i32* %16
store i32 %17, i32* %14
store i32 %15, i32* %16
%18 = getelementptr inbounds i32, i32* %0, i64 3
%19 = load i32, i32* %18
%20 = getelementptr inbounds i32, i32* %0, i64 15
%21 = load i32, i32* %20
store i32 %21, i32* %18
%22 = getelementptr inbounds i32, i32* %0, i64 11
%23 = load i32, i32* %22
store i32 %23, i32* %20
%24 = getelementptr inbounds i32, i32* %0, i64 7
%25 = load i32, i32* %24
store i32 %25, i32* %22
store i32 %19, i32* %24
ret void
}