#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_old(const __m128i *x) {
  __m128i rot2 = _mm_srli_epi32(*x, 2);
  __m128i _calc = _mm_slli_epi32(*x, (32 - 2));
  __m128i rot13 = _mm_srli_epi32(*x, 13);
  rot13 = _mm_xor_si128(rot13, _calc);
  _calc = _mm_slli_epi32(*x, (32 - 13));
  __m128i rot22 = _mm_srli_epi32(*x, 22);
  rot22 = _mm_xor_si128(rot22, _calc);
  _calc = _mm_slli_epi32(*x, (32 - 22));
  _calc = _mm_xor_si128(rot22, _calc);
  _calc = _mm_xor_si128(_calc, rot2);
  _calc = _mm_xor_si128(_calc, rot13);
  return _calc;
}


x86 assembly (clang, -O0):
<funct_S0_old>:
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    -0x14(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x13,%esi
call   1040 <_mm_slli_epi32@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x16,%esi
call   1050 <_mm_srli_epi32@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0xa,%esi
call   1040 <_mm_slli_epi32@plt>
mov    %eax,-0x10(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x10(%rbp),%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    -0x14(%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_old>:
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,%edi
mov    %ebp,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,%r15d
mov    (%rbx),%edi
mov    $0x13,%esi
call   1040 <_mm_slli_epi32@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
mov    $0x16,%esi
call   1050 <_mm_srli_epi32@plt>
mov    %eax,%edi
mov    %ebp,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,%ebp
mov    (%rbx),%edi
mov    $0xa,%esi
call   1040 <_mm_slli_epi32@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,%edi
mov    %r14d,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,%edi
mov    %r15d,%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_old(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %2
%7 = load i32*, i32** %2
%8 = load i32, i32* %7
%9 = call i32 @_mm_srli_epi32(i32 %8, i32 2)
store i32 %9, i32* %3
%10 = load i32*, i32** %2
%11 = load i32, i32* %10
%12 = call i32 @_mm_slli_epi32(i32 %11, i32 30)
store i32 %12, i32* %4
%13 = load i32*, i32** %2
%14 = load i32, i32* %13
%15 = call i32 @_mm_srli_epi32(i32 %14, i32 13)
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = load i32, i32* %4
%18 = call i32 @_mm_xor_si128(i32 %16, i32 %17)
store i32 %18, i32* %5
%19 = load i32*, i32** %2
%20 = load i32, i32* %19
%21 = call i32 @_mm_slli_epi32(i32 %20, i32 19)
store i32 %21, i32* %4
%22 = load i32*, i32** %2
%23 = load i32, i32* %22
%24 = call i32 @_mm_srli_epi32(i32 %23, i32 22)
store i32 %24, i32* %6
%25 = load i32, i32* %6
%26 = load i32, i32* %4
%27 = call i32 @_mm_xor_si128(i32 %25, i32 %26)
store i32 %27, i32* %6
%28 = load i32*, i32** %2
%29 = load i32, i32* %28
%30 = call i32 @_mm_slli_epi32(i32 %29, i32 10)
store i32 %30, i32* %4
%31 = load i32, i32* %6
%32 = load i32, i32* %4
%33 = call i32 @_mm_xor_si128(i32 %31, i32 %32)
store i32 %33, i32* %4
%34 = load i32, i32* %4
%35 = load i32, i32* %3
%36 = call i32 @_mm_xor_si128(i32 %34, i32 %35)
store i32 %36, i32* %4
%37 = load i32, i32* %4
%38 = load i32, i32* %5
%39 = call i32 @_mm_xor_si128(i32 %37, i32 %38)
store i32 %39, i32* %4
%40 = load i32, i32* %4
ret i32 %40
}

LLVM IR (-O2):
define i32 @funct_S0_old(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 %7, i32 %5)
%9 = load i32, i32* %0
%10 = tail call i32 @_mm_slli_epi32(i32 %9, i32 19)
%11 = load i32, i32* %0
%12 = tail call i32 @_mm_srli_epi32(i32 %11, i32 22)
%13 = tail call i32 @_mm_xor_si128(i32 %12, i32 %10)
%14 = load i32, i32* %0
%15 = tail call i32 @_mm_slli_epi32(i32 %14, i32 10)
%16 = tail call i32 @_mm_xor_si128(i32 %13, i32 %15)
%17 = tail call i32 @_mm_xor_si128(i32 %16, i32 %3)
%18 = tail call i32 @_mm_xor_si128(i32 %17, i32 %8)
ret i32 %18
}