#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 */
float avg(float *, size_t);
float avg11(float *, float *, size_t);
float avg12(float *, float *, size_t);
float avg2(float *, size_t);
float avg3(float *, size_t);
float avg4(float *, size_t);
void poly2reg(float *Coeff, float *BufX, float *BufY, size_t Cnt) {
  float x, y;
  float x2, x3, x4;
  float y_x2;
  float y_x;
  float a, b, c;
  float num, denom;
  x = avg(BufX, Cnt);
  y = avg(BufY, Cnt);
  x2 = avg2(BufX, Cnt);
  x3 = avg3(BufX, Cnt);
  x4 = avg4(BufX, Cnt);
  y_x = avg11(BufX, BufY, Cnt);
  y_x2 = avg12(BufX, BufY, Cnt);
  num = ((y_x2 - y * x2) * (x2 - x * x) - (y_x - y * x) * (x3 - x * x2));
  denom = (x4 - x2 * x2) * (x2 - x * x) - (x3 - x * x2) * (x3 - x * x2);
  a = num / denom;
  num = y_x - y * x - a * (x3 - x * x2);
  denom = x2 - x * x;
  b = num / denom;
  c = y - a * x2 - b * x;
  Coeff[0] = a;
  Coeff[1] = b;
  Coeff[2] = c;
}


