#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 */
unsigned int be64get(void *p, uint64_t *v) {
  uint8_t *a;
  a = p;
  *v = (uint64_t)a[0] << 56;
  *v |= (uint64_t)a[1] << 48;
  *v |= (uint64_t)a[2] << 40;
  *v |= (uint64_t)a[3] << 32;
  *v |= (uint64_t)a[4] << 24;
  *v |= a[5] << 16;
  *v |= a[6] << 8;
  *v |= a[7];
  return 8;
}


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

x86 assembly (clang, -O2):
<be64get>:
mov    $0x8,%eax
ret

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

LLVM IR (-O2):
define i32 @be64get(i8* nocapture readnone %0, i32* nocapture readnone %1) {
ret i32 8
}