#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 */

/* Variables and functions */
int /*<<< orphan*/ memcpy(unsigned int *, unsigned char *, int);
unsigned int submask_unzip(unsigned int zipc) {
  unsigned int stmpip;
  unsigned char ctmpip[4];
  ctmpip[0] = zipc >> 24;
  ctmpip[1] = (zipc << 8) >> 24;
  ctmpip[2] = (zipc << 8 << 8) >> 24;
  ctmpip[3] = zipc & 255;
  memcpy(&stmpip, ctmpip, sizeof(unsigned int));
  return stmpip;
}


x86 assembly (clang, -O0):
<submask_unzip>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x18,%eax
mov    %al,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
shr    $0x18,%eax
mov    %al,-0xb(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x8,%eax
shl    $0x8,%eax
shr    $0x18,%eax
mov    %al,-0xa(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x9(%rbp)
lea    -0xc(%rbp),%rsi
lea    -0x8(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<submask_unzip>:
push   %rax
bswap  %edi
mov    %edi,0x4(%rsp)
mov    %rsp,%rdi
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @submask_unzip(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [4 x i8]
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 24
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
store i8 %7, i8* %8
%9 = load i32, i32* %2
%10 = shl i32 %9, 8
%11 = lshr i32 %10, 24
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 1
store i8 %12, i8* %13
%14 = load i32, i32* %2
%15 = shl i32 %14, 8
%16 = shl i32 %15, 8
%17 = lshr i32 %16, 24
%18 = trunc i32 %17 to i8
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 2
store i8 %18, i8* %19
%20 = load i32, i32* %2
%21 = and i32 %20, 255
%22 = trunc i32 %21 to i8
%23 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 3
store i8 %22, i8* %23
%24 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
%25 = call i32 @memcpy(i32* %3, i8* %24, i32 4)
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
define i32 @submask_unzip(i32 %0) {
%2 = alloca i32
%3 = alloca [4 x i8]
%4 = bitcast i32* %2 to i8*
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 0
%6 = lshr i32 %0, 24
%7 = trunc i32 %6 to i8
store i8 %7, i8* %5
%8 = lshr i32 %0, 16
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 1
store i8 %9, i8* %10
%11 = lshr i32 %0, 8
%12 = trunc i32 %11 to i8
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 2
store i8 %12, i8* %13
%14 = trunc i32 %0 to i8
%15 = getelementptr inbounds [4 x i8], [4 x i8]* %3, i64 0, i64 3
store i8 %14, i8* %15
%16 = call i32 @memcpy(i32* %2, i8* %5, i32 4)
%17 = load i32, i32* %2
ret i32 %17
}