#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 SR(uint8_t *block) {
  uint8_t temp0, temp1;
  temp0 = block[7];
  block[7] = (block[7] & 0xF0) ^ (block[5] & 0x0F);
  block[5] = (block[5] & 0xF0) ^ (block[3] & 0x0F);
  block[3] = (block[3] & 0xF0) ^ (block[1] & 0x0F);
  block[1] = (block[1] & 0xF0) ^ (temp0 & 0x0F);
  temp0 = block[0];
  temp1 = block[2];
  block[0] = (block[4] & 0xF0) ^ (block[2] & 0x0F);
  block[2] = (block[6] & 0xF0) ^ (block[4] & 0x0F);
  block[4] = (temp0 & 0xF0) ^ (block[6] & 0x0F);
  block[6] = (temp1 & 0xF0) ^ (temp0 & 0x0F);
}


x86 assembly (clang, -O0):
<SR>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%rax),%ecx
and    $0xf0,%ecx
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%eax
and    $0xf,%eax
xor    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x1c(%rax)
mov    -0x8(%rbp),%rax
mov    0x14(%rax),%ecx
and    $0xf0,%ecx
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
and    $0xf,%eax
xor    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%ecx
and    $0xf0,%ecx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
and    $0xf,%eax
xor    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
and    $0xf0,%ecx
mov    -0xc(%rbp),%eax
and    $0xf,%eax
xor    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%ecx
and    $0xf0,%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
and    $0xf,%eax
xor    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%ecx
and    $0xf0,%ecx
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%eax
and    $0xf,%eax
xor    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0xc(%rbp),%ecx
and    $0xf0,%ecx
mov    -0x8(%rbp),%rax
mov    0x18(%rax),%eax
and    $0xf,%eax
xor    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x10(%rbp),%ecx
and    $0xf0,%ecx
mov    -0xc(%rbp),%eax
and    $0xf,%eax
xor    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x18(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<SR>:
movups 0x4(%rdi),%xmm0
mov    (%rdi),%eax
movd   %eax,%xmm1
movsd  0x18(%rdi),%xmm2
movaps 0xeea(%rip),%xmm3
movaps %xmm0,%xmm4
andps  %xmm3,%xmm4
movaps %xmm0,%xmm5
shufps $0x13,%xmm2,%xmm5
shufps $0x78,%xmm5,%xmm5
andps  %xmm3,%xmm5
pshufd $0xb1,%xmm4,%xmm4
por    %xmm5,%xmm4
movdqu %xmm4,(%rdi)
movss  0x14(%rdi),%xmm4
movaps %xmm4,%xmm5
shufps $0xd4,%xmm0,%xmm5
pshufd $0xd8,%xmm0,%xmm0
movss  %xmm1,%xmm0
shufps $0x24,%xmm5,%xmm0
andps  %xmm3,%xmm0
movlhps %xmm2,%xmm4
movd   %eax,%xmm1
shufps $0xc5,%xmm1,%xmm2
shufps $0x22,%xmm2,%xmm4
andps  0xea7(%rip),%xmm4
orps   %xmm0,%xmm4
movups %xmm4,0x10(%rdi)
ret

LLVM IR (-O0):
define void @SR(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
%6 = getelementptr inbounds i32, i32* %5, i64 7
%7 = load i32, i32* %6
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 7
%10 = load i32, i32* %9
%11 = and i32 %10, 240
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 5
%14 = load i32, i32* %13
%15 = and i32 %14, 15
%16 = xor i32 %11, %15
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 7
store i32 %16, i32* %18
%19 = load i32*, i32** %2
%20 = getelementptr inbounds i32, i32* %19, i64 5
%21 = load i32, i32* %20
%22 = and i32 %21, 240
%23 = load i32*, i32** %2
%24 = getelementptr inbounds i32, i32* %23, i64 3
%25 = load i32, i32* %24
%26 = and i32 %25, 15
%27 = xor i32 %22, %26
%28 = load i32*, i32** %2
%29 = getelementptr inbounds i32, i32* %28, i64 5
store i32 %27, i32* %29
%30 = load i32*, i32** %2
%31 = getelementptr inbounds i32, i32* %30, i64 3
%32 = load i32, i32* %31
%33 = and i32 %32, 240
%34 = load i32*, i32** %2
%35 = getelementptr inbounds i32, i32* %34, i64 1
%36 = load i32, i32* %35
%37 = and i32 %36, 15
%38 = xor i32 %33, %37
%39 = load i32*, i32** %2
%40 = getelementptr inbounds i32, i32* %39, i64 3
store i32 %38, i32* %40
%41 = load i32*, i32** %2
%42 = getelementptr inbounds i32, i32* %41, i64 1
%43 = load i32, i32* %42
%44 = and i32 %43, 240
%45 = load i32, i32* %3
%46 = and i32 %45, 15
%47 = xor i32 %44, %46
%48 = load i32*, i32** %2
%49 = getelementptr inbounds i32, i32* %48, i64 1
store i32 %47, i32* %49
%50 = load i32*, i32** %2
%51 = getelementptr inbounds i32, i32* %50, i64 0
%52 = load i32, i32* %51
store i32 %52, i32* %3
%53 = load i32*, i32** %2
%54 = getelementptr inbounds i32, i32* %53, i64 2
%55 = load i32, i32* %54
store i32 %55, i32* %4
%56 = load i32*, i32** %2
%57 = getelementptr inbounds i32, i32* %56, i64 4
%58 = load i32, i32* %57
%59 = and i32 %58, 240
%60 = load i32*, i32** %2
%61 = getelementptr inbounds i32, i32* %60, i64 2
%62 = load i32, i32* %61
%63 = and i32 %62, 15
%64 = xor i32 %59, %63
%65 = load i32*, i32** %2
%66 = getelementptr inbounds i32, i32* %65, i64 0
store i32 %64, i32* %66
%67 = load i32*, i32** %2
%68 = getelementptr inbounds i32, i32* %67, i64 6
%69 = load i32, i32* %68
%70 = and i32 %69, 240
%71 = load i32*, i32** %2
%72 = getelementptr inbounds i32, i32* %71, i64 4
%73 = load i32, i32* %72
%74 = and i32 %73, 15
%75 = xor i32 %70, %74
%76 = load i32*, i32** %2
%77 = getelementptr inbounds i32, i32* %76, i64 2
store i32 %75, i32* %77
%78 = load i32, i32* %3
%79 = and i32 %78, 240
%80 = load i32*, i32** %2
%81 = getelementptr inbounds i32, i32* %80, i64 6
%82 = load i32, i32* %81
%83 = and i32 %82, 15
%84 = xor i32 %79, %83
%85 = load i32*, i32** %2
%86 = getelementptr inbounds i32, i32* %85, i64 4
store i32 %84, i32* %86
%87 = load i32, i32* %4
%88 = and i32 %87, 240
%89 = load i32, i32* %3
%90 = and i32 %89, 15
%91 = xor i32 %88, %90
%92 = load i32*, i32** %2
%93 = getelementptr inbounds i32, i32* %92, i64 6
store i32 %91, i32* %93
ret void
}

LLVM IR (-O2):
define void @SR(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 5
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %0, i64 1
%5 = getelementptr inbounds i32, i32* %0, i64 4
%6 = bitcast i32* %4 to <4 x i32>*
%7 = load <4 x i32>, <4 x i32>* %6
%8 = extractelement <4 x i32> %7, i64 2
%9 = load i32, i32* %0
%10 = getelementptr inbounds i32, i32* %0, i64 6
%11 = bitcast i32* %10 to <2 x i32>*
%12 = load <2 x i32>, <2 x i32>* %11
%13 = shufflevector <2 x i32> %12, <2 x i32> poison, <4 x i32> <i32 0, i32 1, i32 undef, i32 undef>
%14 = shufflevector <2 x i32> %12, <2 x i32> poison, <4 x i32> <i32 1, i32 0, i32 undef, i32 undef>
%15 = shufflevector <4 x i32> %7, <4 x i32> %14, <4 x i32> <i32 0, i32 4, i32 5, i32 undef>
%16 = shufflevector <4 x i32> %15, <4 x i32> %7, <4 x i32> <i32 0, i32 1, i32 2, i32 7>
%17 = and <4 x i32> %16, <i32 15, i32 15, i32 240, i32 240>
%18 = and <4 x i32> %7, <i32 240, i32 15, i32 240, i32 15>
%19 = shufflevector <4 x i32> %18, <4 x i32> poison, <4 x i32> <i32 2, i32 0, i32 3, i32 1>
%20 = or <4 x i32> %17, %19
%21 = shufflevector <4 x i32> %20, <4 x i32> poison, <4 x i32> <i32 3, i32 1, i32 2, i32 0>
%22 = bitcast i32* %0 to <4 x i32>*
store <4 x i32> %21, <4 x i32>* %22
%23 = extractelement <4 x i32> %7, i64 1
%24 = insertelement <4 x i32> poison, i32 %9, i64 0
%25 = insertelement <4 x i32> %24, i32 %8, i64 1
%26 = insertelement <4 x i32> %25, i32 %23, i64 2
%27 = insertelement <4 x i32> %26, i32 %3, i64 3
%28 = and <4 x i32> %27, <i32 240, i32 15, i32 240, i32 15>
%29 = insertelement <4 x i32> %13, i32 %3, i64 1
%30 = insertelement <4 x i32> %29, i32 %9, i64 2
%31 = shufflevector <4 x i32> %30, <4 x i32> %13, <4 x i32> <i32 0, i32 1, i32 2, i32 5>
%32 = and <4 x i32> %31, <i32 15, i32 240, i32 15, i32 240>
%33 = or <4 x i32> %28, %32
%34 = bitcast i32* %5 to <4 x i32>*
store <4 x i32> %33, <4 x i32>* %34
ret void
}