#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*/ memset(void *, int /*<<< orphan*/, int);
void parse_uncompressed_packet(unsigned char *values_header, int *values) {
  memset((void *)values, 0, sizeof(int) * 4);
  values[0] = (unsigned int)(((values_header[1] & 0x03) << 8) |
                             (values_header[0] & 0xFF));
  values[1] = (unsigned int)(((values_header[2] & 0x0F) << 6) |
                             ((values_header[1] & 0xFC) >> 2));
  values[2] = (unsigned int)(((values_header[3] & 0x3F) << 4) |
                             (values_header[2] & 0xF0) >> 4);
  values[3] = (unsigned int)(((values_header[4] & 0xFF) << 2) |
                             ((values_header[3] & 0xC0) >> 6));
}


x86 assembly (clang, -O0):
<parse_uncompressed_packet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%ecx
and    $0x3,%ecx
shl    $0x8,%ecx
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0xff,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%ecx
and    $0xf,%ecx
shl    $0x6,%ecx
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
and    $0xfc,%eax
sar    $0x2,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%ecx
and    $0x3f,%ecx
shl    $0x4,%ecx
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
and    $0xf0,%eax
sar    $0x4,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
movzbl 0x4(%rax),%ecx
and    $0xff,%ecx
shl    $0x2,%ecx
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
and    $0xc0,%eax
sar    $0x6,%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0xc(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_uncompressed_packet>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    %rsi,%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1030 <memset@plt>
movzbl 0x1(%rbx),%eax
and    $0x3,%eax
shl    $0x8,%eax
movzbl (%rbx),%ecx
or     %eax,%ecx
mov    %ecx,(%r14)
movzbl 0x2(%rbx),%eax
and    $0xf,%eax
shl    $0x6,%eax
movzbl 0x1(%rbx),%ecx
shr    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,0x4(%r14)
movzbl 0x3(%rbx),%eax
and    $0x3f,%eax
shl    $0x4,%eax
movzbl 0x2(%rbx),%ecx
shr    $0x4,%ecx
or     %eax,%ecx
mov    %ecx,0x8(%r14)
movzbl 0x4(%rbx),%eax
movzbl 0x3(%rbx),%ecx
shr    $0x6,%ecx
lea    (%rcx,%rax,4),%eax
mov    %eax,0xc(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @parse_uncompressed_packet(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = bitcast i32* %5 to i8*
%7 = call i32 @memset(i8* %6, i32 0, i32 16)
%8 = load i8*, i8** %3
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = and i32 %11, 3
%13 = shl i32 %12, 8
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = and i32 %17, 255
%19 = or i32 %13, %18
%20 = load i32*, i32** %4
%21 = getelementptr inbounds i32, i32* %20, i64 0
store i32 %19, i32* %21
%22 = load i8*, i8** %3
%23 = getelementptr inbounds i8, i8* %22, i64 2
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = and i32 %25, 15
%27 = shl i32 %26, 6
%28 = load i8*, i8** %3
%29 = getelementptr inbounds i8, i8* %28, i64 1
%30 = load i8, i8* %29
%31 = zext i8 %30 to i32
%32 = and i32 %31, 252
%33 = ashr i32 %32, 2
%34 = or i32 %27, %33
%35 = load i32*, i32** %4
%36 = getelementptr inbounds i32, i32* %35, i64 1
store i32 %34, i32* %36
%37 = load i8*, i8** %3
%38 = getelementptr inbounds i8, i8* %37, i64 3
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = and i32 %40, 63
%42 = shl i32 %41, 4
%43 = load i8*, i8** %3
%44 = getelementptr inbounds i8, i8* %43, i64 2
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = and i32 %46, 240
%48 = ashr i32 %47, 4
%49 = or i32 %42, %48
%50 = load i32*, i32** %4
%51 = getelementptr inbounds i32, i32* %50, i64 2
store i32 %49, i32* %51
%52 = load i8*, i8** %3
%53 = getelementptr inbounds i8, i8* %52, i64 4
%54 = load i8, i8* %53
%55 = zext i8 %54 to i32
%56 = and i32 %55, 255
%57 = shl i32 %56, 2
%58 = load i8*, i8** %3
%59 = getelementptr inbounds i8, i8* %58, i64 3
%60 = load i8, i8* %59
%61 = zext i8 %60 to i32
%62 = and i32 %61, 192
%63 = ashr i32 %62, 6
%64 = or i32 %57, %63
%65 = load i32*, i32** %4
%66 = getelementptr inbounds i32, i32* %65, i64 3
store i32 %64, i32* %66
ret void
}

LLVM IR (-O2):
define void @parse_uncompressed_packet(i8* nocapture %0, i32* %1) {
%3 = bitcast i32* %1 to i8*
%4 = tail call i32 @memset(i8* %3, i32 0, i32 16)
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = and i8 %6, 3
%8 = zext i8 %7 to i32
%9 = shl nuw nsw i32 %8, 8
%10 = load i8, i8* %0
%11 = zext i8 %10 to i32
%12 = or i32 %9, %11
store i32 %12, i32* %1
%13 = getelementptr inbounds i8, i8* %0, i64 2
%14 = load i8, i8* %13
%15 = and i8 %14, 15
%16 = zext i8 %15 to i32
%17 = shl nuw nsw i32 %16, 6
%18 = load i8, i8* %5
%19 = lshr i8 %18, 2
%20 = zext i8 %19 to i32
%21 = or i32 %17, %20
%22 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %21, i32* %22
%23 = getelementptr inbounds i8, i8* %0, i64 3
%24 = load i8, i8* %23
%25 = and i8 %24, 63
%26 = zext i8 %25 to i32
%27 = shl nuw nsw i32 %26, 4
%28 = load i8, i8* %13
%29 = lshr i8 %28, 4
%30 = zext i8 %29 to i32
%31 = or i32 %27, %30
%32 = getelementptr inbounds i32, i32* %1, i64 2
store i32 %31, i32* %32
%33 = getelementptr inbounds i8, i8* %0, i64 4
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = shl nuw nsw i32 %35, 2
%37 = load i8, i8* %23
%38 = lshr i8 %37, 6
%39 = zext i8 %38 to i32
%40 = or i32 %36, %39
%41 = getelementptr inbounds i32, i32* %1, i64 3
store i32 %40, i32* %41
ret void
}