#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 scalar_t__ uint8_t;
typedef int uint64_t;

/* Variables and functions */
uint64_t be_to_h_u64(const uint8_t *buf) {
  return (uint64_t)((uint64_t)buf[7] | (uint64_t)buf[6] << 8 |
                    (uint64_t)buf[5] << 16 | (uint64_t)buf[4] << 24 |
                    (uint64_t)buf[3] << 32 | (uint64_t)buf[2] << 40 |
                    (uint64_t)buf[1] << 48 | (uint64_t)buf[0] << 56);
}


x86 assembly (clang, -O0):
<be_to_h_u64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x38(%rax),%rax
mov    -0x8(%rbp),%rcx
mov    0x30(%rcx),%rcx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x28(%rcx),%rcx
shl    $0x10,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x20(%rcx),%rcx
shl    $0x18,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x18(%rcx),%rcx
mov    %ecx,%edx
mov    $0x20,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x10(%rcx),%rcx
mov    %ecx,%edx
mov    $0x28,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
mov    %ecx,%edx
mov    $0x30,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
mov    (%rcx),%rcx
mov    %ecx,%edx
mov    $0x38,%ecx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @be_to_h_u64(i64* nocapture readnone %0) {
ret i32 poison
}