#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 uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t get32(const uint8_t *bytes, size_t count) {
  static const union {
    uint32_t value;
    uint8_t offsets[4];
  } MAP = {0x18100800};
  uint32_t block = 0;
  switch (count) {
  case 4:
    block |= (uint32_t)bytes[3] << MAP.offsets[3];
  case 3:
    block |= (uint32_t)bytes[2] << MAP.offsets[2];
  case 2:
    block |= (uint32_t)bytes[1] << MAP.offsets[1];
  case 1:
    block |= (uint32_t)bytes[0] << MAP.offsets[0];
  }
  return block;
}


x86 assembly (clang, -O0):
<get32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x20(%rbp)
sub    $0x3,%rax
ja     1190 <get32+0x90>
mov    -0x20(%rbp),%rax
lea    0xecc(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rax
mov    0xc(%rax),%eax
mov    0xed2(%rip),%ecx
shl    %cl,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
mov    0xeb9(%rip),%ecx
shl    %cl,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    0xea0(%rip),%ecx
shl    %cl,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0xe88(%rip),%ecx
shl    %cl,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get32>:
xor    %eax,%eax
ret

LLVM IR (-O0):
@get32.MAP = internal constant { i32, [12 x i8] } { i32 403703808, [12 x i8] undef }
define i32 @get32(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i32
store i32* %0, i32** %3
store i64 %1, i64* %4
store i32 0, i32* %5
%6 = load i64, i64* %4
switch i64 %6, label %39 [
i64 4, label %7
i64 3, label %15
i64 2, label %23
i64 1, label %31
]
7: ; preds = %2
%8 = load i32*, i32** %3
%9 = getelementptr inbounds i32, i32* %8, i64 3
%10 = load i32, i32* %9
%11 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* bitcast ({ i32, [12 x i8] }* @get32.MAP to [4 x i32]*), i64 0, i64 3)
%12 = shl i32 %10, %11
%13 = load i32, i32* %5
%14 = or i32 %13, %12
store i32 %14, i32* %5
br label %15
15: ; preds = %2, %7
%16 = load i32*, i32** %3
%17 = getelementptr inbounds i32, i32* %16, i64 2
%18 = load i32, i32* %17
%19 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* bitcast ({ i32, [12 x i8] }* @get32.MAP to [4 x i32]*), i64 0, i64 2)
%20 = shl i32 %18, %19
%21 = load i32, i32* %5
%22 = or i32 %21, %20
store i32 %22, i32* %5
br label %23
23: ; preds = %2, %15
%24 = load i32*, i32** %3
%25 = getelementptr inbounds i32, i32* %24, i64 1
%26 = load i32, i32* %25
%27 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* bitcast ({ i32, [12 x i8] }* @get32.MAP to [4 x i32]*), i64 0, i64 1)
%28 = shl i32 %26, %27
%29 = load i32, i32* %5
%30 = or i32 %29, %28
store i32 %30, i32* %5
br label %31
31: ; preds = %2, %23
%32 = load i32*, i32** %3
%33 = getelementptr inbounds i32, i32* %32, i64 0
%34 = load i32, i32* %33
%35 = load i32, i32* getelementptr inbounds ([4 x i32], [4 x i32]* bitcast ({ i32, [12 x i8] }* @get32.MAP to [4 x i32]*), i64 0, i64 0)
%36 = shl i32 %34, %35
%37 = load i32, i32* %5
%38 = or i32 %37, %36
store i32 %38, i32* %5
br label %39
39: ; preds = %31, %2
%40 = load i32, i32* %5
ret i32 %40
}

LLVM IR (-O2):
define i32 @get32(i32* nocapture readnone %0, i64 %1) {
ret i32 0
}