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

/* Variables and functions */
void decodeblock(uint8_t wordin[4], uint8_t wordout[3]) {
  wordout[0] = (uint8_t)((unsigned)wordin[0] << 2 | (unsigned)wordin[1] >> 4);
  wordout[1] = (uint8_t)((unsigned)wordin[1] << 4 | (unsigned)wordin[2] >> 2);
  wordout[2] = (uint8_t)(((wordin[2] << 6) & 0xc0) | wordin[3]);
}


x86 assembly (clang, -O0):
<decodeblock>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x2,%ecx
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
shr    $0x4,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
shl    $0x4,%ecx
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
shr    $0x2,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ecx
shl    $0x6,%ecx
and    $0xc0,%ecx
mov    -0x8(%rbp),%rax
or     0xc(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<decodeblock>:
mov    (%rdi),%eax
mov    0x4(%rdi),%ecx
shl    $0x2,%eax
shr    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,(%rsi)
mov    0x4(%rdi),%eax
mov    0x8(%rdi),%ecx
shl    $0x4,%eax
shr    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,0x4(%rsi)
mov    0x8(%rdi),%eax
shl    $0x6,%eax
movzbl %al,%eax
or     0xc(%rdi),%eax
mov    %eax,0x8(%rsi)
ret

LLVM IR (-O0):
define void @decodeblock(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 = getelementptr inbounds i32, i32* %5, i64 0
%7 = load i32, i32* %6
%8 = shl i32 %7, 2
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = lshr i32 %11, 4
%13 = or i32 %8, %12
%14 = load i32*, i32** %4
%15 = getelementptr inbounds i32, i32* %14, i64 0
store i32 %13, i32* %15
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 1
%18 = load i32, i32* %17
%19 = shl i32 %18, 4
%20 = load i32*, i32** %3
%21 = getelementptr inbounds i32, i32* %20, i64 2
%22 = load i32, i32* %21
%23 = lshr i32 %22, 2
%24 = or i32 %19, %23
%25 = load i32*, i32** %4
%26 = getelementptr inbounds i32, i32* %25, i64 1
store i32 %24, i32* %26
%27 = load i32*, i32** %3
%28 = getelementptr inbounds i32, i32* %27, i64 2
%29 = load i32, i32* %28
%30 = shl i32 %29, 6
%31 = and i32 %30, 192
%32 = load i32*, i32** %3
%33 = getelementptr inbounds i32, i32* %32, i64 3
%34 = load i32, i32* %33
%35 = or i32 %31, %34
%36 = load i32*, i32** %4
%37 = getelementptr inbounds i32, i32* %36, i64 2
store i32 %35, i32* %37
ret void
}

LLVM IR (-O2):
define void @decodeblock(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = shl i32 %3, 2
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = lshr i32 %6, 4
%8 = or i32 %7, %4
store i32 %8, i32* %1
%9 = load i32, i32* %5
%10 = shl i32 %9, 4
%11 = getelementptr inbounds i32, i32* %0, i64 2
%12 = load i32, i32* %11
%13 = lshr i32 %12, 2
%14 = or i32 %13, %10
%15 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %14, i32* %15
%16 = load i32, i32* %11
%17 = shl i32 %16, 6
%18 = and i32 %17, 192
%19 = getelementptr inbounds i32, i32* %0, i64 3
%20 = load i32, i32* %19
%21 = or i32 %18, %20
%22 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %21, i32* %22
ret void
}