#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 */
int read_raw_byte(char *, void *, int);
int read_raw_little_endian64(unsigned long long *tag, void *_buffer,
                             int offset) {
  offset = read_raw_byte((char *)tag, _buffer, offset);
  char b1 = (char)*tag;
  offset = read_raw_byte((char *)tag, _buffer, offset);
  char b2 = (char)*tag;
  offset = read_raw_byte((char *)tag, _buffer, offset);
  char b3 = (char)*tag;
  offset = read_raw_byte((char *)tag, _buffer, offset);
  char b4 = (char)*tag;
  offset = read_raw_byte((char *)tag, _buffer, offset);
  char b5 = (char)*tag;
  offset = read_raw_byte((char *)tag, _buffer, offset);
  char b6 = (char)*tag;
  offset = read_raw_byte((char *)tag, _buffer, offset);
  char b7 = (char)*tag;
  offset = read_raw_byte((char *)tag, _buffer, offset);
  char b8 = (char)*tag;
  *tag = (((unsigned long long)b1 & 0xff)) |
         (((unsigned long long)b2 & 0xff) << 8) |
         (((unsigned long long)b3 & 0xff) << 16) |
         (((unsigned long long)b4 & 0xff) << 24) |
         (((unsigned long long)b5 & 0xff) << 32) |
         (((unsigned long long)b6 & 0xff) << 40) |
         (((unsigned long long)b7 & 0xff) << 48) |
         (((unsigned long long)b8 & 0xff) << 56);
  return offset;
}


