#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_add_epi32(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_and_si128(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_or_si128(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ _mm_slli_epi32(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_srli_epi32(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_xor_si128(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i funct_S0_Maj(__m128i *x, __m128i *y, __m128i *z) {
  __m128i _calc_maj1 = _mm_or_si128(*y, *z);
  __m128i _calc_maj2 = _mm_and_si128(*y, *z);
  __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_maj1 = _mm_and_si128(_calc_maj1, *x);
  rot2 = _mm_xor_si128(rot2, _calc);
  _calc_maj1 = _mm_or_si128(_calc_maj1, _calc_maj2);
  _calc = _mm_add_epi32(_calc_maj1, rot2);
  return _calc;
}


x86 assembly (clang, -O0):
<funct_S0_Maj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
call   1040 <_mm_or_si128@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
call   1080 <_mm_and_si128@plt>
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x2,%esi
call   1070 <_mm_srli_epi32@plt>
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x1e,%esi
call   1060 <_mm_slli_epi32@plt>
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0xd,%esi
call   1070 <_mm_srli_epi32@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x13,%esi
call   1060 <_mm_slli_epi32@plt>
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x2c(%rbp),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0x16,%esi
call   1070 <_mm_srli_epi32@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    $0xa,%esi
call   1060 <_mm_slli_epi32@plt>
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x2c(%rbp),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
call   1080 <_mm_and_si128@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x28(%rbp),%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1040 <_mm_or_si128@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x24(%rbp),%esi
call   1030 <_mm_add_epi32@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<funct_S0_Maj>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbp
mov    %rsi,%rbx
mov    %rdi,%r12
mov    (%rsi),%edi
mov    (%rdx),%esi
call   1040 <_mm_or_si128@plt>
mov    %eax,%r15d
mov    (%rbx),%edi
mov    0x0(%rbp),%esi
call   1080 <_mm_and_si128@plt>
mov    %eax,0x4(%rsp)
mov    (%r12),%edi
mov    $0x2,%esi
call   1070 <_mm_srli_epi32@plt>
mov    %eax,%r13d
mov    (%r12),%edi
mov    $0x1e,%esi
call   1060 <_mm_slli_epi32@plt>
mov    %eax,%ebp
mov    (%r12),%edi
mov    $0xd,%esi
call   1070 <_mm_srli_epi32@plt>
mov    %eax,%ebx
mov    %r13d,%edi
mov    %ebp,%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,%ebp
mov    (%r12),%edi
mov    $0x13,%esi
call   1060 <_mm_slli_epi32@plt>
mov    %eax,%r13d
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,%ebx
mov    (%r12),%edi
mov    $0x16,%esi
call   1070 <_mm_srli_epi32@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    %r13d,%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,%ebx
mov    (%r12),%edi
mov    $0xa,%esi
call   1060 <_mm_slli_epi32@plt>
mov    %eax,%r13d
mov    %ebx,%edi
mov    %r14d,%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,%ebx
mov    (%r12),%esi
mov    %r15d,%edi
call   1080 <_mm_and_si128@plt>
mov    %eax,%ebp
mov    %ebx,%edi
mov    %r13d,%esi
call   1050 <_mm_xor_si128@plt>
mov    %eax,%ebx
mov    %ebp,%edi
mov    0x4(%rsp),%esi
call   1040 <_mm_or_si128@plt>
mov    %eax,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <_mm_add_epi32@plt>

