#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 */
void InShiftRows(uint8_t InValue[]) {
  uint8_t TempValue[16];
  uint8_t i;
  for (i = 0; i < 16; i++) {
    TempValue[i] = InValue[i];
  }
  for (i = 0; i < 16; i++) {
    InValue[i] = TempValue[(i + 16 - ((i % 4) * 4)) % 16];
  }
}


x86 assembly (clang, -O0):
<InShiftRows>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x54(%rbp)
cmpl   $0x10,-0x54(%rbp)
jge    113a <InShiftRows+0x3a>
mov    -0x8(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
movslq -0x54(%rbp),%rax
mov    %ecx,-0x50(%rbp,%rax,4)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    110f <InShiftRows+0xf>
movl   $0x0,-0x54(%rbp)
cmpl   $0x10,-0x54(%rbp)
jge    118f <InShiftRows+0x8f>
mov    -0x54(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x58(%rbp)
mov    -0x54(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    -0x58(%rbp),%eax
shl    $0x2,%edx
sub    %edx,%eax
mov    $0x10,%ecx
cltd
idiv   %ecx
movslq %edx,%rax
mov    -0x50(%rbp,%rax,4),%edx
mov    -0x8(%rbp),%rax
movslq -0x54(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
jmp    1141 <InShiftRows+0x41>
pop    %rbp
ret

x86 assembly (clang, -O2):
<InShiftRows>:
push   %rbp
push   %r15
push   %r14
push   %rbx
mov    0x4(%rdi),%r11d
mov    0x8(%rdi),%r9d
mov    0xc(%rdi),%r8d
mov    0x14(%rdi),%r15d
mov    0x18(%rdi),%r10d
mov    0x1c(%rdi),%ecx
mov    0x24(%rdi),%r14d
mov    0x28(%rdi),%eax
mov    0x2c(%rdi),%ebx
mov    0x34(%rdi),%ebp
mov    0x38(%rdi),%edx
mov    0x3c(%rdi),%esi
mov    %ebp,0x4(%rdi)
mov    %eax,0x8(%rdi)
mov    %ecx,0xc(%rdi)
mov    %r11d,0x14(%rdi)
mov    %edx,0x18(%rdi)
mov    %ebx,0x1c(%rdi)
mov    %r15d,0x24(%rdi)
mov    %r9d,0x28(%rdi)
mov    %esi,0x2c(%rdi)
mov    %r14d,0x34(%rdi)
mov    %r10d,0x38(%rdi)
mov    %r8d,0x3c(%rdi)
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @InShiftRows(i32* %0) {
%2 = alloca i32*
%3 = alloca [16 x i32]
%4 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %4
br label %5
5: ; preds = %17, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 16
br i1 %7, label %8, label %20
8: ; preds = %5
%9 = load i32*, i32** %2
%10 = load i32, i32* %4
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i32, i32* %9, i64 %11
%13 = load i32, i32* %12
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 %15
store i32 %13, i32* %16
br label %17
17: ; preds = %8
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %5
20: ; preds = %5
store i32 0, i32* %4
br label %21
21: ; preds = %39, %20
%22 = load i32, i32* %4
%23 = icmp slt i32 %22, 16
br i1 %23, label %24, label %42
24: ; preds = %21
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 16
%27 = load i32, i32* %4
%28 = srem i32 %27, 4
%29 = mul nsw i32 %28, 4
%30 = sub nsw i32 %26, %29
%31 = srem i32 %30, 16
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds [16 x i32], [16 x i32]* %3, i64 0, i64 %32
%34 = load i32, i32* %33
%35 = load i32*, i32** %2
%36 = load i32, i32* %4
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i32, i32* %35, i64 %37
store i32 %34, i32* %38
br label %39
39: ; preds = %24
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 1
store i32 %41, i32* %4
br label %21
42: ; preds = %21
ret void
}

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