#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 Z(double);
double fabs(double);
double Q(double chi) {
  double t, b[6];
  double total;
  double x;
  int i;
  b[0] = 0.2316419;
  b[1] = 0.319381530;
  b[2] = -0.356563782;
  b[3] = 1.781477937;
  b[4] = -1.821255978;
  b[5] = 1.330274429;
  t = 1.0 / (1.0 + (b[0] * fabs(chi)));
  x = 1;
  total = 0;
  for (i = 1; i <= 5; i++) {
    x *= t;
    total += b[i] * x;
  }
  if (chi < 0) {
    return total * Z(chi);
  } else {
    return 1 - total * Z(chi);
  }
}


x86 assembly (clang, -O0):
<Q>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  0xf08(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xef3(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xede(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  0xeb4(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe9f(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
movaps 0xec1(%rip),%xmm2
pand   %xmm2,%xmm0
mulsd  %xmm0,%xmm1
movsd  0xe71(%rip),%xmm0
addsd  %xmm0,%xmm1
movsd  0xe65(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe54(%rip),%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x1,-0x64(%rbp)
cmpl   $0x5,-0x64(%rbp)
jg     1208 <Q+0xf8>
movsd  -0x18(%rbp),%xmm0
mulsd  -0x60(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
movslq -0x64(%rbp),%rax
movsd  -0x50(%rbp,%rax,8),%xmm0
movsd  -0x60(%rbp),%xmm2
movsd  -0x58(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    11c0 <Q+0xb0>
xorps  %xmm0,%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    1240 <Q+0x130>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <Z@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1288 <Q+0x178>
movsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <Z@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm1,%xmm0
movsd  0xd81(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q>:
sub    $0x28,%rsp
movapd 0xee4(%rip),%xmm1
andpd  %xmm0,%xmm1
movapd %xmm0,0x10(%rsp)
mulsd  0xee2(%rip),%xmm1
movsd  0xee2(%rip),%xmm2
addsd  %xmm2,%xmm1
movapd %xmm2,%xmm4
divsd  %xmm1,%xmm4
movsd  0xed6(%rip),%xmm3
mulsd  %xmm4,%xmm3
xorpd  %xmm1,%xmm1
addsd  %xmm1,%xmm3
movapd %xmm4,%xmm1
mulsd  %xmm4,%xmm1
movapd %xmm4,%xmm2
mulsd  %xmm1,%xmm2
mulsd  0xeba(%rip),%xmm1
addsd  %xmm3,%xmm1
movapd %xmm4,%xmm3
mulsd  %xmm2,%xmm3
mulsd  0xeae(%rip),%xmm2
addsd  %xmm1,%xmm2
mulsd  %xmm3,%xmm4
mulsd  0xea6(%rip),%xmm3
addsd  %xmm2,%xmm3
mulsd  0xea2(%rip),%xmm4
addsd  %xmm3,%xmm4
movsd  %xmm4,0x8(%rsp)
call   1030 <Z@plt>
mulsd  0x8(%rsp),%xmm0
movsd  0xe5d(%rip),%xmm2
subsd  %xmm0,%xmm2
movapd 0x10(%rsp),%xmm1
cmpltsd 0xe7a(%rip),%xmm1
andpd  %xmm1,%xmm0
andnpd %xmm2,%xmm1
orpd   %xmm1,%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @Q(double %0) {
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca [6 x double]
%6 = alloca double
%7 = alloca double
%8 = alloca i32
store double %0, double* %3
%9 = getelementptr inbounds [6 x double], [6 x double]* %5, i64 0, i64 0
store double 0x3FCDA6711871100E, double* %9
%10 = getelementptr inbounds [6 x double], [6 x double]* %5, i64 0, i64 1
store double 0x3FD470BF3A92F8EC, double* %10
%11 = getelementptr inbounds [6 x double], [6 x double]* %5, i64 0, i64 2
store double 0xBFD6D1F0E5A8325B, double* %11
%12 = getelementptr inbounds [6 x double], [6 x double]* %5, i64 0, i64 3
store double 0x3FFC80EF025F5E68, double* %12
%13 = getelementptr inbounds [6 x double], [6 x double]* %5, i64 0, i64 4
store double 0xBFFD23DD4EF278D0, double* %13
%14 = getelementptr inbounds [6 x double], [6 x double]* %5, i64 0, i64 5
store double 0x3FF548CDD6F42943, double* %14
%15 = getelementptr inbounds [6 x double], [6 x double]* %5, i64 0, i64 0
%16 = load double, double* %15
%17 = load double, double* %3
%18 = call double @llvm.fabs.f64(double %17)
%19 = call double @llvm.fmuladd.f64(double %16, double %18, double 1.000000e+00)
%20 = fdiv double 1.000000e+00, %19
store double %20, double* %4
store double 1.000000e+00, double* %7
store double 0.000000e+00, double* %6
store i32 1, i32* %8
br label %21
21: ; preds = %35, %1
%22 = load i32, i32* %8
%23 = icmp sle i32 %22, 5
br i1 %23, label %24, label %38
24: ; preds = %21
%25 = load double, double* %4
%26 = load double, double* %7
%27 = fmul double %26, %25
store double %27, double* %7
%28 = load i32, i32* %8
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [6 x double], [6 x double]* %5, i64 0, i64 %29
%31 = load double, double* %30
%32 = load double, double* %7
%33 = load double, double* %6
%34 = call double @llvm.fmuladd.f64(double %31, double %32, double %33)
store double %34, double* %6
br label %35
35: ; preds = %24
%36 = load i32, i32* %8
%37 = add nsw i32 %36, 1
store i32 %37, i32* %8
br label %21
38: ; preds = %21
%39 = load double, double* %3
%40 = fcmp olt double %39, 0.000000e+00
br i1 %40, label %41, label %46
41: ; preds = %38
%42 = load double, double* %6
%43 = load double, double* %3
%44 = call double @Z(double %43)
%45 = fmul double %42, %44
store double %45, double* %2
br label %52
46: ; preds = %38
%47 = load double, double* %6
%48 = load double, double* %3
%49 = call double @Z(double %48)
%50 = fneg double %47
%51 = call double @llvm.fmuladd.f64(double %50, double %49, double 1.000000e+00)
store double %51, double* %2
br label %52
52: ; preds = %46, %41
%53 = load double, double* %2
ret double %53
}

LLVM IR (-O2):
define double @Q(double %0) {
%2 = tail call double @llvm.fabs.f64(double %0)
%3 = tail call double @llvm.fmuladd.f64(double %2, double 0x3FCDA6711871100E, double 1.000000e+00)
%4 = fdiv double 1.000000e+00, %3
%5 = tail call double @llvm.fmuladd.f64(double %4, double 0x3FD470BF3A92F8EC, double 0.000000e+00)
%6 = fmul double %4, %4
%7 = tail call double @llvm.fmuladd.f64(double %6, double 0xBFD6D1F0E5A8325B, double %5)
%8 = fmul double %4, %6
%9 = tail call double @llvm.fmuladd.f64(double %8, double 0x3FFC80EF025F5E68, double %7)
%10 = fmul double %4, %8
%11 = tail call double @llvm.fmuladd.f64(double %10, double 0xBFFD23DD4EF278D0, double %9)
%12 = fmul double %4, %10
%13 = tail call double @llvm.fmuladd.f64(double %12, double 0x3FF548CDD6F42943, double %11)
%14 = fcmp olt double %0, 0.000000e+00
%15 = tail call double @Z(double %0)
%16 = fmul double %13, %15
%17 = fneg double %13
%18 = tail call double @llvm.fmuladd.f64(double %17, double %15, double 1.000000e+00)
%19 = select i1 %14, double %16, double %18
ret double %19
}