#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 /*<<< orphan*/ __m128i;

/* Variables and functions */
int /*<<< orphan*/ _mm_slli_epi32(int /*<<< orphan*/ const, int);
int /*<<< orphan*/ _mm_srli_epi32(int /*<<< orphan*/ const, int);
int /*<<< orphan*/ _mm_xor_si128(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i funct_S0(const __m128i *x) {
  __m128i rot2 = _mm_srli_epi32(*x, 2);
  __m128i _calc = _mm_slli_epi32(*x, (32 - 2));
  __m128i rot13_22 = _mm_srli_epi32(*x, 13);
  rot2 = _mm_xor_si128(rot2, _calc);
  _calc = _mm_slli_epi32(*x, (32 - 13));
  rot2 = _mm_xor_si128(rot2, rot13_22);
  rot13_22 = _mm_srli_epi32(*x, 22);
  rot2 = _mm_xor_si128(rot2, _calc);
  _calc = _mm_slli_epi32(*x, (32 - 22));
  rot2 = _mm_xor_si128(rot2, rot13_22);
  _calc = _mm_xor_si128(_calc, rot2);
  return _calc;
}


x86 assembly (clang, -O0):
<funct_S0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x2,%esi
call   1050 <_mm_srli_epi32@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x1e,%esi
call   1040 <_mm_slli_epi32@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0xd,%esi
call   1050 <_mm_srli_epi32@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x13,%esi
call   1040 <_mm_slli_epi32@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x16,%esi
call   1050 <_mm_srli_epi32@plt>
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0xa,%esi
call   1040 <_mm_slli_epi32@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funct_S0>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%edi
mov    $0x2,%esi
call   1050 <_mm_srli_epi32@plt>
mov    %eax,%r14d
mov    (%rbx),%edi
mov    $0x1e,%esi
call   1040 <_mm_slli_epi32@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
mov    $0xd,%esi
call   1050 <_mm_srli_epi32@plt>
mov    %eax,%r15d
mov    %r14d,%edi
mov    %ebp,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
mov    $0x13,%esi
call   1040 <_mm_slli_epi32@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    %r15d,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
mov    $0x16,%esi
call   1050 <_mm_srli_epi32@plt>
mov    %eax,%r15d
mov    %ebp,%edi
mov    %r14d,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
mov    $0xa,%esi
call   1040 <_mm_slli_epi32@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    %r15d,%esi
call   1030 <_mm_xor_si128@plt>
mov    %ebx,%edi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <_mm_xor_si128@plt>

LLVM IR (-O0):
define i32 @funct_S0(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
%6 = load i32*, i32** %2
%7 = load i32, i32* %6
%8 = call i32 @_mm_srli_epi32(i32 %7, i32 2)
store i32 %8, i32* %3
%9 = load i32*, i32** %2
%10 = load i32, i32* %9
%11 = call i32 @_mm_slli_epi32(i32 %10, i32 30)
store i32 %11, i32* %4
%12 = load i32*, i32** %2
%13 = load i32, i32* %12
%14 = call i32 @_mm_srli_epi32(i32 %13, i32 13)
store i32 %14, i32* %5
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = call i32 @_mm_xor_si128(i32 %15, i32 %16)
store i32 %17, i32* %3
%18 = load i32*, i32** %2
%19 = load i32, i32* %18
%20 = call i32 @_mm_slli_epi32(i32 %19, i32 19)
store i32 %20, i32* %4
%21 = load i32, i32* %3
%22 = load i32, i32* %5
%23 = call i32 @_mm_xor_si128(i32 %21, i32 %22)
store i32 %23, i32* %3
%24 = load i32*, i32** %2
%25 = load i32, i32* %24
%26 = call i32 @_mm_srli_epi32(i32 %25, i32 22)
store i32 %26, i32* %5
%27 = load i32, i32* %3
%28 = load i32, i32* %4
%29 = call i32 @_mm_xor_si128(i32 %27, i32 %28)
store i32 %29, i32* %3
%30 = load i32*, i32** %2
%31 = load i32, i32* %30
%32 = call i32 @_mm_slli_epi32(i32 %31, i32 10)
store i32 %32, i32* %4
%33 = load i32, i32* %3
%34 = load i32, i32* %5
%35 = call i32 @_mm_xor_si128(i32 %33, i32 %34)
store i32 %35, i32* %3
%36 = load i32, i32* %4
%37 = load i32, i32* %3
%38 = call i32 @_mm_xor_si128(i32 %36, i32 %37)
store i32 %38, i32* %4
%39 = load i32, i32* %4
ret i32 %39
}

LLVM IR (-O2):
define i32 @funct_S0(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = tail call i32 @_mm_srli_epi32(i32 %2, i32 2)
%4 = load i32, i32* %0
%5 = tail call i32 @_mm_slli_epi32(i32 %4, i32 30)
%6 = load i32, i32* %0
%7 = tail call i32 @_mm_srli_epi32(i32 %6, i32 13)
%8 = tail call i32 @_mm_xor_si128(i32 %3, i32 %5)
%9 = load i32, i32* %0
%10 = tail call i32 @_mm_slli_epi32(i32 %9, i32 19)
%11 = tail call i32 @_mm_xor_si128(i32 %8, i32 %7)
%12 = load i32, i32* %0
%13 = tail call i32 @_mm_srli_epi32(i32 %12, i32 22)
%14 = tail call i32 @_mm_xor_si128(i32 %11, i32 %10)
%15 = load i32, i32* %0
%16 = tail call i32 @_mm_slli_epi32(i32 %15, i32 10)
%17 = tail call i32 @_mm_xor_si128(i32 %14, i32 %13)
%18 = tail call i32 @_mm_xor_si128(i32 %16, i32 %17)
ret i32 %18
}