LLVM IR (-O0):
define i32 @funct_S0_Maj(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%12 = load i32*, i32** %5
%13 = load i32, i32* %12
%14 = load i32*, i32** %6
%15 = load i32, i32* %14
%16 = call i32 @_mm_or_si128(i32 %13, i32 %15)
store i32 %16, i32* %7
%17 = load i32*, i32** %5
%18 = load i32, i32* %17
%19 = load i32*, i32** %6
%20 = load i32, i32* %19
%21 = call i32 @_mm_and_si128(i32 %18, i32 %20)
store i32 %21, i32* %8
%22 = load i32*, i32** %4
%23 = load i32, i32* %22
%24 = call i32 @_mm_srli_epi32(i32 %23, i32 2)
store i32 %24, i32* %9
%25 = load i32*, i32** %4
%26 = load i32, i32* %25
%27 = call i32 @_mm_slli_epi32(i32 %26, i32 30)
store i32 %27, i32* %10
%28 = load i32*, i32** %4
%29 = load i32, i32* %28
%30 = call i32 @_mm_srli_epi32(i32 %29, i32 13)
store i32 %30, i32* %11
%31 = load i32, i32* %9
%32 = load i32, i32* %10
%33 = call i32 @_mm_xor_si128(i32 %31, i32 %32)
store i32 %33, i32* %9
%34 = load i32*, i32** %4
%35 = load i32, i32* %34
%36 = call i32 @_mm_slli_epi32(i32 %35, i32 19)
store i32 %36, i32* %10
%37 = load i32, i32* %9
%38 = load i32, i32* %11
%39 = call i32 @_mm_xor_si128(i32 %37, i32 %38)
store i32 %39, i32* %9
%40 = load i32*, i32** %4
%41 = load i32, i32* %40
%42 = call i32 @_mm_srli_epi32(i32 %41, i32 22)
store i32 %42, i32* %11
%43 = load i32, i32* %9
%44 = load i32, i32* %10
%45 = call i32 @_mm_xor_si128(i32 %43, i32 %44)
store i32 %45, i32* %9
%46 = load i32*, i32** %4
%47 = load i32, i32* %46
%48 = call i32 @_mm_slli_epi32(i32 %47, i32 10)
store i32 %48, i32* %10
%49 = load i32, i32* %9
%50 = load i32, i32* %11
%51 = call i32 @_mm_xor_si128(i32 %49, i32 %50)
store i32 %51, i32* %9
%52 = load i32, i32* %7
%53 = load i32*, i32** %4
%54 = load i32, i32* %53
%55 = call i32 @_mm_and_si128(i32 %52, i32 %54)
store i32 %55, i32* %7
%56 = load i32, i32* %9
%57 = load i32, i32* %10
%58 = call i32 @_mm_xor_si128(i32 %56, i32 %57)
store i32 %58, i32* %9
%59 = load i32, i32* %7
%60 = load i32, i32* %8
%61 = call i32 @_mm_or_si128(i32 %59, i32 %60)
store i32 %61, i32* %7
%62 = load i32, i32* %7
%63 = load i32, i32* %9
%64 = call i32 @_mm_add_epi32(i32 %62, i32 %63)
store i32 %64, i32* %10
%65 = load i32, i32* %10
ret i32 %65
}

LLVM IR (-O2):
define i32 @funct_S0_Maj(i32* nocapture %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = tail call i32 @_mm_or_si128(i32 %4, i32 %5)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = tail call i32 @_mm_and_si128(i32 %7, i32 %8)
%10 = load i32, i32* %0
%11 = tail call i32 @_mm_srli_epi32(i32 %10, i32 2)
%12 = load i32, i32* %0
%13 = tail call i32 @_mm_slli_epi32(i32 %12, i32 30)
%14 = load i32, i32* %0
%15 = tail call i32 @_mm_srli_epi32(i32 %14, i32 13)
%16 = tail call i32 @_mm_xor_si128(i32 %11, i32 %13)
%17 = load i32, i32* %0
%18 = tail call i32 @_mm_slli_epi32(i32 %17, i32 19)
%19 = tail call i32 @_mm_xor_si128(i32 %16, i32 %15)
%20 = load i32, i32* %0
%21 = tail call i32 @_mm_srli_epi32(i32 %20, i32 22)
%22 = tail call i32 @_mm_xor_si128(i32 %19, i32 %18)
%23 = load i32, i32* %0
%24 = tail call i32 @_mm_slli_epi32(i32 %23, i32 10)
%25 = tail call i32 @_mm_xor_si128(i32 %22, i32 %21)
%26 = load i32, i32* %0
%27 = tail call i32 @_mm_and_si128(i32 %6, i32 %26)
%28 = tail call i32 @_mm_xor_si128(i32 %25, i32 %24)
%29 = tail call i32 @_mm_or_si128(i32 %27, i32 %9)
%30 = tail call i32 @_mm_add_epi32(i32 %29, i32 %28)
ret i32 %30
}