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

/* Variables and functions */
int /*<<< orphan*/ _mm_slli_pi16(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_slli_pi32(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_slli_si64(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_srai_pi16(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_srai_pi32(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_srli_pi16(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_srli_pi32(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_srli_si64(int /*<<< orphan*/, int);
void __attribute__((target("sse"))) shift(__m64 a, __m64 b, int c) {
  _mm_slli_pi16(a, c);
  _mm_slli_pi32(a, c);
  _mm_slli_si64(a, c);
  _mm_srli_pi16(a, c);
  _mm_srli_pi32(a, c);
  _mm_srli_si64(a, c);
  _mm_srai_pi16(a, c);
  _mm_srai_pi32(a, c);
}


x86 assembly (clang, -O0):
<shift>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1060 <_mm_slli_pi16@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   10a0 <_mm_slli_pi32@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <_mm_slli_si64@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <_mm_srli_pi16@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1080 <_mm_srli_pi32@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1070 <_mm_srli_si64@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1090 <_mm_srai_pi16@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <_mm_srai_pi32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<shift>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebx
mov    %edi,%ebp
mov    %edx,%esi
call   1060 <_mm_slli_pi16@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   10a0 <_mm_slli_pi32@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <_mm_slli_si64@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <_mm_srli_pi16@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1080 <_mm_srli_pi32@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1070 <_mm_srli_si64@plt>
mov    %ebp,%edi
mov    %ebx,%esi
call   1090 <_mm_srai_pi16@plt>
mov    %ebp,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <_mm_srai_pi32@plt>

LLVM IR (-O0):
define void @shift(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = call i32 @_mm_slli_pi16(i32 %7, i32 %8)
%10 = load i32, i32* %4
%11 = load i32, i32* %6
%12 = call i32 @_mm_slli_pi32(i32 %10, i32 %11)
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = call i32 @_mm_slli_si64(i32 %13, i32 %14)
%16 = load i32, i32* %4
%17 = load i32, i32* %6
%18 = call i32 @_mm_srli_pi16(i32 %16, i32 %17)
%19 = load i32, i32* %4
%20 = load i32, i32* %6
%21 = call i32 @_mm_srli_pi32(i32 %19, i32 %20)
%22 = load i32, i32* %4
%23 = load i32, i32* %6
%24 = call i32 @_mm_srli_si64(i32 %22, i32 %23)
%25 = load i32, i32* %4
%26 = load i32, i32* %6
%27 = call i32 @_mm_srai_pi16(i32 %25, i32 %26)
%28 = load i32, i32* %4
%29 = load i32, i32* %6
%30 = call i32 @_mm_srai_pi32(i32 %28, i32 %29)
ret void
}

LLVM IR (-O2):
define void @shift(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 @_mm_slli_pi16(i32 %0, i32 %2)
%5 = tail call i32 @_mm_slli_pi32(i32 %0, i32 %2)
%6 = tail call i32 @_mm_slli_si64(i32 %0, i32 %2)
%7 = tail call i32 @_mm_srli_pi16(i32 %0, i32 %2)
%8 = tail call i32 @_mm_srli_pi32(i32 %0, i32 %2)
%9 = tail call i32 @_mm_srli_si64(i32 %0, i32 %2)
%10 = tail call i32 @_mm_srai_pi16(i32 %0, i32 %2)
%11 = tail call i32 @_mm_srai_pi32(i32 %0, i32 %2)
ret void
}