#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_si128(int /*<<< orphan*/, int);
int /*<<< orphan*/ _mm_xor_si128(int /*<<< orphan*/, int /*<<< orphan*/);
__m128i expand_key(__m128i key, __m128i temp) {
  key = _mm_xor_si128(key, _mm_slli_si128(key, 4));
  key = _mm_xor_si128(key, _mm_slli_si128(key, 4));
  key = _mm_xor_si128(key, _mm_slli_si128(key, 4));
  key = _mm_xor_si128(key, temp);
  return key;
}


x86 assembly (clang, -O0):
<expand_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1040 <_mm_slli_si128@plt>
mov    -0x14(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1040 <_mm_slli_si128@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x4,%esi
call   1040 <_mm_slli_si128@plt>
mov    -0xc(%rbp),%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expand_key>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    $0x4,%esi
call   1040 <_mm_slli_si128@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    $0x4,%esi
call   1040 <_mm_slli_si128@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,%ebp
mov    %eax,%edi
mov    $0x4,%esi
call   1040 <_mm_slli_si128@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <_mm_xor_si128@plt>
mov    %eax,%edi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <_mm_xor_si128@plt>

LLVM IR (-O0):
define i32 @expand_key(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @_mm_slli_si128(i32 %6, i32 4)
%8 = call i32 @_mm_xor_si128(i32 %5, i32 %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = load i32, i32* %3
%11 = call i32 @_mm_slli_si128(i32 %10, i32 4)
%12 = call i32 @_mm_xor_si128(i32 %9, i32 %11)
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = load i32, i32* %3
%15 = call i32 @_mm_slli_si128(i32 %14, i32 4)
%16 = call i32 @_mm_xor_si128(i32 %13, i32 %15)
store i32 %16, i32* %3
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = call i32 @_mm_xor_si128(i32 %17, i32 %18)
store i32 %19, i32* %3
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @expand_key(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_slli_si128(i32 %0, i32 4)
%4 = tail call i32 @_mm_xor_si128(i32 %0, i32 %3)
%5 = tail call i32 @_mm_slli_si128(i32 %4, i32 4)
%6 = tail call i32 @_mm_xor_si128(i32 %4, i32 %5)
%7 = tail call i32 @_mm_slli_si128(i32 %6, i32 4)
%8 = tail call i32 @_mm_xor_si128(i32 %6, i32 %7)
%9 = tail call i32 @_mm_xor_si128(i32 %8, i32 %1)
ret i32 %9
}