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


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

x86 assembly (clang, -O2):
<InverseSR>:
movups 0xc(%rdi),%xmm0
movsd  0x4(%rdi),%xmm1
movss  0x1c(%rdi),%xmm2
movss  (%rdi),%xmm3
movaps %xmm3,%xmm4
unpcklps %xmm2,%xmm4
shufps $0x14,%xmm1,%xmm4
andps  0xedd(%rip),%xmm4
shufps $0xd4,%xmm0,%xmm2
pshufd $0xff,%xmm0,%xmm5
punpckldq %xmm1,%xmm5
shufps $0x21,%xmm0,%xmm1
shufps $0x28,%xmm2,%xmm1
movaps 0xed1(%rip),%xmm2
andps  %xmm2,%xmm1
orps   %xmm4,%xmm1
movups %xmm1,0x10(%rdi)
movaps %xmm0,%xmm1
andps  %xmm2,%xmm1
pshufd $0xb1,%xmm1,%xmm1
movlhps %xmm3,%xmm0
shufps $0x24,%xmm0,%xmm5
andps  %xmm2,%xmm5
orps   %xmm1,%xmm5
movups %xmm5,(%rdi)
ret

LLVM IR (-O0):
define void @InverseSR(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 1
%7 = load i32, i32* %6
store i32 %7, i32* %3
%8 = load i32*, i32** %2
%9 = getelementptr inbounds i32, i32* %8, i64 1
%10 = load i32, i32* %9
%11 = and i32 %10, 240
%12 = load i32*, i32** %2
%13 = getelementptr inbounds i32, i32* %12, i64 3
%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 1
store i32 %16, i32* %18
%19 = load i32*, i32** %2
%20 = getelementptr inbounds i32, i32* %19, i64 3
%21 = load i32, i32* %20
%22 = and i32 %21, 240
%23 = load i32*, i32** %2
%24 = getelementptr inbounds i32, i32* %23, i64 5
%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 3
store i32 %27, i32* %29
%30 = load i32*, i32** %2
%31 = getelementptr inbounds i32, i32* %30, i64 5
%32 = load i32, i32* %31
%33 = and i32 %32, 240
%34 = load i32*, i32** %2
%35 = getelementptr inbounds i32, i32* %34, i64 7
%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 5
store i32 %38, i32* %40
%41 = load i32*, i32** %2
%42 = getelementptr inbounds i32, i32* %41, i64 7
%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 7
store i32 %47, i32* %49
%50 = load i32*, i32** %2
%51 = getelementptr inbounds i32, i32* %50, i64 6
%52 = load i32, i32* %51
store i32 %52, i32* %3
%53 = load i32*, i32** %2
%54 = getelementptr inbounds i32, i32* %53, i64 4
%55 = load i32, i32* %54
store i32 %55, i32* %4
%56 = load i32*, i32** %2
%57 = getelementptr inbounds i32, i32* %56, i64 2
%58 = load i32, i32* %57
%59 = and i32 %58, 240
%60 = load i32*, i32** %2
%61 = getelementptr inbounds i32, i32* %60, i64 4
%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 6
store i32 %64, i32* %66
%67 = load i32*, i32** %2
%68 = getelementptr inbounds i32, i32* %67, i64 0
%69 = load i32, i32* %68
%70 = and i32 %69, 240
%71 = load i32*, i32** %2
%72 = getelementptr inbounds i32, i32* %71, i64 2
%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 4
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 0
%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 2
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 0
store i32 %91, i32* %93
ret void
}

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