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

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


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

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

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

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