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

/* Variables and functions */
void P_layer(uint16_t *data) {
  data[1] = (((data[1]) << 1) ^ ((data[1]) >> 15));
  data[2] = (((data[2]) << 12) ^ ((data[2]) >> 4));
  data[3] = (((data[3]) << 13) ^ ((data[3]) >> 3));
}


x86 assembly (clang, -O0):
<P_layer>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
shl    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
sar    $0xf,%eax
xor    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
shl    $0xc,%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
sar    $0x4,%eax
xor    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
shl    $0xd,%ecx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
sar    $0x3,%eax
xor    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<P_layer>:
mov    0x4(%rdi),%eax
mov    0x8(%rdi),%ecx
lea    (%rax,%rax,1),%edx
sar    $0xf,%eax
xor    %edx,%eax
mov    %eax,0x4(%rdi)
mov    %ecx,%eax
shl    $0xc,%eax
sar    $0x4,%ecx
xor    %eax,%ecx
mov    %ecx,0x8(%rdi)
mov    0xc(%rdi),%eax
mov    %eax,%ecx
shl    $0xd,%ecx
sar    $0x3,%eax
xor    %ecx,%eax
mov    %eax,0xc(%rdi)
ret

LLVM IR (-O0):
define void @P_layer(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 = shl i32 %5, 1
%7 = load i32*, i32** %2
%8 = getelementptr inbounds i32, i32* %7, i64 1
%9 = load i32, i32* %8
%10 = ashr i32 %9, 15
%11 = xor 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 = shl i32 %16, 12
%18 = load i32*, i32** %2
%19 = getelementptr inbounds i32, i32* %18, i64 2
%20 = load i32, i32* %19
%21 = ashr i32 %20, 4
%22 = xor 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 = shl i32 %27, 13
%29 = load i32*, i32** %2
%30 = getelementptr inbounds i32, i32* %29, i64 3
%31 = load i32, i32* %30
%32 = ashr i32 %31, 3
%33 = xor 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 @P_layer(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = shl i32 %3, 1
%5 = ashr i32 %3, 15
%6 = xor i32 %4, %5
store i32 %6, i32* %2
%7 = getelementptr inbounds i32, i32* %0, i64 2
%8 = load i32, i32* %7
%9 = shl i32 %8, 12
%10 = ashr i32 %8, 4
%11 = xor i32 %9, %10
store i32 %11, i32* %7
%12 = getelementptr inbounds i32, i32* %0, i64 3
%13 = load i32, i32* %12
%14 = shl i32 %13, 13
%15 = ashr i32 %13, 3
%16 = xor i32 %14, %15
store i32 %16, i32* %12
ret void
}