#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 sqrtf(double);
void young_vliet(float s, float *a0, float *a1, float *a2, float *a3) {
  float q;
  q = 0.0;
  if (s > 2.5) {
    q = 0.98711 * s - 0.96330;
  } else {
    q = 3.97156 - 4.14554 * sqrtf(1.0 - 0.26891 * s);
  }
  *a0 = 1.57825 + 2.44413 * q + 1.4281 * q * q + 0.422205 * q * q * q;
  *a1 = 2.44413 * q + 2.85619 * q * q + 1.26661 * q * q * q;
  *a2 = -1.4281 * q * q - 1.26661 * q * q * q;
  *a3 = 0.422205 * q * q * q;
}


x86 assembly (clang, -O0):
<young_vliet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeba(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    117f <young_vliet+0x6f>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xec7(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xec3(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
jmp    11c6 <young_vliet+0xb6>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe88(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe84(%rip),%xmm1
addsd  %xmm1,%xmm0
call   1030 <sqrtf@plt>
movsd  0xe5b(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe57(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe79(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xe85(%rip),%xmm1
addsd  %xmm1,%xmm0
movss  -0x2c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movsd  0xe68(%rip),%xmm1
mulsd  %xmm2,%xmm1
movss  -0x2c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm2
movsd  0xe1a(%rip),%xmm0
mulsd  %xmm2,%xmm0
movss  -0x2c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm0
movss  -0x2c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm2
movsd  0xdf2(%rip),%xmm0
mulsd  %xmm2,%xmm0
movss  -0x2c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm0
movsd  0xdd1(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm2
movsd  0xda8(%rip),%xmm0
mulsd  %xmm2,%xmm0
movss  -0x2c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm0
movss  -0x2c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x18(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xd71(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x2c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm2
movss  -0x2c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm3
movsd  0xd4b(%rip),%xmm1
mulsd  %xmm3,%xmm1
movss  -0x2c(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
mulsd  %xmm3,%xmm1
movss  -0x2c(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
mulsd  %xmm3,%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x20(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xce9(%rip),%xmm0
mulsd  %xmm1,%xmm0
movss  -0x2c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
movss  -0x2c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
mov    -0x28(%rbp),%rax
movss  %xmm0,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<young_vliet>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%rbx
movaps %xmm0,%xmm1
cvtss2sd %xmm0,%xmm0
ucomiss 0xece(%rip),%xmm1
jbe    1146 <young_vliet+0x36>
mulsd  0xeec(%rip),%xmm0
addsd  0xeec(%rip),%xmm0
jmp    117a <young_vliet+0x6a>
mulsd  0xeba(%rip),%xmm0
addsd  0xeba(%rip),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1165 <young_vliet+0x55>
sqrtsd %xmm0,%xmm0
jmp    116a <young_vliet+0x5a>
call   1030 <sqrtf@plt>
mulsd  0xea6(%rip),%xmm0
addsd  0xea6(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeae(%rip),%xmm2
mulsd  %xmm0,%xmm2
movsd  0xeaa(%rip),%xmm1
addsd  %xmm2,%xmm1
movsd  0xea6(%rip),%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm0,%xmm3
addsd  %xmm1,%xmm3
movsd  0xe9a(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
addsd  %xmm1,%xmm3
cvtsd2ss %xmm3,%xmm3
movsd  0xe86(%rip),%xmm4
mulsd  %xmm0,%xmm4
mulsd  %xmm0,%xmm4
addsd  %xmm2,%xmm4
movsd  0xe7a(%rip),%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
mulsd  %xmm0,%xmm2
addsd  %xmm2,%xmm4
cvtsd2ss %xmm4,%xmm4
movss  %xmm3,(%rbx)
movss  %xmm4,(%r12)
movsd  0xe5c(%rip),%xmm3
mulsd  %xmm0,%xmm3
mulsd  %xmm0,%xmm3
subsd  %xmm2,%xmm3
xorps  %xmm0,%xmm0
cvtsd2ss %xmm3,%xmm0
movss  %xmm0,(%r15)
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movss  %xmm0,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @young_vliet(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*
%11 = 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
store float 0.000000e+00, float* %11
%12 = load float, float* %6
%13 = fpext float %12 to double
%14 = fcmp ogt double %13, 2.500000e+00
br i1 %14, label %15, label %20
15: ; preds = %5
%16 = load float, float* %6
%17 = fpext float %16 to double
%18 = call double @llvm.fmuladd.f64(double 9.871100e-01, double %17, double -9.633000e-01)
%19 = fptrunc double %18 to float
store float %19, float* %11
br label %27
20: ; preds = %5
%21 = load float, float* %6
%22 = fpext float %21 to double
%23 = call double @llvm.fmuladd.f64(double -2.689100e-01, double %22, double 1.000000e+00)
%24 = call double @sqrtf(double %23)
%25 = call double @llvm.fmuladd.f64(double -4.145540e+00, double %24, double 3.971560e+00)
%26 = fptrunc double %25 to float
store float %26, float* %11
br label %27
27: ; preds = %20, %15
%28 = load float, float* %11
%29 = fpext float %28 to double
%30 = call double @llvm.fmuladd.f64(double 2.444130e+00, double %29, double 1.578250e+00)
%31 = load float, float* %11
%32 = fpext float %31 to double
%33 = fmul double 1.428100e+00, %32
%34 = load float, float* %11
%35 = fpext float %34 to double
%36 = call double @llvm.fmuladd.f64(double %33, double %35, double %30)
%37 = load float, float* %11
%38 = fpext float %37 to double
%39 = fmul double 4.222050e-01, %38
%40 = load float, float* %11
%41 = fpext float %40 to double
%42 = fmul double %39, %41
%43 = load float, float* %11
%44 = fpext float %43 to double
%45 = call double @llvm.fmuladd.f64(double %42, double %44, double %36)
%46 = fptrunc double %45 to float
%47 = load float*, float** %7
store float %46, float* %47
%48 = load float, float* %11
%49 = fpext float %48 to double
%50 = load float, float* %11
%51 = fpext float %50 to double
%52 = fmul double 2.856190e+00, %51
%53 = load float, float* %11
%54 = fpext float %53 to double
%55 = fmul double %52, %54
%56 = call double @llvm.fmuladd.f64(double 2.444130e+00, double %49, double %55)
%57 = load float, float* %11
%58 = fpext float %57 to double
%59 = fmul double 1.266610e+00, %58
%60 = load float, float* %11
%61 = fpext float %60 to double
%62 = fmul double %59, %61
%63 = load float, float* %11
%64 = fpext float %63 to double
%65 = call double @llvm.fmuladd.f64(double %62, double %64, double %56)
%66 = fptrunc double %65 to float
%67 = load float*, float** %8
store float %66, float* %67
%68 = load float, float* %11
%69 = fpext float %68 to double
%70 = fmul double -1.428100e+00, %69
%71 = load float, float* %11
%72 = fpext float %71 to double
%73 = load float, float* %11
%74 = fpext float %73 to double
%75 = fmul double 1.266610e+00, %74
%76 = load float, float* %11
%77 = fpext float %76 to double
%78 = fmul double %75, %77
%79 = load float, float* %11
%80 = fpext float %79 to double
%81 = fmul double %78, %80
%82 = fneg double %81
%83 = call double @llvm.fmuladd.f64(double %70, double %72, double %82)
%84 = fptrunc double %83 to float
%85 = load float*, float** %9
store float %84, float* %85
%86 = load float, float* %11
%87 = fpext float %86 to double
%88 = fmul double 4.222050e-01, %87
%89 = load float, float* %11
%90 = fpext float %89 to double
%91 = fmul double %88, %90
%92 = load float, float* %11
%93 = fpext float %92 to double
%94 = fmul double %91, %93
%95 = fptrunc double %94 to float
%96 = load float*, float** %10
store float %95, float* %96
ret void
}

LLVM IR (-O2):
define void @young_vliet(float %0, float* nocapture writeonly %1, float* nocapture writeonly %2, float* nocapture writeonly %3, float* nocapture writeonly %4) {
%6 = fpext float %0 to double
%7 = fcmp ogt float %0, 2.500000e+00
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call double @llvm.fmuladd.f64(double %6, double 9.871100e-01, double -9.633000e-01)
br label %14
10: ; preds = %5
%11 = tail call double @llvm.fmuladd.f64(double %6, double -2.689100e-01, double 1.000000e+00)
%12 = tail call double @sqrtf(double %11)
%13 = tail call double @llvm.fmuladd.f64(double %12, double -4.145540e+00, double 3.971560e+00)
br label %14
14: ; preds = %10, %8
%15 = phi double [ %9, %8 ], [ %13, %10 ]
%16 = fptrunc double %15 to float
%17 = fpext float %16 to double
%18 = tail call double @llvm.fmuladd.f64(double %17, double 2.444130e+00, double 1.578250e+00)
%19 = fmul double %17, 1.428100e+00
%20 = tail call double @llvm.fmuladd.f64(double %19, double %17, double %18)
%21 = fmul double %17, 4.222050e-01
%22 = fmul double %21, %17
%23 = tail call double @llvm.fmuladd.f64(double %22, double %17, double %20)
%24 = fptrunc double %23 to float
store float %24, float* %1
%25 = fmul double %17, 2.856190e+00
%26 = fmul double %25, %17
%27 = tail call double @llvm.fmuladd.f64(double %17, double 2.444130e+00, double %26)
%28 = fmul double %17, 1.266610e+00
%29 = fmul double %28, %17
%30 = tail call double @llvm.fmuladd.f64(double %29, double %17, double %27)
%31 = fptrunc double %30 to float
store float %31, float* %2
%32 = fmul double %17, -1.428100e+00
%33 = fneg double %29
%34 = fmul double %17, %33
%35 = tail call double @llvm.fmuladd.f64(double %32, double %17, double %34)
%36 = fptrunc double %35 to float
store float %36, float* %3
%37 = fmul double %22, %17
%38 = fptrunc double %37 to float
store float %38, float* %4
ret void
}