#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*/ uint64_t;
typedef uintptr_t uint32_t;
typedef int /*<<< orphan*/ key;

/* Variables and functions */
int UINT32_MAX;
int htole64(int /*<<< orphan*/ const);
int /*<<< orphan*/ rgph_murmur32s_finalise(size_t, uintptr_t *);
int /*<<< orphan*/ rgph_murmur32s_mix(int, uintptr_t *, int);
uint32_t rgph_u32_murmur32s_data64(const void *data, size_t len,
                                   uintptr_t seed) {
  const uint64_t *key = data;
  const uint64_t *end = key + len;
  uint32_t h[1] = {seed};
  for (; key != end; key += 1) {
    rgph_murmur32s_mix(htole64(key[0]) & UINT32_MAX, h, 0);
    rgph_murmur32s_mix(htole64(key[0]) >> 32, h, 0);
  }
  rgph_murmur32s_mix(0, h, 1);
  rgph_murmur32s_finalise(len * sizeof(key[0]), h);
  return h[0];
}


x86 assembly (clang, -O0):
<rgph_u32_murmur32s_data64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
je     11c6 <rgph_u32_murmur32s_data64+0x96>
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1040 <htole64@plt>
mov    %eax,%edi
mov    0x2e6f(%rip),%rax
and    (%rax),%edi
lea    -0x30(%rbp),%rsi
xor    %edx,%edx
call   1030 <rgph_murmur32s_mix@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1040 <htole64@plt>
mov    %eax,%edi
mov    $0x20,%ecx
sar    %cl,%edi
lea    -0x30(%rbp),%rsi
xor    %edx,%edx
call   1030 <rgph_murmur32s_mix@plt>
mov    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x20(%rbp)
jmp    1167 <rgph_u32_murmur32s_data64+0x37>
lea    -0x30(%rbp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <rgph_murmur32s_mix@plt>
mov    -0x10(%rbp),%rdi
shl    $0x2,%rdi
lea    -0x30(%rbp),%rsi
call   1050 <rgph_murmur32s_finalise@plt>
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_u32_murmur32s_data64>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%r14
shl    $0x2,%r14
mov    %rdx,0x8(%rsp)
test   %r14,%r14
je     1195 <rgph_u32_murmur32s_data64+0x65>
mov    %rdi,%r12
xor    %ebx,%ebx
mov    0x2e9e(%rip),%r13
lea    0x8(%rsp),%r15
nop
mov    (%r12,%rbx,1),%edi
call   1040 <htole64@plt>
and    0x0(%r13),%eax
mov    %eax,%edi
mov    %r15,%rsi
xor    %edx,%edx
call   1030 <rgph_murmur32s_mix@plt>
mov    (%r12,%rbx,1),%edi
call   1040 <htole64@plt>
mov    %r15,%rsi
xor    %edx,%edx
call   1030 <rgph_murmur32s_mix@plt>
add    $0x4,%rbx
cmp    %rbx,%r14
jne    1160 <rgph_u32_murmur32s_data64+0x30>
lea    0x8(%rsp),%rbx
xor    %edi,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
call   1030 <rgph_murmur32s_mix@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <rgph_murmur32s_finalise@plt>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@UINT32_MAX = global i32 0
define i64 @rgph_u32_murmur32s_data64(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca [1 x i64]
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
store i32* %11, i32** %7
%12 = load i32*, i32** %7
%13 = load i64, i64* %5
%14 = getelementptr inbounds i32, i32* %12, i64 %13
store i32* %14, i32** %8
%15 = getelementptr inbounds [1 x i64], [1 x i64]* %9, i64 0, i64 0
%16 = load i64, i64* %6
store i64 %16, i64* %15
br label %17
17: ; preds = %37, %3
%18 = load i32*, i32** %7
%19 = load i32*, i32** %8
%20 = icmp ne i32* %18, %19
br i1 %20, label %21, label %40
21: ; preds = %17
%22 = load i32*, i32** %7
%23 = getelementptr inbounds i32, i32* %22, i64 0
%24 = load i32, i32* %23
%25 = call i32 @htole64(i32 %24)
%26 = load i32, i32* @UINT32_MAX
%27 = and i32 %25, %26
%28 = getelementptr inbounds [1 x i64], [1 x i64]* %9, i64 0, i64 0
%29 = call i32 @rgph_murmur32s_mix(i32 %27, i64* %28, i32 0)
%30 = load i32*, i32** %7
%31 = getelementptr inbounds i32, i32* %30, i64 0
%32 = load i32, i32* %31
%33 = call i32 @htole64(i32 %32)
%34 = ashr i32 %33, 32
%35 = getelementptr inbounds [1 x i64], [1 x i64]* %9, i64 0, i64 0
%36 = call i32 @rgph_murmur32s_mix(i32 %34, i64* %35, i32 0)
br label %37
37: ; preds = %21
%38 = load i32*, i32** %7
%39 = getelementptr inbounds i32, i32* %38, i64 1
store i32* %39, i32** %7
br label %17
40: ; preds = %17
%41 = getelementptr inbounds [1 x i64], [1 x i64]* %9, i64 0, i64 0
%42 = call i32 @rgph_murmur32s_mix(i32 0, i64* %41, i32 1)
%43 = load i64, i64* %5
%44 = mul i64 %43, 4
%45 = getelementptr inbounds [1 x i64], [1 x i64]* %9, i64 0, i64 0
%46 = call i32 @rgph_murmur32s_finalise(i64 %44, i64* %45)
%47 = getelementptr inbounds [1 x i64], [1 x i64]* %9, i64 0, i64 0
%48 = load i64, i64* %47
ret i64 %48
}

LLVM IR (-O2):
@UINT32_MAX = global i32 0
define i64 @rgph_u32_murmur32s_data64(i8* %0, i64 %1, i64 %2) {
%4 = alloca [1 x i64]
%5 = bitcast i8* %0 to i32*
%6 = getelementptr inbounds i32, i32* %5, i64 %1
%7 = bitcast [1 x i64]* %4 to i8*
%8 = getelementptr inbounds [1 x i64], [1 x i64]* %4, i64 0, i64 0
store i64 %2, i64* %8
%9 = icmp eq i32* %6, %5
br i1 %9, label %22, label %10
10: ; preds = %3, %10
%11 = phi i32* [ %20, %10 ], [ %5, %3 ]
%12 = load i32, i32* %11
%13 = call i32 @htole64(i32 %12)
%14 = load i32, i32* @UINT32_MAX
%15 = and i32 %14, %13
%16 = call i32 @rgph_murmur32s_mix(i32 %15, i64* %8, i32 0)
%17 = load i32, i32* %11
%18 = call i32 @htole64(i32 %17)
%19 = call i32 @rgph_murmur32s_mix(i32 poison, i64* %8, i32 0)
%20 = getelementptr inbounds i32, i32* %11, i64 1
%21 = icmp eq i32* %20, %6
br i1 %21, label %22, label %10
22: ; preds = %10, %3
%23 = call i32 @rgph_murmur32s_mix(i32 0, i64* %8, i32 1)
%24 = shl i64 %1, 2
%25 = call i32 @rgph_murmur32s_finalise(i64 %24, i64* %8)
%26 = load i64, i64* %8
ret i64 %26
}