x86 assembly (clang, -O0):
<read_raw_little_endian64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read_raw_byte@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %al,-0x15(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read_raw_byte@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %al,-0x16(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read_raw_byte@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %al,-0x17(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read_raw_byte@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %al,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read_raw_byte@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read_raw_byte@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %al,-0x1a(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read_raw_byte@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %al,-0x1b(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <read_raw_byte@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %al,-0x1c(%rbp)
movsbq -0x15(%rbp),%rcx
and    $0xff,%rcx
movsbq -0x16(%rbp),%rax
and    $0xff,%rax
shl    $0x8,%rax
or     %rax,%rcx
movsbq -0x17(%rbp),%rax
and    $0xff,%rax
shl    $0x10,%rax
or     %rax,%rcx
movsbq -0x18(%rbp),%rax
and    $0xff,%rax
shl    $0x18,%rax
or     %rax,%rcx
movsbq -0x19(%rbp),%rax
and    $0xff,%rax
shl    $0x20,%rax
or     %rax,%rcx
movsbq -0x1a(%rbp),%rax
and    $0xff,%rax
shl    $0x28,%rax
or     %rax,%rcx
movsbq -0x1b(%rbp),%rax
and    $0xff,%rax
shl    $0x30,%rax
or     %rax,%rcx
movsbq -0x1c(%rbp),%rax
and    $0xff,%rax
shl    $0x38,%rax
or     %rax,%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_raw_little_endian64>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <read_raw_byte@plt>
movzbl (%rbx),%ecx
mov    %rcx,0x10(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <read_raw_byte@plt>
mov    (%rbx),%r13d
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <read_raw_byte@plt>
mov    (%rbx),%ecx
mov    %rcx,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <read_raw_byte@plt>
mov    (%rbx),%r12d
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <read_raw_byte@plt>
mov    (%rbx),%rcx
mov    %rcx,(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <read_raw_byte@plt>
mov    (%rbx),%rbp
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <read_raw_byte@plt>
mov    (%rbx),%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <read_raw_byte@plt>
mov    (%rbx),%rcx
shl    $0x8,%r13d
movzwl %r13w,%edx
add    0x10(%rsp),%rdx
movzbl 0x8(%rsp),%esi
shl    $0x10,%rsi
or     %rdx,%rsi
shl    $0x18,%r12d
or     %rsi,%r12
movzbl (%rsp),%edx
shl    $0x20,%rdx
or     %r12,%rdx
movzbl %bpl,%esi
shl    $0x28,%rsi
or     %rdx,%rsi
movzbl %r15b,%edx
shl    $0x30,%rdx
or     %rsi,%rdx
shl    $0x38,%rcx
or     %rdx,%rcx
mov    %rcx,(%rbx)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @read_raw_little_endian64(i64* %0, i8* %1, i32 %2) {
%4 = alloca i64*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
%11 = alloca i8
%12 = alloca i8
%13 = alloca i8
%14 = alloca i8
store i64* %0, i64** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%15 = load i64*, i64** %4
%16 = bitcast i64* %15 to i8*
%17 = load i8*, i8** %5
%18 = load i32, i32* %6
%19 = call i32 @read_raw_byte(i8* %16, i8* %17, i32 %18)
store i32 %19, i32* %6
%20 = load i64*, i64** %4
%21 = load i64, i64* %20
%22 = trunc i64 %21 to i8
store i8 %22, i8* %7
%23 = load i64*, i64** %4
%24 = bitcast i64* %23 to i8*
%25 = load i8*, i8** %5
%26 = load i32, i32* %6
%27 = call i32 @read_raw_byte(i8* %24, i8* %25, i32 %26)
store i32 %27, i32* %6
%28 = load i64*, i64** %4
%29 = load i64, i64* %28
%30 = trunc i64 %29 to i8
store i8 %30, i8* %8
%31 = load i64*, i64** %4
%32 = bitcast i64* %31 to i8*
%33 = load i8*, i8** %5
%34 = load i32, i32* %6
%35 = call i32 @read_raw_byte(i8* %32, i8* %33, i32 %34)
store i32 %35, i32* %6
%36 = load i64*, i64** %4
%37 = load i64, i64* %36
%38 = trunc i64 %37 to i8
store i8 %38, i8* %9
%39 = load i64*, i64** %4
%40 = bitcast i64* %39 to i8*
%41 = load i8*, i8** %5
%42 = load i32, i32* %6
%43 = call i32 @read_raw_byte(i8* %40, i8* %41, i32 %42)
store i32 %43, i32* %6
%44 = load i64*, i64** %4
%45 = load i64, i64* %44
%46 = trunc i64 %45 to i8
store i8 %46, i8* %10
%47 = load i64*, i64** %4
%48 = bitcast i64* %47 to i8*
%49 = load i8*, i8** %5
%50 = load i32, i32* %6
%51 = call i32 @read_raw_byte(i8* %48, i8* %49, i32 %50)
store i32 %51, i32* %6
%52 = load i64*, i64** %4
%53 = load i64, i64* %52
%54 = trunc i64 %53 to i8
store i8 %54, i8* %11
%55 = load i64*, i64** %4
%56 = bitcast i64* %55 to i8*
%57 = load i8*, i8** %5
%58 = load i32, i32* %6
%59 = call i32 @read_raw_byte(i8* %56, i8* %57, i32 %58)
store i32 %59, i32* %6
%60 = load i64*, i64** %4
%61 = load i64, i64* %60
%62 = trunc i64 %61 to i8
store i8 %62, i8* %12
%63 = load i64*, i64** %4
%64 = bitcast i64* %63 to i8*
%65 = load i8*, i8** %5
%66 = load i32, i32* %6
%67 = call i32 @read_raw_byte(i8* %64, i8* %65, i32 %66)
store i32 %67, i32* %6
%68 = load i64*, i64** %4
%69 = load i64, i64* %68
%70 = trunc i64 %69 to i8
store i8 %70, i8* %13
%71 = load i64*, i64** %4
%72 = bitcast i64* %71 to i8*
%73 = load i8*, i8** %5
%74 = load i32, i32* %6
%75 = call i32 @read_raw_byte(i8* %72, i8* %73, i32 %74)
store i32 %75, i32* %6
%76 = load i64*, i64** %4
%77 = load i64, i64* %76
%78 = trunc i64 %77 to i8
store i8 %78, i8* %14
%79 = load i8, i8* %7
%80 = sext i8 %79 to i64
%81 = and i64 %80, 255
%82 = load i8, i8* %8
%83 = sext i8 %82 to i64
%84 = and i64 %83, 255
%85 = shl i64 %84, 8
%86 = or i64 %81, %85
%87 = load i8, i8* %9
%88 = sext i8 %87 to i64
%89 = and i64 %88, 255
%90 = shl i64 %89, 16
%91 = or i64 %86, %90
%92 = load i8, i8* %10
%93 = sext i8 %92 to i64
%94 = and i64 %93, 255
%95 = shl i64 %94, 24
%96 = or i64 %91, %95
%97 = load i8, i8* %11
%98 = sext i8 %97 to i64
%99 = and i64 %98, 255
%100 = shl i64 %99, 32
%101 = or i64 %96, %100
%102 = load i8, i8* %12
%103 = sext i8 %102 to i64
%104 = and i64 %103, 255
%105 = shl i64 %104, 40
%106 = or i64 %101, %105
%107 = load i8, i8* %13
%108 = sext i8 %107 to i64
%109 = and i64 %108, 255
%110 = shl i64 %109, 48
%111 = or i64 %106, %110
%112 = load i8, i8* %14
%113 = sext i8 %112 to i64
%114 = and i64 %113, 255
%115 = shl i64 %114, 56
%116 = or i64 %111, %115
%117 = load i64*, i64** %4
store i64 %116, i64* %117
%118 = load i32, i32* %6
ret i32 %118
}

LLVM IR (-O2):
define i32 @read_raw_little_endian64(i64* %0, i8* %1, i32 %2) {
%4 = bitcast i64* %0 to i8*
%5 = tail call i32 @read_raw_byte(i8* %4, i8* %1, i32 %2)
%6 = load i64, i64* %0
%7 = tail call i32 @read_raw_byte(i8* %4, i8* %1, i32 %5)
%8 = load i64, i64* %0
%9 = tail call i32 @read_raw_byte(i8* %4, i8* %1, i32 %7)
%10 = load i64, i64* %0
%11 = tail call i32 @read_raw_byte(i8* %4, i8* %1, i32 %9)
%12 = load i64, i64* %0
%13 = tail call i32 @read_raw_byte(i8* %4, i8* %1, i32 %11)
%14 = load i64, i64* %0
%15 = tail call i32 @read_raw_byte(i8* %4, i8* %1, i32 %13)
%16 = load i64, i64* %0
%17 = tail call i32 @read_raw_byte(i8* %4, i8* %1, i32 %15)
%18 = load i64, i64* %0
%19 = tail call i32 @read_raw_byte(i8* %4, i8* %1, i32 %17)
%20 = load i64, i64* %0
%21 = and i64 %6, 255
%22 = shl i64 %8, 8
%23 = and i64 %22, 65280
%24 = or i64 %23, %21
%25 = shl i64 %10, 16
%26 = and i64 %25, 16711680
%27 = or i64 %24, %26
%28 = shl i64 %12, 24
%29 = and i64 %28, 4278190080
%30 = or i64 %27, %29
%31 = shl i64 %14, 32
%32 = and i64 %31, 1095216660480
%33 = or i64 %30, %32
%34 = shl i64 %16, 40
%35 = and i64 %34, 280375465082880
%36 = or i64 %33, %35
%37 = shl i64 %18, 48
%38 = and i64 %37, 71776119061217280
%39 = or i64 %36, %38
%40 = shl i64 %20, 56
%41 = or i64 %39, %40
store i64 %41, i64* %0
ret i32 %19
}