#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 */

/* Variables and functions */
double UINT_MAX;
int /*<<< orphan*/ hsfc3d(unsigned int *, unsigned int *, unsigned int *);
void fhsfc3d(double coord[], unsigned *nkey, unsigned key[]) {
  const double imax = UINT_MAX;
  unsigned c[3];
  c[0] = (unsigned)(coord[0] * imax);
  c[1] = (unsigned)(coord[1] * imax);
  c[2] = (unsigned)(coord[2] * imax);
  hsfc3d(c, nkey, key);
}


x86 assembly (clang, -O0):
<fhsfc3d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ebd(%rip),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %eax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movsd  0x10(%rax),%xmm0
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
mov    %eax,-0x24(%rbp)
lea    -0x2c(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <hsfc3d@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fhsfc3d>:
sub    $0x18,%rsp
mov    0x2ecd(%rip),%rax
movsd  (%rax),%xmm0
movsd  (%rdi),%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rax
mov    %eax,0xc(%rsp)
movsd  0x8(%rdi),%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%rax
mov    %eax,0x10(%rsp)
mulsd  0x10(%rdi),%xmm0
cvttsd2si %xmm0,%rax
mov    %eax,0x14(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <hsfc3d@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@UINT_MAX = global double 0.000000e+00
define void @fhsfc3d(double* %0, i32* %1, i32* %2) {
%4 = alloca double*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca double
%8 = alloca [3 x i32]
store double* %0, double** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%9 = load double, double* @UINT_MAX
store double %9, double* %7
%10 = load double*, double** %4
%11 = getelementptr inbounds double, double* %10, i64 0
%12 = load double, double* %11
%13 = load double, double* %7
%14 = fmul double %12, %13
%15 = fptoui double %14 to i32
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 0
store i32 %15, i32* %16
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = load double, double* %7
%21 = fmul double %19, %20
%22 = fptoui double %21 to i32
%23 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 1
store i32 %22, i32* %23
%24 = load double*, double** %4
%25 = getelementptr inbounds double, double* %24, i64 2
%26 = load double, double* %25
%27 = load double, double* %7
%28 = fmul double %26, %27
%29 = fptoui double %28 to i32
%30 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 2
store i32 %29, i32* %30
%31 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 0
%32 = load i32*, i32** %5
%33 = load i32*, i32** %6
%34 = call i32 @hsfc3d(i32* %31, i32* %32, i32* %33)
ret void
}

LLVM IR (-O2):
@UINT_MAX = global double 0.000000e+00
define void @fhsfc3d(double* nocapture %0, i32* %1, i32* %2) {
%4 = alloca [3 x i32]
%5 = load double, double* @UINT_MAX
%6 = bitcast [3 x i32]* %4 to i8*
%7 = load double, double* %0
%8 = fmul double %5, %7
%9 = fptoui double %8 to i32
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
store i32 %9, i32* %10
%11 = getelementptr inbounds double, double* %0, i64 1
%12 = load double, double* %11
%13 = fmul double %5, %12
%14 = fptoui double %13 to i32
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 1
store i32 %14, i32* %15
%16 = getelementptr inbounds double, double* %0, i64 2
%17 = load double, double* %16
%18 = fmul double %5, %17
%19 = fptoui double %18 to i32
%20 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 2
store i32 %19, i32* %20
%21 = call i32 @hsfc3d(i32* %10, i32* %1, i32* %2)
ret void
}