#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 scalar_t__ uint8_t;
typedef int uint32_t;
typedef scalar_t__ uint16_t;

/* Variables and functions */
void _bytecode_read(uint32_t bytecode, uint8_t *code, uint32_t *value,
                    uint16_t *addr, uint8_t *r0, uint8_t *r1, uint8_t *r2) {
  *code = (uint8_t)(bytecode >> 24);
  *value = (uint32_t)(bytecode & 0x00FFFFF);
  *addr = (uint16_t)(bytecode & 0x0000FFFF);
  *r0 = (uint16_t)((bytecode & 0x00FF0000) >> 16);
  *r1 = (uint16_t)((bytecode & 0x0000FF00) >> 8);
  *r2 = (uint16_t)((bytecode & 0x000000FF));
}


x86 assembly (clang, -O0):
<_bytecode_read>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
movslq %eax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%ecx
and    $0xfffff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
movslq %eax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
and    $0xff0000,%eax
sar    $0x10,%eax
movslq %eax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
and    $0xff00,%eax
sar    $0x8,%eax
movslq %eax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
movslq %eax,%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_bytecode_read>:
push   %rbp
push   %rbx
mov    %edi,%eax
mov    %edi,%ebx
movzwl %ax,%r10d
movzbl %ah,%ebp
movzbl %al,%r11d
sar    $0x18,%eax
cltq
mov    %rax,(%rsi)
and    $0xfffff,%ebx
mov    %ebx,(%rdx)
mov    0x18(%rsp),%rax
mov    %r10,(%rcx)
shr    $0x10,%edi
movzbl %dil,%ecx
mov    %rcx,(%r8)
mov    %rbp,(%r9)
mov    %r11,(%rax)
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define void @_bytecode_read(i32 %0, i64* %1, i32* %2, i64* %3, i64* %4, i64* %5, i64* %6) {
%8 = alloca i32
%9 = alloca i64*
%10 = alloca i32*
%11 = alloca i64*
%12 = alloca i64*
%13 = alloca i64*
%14 = alloca i64*
store i32 %0, i32* %8
store i64* %1, i64** %9
store i32* %2, i32** %10
store i64* %3, i64** %11
store i64* %4, i64** %12
store i64* %5, i64** %13
store i64* %6, i64** %14
%15 = load i32, i32* %8
%16 = ashr i32 %15, 24
%17 = sext i32 %16 to i64
%18 = load i64*, i64** %9
store i64 %17, i64* %18
%19 = load i32, i32* %8
%20 = and i32 %19, 1048575
%21 = load i32*, i32** %10
store i32 %20, i32* %21
%22 = load i32, i32* %8
%23 = and i32 %22, 65535
%24 = sext i32 %23 to i64
%25 = load i64*, i64** %11
store i64 %24, i64* %25
%26 = load i32, i32* %8
%27 = and i32 %26, 16711680
%28 = ashr i32 %27, 16
%29 = sext i32 %28 to i64
%30 = load i64*, i64** %12
store i64 %29, i64* %30
%31 = load i32, i32* %8
%32 = and i32 %31, 65280
%33 = ashr i32 %32, 8
%34 = sext i32 %33 to i64
%35 = load i64*, i64** %13
store i64 %34, i64* %35
%36 = load i32, i32* %8
%37 = and i32 %36, 255
%38 = sext i32 %37 to i64
%39 = load i64*, i64** %14
store i64 %38, i64* %39
ret void
}

LLVM IR (-O2):
define void @_bytecode_read(i32 %0, i64* nocapture writeonly %1, i32* nocapture writeonly %2, i64* nocapture writeonly %3, i64* nocapture writeonly %4, i64* nocapture writeonly %5, i64* nocapture writeonly %6) {
%8 = ashr i32 %0, 24
%9 = sext i32 %8 to i64
store i64 %9, i64* %1
%10 = and i32 %0, 1048575
store i32 %10, i32* %2
%11 = and i32 %0, 65535
%12 = zext i32 %11 to i64
store i64 %12, i64* %3
%13 = lshr i32 %0, 16
%14 = and i32 %13, 255
%15 = zext i32 %14 to i64
store i64 %15, i64* %4
%16 = lshr i32 %0, 8
%17 = and i32 %16, 255
%18 = zext i32 %17 to i64
store i64 %18, i64* %5
%19 = and i32 %0, 255
%20 = zext i32 %19 to i64
store i64 %20, i64* %6
ret void
}