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

/* Variables and functions */
uint64_t __be64_to_cpu(uint64_t val) {
  uint64_t c1, c2, c3, c4, c5, c6, c7, c8;
  c1 = (val >> 56) & 0xff;
  c2 = (val >> 48) & 0xff;
  c3 = (val >> 40) & 0xff;
  c4 = (val >> 32) & 0xff;
  c5 = (val >> 24) & 0xff;
  c6 = (val >> 16) & 0xff;
  c7 = (val >> 8) & 0xff;
  c8 = val & 0xff;
  return c1 | c2 << 8 | c3 << 16 | c4 << 24 | c5 << 32 | c6 << 40 | c7 << 48 |
         c8 << 56;
}


x86 assembly (clang, -O0):
<__be64_to_cpu>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x38,%ecx
sar    %cl,%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x30,%ecx
sar    %cl,%eax
and    $0xff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x28,%ecx
sar    %cl,%eax
and    $0xff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x20(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x14(%rbp),%ecx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x18(%rbp),%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x1c(%rbp),%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x20(%rbp),%edx
mov    $0x30,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x24(%rbp),%edx
mov    $0x38,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__be64_to_cpu>:
ret

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

LLVM IR (-O2):
define i32 @__be64_to_cpu(i32 %0) {
ret i32 poison
}