#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 uint32_t;

/* Variables and functions */
int rotr32(int, int);
uint32_t MixColumn(uint32_t word) {
  uint32_t word_02, word_03;
  word_02 = ((word & 0x7f7f7f7f) << 1) ^ (((word & 0x80808080) >> 7) * 0x1b);
  word_03 = word_02 ^ word;
  return word_02 ^ rotr32(word, 8) ^ rotr32(word, 16) ^ rotr32(word_03, 24);
}


x86 assembly (clang, -O0):
<MixColumn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f7f7f7f,%eax
shl    $0x1,%eax
mov    -0x4(%rbp),%ecx
and    $0x80808080,%ecx
shr    $0x7,%ecx
imul   $0x1b,%ecx,%ecx
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1030 <rotr32@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x10,%esi
call   1030 <rotr32@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
xor    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    $0x18,%esi
call   1030 <rotr32@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
xor    %ecx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MixColumn>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    (%rbx,%rbx,1),%eax
and    $0xfefefefe,%eax
mov    %edi,%ecx
shr    $0x7,%ecx
and    $0x1010101,%ecx
lea    (%rcx,%rcx,8),%ecx
lea    (%rcx,%rcx,2),%ebp
xor    %eax,%ebp
mov    %ebp,%r15d
xor    %edi,%r15d
mov    $0x8,%esi
call   1030 <rotr32@plt>
mov    %eax,%r14d
mov    %ebx,%edi
mov    $0x10,%esi
call   1030 <rotr32@plt>
mov    %eax,%ebx
xor    %r14d,%ebx
xor    %ebp,%ebx
mov    %r15d,%edi
mov    $0x18,%esi
call   1030 <rotr32@plt>
xor    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @MixColumn(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 2139062143
%7 = shl i32 %6, 1
%8 = load i32, i32* %2
%9 = and i32 %8, -2139062144
%10 = lshr i32 %9, 7
%11 = mul i32 %10, 27
%12 = xor i32 %7, %11
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = xor i32 %13, %14
store i32 %15, i32* %4
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = call i32 @rotr32(i32 %17, i32 8)
%19 = xor i32 %16, %18
%20 = load i32, i32* %2
%21 = call i32 @rotr32(i32 %20, i32 16)
%22 = xor i32 %19, %21
%23 = load i32, i32* %4
%24 = call i32 @rotr32(i32 %23, i32 24)
%25 = xor i32 %22, %24
ret i32 %25
}

LLVM IR (-O2):
define i32 @MixColumn(i32 %0) {
%2 = shl i32 %0, 1
%3 = and i32 %2, -16843010
%4 = lshr i32 %0, 7
%5 = and i32 %4, 16843009
%6 = mul nuw nsw i32 %5, 27
%7 = xor i32 %6, %3
%8 = xor i32 %7, %0
%9 = tail call i32 @rotr32(i32 %0, i32 8)
%10 = xor i32 %9, %7
%11 = tail call i32 @rotr32(i32 %0, i32 16)
%12 = xor i32 %10, %11
%13 = tail call i32 @rotr32(i32 %8, i32 24)
%14 = xor i32 %12, %13
ret i32 %14
}