#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 int64_t;

/* Variables and functions */
int64_t parseHexAmount(unsigned char *buffer) {
  int64_t result = 0;
  result += ((int64_t)*buffer);
  result += ((int64_t) * (buffer + 1)) << 8;
  result += ((int64_t) * (buffer + 2)) << 16;
  result += ((int64_t) * (buffer + 3)) << 24;
  result += ((int64_t) * (buffer + 4)) << 32;
  result += ((int64_t) * (buffer + 5)) << 40;
  result += ((int64_t) * (buffer + 6)) << 48;
  result += ((int64_t) * (buffer + 7)) << 56;
  return result;
}


x86 assembly (clang, -O0):
<parseHexAmount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
shl    $0x10,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
shl    $0x18,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x4(%rax),%eax
mov    $0x20,%ecx
shl    %cl,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x5(%rax),%eax
mov    $0x28,%ecx
shl    %cl,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x6(%rax),%eax
mov    $0x30,%ecx
shl    %cl,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x7(%rax),%eax
mov    $0x38,%ecx
shl    %cl,%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<parseHexAmount>:
ret

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

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