#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 sqr(float);
float GTR2_aniso(float NdotH, float HdotX, float HdotY, float ax, float ay) {
  return 1 / (3.14159265358979323846264 * ax * ay *
              sqr(sqr(HdotX / ax) + sqr(HdotY / ay) + NdotH * NdotH));
}


x86 assembly (clang, -O0):
<GTR2_aniso>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xec6(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
call   1030 <sqr@plt>
movsd  %xmm0,-0x28(%rbp)
movss  -0xc(%rbp),%xmm0
divss  -0x14(%rbp),%xmm0
call   1030 <sqr@plt>
movaps %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
addsd  %xmm1,%xmm0
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
call   1030 <sqr@plt>
movsd  -0x20(%rbp),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe4d(%rip),%xmm0
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GTR2_aniso>:
sub    $0x28,%rsp
cvtss2sd %xmm3,%xmm5
mulsd  0xee0(%rip),%xmm5
movss  %xmm4,0xc(%rsp)
movss  %xmm2,0x10(%rsp)
movss  %xmm0,0x14(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm4,%xmm0
mulsd  %xmm5,%xmm0
movsd  %xmm0,0x20(%rsp)
divss  %xmm3,%xmm1
movaps %xmm1,%xmm0
call   1030 <sqr@plt>
movsd  %xmm0,0x18(%rsp)
movss  0x10(%rsp),%xmm0
divss  0xc(%rsp),%xmm0
call   1030 <sqr@plt>
addsd  0x18(%rsp),%xmm0
movss  0x14(%rsp),%xmm1
mulss  %xmm1,%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
call   1030 <sqr@plt>
mulsd  0x20(%rsp),%xmm0
movsd  0xe70(%rip),%xmm1
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define float @GTR2_aniso(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %9
%12 = fpext float %11 to double
%13 = fmul double 0x400921FB54442D18, %12
%14 = load float, float* %10
%15 = fpext float %14 to double
%16 = fmul double %13, %15
%17 = load float, float* %7
%18 = load float, float* %9
%19 = fdiv float %17, %18
%20 = call double @sqr(float %19)
%21 = load float, float* %8
%22 = load float, float* %10
%23 = fdiv float %21, %22
%24 = call double @sqr(float %23)
%25 = fadd double %20, %24
%26 = load float, float* %6
%27 = load float, float* %6
%28 = fmul float %26, %27
%29 = fpext float %28 to double
%30 = fadd double %25, %29
%31 = fptrunc double %30 to float
%32 = call double @sqr(float %31)
%33 = fmul double %16, %32
%34 = fdiv double 1.000000e+00, %33
%35 = fptrunc double %34 to float
ret float %35
}

LLVM IR (-O2):
define float @GTR2_aniso(float %0, float %1, float %2, float %3, float %4) {
%6 = fpext float %3 to double
%7 = fmul double %6, 0x400921FB54442D18
%8 = fpext float %4 to double
%9 = fmul double %7, %8
%10 = fdiv float %1, %3
%11 = tail call double @sqr(float %10)
%12 = fdiv float %2, %4
%13 = tail call double @sqr(float %12)
%14 = fadd double %11, %13
%15 = fmul float %0, %0
%16 = fpext float %15 to double
%17 = fadd double %14, %16
%18 = fptrunc double %17 to float
%19 = tail call double @sqr(float %18)
%20 = fmul double %9, %19
%21 = fdiv double 1.000000e+00, %20
%22 = fptrunc double %21 to float
ret float %22
}