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

/* Variables and functions */
void prv_extract_int8(int32_t in, int32_t *a, int32_t *b, int32_t *c,
                      int32_t *d) {
  *a = in & 0xff;
  *b = (in >> 8) & 0xff;
  *c = (in >> 16) & 0xff;
  *d = (in >> 24) & 0xff;
  if (*a & 0x80)
    *a |= 0xffffff00;
  if (*b & 0x80)
    *b |= 0xffffff00;
  if (*c & 0x80)
    *c |= 0xffffff00;
  if (*d & 0x80)
    *d |= 0xffffff00;
}


x86 assembly (clang, -O0):
<prv_extract_int8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x18,%ecx
and    $0xff,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     117e <prv_extract_int8+0x7e>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
or     $0xffffff00,%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     11a0 <prv_extract_int8+0xa0>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
or     $0xffffff00,%ecx
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     11c2 <prv_extract_int8+0xc2>
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
or     $0xffffff00,%ecx
mov    %ecx,(%rax)
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     11e4 <prv_extract_int8+0xe4>
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
or     $0xffffff00,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<prv_extract_int8>:
mov    %edi,%eax
movzbl %al,%edi
mov    %edi,(%rsi)
movzbl %ah,%edi
mov    %edi,(%rdx)
mov    %eax,%edi
shr    $0x10,%edi
movzbl %dil,%edi
mov    %edi,(%rcx)
shr    $0x18,%eax
mov    %eax,(%r8)
mov    (%rsi),%eax
test   $0x80,%al
je     112a <prv_extract_int8+0x2a>
or     $0xffffff00,%eax
mov    %eax,(%rsi)
mov    (%rdx),%eax
test   $0x80,%al
je     1137 <prv_extract_int8+0x37>
or     $0xffffff00,%eax
mov    %eax,(%rdx)
mov    (%rcx),%eax
test   $0x80,%al
je     1144 <prv_extract_int8+0x44>
or     $0xffffff00,%eax
mov    %eax,(%rcx)
mov    (%r8),%eax
test   $0x80,%al
je     1153 <prv_extract_int8+0x53>
or     $0xffffff00,%eax
mov    %eax,(%r8)
ret

LLVM IR (-O0):
define void @prv_extract_int8(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = and i32 %11, 255
%13 = load i32*, i32** %7
store i32 %12, i32* %13
%14 = load i32, i32* %6
%15 = ashr i32 %14, 8
%16 = and i32 %15, 255
%17 = load i32*, i32** %8
store i32 %16, i32* %17
%18 = load i32, i32* %6
%19 = ashr i32 %18, 16
%20 = and i32 %19, 255
%21 = load i32*, i32** %9
store i32 %20, i32* %21
%22 = load i32, i32* %6
%23 = ashr i32 %22, 24
%24 = and i32 %23, 255
%25 = load i32*, i32** %10
store i32 %24, i32* %25
%26 = load i32*, i32** %7
%27 = load i32, i32* %26
%28 = and i32 %27, 128
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %34
30: ; preds = %5
%31 = load i32*, i32** %7
%32 = load i32, i32* %31
%33 = or i32 %32, -256
store i32 %33, i32* %31
br label %34
34: ; preds = %30, %5
%35 = load i32*, i32** %8
%36 = load i32, i32* %35
%37 = and i32 %36, 128
%38 = icmp ne i32 %37, 0
br i1 %38, label %39, label %43
39: ; preds = %34
%40 = load i32*, i32** %8
%41 = load i32, i32* %40
%42 = or i32 %41, -256
store i32 %42, i32* %40
br label %43
43: ; preds = %39, %34
%44 = load i32*, i32** %9
%45 = load i32, i32* %44
%46 = and i32 %45, 128
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %52
48: ; preds = %43
%49 = load i32*, i32** %9
%50 = load i32, i32* %49
%51 = or i32 %50, -256
store i32 %51, i32* %49
br label %52
52: ; preds = %48, %43
%53 = load i32*, i32** %10
%54 = load i32, i32* %53
%55 = and i32 %54, 128
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %61
57: ; preds = %52
%58 = load i32*, i32** %10
%59 = load i32, i32* %58
%60 = or i32 %59, -256
store i32 %60, i32* %58
br label %61
61: ; preds = %57, %52
ret void
}

LLVM IR (-O2):
define void @prv_extract_int8(i32 %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture %3, i32* nocapture %4) {
%6 = and i32 %0, 255
store i32 %6, i32* %1
%7 = lshr i32 %0, 8
%8 = and i32 %7, 255
store i32 %8, i32* %2
%9 = lshr i32 %0, 16
%10 = and i32 %9, 255
store i32 %10, i32* %3
%11 = lshr i32 %0, 24
store i32 %11, i32* %4
%12 = load i32, i32* %1
%13 = and i32 %12, 128
%14 = icmp eq i32 %13, 0
br i1 %14, label %17, label %15
15: ; preds = %5
%16 = or i32 %12, -256
store i32 %16, i32* %1
br label %17
17: ; preds = %15, %5
%18 = load i32, i32* %2
%19 = and i32 %18, 128
%20 = icmp eq i32 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %17
%22 = or i32 %18, -256
store i32 %22, i32* %2
br label %23
23: ; preds = %21, %17
%24 = load i32, i32* %3
%25 = and i32 %24, 128
%26 = icmp eq i32 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %23
%28 = or i32 %24, -256
store i32 %28, i32* %3
br label %29
29: ; preds = %27, %23
%30 = load i32, i32* %4
%31 = and i32 %30, 128
%32 = icmp eq i32 %31, 0
br i1 %32, label %35, label %33
33: ; preds = %29
%34 = or i32 %30, -256
store i32 %34, i32* %4
br label %35
35: ; preds = %33, %29
ret void
}