#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 */

/* Variables and functions */
scalar_t__ ReadByte();
long long ReadLongLong() {
  long long v = 0;
  v |= (long long)ReadByte() << 56;
  v |= (long long)ReadByte() << 48;
  v |= (long long)ReadByte() << 40;
  v |= (long long)ReadByte() << 32;
  v |= (long long)ReadByte() << 24;
  v |= (long long)ReadByte() << 16;
  v |= (long long)ReadByte() << 8;
  v |= (long long)ReadByte();
  return v;
}


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

x86 assembly (clang, -O2):
<ReadLongLong>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <ReadByte@plt>
mov    %rax,%rbx
shl    $0x38,%rbx
xor    %eax,%eax
call   1030 <ReadByte@plt>
mov    %rax,%r14
shl    $0x30,%r14
or     %rbx,%r14
xor    %eax,%eax
call   1030 <ReadByte@plt>
mov    %rax,%r15
shl    $0x28,%r15
xor    %eax,%eax
call   1030 <ReadByte@plt>
mov    %rax,%r12
shl    $0x20,%r12
or     %r15,%r12
or     %r14,%r12
xor    %eax,%eax
call   1030 <ReadByte@plt>
mov    %rax,%r14
shl    $0x18,%r14
xor    %eax,%eax
call   1030 <ReadByte@plt>
mov    %rax,%r15
shl    $0x10,%r15
or     %r14,%r15
xor    %eax,%eax
call   1030 <ReadByte@plt>
mov    %rax,%rbx
shl    $0x8,%rbx
or     %r15,%rbx
or     %r12,%rbx
xor    %eax,%eax
call   1030 <ReadByte@plt>
or     %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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