#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 /*<<< orphan*/ FILE;

/* Variables and functions */
unsigned long long getc(int /*<<< orphan*/ *);
unsigned long long read8LE(FILE *fp) {
  unsigned long long val;
  val = getc(fp);
  val |= (unsigned long long)getc(fp) << 8;
  val |= (unsigned long long)getc(fp) << 16;
  val |= (unsigned long long)getc(fp) << 24;
  val |= (unsigned long long)getc(fp) << 32;
  val |= (unsigned long long)getc(fp) << 40;
  val |= (unsigned long long)getc(fp) << 48;
  val |= (unsigned long long)getc(fp) << 56;
  return val;
}


x86 assembly (clang, -O0):
<read8LE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
shl    $0x8,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
shl    $0x10,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
shl    $0x18,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
shl    $0x20,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
shl    $0x28,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
shl    $0x30,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <getc@plt>
shl    $0x38,%rax
or     -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read8LE>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %rdi,%r14
call   1030 <getc@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <getc@plt>
mov    %rax,%r15
shl    $0x8,%r15
or     %rbx,%r15
mov    %r14,%rdi
call   1030 <getc@plt>
mov    %rax,%r12
shl    $0x10,%r12
mov    %r14,%rdi
call   1030 <getc@plt>
mov    %rax,%r13
shl    $0x18,%r13
or     %r12,%r13
or     %r15,%r13
mov    %r14,%rdi
call   1030 <getc@plt>
mov    %rax,%r15
shl    $0x20,%r15
mov    %r14,%rdi
call   1030 <getc@plt>
mov    %rax,%r12
shl    $0x28,%r12
or     %r15,%r12
mov    %r14,%rdi
call   1030 <getc@plt>
mov    %rax,%rbx
shl    $0x30,%rbx
or     %r12,%rbx
or     %r13,%rbx
mov    %r14,%rdi
call   1030 <getc@plt>
shl    $0x38,%rax
or     %rbx,%rax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @read8LE(i32* nocapture %0) {
%2 = tail call i64 @getc(i32* %0)
%3 = tail call i64 @getc(i32* %0)
%4 = shl i64 %3, 8
%5 = or i64 %4, %2
%6 = tail call i64 @getc(i32* %0)
%7 = shl i64 %6, 16
%8 = or i64 %5, %7
%9 = tail call i64 @getc(i32* %0)
%10 = shl i64 %9, 24
%11 = or i64 %8, %10
%12 = tail call i64 @getc(i32* %0)
%13 = shl i64 %12, 32
%14 = or i64 %11, %13
%15 = tail call i64 @getc(i32* %0)
%16 = shl i64 %15, 40
%17 = or i64 %14, %16
%18 = tail call i64 @getc(i32* %0)
%19 = shl i64 %18, 48
%20 = or i64 %17, %19
%21 = tail call i64 @getc(i32* %0)
%22 = shl i64 %21, 56
%23 = or i64 %20, %22
ret i64 %23
}