#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 read_le64(unsigned char *in) {
  uint64_t result = 0;
  result |= (uint64_t)in[0];
  result |= (uint64_t)in[1] << 8;
  result |= (uint64_t)in[2] << 16;
  result |= (uint64_t)in[3] << 24;
  result |= (uint64_t)in[4] << 32;
  result |= (uint64_t)in[5] << 40;
  result |= (uint64_t)in[6] << 48;
  result |= (uint64_t)in[7] << 56;
  return result;
}


x86 assembly (clang, -O0):
<read_le64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x10,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x4(%rax),%eax
mov    $0x20,%ecx
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x5(%rax),%eax
mov    $0x28,%ecx
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x6(%rax),%eax
mov    $0x30,%ecx
shl    %cl,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x7(%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):
<read_le64>:
ret

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

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