#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 scalar_t__ ptrdiff_t;

/* Variables and functions */
float float_hash_1d(scalar_t__);
scalar_t__ hash_1d(scalar_t__);
float norm_hash_1d(ptrdiff_t x) {
  float result = float_hash_1d(x);
  x = hash_1d(x);
  result += ((float)x / ((float)0xff));
  x = hash_1d(x);
  result += ((float)x / ((float)0xff));
  result /= 3.0;
  return result;
}


x86 assembly (clang, -O0):
<norm_hash_1d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <float_hash_1d@plt>
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <hash_1d@plt>
mov    %rax,-0x8(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm0
movss  0xeb3(%rip),%xmm1
divss  %xmm1,%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <hash_1d@plt>
mov    %rax,-0x8(%rbp)
cvtsi2ssq -0x8(%rbp),%xmm0
movss  0xe8a(%rip),%xmm1
divss  %xmm1,%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe63(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<norm_hash_1d>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1040 <float_hash_1d@plt>
movss  %xmm0,0xc(%rsp)
mov    %rbx,%rdi
call   1030 <hash_1d@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <hash_1d@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rbx,%xmm0
cvtsi2ss %rax,%xmm1
unpcklps %xmm1,%xmm0
divps  0xea3(%rip),%xmm0
movss  0xc(%rsp),%xmm1
addss  %xmm0,%xmm1
shufps $0x55,%xmm0,%xmm0
addss  %xmm1,%xmm0
divss  0xe99(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define float @norm_hash_1d(i64 %0) {
%2 = alloca i64
%3 = alloca float
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call float @float_hash_1d(i64 %4)
store float %5, float* %3
%6 = load i64, i64* %2
%7 = call i64 @hash_1d(i64 %6)
store i64 %7, i64* %2
%8 = load i64, i64* %2
%9 = sitofp i64 %8 to float
%10 = fdiv float %9, 2.550000e+02
%11 = load float, float* %3
%12 = fadd float %11, %10
store float %12, float* %3
%13 = load i64, i64* %2
%14 = call i64 @hash_1d(i64 %13)
store i64 %14, i64* %2
%15 = load i64, i64* %2
%16 = sitofp i64 %15 to float
%17 = fdiv float %16, 2.550000e+02
%18 = load float, float* %3
%19 = fadd float %18, %17
store float %19, float* %3
%20 = load float, float* %3
%21 = fpext float %20 to double
%22 = fdiv double %21, 3.000000e+00
%23 = fptrunc double %22 to float
store float %23, float* %3
%24 = load float, float* %3
ret float %24
}

LLVM IR (-O2):
define float @norm_hash_1d(i64 %0) {
%2 = tail call float @float_hash_1d(i64 %0)
%3 = tail call i64 @hash_1d(i64 %0)
%4 = tail call i64 @hash_1d(i64 %3)
%5 = insertelement <2 x i64> poison, i64 %3, i64 0
%6 = insertelement <2 x i64> %5, i64 %4, i64 1
%7 = sitofp <2 x i64> %6 to <2 x float>
%8 = fdiv <2 x float> %7, <float 2.550000e+02, float 2.550000e+02>
%9 = extractelement <2 x float> %8, i64 0
%10 = fadd float %2, %9
%11 = extractelement <2 x float> %8, i64 1
%12 = fadd float %10, %11
%13 = fdiv float %12, 3.000000e+00
ret float %13
}