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

/* Variables and functions */
int /*<<< orphan*/ htole64(int /*<<< orphan*/ const);
int /*<<< orphan*/ rgph_t1ha64s_finalise(int /*<<< orphan*/ *);
int /*<<< orphan*/ rgph_t1ha64s_fmix1(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ rgph_t1ha64s_fmix2(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ rgph_t1ha64s_fmix3(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ rgph_t1ha64s_fmix4(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ rgph_t1ha64s_fold(int /*<<< orphan*/ *);
int /*<<< orphan*/ rgph_t1ha64s_init(size_t, uintptr_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ rgph_t1ha64s_mix(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
uint64_t rgph_u64_t1ha64s_data64(const void *data, size_t len, uintptr_t seed) {
  const uint64_t *key = data;
  const uint64_t *end = key + len;
  size_t bytes = len * sizeof(key[0]);
  uint64_t w[4], h[4];
  rgph_t1ha64s_init(bytes, seed, h);
  if (bytes > 32) {
    for (; end - key >= 4; key += 4) {
      w[0] = htole64(key[0]);
      w[1] = htole64(key[1]);
      w[2] = htole64(key[2]);
      w[3] = htole64(key[3]);
      rgph_t1ha64s_mix(w, h);
    }
    len &= 3;
    rgph_t1ha64s_fold(h);
  }
  switch (len) {
  case 4:
    rgph_t1ha64s_fmix4(htole64(*key++), h);
  case 3:
    rgph_t1ha64s_fmix3(htole64(*key++), h);
  case 2:
    rgph_t1ha64s_fmix2(htole64(*key++), h);
  case 1:
    rgph_t1ha64s_fmix1(htole64(*key++), h);
    break;
  }
  return rgph_t1ha64s_finalise(h);
}


x86 assembly (clang, -O0):
<rgph_u64_t1ha64s_data64>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%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    -0x10(%rbp),%rax
shl    $0x2,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   1050 <rgph_t1ha64s_init@plt>
cmpq   $0x20,-0x30(%rbp)
jbe    1273 <rgph_u64_t1ha64s_data64+0xe3>
jmp    11ec <rgph_u64_t1ha64s_data64+0x5c>
mov    -0x28(%rbp),%rax
mov    -0x20(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
cmp    $0x4,%rax
jl     125e <rgph_u64_t1ha64s_data64+0xce>
mov    -0x20(%rbp),%rax
mov    (%rax),%edi
call   1080 <htole64@plt>
mov    %eax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%edi
call   1080 <htole64@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%edi
call   1080 <htole64@plt>
mov    %eax,-0x38(%rbp)
mov    -0x20(%rbp),%rax
mov    0xc(%rax),%edi
call   1080 <htole64@plt>
mov    %eax,-0x34(%rbp)
lea    -0x40(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1030 <rgph_t1ha64s_mix@plt>
mov    -0x20(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x20(%rbp)
jmp    11ec <rgph_u64_t1ha64s_data64+0x5c>
mov    -0x10(%rbp),%rax
and    $0x3,%rax
mov    %rax,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
call   1090 <rgph_t1ha64s_fold@plt>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x58(%rbp)
sub    $0x3,%rax
ja     1321 <rgph_u64_t1ha64s_data64+0x191>
mov    -0x58(%rbp),%rax
lea    0xd6c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%edi
call   1080 <htole64@plt>
mov    %eax,%edi
lea    -0x50(%rbp),%rsi
call   1060 <rgph_t1ha64s_fmix4@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%edi
call   1080 <htole64@plt>
mov    %eax,%edi
lea    -0x50(%rbp),%rsi
call   10b0 <rgph_t1ha64s_fmix3@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%edi
call   1080 <htole64@plt>
mov    %eax,%edi
lea    -0x50(%rbp),%rsi
call   1040 <rgph_t1ha64s_fmix2@plt>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%edi
call   1080 <htole64@plt>
mov    %eax,%edi
lea    -0x50(%rbp),%rsi
call   10a0 <rgph_t1ha64s_fmix1@plt>
lea    -0x50(%rbp),%rdi
call   1070 <rgph_t1ha64s_finalise@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_u64_t1ha64s_data64>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %rsi,%r14
mov    %rdi,%r15
lea    0x0(,%rsi,4),%rbx
mov    %rsp,%rax
mov    %rbx,%rdi
mov    %rdx,%rsi
mov    %rax,%rdx
call   1050 <rgph_t1ha64s_init@plt>
cmp    $0x21,%rbx
jb     1228 <rgph_u64_t1ha64s_data64+0x98>
cmp    $0xd,%rbx
jl     121c <rgph_u64_t1ha64s_data64+0x8c>
lea    0x10(%rsp),%r12
mov    %rsp,%r13
mov    (%r15),%edi
call   1080 <htole64@plt>
mov    %eax,0x10(%rsp)
mov    0x4(%r15),%edi
call   1080 <htole64@plt>
mov    %eax,0x14(%rsp)
mov    0x8(%r15),%edi
call   1080 <htole64@plt>
mov    %eax,0x18(%rsp)
mov    0xc(%r15),%edi
call   1080 <htole64@plt>
mov    %eax,0x1c(%rsp)
mov    %r12,%rdi
mov    %r13,%rsi
call   1030 <rgph_t1ha64s_mix@plt>
add    $0x10,%r15
add    $0xfffffffffffffff0,%rbx
cmp    $0xc,%rbx
jg     11d0 <rgph_u64_t1ha64s_data64+0x40>
and    $0x3,%r14d
mov    %rsp,%rdi
call   1090 <rgph_t1ha64s_fold@plt>
add    $0xffffffffffffffff,%r14
cmp    $0x3,%r14
ja     1296 <rgph_u64_t1ha64s_data64+0x106>
lea    0xdc7(%rip),%rax
movslq (%rax,%r14,4),%rcx
add    %rax,%rcx
jmp    *%rcx
mov    (%r15),%edi
add    $0x4,%r15
call   1080 <htole64@plt>
mov    %rsp,%rsi
mov    %eax,%edi
call   1060 <rgph_t1ha64s_fmix4@plt>
mov    (%r15),%edi
add    $0x4,%r15
call   1080 <htole64@plt>
mov    %rsp,%rsi
mov    %eax,%edi
call   10b0 <rgph_t1ha64s_fmix3@plt>
mov    (%r15),%edi
add    $0x4,%r15
call   1080 <htole64@plt>
mov    %rsp,%rsi
mov    %eax,%edi
call   1040 <rgph_t1ha64s_fmix2@plt>
mov    (%r15),%edi
call   1080 <htole64@plt>
mov    %rsp,%rsi
mov    %eax,%edi
call   10a0 <rgph_t1ha64s_fmix1@plt>
mov    %rsp,%rdi
call   1070 <rgph_t1ha64s_finalise@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @rgph_u64_t1ha64s_data64(i8* %0, i64 %1, i64 %2) {
%4 = alloca [4 x i32]
%5 = alloca [4 x i32]
%6 = bitcast i8* %0 to i32*
%7 = shl i64 %1, 2
%8 = bitcast [4 x i32]* %4 to i8*
%9 = bitcast [4 x i32]* %5 to i8*
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%11 = call i32 @rgph_t1ha64s_init(i64 %7, i64 %2, i32* %10)
%12 = icmp ugt i64 %7, 32
br i1 %12, label %13, label %46
13: ; preds = %3
%14 = getelementptr inbounds i32, i32* %6, i64 %1
%15 = ptrtoint i32* %14 to i64
%16 = ptrtoint i8* %0 to i64
%17 = sub i64 %15, %16
%18 = icmp sgt i64 %17, 12
br i1 %18, label %19, label %42
19: ; preds = %13
%20 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%21 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 1
%22 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 2
%23 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 3
br label %24
24: ; preds = %19, %24
%25 = phi i32* [ %6, %19 ], [ %38, %24 ]
%26 = load i32, i32* %25
%27 = call i32 @htole64(i32 %26)
store i32 %27, i32* %20
%28 = getelementptr inbounds i32, i32* %25, i64 1
%29 = load i32, i32* %28
%30 = call i32 @htole64(i32 %29)
store i32 %30, i32* %21
%31 = getelementptr inbounds i32, i32* %25, i64 2
%32 = load i32, i32* %31
%33 = call i32 @htole64(i32 %32)
store i32 %33, i32* %22
%34 = getelementptr inbounds i32, i32* %25, i64 3
%35 = load i32, i32* %34
%36 = call i32 @htole64(i32 %35)
store i32 %36, i32* %23
%37 = call i32 @rgph_t1ha64s_mix(i32* %20, i32* %10)
%38 = getelementptr inbounds i32, i32* %25, i64 4
%39 = ptrtoint i32* %38 to i64
%40 = sub i64 %15, %39
%41 = icmp sgt i64 %40, 12
br i1 %41, label %24, label %42
42: ; preds = %24, %13
%43 = phi i32* [ %6, %13 ], [ %38, %24 ]
%44 = and i64 %1, 3
%45 = call i32 @rgph_t1ha64s_fold(i32* %10)
br label %46
46: ; preds = %42, %3
%47 = phi i32* [ %43, %42 ], [ %6, %3 ]
%48 = phi i64 [ %44, %42 ], [ %1, %3 ]
switch i64 %48, label %71 [
i64 4, label %49
i64 3, label %54
i64 2, label %60
i64 1, label %66
]
49: ; preds = %46
%50 = getelementptr inbounds i32, i32* %47, i64 1
%51 = load i32, i32* %47
%52 = call i32 @htole64(i32 %51)
%53 = call i32 @rgph_t1ha64s_fmix4(i32 %52, i32* %10)
br label %54
54: ; preds = %46, %49
%55 = phi i32* [ %47, %46 ], [ %50, %49 ]
%56 = getelementptr inbounds i32, i32* %55, i64 1
%57 = load i32, i32* %55
%58 = call i32 @htole64(i32 %57)
%59 = call i32 @rgph_t1ha64s_fmix3(i32 %58, i32* %10)
br label %60
60: ; preds = %46, %54
%61 = phi i32* [ %47, %46 ], [ %56, %54 ]
%62 = getelementptr inbounds i32, i32* %61, i64 1
%63 = load i32, i32* %61
%64 = call i32 @htole64(i32 %63)
%65 = call i32 @rgph_t1ha64s_fmix2(i32 %64, i32* %10)
br label %66
66: ; preds = %46, %60
%67 = phi i32* [ %47, %46 ], [ %62, %60 ]
%68 = load i32, i32* %67
%69 = call i32 @htole64(i32 %68)
%70 = call i32 @rgph_t1ha64s_fmix1(i32 %69, i32* %10)
br label %71
71: ; preds = %46, %66
%72 = call i32 @rgph_t1ha64s_finalise(i32* %10)
ret i32 %72
}