#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 */
int sqrt(double);
int xp(float);
double ChiSq_1(int v, float x) {
  double inner;
  inner = 1. - 2. / (9. * v) + xp(x) * sqrt((double)2. / (double)(9. * v));
  return v * inner * inner * inner;
}


x86 assembly (clang, -O0):
<ChiSq_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm1
movsd  0xecb(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  0xeb7(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  0xebb(%rip),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <xp@plt>
mov    %eax,-0x14(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xe90(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  0xe7c(%rip),%xmm0
divsd  %xmm1,%xmm0
call   1040 <sqrt@plt>
movsd  -0x20(%rbp),%xmm0
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
imul   %ecx,%eax
cvtsi2sd %eax,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
mulsd  -0x10(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ChiSq_1>:
push   %rbx
sub    $0x20,%rsp
cvtsi2sd %edi,%xmm2
movsd  %xmm2,0x18(%rsp)
movsd  0xec9(%rip),%xmm1
mulsd  %xmm2,%xmm1
movsd  0xec5(%rip),%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%rsp)
movsd  0xebb(%rip),%xmm1
subsd  %xmm2,%xmm1
movsd  %xmm1,0x10(%rsp)
call   1030 <xp@plt>
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
call   1040 <sqrt@plt>
imul   %ebx,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
addsd  0x10(%rsp),%xmm1
movsd  0x18(%rsp),%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @ChiSq_1(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca double
store i32 %0, i32* %3
store float %1, float* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = fmul double 9.000000e+00, %7
%9 = fdiv double 2.000000e+00, %8
%10 = fsub double 1.000000e+00, %9
%11 = load float, float* %4
%12 = call i32 @xp(float %11)
%13 = load i32, i32* %3
%14 = sitofp i32 %13 to double
%15 = fmul double 9.000000e+00, %14
%16 = fdiv double 2.000000e+00, %15
%17 = call i32 @sqrt(double %16)
%18 = mul nsw i32 %12, %17
%19 = sitofp i32 %18 to double
%20 = fadd double %10, %19
store double %20, double* %5
%21 = load i32, i32* %3
%22 = sitofp i32 %21 to double
%23 = load double, double* %5
%24 = fmul double %22, %23
%25 = load double, double* %5
%26 = fmul double %24, %25
%27 = load double, double* %5
%28 = fmul double %26, %27
ret double %28
}

LLVM IR (-O2):
define double @ChiSq_1(i32 %0, float %1) {
%3 = sitofp i32 %0 to double
%4 = fmul double %3, 9.000000e+00
%5 = fdiv double 2.000000e+00, %4
%6 = fsub double 1.000000e+00, %5
%7 = tail call i32 @xp(float %1)
%8 = tail call i32 @sqrt(double %5)
%9 = mul nsw i32 %8, %7
%10 = sitofp i32 %9 to double
%11 = fadd double %6, %10
%12 = fmul double %11, %3
%13 = fmul double %11, %12
%14 = fmul double %11, %13
ret double %14
}