#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 unsigned char uint32_t;

/* Variables and functions */
uint32_t op_dev_rev_recv(unsigned char *packet) {
  uint32_t res = 0;
  packet++;
  res |= packet[0];
  res <<= (3 * 8);
  res |= packet[1];
  res <<= (2 * 8);
  res |= packet[2];
  res <<= (1 * 8);
  res |= packet[3];
  return res;
}


x86 assembly (clang, -O0):
<op_dev_rev_recv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
movzbl -0x9(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
shl    $0x18,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%ecx
movzbl -0x9(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
shl    $0x10,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%ecx
movzbl -0x9(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
shl    $0x8,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%ecx
movzbl -0x9(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x9(%rbp)
movzbl -0x9(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_dev_rev_recv>:
mov    0x4(%rdi),%al
ret

LLVM IR (-O0):
define zeroext i8 @op_dev_rev_recv(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
store i8 0, i8* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i32 1
store i8* %5, i8** %2
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = or i32 %11, %9
%13 = trunc i32 %12 to i8
store i8 %13, i8* %3
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = shl i32 %15, 24
%17 = trunc i32 %16 to i8
store i8 %17, i8* %3
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = load i8, i8* %3
%23 = zext i8 %22 to i32
%24 = or i32 %23, %21
%25 = trunc i32 %24 to i8
store i8 %25, i8* %3
%26 = load i8, i8* %3
%27 = zext i8 %26 to i32
%28 = shl i32 %27, 16
%29 = trunc i32 %28 to i8
store i8 %29, i8* %3
%30 = load i8*, i8** %2
%31 = getelementptr inbounds i8, i8* %30, i64 2
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = load i8, i8* %3
%35 = zext i8 %34 to i32
%36 = or i32 %35, %33
%37 = trunc i32 %36 to i8
store i8 %37, i8* %3
%38 = load i8, i8* %3
%39 = zext i8 %38 to i32
%40 = shl i32 %39, 8
%41 = trunc i32 %40 to i8
store i8 %41, i8* %3
%42 = load i8*, i8** %2
%43 = getelementptr inbounds i8, i8* %42, i64 3
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %3
%47 = zext i8 %46 to i32
%48 = or i32 %47, %45
%49 = trunc i32 %48 to i8
store i8 %49, i8* %3
%50 = load i8, i8* %3
ret i8 %50
}

LLVM IR (-O2):
define zeroext i8 @op_dev_rev_recv(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = load i8, i8* %2
ret i8 %3
}