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

/* Variables and functions */
int /*<<< orphan*/ htole32(int /*<<< orphan*/);
int /*<<< orphan*/ rgph_xxh32s_finalise(int /*<<< orphan*/ *);
int /*<<< orphan*/ rgph_xxh32s_fmix4(int /*<<< orphan*/, int /*<<< orphan*/ *);
int /*<<< orphan*/ rgph_xxh32s_fold(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ rgph_xxh32s_init(int, uintptr_t, int /*<<< orphan*/ *);
uint32_t rgph_u32_xxh32s_u32(uint32_t value, uintptr_t seed) {
  uint32_t h[4];
  rgph_xxh32s_init(sizeof(value), seed, h);
  rgph_xxh32s_fold(sizeof(value), h);
  rgph_xxh32s_fmix4(htole32(value), h);
  rgph_xxh32s_finalise(h);
  return h[0];
}


x86 assembly (clang, -O0):
<rgph_u32_xxh32s_u32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    -0x20(%rbp),%rdx
mov    $0x4,%edi
call   1050 <rgph_xxh32s_init@plt>
lea    -0x20(%rbp),%rsi
mov    $0x4,%edi
call   1070 <rgph_xxh32s_fold@plt>
mov    -0x4(%rbp),%edi
call   1030 <htole32@plt>
mov    %eax,%edi
lea    -0x20(%rbp),%rsi
call   1060 <rgph_xxh32s_fmix4@plt>
lea    -0x20(%rbp),%rdi
call   1040 <rgph_xxh32s_finalise@plt>
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgph_u32_xxh32s_u32>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebp
mov    %rsp,%rbx
mov    $0x4,%edi
mov    %rbx,%rdx
call   1050 <rgph_xxh32s_init@plt>
mov    $0x4,%edi
mov    %rbx,%rsi
call   1070 <rgph_xxh32s_fold@plt>
mov    %ebp,%edi
call   1030 <htole32@plt>
mov    %eax,%edi
mov    %rbx,%rsi
call   1060 <rgph_xxh32s_fmix4@plt>
mov    %rbx,%rdi
call   1040 <rgph_xxh32s_finalise@plt>
mov    (%rsp),%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @rgph_u32_xxh32s_u32(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca [4 x i32]
store i32 %0, i32* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%8 = call i32 @rgph_xxh32s_init(i32 4, i64 %6, i32* %7)
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%10 = call i32 @rgph_xxh32s_fold(i32 4, i32* %9)
%11 = load i32, i32* %3
%12 = call i32 @htole32(i32 %11)
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%14 = call i32 @rgph_xxh32s_fmix4(i32 %12, i32* %13)
%15 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%16 = call i32 @rgph_xxh32s_finalise(i32* %15)
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%18 = load i32, i32* %17
ret i32 %18
}

LLVM IR (-O2):
define i32 @rgph_u32_xxh32s_u32(i32 %0, i64 %1) {
%3 = alloca [4 x i32]
%4 = bitcast [4 x i32]* %3 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%6 = call i32 @rgph_xxh32s_init(i32 4, i64 %1, i32* %5)
%7 = call i32 @rgph_xxh32s_fold(i32 4, i32* %5)
%8 = call i32 @htole32(i32 %0)
%9 = call i32 @rgph_xxh32s_fmix4(i32 %8, i32* %5)
%10 = call i32 @rgph_xxh32s_finalise(i32* %5)
%11 = load i32, i32* %5
ret i32 %11
}