x86 assembly (clang, -O0):
<poly2reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <avg@plt>
movss  %xmm0,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <avg@plt>
movss  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <avg2@plt>
movss  %xmm0,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <avg3@plt>
movss  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1070 <avg4@plt>
movss  %xmm0,-0x34(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1080 <avg11@plt>
movss  %xmm0,-0x3c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <avg12@plt>
movss  %xmm0,-0x38(%rbp)
movss  -0x38(%rbp),%xmm1
movss  -0x28(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x2c(%rbp),%xmm1
movss  -0x24(%rbp),%xmm2
movss  -0x24(%rbp),%xmm3
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
mulss  %xmm3,%xmm2
addss  %xmm1,%xmm2
movss  -0x3c(%rbp),%xmm3
movss  -0x28(%rbp),%xmm1
movss  -0x24(%rbp),%xmm4
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm4,%xmm1
addss  %xmm3,%xmm1
movss  -0x30(%rbp),%xmm4
movss  -0x24(%rbp),%xmm3
movss  -0x2c(%rbp),%xmm5
movd   %xmm3,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm3
mulss  %xmm5,%xmm3
addss  %xmm4,%xmm3
mulss  %xmm3,%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x34(%rbp),%xmm1
movss  -0x2c(%rbp),%xmm0
movss  -0x2c(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  -0x2c(%rbp),%xmm1
movss  -0x24(%rbp),%xmm2
movss  -0x24(%rbp),%xmm3
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
mulss  %xmm3,%xmm2
addss  %xmm1,%xmm2
movss  -0x30(%rbp),%xmm3
movss  -0x24(%rbp),%xmm1
movss  -0x2c(%rbp),%xmm4
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm4,%xmm1
addss  %xmm3,%xmm1
movss  -0x30(%rbp),%xmm4
movss  -0x24(%rbp),%xmm3
movss  -0x2c(%rbp),%xmm5
movd   %xmm3,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm3
mulss  %xmm5,%xmm3
addss  %xmm4,%xmm3
mulss  %xmm3,%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x50(%rbp)
movss  -0x4c(%rbp),%xmm0
divss  -0x50(%rbp),%xmm0
movss  %xmm0,-0x40(%rbp)
movss  -0x3c(%rbp),%xmm0
movss  -0x28(%rbp),%xmm1
movss  -0x24(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x40(%rbp),%xmm0
movss  -0x30(%rbp),%xmm3
movss  -0x24(%rbp),%xmm2
movss  -0x2c(%rbp),%xmm4
movd   %xmm2,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm2
mulss  %xmm4,%xmm2
addss  %xmm3,%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4c(%rbp)
movss  -0x2c(%rbp),%xmm1
movss  -0x24(%rbp),%xmm0
movss  -0x24(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x50(%rbp)
movss  -0x4c(%rbp),%xmm0
divss  -0x50(%rbp),%xmm0
movss  %xmm0,-0x44(%rbp)
movss  -0x28(%rbp),%xmm0
movss  -0x40(%rbp),%xmm1
movss  -0x2c(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
movss  -0x44(%rbp),%xmm0
movss  -0x24(%rbp),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x48(%rbp)
movss  -0x40(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  -0x44(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
movss  -0x48(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<poly2reg>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%rbx
mov    %rdx,%r15
mov    %rsi,%r12
mov    %rdi,%r14
mov    %rsi,%rdi
mov    %rcx,%rsi
call   1060 <avg@plt>
movss  %xmm0,0x14(%rsp)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1060 <avg@plt>
movss  %xmm0,0x8(%rsp)
mov    %r12,%rdi
mov    %rbx,%rsi
call   1050 <avg2@plt>
movss  %xmm0,0x4(%rsp)
mov    %r12,%rdi
mov    %rbx,%rsi
call   1030 <avg3@plt>
movss  %xmm0,0xc(%rsp)
mov    %r12,%rdi
mov    %rbx,%rsi
call   1070 <avg4@plt>
movss  %xmm0,0x10(%rsp)
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1080 <avg11@plt>
movss  %xmm0,(%rsp)
mov    %r12,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1040 <avg12@plt>
movss  0x8(%rsp),%xmm4
movaps %xmm4,%xmm1
movss  0x4(%rsp),%xmm5
mulss  %xmm5,%xmm1
subss  %xmm1,%xmm0
movss  0x14(%rsp),%xmm3
movaps %xmm3,%xmm2
mulss  %xmm3,%xmm2
movaps %xmm5,%xmm1
subss  %xmm2,%xmm1
movaps %xmm4,%xmm2
movaps %xmm4,%xmm8
mulss  %xmm3,%xmm2
movss  (%rsp),%xmm4
subss  %xmm2,%xmm4
movaps %xmm3,%xmm2
mulss  %xmm5,%xmm2
movss  0xc(%rsp),%xmm6
subss  %xmm2,%xmm6
movaps %xmm6,%xmm2
mulss  %xmm4,%xmm2
mulss  %xmm1,%xmm0
subss  %xmm2,%xmm0
movaps %xmm5,%xmm2
mulss  %xmm5,%xmm2
movss  0x10(%rsp),%xmm7
subss  %xmm2,%xmm7
movaps %xmm6,%xmm2
mulss  %xmm6,%xmm2
mulss  %xmm1,%xmm7
subss  %xmm2,%xmm7
divss  %xmm7,%xmm0
mulss  %xmm0,%xmm6
movaps %xmm4,%xmm2
subss  %xmm6,%xmm2
divss  %xmm1,%xmm2
mulss  %xmm0,%xmm5
movaps %xmm8,%xmm1
subss  %xmm5,%xmm1
mulss  %xmm2,%xmm3
subss  %xmm3,%xmm1
movss  %xmm0,(%r14)
movss  %xmm2,0x4(%r14)
movss  %xmm1,0x8(%r14)
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @poly2reg(float* %0, float* %1, float* %2, i64 %3) {
%5 = alloca float*
%6 = alloca float*
%7 = alloca float*
%8 = alloca i64
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = alloca float
%16 = alloca float
%17 = alloca float
%18 = alloca float
%19 = alloca float
%20 = alloca float
store float* %0, float** %5
store float* %1, float** %6
store float* %2, float** %7
store i64 %3, i64* %8
%21 = load float*, float** %6
%22 = load i64, i64* %8
%23 = call float @avg(float* %21, i64 %22)
store float %23, float* %9
%24 = load float*, float** %7
%25 = load i64, i64* %8
%26 = call float @avg(float* %24, i64 %25)
store float %26, float* %10
%27 = load float*, float** %6
%28 = load i64, i64* %8
%29 = call float @avg2(float* %27, i64 %28)
store float %29, float* %11
%30 = load float*, float** %6
%31 = load i64, i64* %8
%32 = call float @avg3(float* %30, i64 %31)
store float %32, float* %12
%33 = load float*, float** %6
%34 = load i64, i64* %8
%35 = call float @avg4(float* %33, i64 %34)
store float %35, float* %13
%36 = load float*, float** %6
%37 = load float*, float** %7
%38 = load i64, i64* %8
%39 = call float @avg11(float* %36, float* %37, i64 %38)
store float %39, float* %15
%40 = load float*, float** %6
%41 = load float*, float** %7
%42 = load i64, i64* %8
%43 = call float @avg12(float* %40, float* %41, i64 %42)
store float %43, float* %14
%44 = load float, float* %14
%45 = load float, float* %10
%46 = load float, float* %11
%47 = fneg float %45
%48 = call float @llvm.fmuladd.f32(float %47, float %46, float %44)
%49 = load float, float* %11
%50 = load float, float* %9
%51 = load float, float* %9
%52 = fneg float %50
%53 = call float @llvm.fmuladd.f32(float %52, float %51, float %49)
%54 = load float, float* %15
%55 = load float, float* %10
%56 = load float, float* %9
%57 = fneg float %55
%58 = call float @llvm.fmuladd.f32(float %57, float %56, float %54)
%59 = load float, float* %12
%60 = load float, float* %9
%61 = load float, float* %11
%62 = fneg float %60
%63 = call float @llvm.fmuladd.f32(float %62, float %61, float %59)
%64 = fmul float %58, %63
%65 = fneg float %64
%66 = call float @llvm.fmuladd.f32(float %48, float %53, float %65)
store float %66, float* %19
%67 = load float, float* %13
%68 = load float, float* %11
%69 = load float, float* %11
%70 = fneg float %68
%71 = call float @llvm.fmuladd.f32(float %70, float %69, float %67)
%72 = load float, float* %11
%73 = load float, float* %9
%74 = load float, float* %9
%75 = fneg float %73
%76 = call float @llvm.fmuladd.f32(float %75, float %74, float %72)
%77 = load float, float* %12
%78 = load float, float* %9
%79 = load float, float* %11
%80 = fneg float %78
%81 = call float @llvm.fmuladd.f32(float %80, float %79, float %77)
%82 = load float, float* %12
%83 = load float, float* %9
%84 = load float, float* %11
%85 = fneg float %83
%86 = call float @llvm.fmuladd.f32(float %85, float %84, float %82)
%87 = fmul float %81, %86
%88 = fneg float %87
%89 = call float @llvm.fmuladd.f32(float %71, float %76, float %88)
store float %89, float* %20
%90 = load float, float* %19
%91 = load float, float* %20
%92 = fdiv float %90, %91
store float %92, float* %16
%93 = load float, float* %15
%94 = load float, float* %10
%95 = load float, float* %9
%96 = fneg float %94
%97 = call float @llvm.fmuladd.f32(float %96, float %95, float %93)
%98 = load float, float* %16
%99 = load float, float* %12
%100 = load float, float* %9
%101 = load float, float* %11
%102 = fneg float %100
%103 = call float @llvm.fmuladd.f32(float %102, float %101, float %99)
%104 = fneg float %98
%105 = call float @llvm.fmuladd.f32(float %104, float %103, float %97)
store float %105, float* %19
%106 = load float, float* %11
%107 = load float, float* %9
%108 = load float, float* %9
%109 = fneg float %107
%110 = call float @llvm.fmuladd.f32(float %109, float %108, float %106)
store float %110, float* %20
%111 = load float, float* %19
%112 = load float, float* %20
%113 = fdiv float %111, %112
store float %113, float* %17
%114 = load float, float* %10
%115 = load float, float* %16
%116 = load float, float* %11
%117 = fneg float %115
%118 = call float @llvm.fmuladd.f32(float %117, float %116, float %114)
%119 = load float, float* %17
%120 = load float, float* %9
%121 = fneg float %119
%122 = call float @llvm.fmuladd.f32(float %121, float %120, float %118)
store float %122, float* %18
%123 = load float, float* %16
%124 = load float*, float** %5
%125 = getelementptr inbounds float, float* %124, i64 0
store float %123, float* %125
%126 = load float, float* %17
%127 = load float*, float** %5
%128 = getelementptr inbounds float, float* %127, i64 1
store float %126, float* %128
%129 = load float, float* %18
%130 = load float*, float** %5
%131 = getelementptr inbounds float, float* %130, i64 2
store float %129, float* %131
ret void
}

LLVM IR (-O2):
define void @poly2reg(float* nocapture writeonly %0, float* %1, float* %2, i64 %3) {
%5 = tail call float @avg(float* %1, i64 %3)
%6 = tail call float @avg(float* %2, i64 %3)
%7 = tail call float @avg2(float* %1, i64 %3)
%8 = tail call float @avg3(float* %1, i64 %3)
%9 = tail call float @avg4(float* %1, i64 %3)
%10 = tail call float @avg11(float* %1, float* %2, i64 %3)
%11 = tail call float @avg12(float* %1, float* %2, i64 %3)
%12 = fneg float %6
%13 = tail call float @llvm.fmuladd.f32(float %12, float %7, float %11)
%14 = fneg float %5
%15 = tail call float @llvm.fmuladd.f32(float %14, float %5, float %7)
%16 = tail call float @llvm.fmuladd.f32(float %12, float %5, float %10)
%17 = tail call float @llvm.fmuladd.f32(float %14, float %7, float %8)
%18 = fneg float %16
%19 = fmul float %17, %18
%20 = tail call float @llvm.fmuladd.f32(float %13, float %15, float %19)
%21 = fneg float %7
%22 = tail call float @llvm.fmuladd.f32(float %21, float %7, float %9)
%23 = fneg float %17
%24 = fmul float %17, %23
%25 = tail call float @llvm.fmuladd.f32(float %22, float %15, float %24)
%26 = fdiv float %20, %25
%27 = fneg float %26
%28 = tail call float @llvm.fmuladd.f32(float %27, float %17, float %16)
%29 = fdiv float %28, %15
%30 = tail call float @llvm.fmuladd.f32(float %27, float %7, float %6)
%31 = fneg float %29
%32 = tail call float @llvm.fmuladd.f32(float %31, float %5, float %30)
store float %26, float* %0
%33 = getelementptr inbounds float, float* %0, i64 1
store float %29, float* %33
%34 = getelementptr inbounds float, float* %0, i64 2
store float %32, float* %34
ret void
}