#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 uint64_t;

/* Variables and functions */
uint64_t prince_shift_rows(const uint64_t in, int inverse) {
  const uint64_t row_mask = 0xF000F000F000F000;
  uint64_t shift_rows_out = 0;
  for (unsigned int i = 0; i < 4; i++) {
    const uint64_t row = in & (row_mask >> (4 * i));
    const unsigned int shift = inverse ? i * 16 : 64 - i * 16;
    shift_rows_out |= (row >> shift) | (row << (64 - shift));
  }
  return shift_rows_out;
}


x86 assembly (clang, -O0):
<prince_shift_rows>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0xf000f000,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jae    119b <prince_shift_rows+0x9b>
mov    -0x4(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
mov    $0xf000f000,%edx
sar    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1158 <prince_shift_rows+0x58>
mov    -0x14(%rbp),%eax
shl    $0x4,%eax
mov    %eax,-0x20(%rbp)
jmp    1168 <prince_shift_rows+0x68>
mov    -0x14(%rbp),%ecx
shl    $0x4,%ecx
mov    $0x40,%eax
sub    %ecx,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sar    %cl,%eax
mov    -0x18(%rbp),%edx
mov    $0x40,%ecx
sub    -0x1c(%rbp),%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
or     -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111f <prince_shift_rows+0x1f>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prince_shift_rows>:
ret

LLVM IR (-O0):
define i32 @prince_shift_rows(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 -268374016, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
br label %10
10: ; preds = %40, %2
%11 = load i32, i32* %7
%12 = icmp ult i32 %11, 4
br i1 %12, label %13, label %43
13: ; preds = %10
%14 = load i32, i32* %3
%15 = load i32, i32* %7
%16 = mul i32 4, %15
%17 = ashr i32 -268374016, %16
%18 = and i32 %14, %17
store i32 %18, i32* %8
%19 = load i32, i32* %4
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %24
21: ; preds = %13
%22 = load i32, i32* %7
%23 = mul i32 %22, 16
br label %28
24: ; preds = %13
%25 = load i32, i32* %7
%26 = mul i32 %25, 16
%27 = sub i32 64, %26
br label %28
28: ; preds = %24, %21
%29 = phi i32 [ %23, %21 ], [ %27, %24 ]
store i32 %29, i32* %9
%30 = load i32, i32* %8
%31 = load i32, i32* %9
%32 = ashr i32 %30, %31
%33 = load i32, i32* %8
%34 = load i32, i32* %9
%35 = sub i32 64, %34
%36 = shl i32 %33, %35
%37 = or i32 %32, %36
%38 = load i32, i32* %6
%39 = or i32 %38, %37
store i32 %39, i32* %6
br label %40
40: ; preds = %28
%41 = load i32, i32* %7
%42 = add i32 %41, 1
store i32 %42, i32* %7
br label %10
43: ; preds = %10
%44 = load i32, i32* %6
ret i32 %44
}

LLVM IR (-O2):
define i32 @prince_shift_rows(i32 %0, i32 %1) {
ret i32 poison
}