#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 opts(uint8_t byte, uint8_t *options) {
  *(options++) = byte | ((byte << 1) & 0xff);
  *(options++) = byte & (byte << 1);
  *(options++) = byte | ((byte >> 1) & 0xff);
  *(options++) = byte & (byte >> 1);
}


x86 assembly (clang, -O0):
<opts>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
and    $0xff,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
and    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
and    $0xff,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
mov    -0x4(%rbp),%eax
sar    $0x1,%eax
and    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<opts>:
lea    (%rdi,%rdi,1),%eax
movzbl %al,%ecx
or     %edi,%ecx
mov    %ecx,(%rsi)
and    %edi,%eax
mov    %eax,0x4(%rsi)
mov    %edi,%eax
sar    %eax
movzbl %al,%ecx
or     %edi,%ecx
mov    %ecx,0x8(%rsi)
and    %edi,%eax
mov    %eax,0xc(%rsi)
ret

LLVM IR (-O0):
define void @opts(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 = shl i32 %6, 1
%8 = and i32 %7, 255
%9 = or i32 %5, %8
%10 = load i32*, i32** %4
%11 = getelementptr inbounds i32, i32* %10, i32 1
store i32* %11, i32** %4
store i32 %9, i32* %10
%12 = load i32, i32* %3
%13 = load i32, i32* %3
%14 = shl i32 %13, 1
%15 = and i32 %12, %14
%16 = load i32*, i32** %4
%17 = getelementptr inbounds i32, i32* %16, i32 1
store i32* %17, i32** %4
store i32 %15, i32* %16
%18 = load i32, i32* %3
%19 = load i32, i32* %3
%20 = ashr i32 %19, 1
%21 = and i32 %20, 255
%22 = or i32 %18, %21
%23 = load i32*, i32** %4
%24 = getelementptr inbounds i32, i32* %23, i32 1
store i32* %24, i32** %4
store i32 %22, i32* %23
%25 = load i32, i32* %3
%26 = load i32, i32* %3
%27 = ashr i32 %26, 1
%28 = and i32 %25, %27
%29 = load i32*, i32** %4
%30 = getelementptr inbounds i32, i32* %29, i32 1
store i32* %30, i32** %4
store i32 %28, i32* %29
ret void
}

LLVM IR (-O2):
define void @opts(i32 %0, i32* nocapture writeonly %1) {
%3 = shl i32 %0, 1
%4 = and i32 %3, 254
%5 = or i32 %4, %0
%6 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %5, i32* %1
%7 = and i32 %3, %0
%8 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %7, i32* %6
%9 = ashr i32 %0, 1
%10 = and i32 %9, 255
%11 = or i32 %10, %0
%12 = getelementptr inbounds i32, i32* %1, i64 3
store i32 %11, i32* %8
%13 = and i32 %9, %0
store i32 %13, i32* %12
ret void
}