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

/* Variables and functions */
int UINT32_MAX;
int htole64(int const);
int /*<<< orphan*/ rgph_murmur32_finalise(size_t, int *);
int /*<<< orphan*/ rgph_murmur32_mix(int *, int *);
int /*<<< orphan*/ rgph_murmur32_mix0(int, int *);
int /*<<< orphan*/ rgph_murmur32_mix1(int, int *);
void rgph_u32x4_murmur32v_data64(const void *data, size_t len, uintptr_t seed,
                                 uint32_t *restrict h) {
  const uint64_t *restrict key = data;
  const uint64_t *end = key + len;
  uint32_t w[4];
  uint64_t a, b;
  h[0] = h[1] = h[2] = h[3] = seed;
  for (; end - key >= 2; key += 2) {
    a = htole64(key[0]);
    b = htole64(key[1]);
    w[0] = a & UINT32_MAX;
    w[1] = a >> 32;
    w[2] = b & UINT32_MAX;
    w[3] = b >> 32;
    rgph_murmur32_mix(w, h);
  }
  switch (end - key) {
  case 1:
    a = htole64(key[0]);
    w[0] = a & UINT32_MAX;
    w[1] = a >> 32;
    rgph_murmur32_mix1(w[1], h);
    rgph_murmur32_mix0(w[0], h);
  case 0:
    rgph_murmur32_finalise(len * sizeof(key[0]), h);
  }
}


