#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 IP_layer(uint16_t *data) {
  data[1] = (((data[1]) << 15) ^ ((data[1]) >> 1));
  data[2] = (((data[2]) << 4) ^ ((data[2]) >> 12));
  data[3] = (((data[3]) << 3) ^ ((data[3]) >> 13));
}


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

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

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