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

/* Variables and functions */
void pi2(uint32_t *a) {
  a[1] = (((a[1]) >> 1) | ((a[1]) << (32 - 1)));
  a[2] = (((a[2]) >> 5) | ((a[2]) << (32 - 5)));
  a[3] = (((a[3]) >> 2) | ((a[3]) << (32 - 2)));
}


x86 assembly (clang, -O0):
<pi2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
sar    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
shl    $0x1f,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
sar    $0x5,%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
shl    $0x1b,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
sar    $0x2,%ecx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
shl    $0x1e,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pi2>:
mov    0x4(%rdi),%eax
mov    0x8(%rdi),%ecx
mov    %eax,%edx
sar    %edx
shl    $0x1f,%eax
or     %edx,%eax
mov    %eax,0x4(%rdi)
mov    %ecx,%eax
sar    $0x5,%eax
shl    $0x1b,%ecx
or     %eax,%ecx
mov    %ecx,0x8(%rdi)
mov    0xc(%rdi),%eax
mov    %eax,%ecx
sar    $0x2,%ecx
shl    $0x1e,%eax
or     %ecx,%eax
mov    %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @pi2(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = ashr i32 %5, 1
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = shl i32 %9, 31
%11 = or i32 %6, %10
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 1
store i32 %11, i32* %13
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i64 2
%16 = load i32, i32* %15
%17 = ashr i32 %16, 5
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 2
%20 = load i32, i32* %19
%21 = shl i32 %20, 27
%22 = or i32 %17, %21
%23 = load i32*, i32** %2
%24 = getelementptr inbounds i32, i32* %23, i64 2
store i32 %22, i32* %24
%25 = load i32*, i32** %2
%26 = getelementptr inbounds i32, i32* %25, i64 3
%27 = load i32, i32* %26
%28 = ashr i32 %27, 2
%29 = load i32*, i32** %2
%30 = getelementptr inbounds i32, i32* %29, i64 3
%31 = load i32, i32* %30
%32 = shl i32 %31, 30
%33 = or i32 %28, %32
%34 = load i32*, i32** %2
%35 = getelementptr inbounds i32, i32* %34, i64 3
store i32 %33, i32* %35
ret void
}

LLVM IR (-O2):
define void @pi2(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = ashr i32 %3, 1
%5 = shl i32 %3, 31
%6 = or i32 %4, %5
store i32 %6, i32* %2
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = ashr i32 %8, 5
%10 = shl i32 %8, 27
%11 = or i32 %9, %10
store i32 %11, i32* %7
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = ashr i32 %13, 2
%15 = shl i32 %13, 30
%16 = or i32 %14, %15
store i32 %16, i32* %12
ret void
}