x86 assembly (clang, -O0):
<rgph_u32x4_murmur32v_data64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    -0x10(%rbp),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x18(%rbp),%rax
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x20(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x20(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
cmp    $0x2,%rax
jl     1230 <rgph_u32x4_murmur32v_data64+0xe0>
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
call   1070 <htole64@plt>
mov    %eax,-0x44(%rbp)
mov    -0x28(%rbp),%rax
mov    0x4(%rax),%edi
call   1070 <htole64@plt>
mov    %eax,-0x48(%rbp)
mov    -0x44(%rbp),%eax
mov    0x2e14(%rip),%rcx
and    (%rcx),%eax
mov    %eax,-0x40(%rbp)
mov    -0x44(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x48(%rbp),%eax
mov    0x2df8(%rip),%rcx
and    (%rcx),%eax
mov    %eax,-0x38(%rbp)
mov    -0x48(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0x34(%rbp)
lea    -0x40(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <rgph_murmur32_mix@plt>
mov    -0x28(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x28(%rbp)
jmp    11a4 <rgph_u32x4_murmur32v_data64+0x54>
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
mov    %rax,-0x50(%rbp)
test   %rax,%rax
je     12a6 <rgph_u32x4_murmur32v_data64+0x156>
jmp    1251 <rgph_u32x4_murmur32v_data64+0x101>
mov    -0x50(%rbp),%rax
sub    $0x1,%rax
jne    12b7 <rgph_u32x4_murmur32v_data64+0x167>
jmp    1264 <rgph_u32x4_murmur32v_data64+0x114>
mov    -0x28(%rbp),%rax
mov    (%rax),%edi
call   1070 <htole64@plt>
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    0x2d7c(%rip),%rcx
and    (%rcx),%eax
mov    %eax,-0x40(%rbp)
mov    -0x44(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1040 <rgph_murmur32_mix1@plt>
mov    -0x40(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1050 <rgph_murmur32_mix0@plt>
mov    -0x10(%rbp),%rdi
shl    $0x2,%rdi
mov    -0x20(%rbp),%rsi
call   1030 <rgph_murmur32_finalise@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_u32x4_murmur32v_data64>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%r15
mov    %rsi,%rbp
mov    %rdi,%rbx
lea    0x0(,%rsi,4),%r13
mov    %edx,0xc(%rcx)
mov    %edx,0x8(%rcx)
mov    %edx,0x4(%rcx)
mov    %edx,(%rcx)
cmp    $0x5,%r13
jl     11cd <rgph_u32x4_murmur32v_data64+0x7d>
mov    %rbp,0x10(%rsp)
mov    0x2e6c(%rip),%r14
mov    %rsp,%r12
nop
mov    (%rbx),%edi
call   1070 <htole64@plt>
mov    %eax,%ebp
mov    0x4(%rbx),%edi
call   1070 <htole64@plt>
mov    (%r14),%ecx
and    %ecx,%ebp
mov    %ebp,(%rsp)
and    %ecx,%eax
mov    %eax,0x8(%rsp)
mov    %r12,%rdi
mov    %r15,%rsi
call   1060 <rgph_murmur32_mix@plt>
add    $0x8,%rbx
add    $0xfffffffffffffff8,%r13
cmp    $0x4,%r13
jg     1190 <rgph_u32x4_murmur32v_data64+0x40>
mov    0x10(%rsp),%rbp
sar    $0x2,%r13
je     11ff <rgph_u32x4_murmur32v_data64+0xaf>
cmp    $0x1,%r13
jne    120e <rgph_u32x4_murmur32v_data64+0xbe>
mov    (%rbx),%edi
call   1070 <htole64@plt>
mov    0x2e11(%rip),%rcx
and    (%rcx),%eax
mov    %eax,(%rsp)
mov    %r15,%rsi
call   1040 <rgph_murmur32_mix1@plt>
mov    (%rsp),%edi
mov    %r15,%rsi
call   1050 <rgph_murmur32_mix0@plt>
shl    $0x2,%rbp
mov    %rbp,%rdi
mov    %r15,%rsi
call   1030 <rgph_murmur32_finalise@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@UINT32_MAX = global i32 0
define void @rgph_u32x4_murmur32v_data64(i8* %0, i64 %1, i64 %2, i32* noalias %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca [4 x i32]
%12 = alloca i32
%13 = alloca i32
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%14 = load i8*, i8** %5
%15 = bitcast i8* %14 to i32*
store i32* %15, i32** %9
%16 = load i32*, i32** %9
%17 = load i64, i64* %6
%18 = getelementptr inbounds i32, i32* %16, i64 %17
store i32* %18, i32** %10
%19 = load i64, i64* %7
%20 = trunc i64 %19 to i32
%21 = load i32*, i32** %8
%22 = getelementptr inbounds i32, i32* %21, i64 3
store i32 %20, i32* %22
%23 = load i32*, i32** %8
%24 = getelementptr inbounds i32, i32* %23, i64 2
store i32 %20, i32* %24
%25 = load i32*, i32** %8
%26 = getelementptr inbounds i32, i32* %25, i64 1
store i32 %20, i32* %26
%27 = load i32*, i32** %8
%28 = getelementptr inbounds i32, i32* %27, i64 0
store i32 %20, i32* %28
br label %29
29: ; preds = %63, %4
%30 = load i32*, i32** %10
%31 = load i32*, i32** %9
%32 = ptrtoint i32* %30 to i64
%33 = ptrtoint i32* %31 to i64
%34 = sub i64 %32, %33
%35 = sdiv exact i64 %34, 4
%36 = icmp sge i64 %35, 2
br i1 %36, label %37, label %66
37: ; preds = %29
%38 = load i32*, i32** %9
%39 = getelementptr inbounds i32, i32* %38, i64 0
%40 = load i32, i32* %39
%41 = call i32 @htole64(i32 %40)
store i32 %41, i32* %12
%42 = load i32*, i32** %9
%43 = getelementptr inbounds i32, i32* %42, i64 1
%44 = load i32, i32* %43
%45 = call i32 @htole64(i32 %44)
store i32 %45, i32* %13
%46 = load i32, i32* %12
%47 = load i32, i32* @UINT32_MAX
%48 = and i32 %46, %47
%49 = getelementptr inbounds [4 x i32], [4 x i32]* %11, i64 0, i64 0
store i32 %48, i32* %49
%50 = load i32, i32* %12
%51 = ashr i32 %50, 32
%52 = getelementptr inbounds [4 x i32], [4 x i32]* %11, i64 0, i64 1
store i32 %51, i32* %52
%53 = load i32, i32* %13
%54 = load i32, i32* @UINT32_MAX
%55 = and i32 %53, %54
%56 = getelementptr inbounds [4 x i32], [4 x i32]* %11, i64 0, i64 2
store i32 %55, i32* %56
%57 = load i32, i32* %13
%58 = ashr i32 %57, 32
%59 = getelementptr inbounds [4 x i32], [4 x i32]* %11, i64 0, i64 3
store i32 %58, i32* %59
%60 = getelementptr inbounds [4 x i32], [4 x i32]* %11, i64 0, i64 0
%61 = load i32*, i32** %8
%62 = call i32 @rgph_murmur32_mix(i32* %60, i32* %61)
br label %63
63: ; preds = %37
%64 = load i32*, i32** %9
%65 = getelementptr inbounds i32, i32* %64, i64 2
store i32* %65, i32** %9
br label %29
66: ; preds = %29
%67 = load i32*, i32** %10
%68 = load i32*, i32** %9
%69 = ptrtoint i32* %67 to i64
%70 = ptrtoint i32* %68 to i64
%71 = sub i64 %69, %70
%72 = sdiv exact i64 %71, 4
switch i64 %72, label %98 [
i64 1, label %73
i64 0, label %93
]
73: ; preds = %66
%74 = load i32*, i32** %9
%75 = getelementptr inbounds i32, i32* %74, i64 0
%76 = load i32, i32* %75
%77 = call i32 @htole64(i32 %76)
store i32 %77, i32* %12
%78 = load i32, i32* %12
%79 = load i32, i32* @UINT32_MAX
%80 = and i32 %78, %79
%81 = getelementptr inbounds [4 x i32], [4 x i32]* %11, i64 0, i64 0
store i32 %80, i32* %81
%82 = load i32, i32* %12
%83 = ashr i32 %82, 32
%84 = getelementptr inbounds [4 x i32], [4 x i32]* %11, i64 0, i64 1
store i32 %83, i32* %84
%85 = getelementptr inbounds [4 x i32], [4 x i32]* %11, i64 0, i64 1
%86 = load i32, i32* %85
%87 = load i32*, i32** %8
%88 = call i32 @rgph_murmur32_mix1(i32 %86, i32* %87)
%89 = getelementptr inbounds [4 x i32], [4 x i32]* %11, i64 0, i64 0
%90 = load i32, i32* %89
%91 = load i32*, i32** %8
%92 = call i32 @rgph_murmur32_mix0(i32 %90, i32* %91)
br label %93
93: ; preds = %66, %73
%94 = load i64, i64* %6
%95 = mul i64 %94, 4
%96 = load i32*, i32** %8
%97 = call i32 @rgph_murmur32_finalise(i64 %95, i32* %96)
br label %98
98: ; preds = %93, %66
ret void
}

LLVM IR (-O2):
@UINT32_MAX = global i32 0
define void @rgph_u32x4_murmur32v_data64(i8* %0, i64 %1, i64 %2, i32* noalias %3) {
%5 = alloca [4 x i32]
%6 = bitcast i8* %0 to i32*
%7 = getelementptr inbounds i32, i32* %6, i64 %1
%8 = bitcast [4 x i32]* %5 to i8*
%9 = trunc i64 %2 to i32
%10 = getelementptr inbounds i32, i32* %3, i64 3
store i32 %9, i32* %10
%11 = getelementptr inbounds i32, i32* %3, i64 2
store i32 %9, i32* %11
%12 = getelementptr inbounds i32, i32* %3, i64 1
store i32 %9, i32* %12
store i32 %9, i32* %3
%13 = ptrtoint i32* %7 to i64
%14 = ptrtoint i8* %0 to i64
%15 = sub i64 %13, %14
%16 = icmp sgt i64 %15, 4
br i1 %16, label %17, label %35
17: ; preds = %4
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%19 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 2
br label %20
20: ; preds = %17, %20
%21 = phi i32* [ %6, %17 ], [ %31, %20 ]
%22 = load i32, i32* %21
%23 = call i32 @htole64(i32 %22)
%24 = getelementptr inbounds i32, i32* %21, i64 1
%25 = load i32, i32* %24
%26 = call i32 @htole64(i32 %25)
%27 = load i32, i32* @UINT32_MAX
%28 = and i32 %27, %23
store i32 %28, i32* %18
%29 = and i32 %27, %26
store i32 %29, i32* %19
%30 = call i32 @rgph_murmur32_mix(i32* %18, i32* %3)
%31 = getelementptr inbounds i32, i32* %21, i64 2
%32 = ptrtoint i32* %31 to i64
%33 = sub i64 %13, %32
%34 = icmp sgt i64 %33, 4
br i1 %34, label %20, label %35
35: ; preds = %20, %4
%36 = phi i32* [ %6, %4 ], [ %31, %20 ]
%37 = phi i64 [ %15, %4 ], [ %33, %20 ]
%38 = ashr exact i64 %37, 2
switch i64 %38, label %51 [
i64 1, label %39
i64 0, label %48
]
39: ; preds = %35
%40 = load i32, i32* %36
%41 = call i32 @htole64(i32 %40)
%42 = load i32, i32* @UINT32_MAX
%43 = and i32 %42, %41
%44 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
store i32 %43, i32* %44
%45 = call i32 @rgph_murmur32_mix1(i32 poison, i32* %3)
%46 = load i32, i32* %44
%47 = call i32 @rgph_murmur32_mix0(i32 %46, i32* %3)
br label %48
48: ; preds = %35, %39
%49 = shl i64 %1, 2
%50 = call i32 @rgph_murmur32_finalise(i64 %49, i32* %3)
br label %51
51: ; preds = %48, %35
ret void
}