// File: /workspace/github_c_makefile_star2_O3/georgeweigt[P]sassafras/sassafras.c
// Function: proc_anova_prelim
void
proc_anova_prelim(void)
{
	int i, j, k, x;

	xfree(miss);
	xfree(B);
	xfree(GG);
	xfree(TT);
	xfree(XX);
	xfree(Y);
	xfree(Yhat);

	// missing data

	miss = (int *) xmalloc(dataset->nobs * sizeof (int));

	nmiss = 0;

	for (i = 0; i < dataset->nobs; i++) {
		miss[i] = 0;
		if (isnan(dataset->spec[yvar].v[i])) {
			miss[i] = 1;
			nmiss++;
			continue;
		}
		for (j = 0; j < nx; j++) {
			x = xtab[j];
			if (isnan(dataset->spec[x].v[i])) {
				miss[i] = 1;
				nmiss++;
				break;
			}
		}
	}

	nobs = dataset->nobs - nmiss;

	// add up all levels

	ncol = 1; // for intercept

	for (i = 0; i < nx; i++) {
		x = xtab[i];
		ncol += dataset->spec[x].num_levels;
	}

	B = (double *) xmalloc(ncol * sizeof (double));
	GG = (double *) xmalloc(ncol * ncol * sizeof (double));
	TT = (double *) xmalloc(ncol * ncol * sizeof (double));
	XX = (double *) xmalloc(nobs * ncol * sizeof (double));
	Y = (double *) xmalloc(nobs * sizeof (double));
	Yhat = (double *) xmalloc(nobs * sizeof (double));

	// fill Y with non-missing values

	k = 0;

	for (i = 0; i < dataset->nobs; i++) {
		if (miss[i])
			continue;
		Y[k++] = dataset->spec[yvar].v[i];
	}

	ybar = 0;

	for (i = 0; i < nobs; i++)
		ybar += Y[i];

	ybar /= nobs;

	// corrected sum of squares

	css = 0;

	for (i = 0; i < nobs; i++)
		css += (Y[i] - ybar) * (Y[i] - ybar);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq 0xdba6(%rip), %rdi      # 0x14ac8
testq %rdi, %rdi
je 0x6f2c
callq 0x2040
movq 0xdb9d(%rip), %rdi      # 0x14ad0
testq %rdi, %rdi
je 0x6f3d
callq 0x2040
movq 0xdb94(%rip), %rdi      # 0x14ad8
testq %rdi, %rdi
je 0x6f4e
callq 0x2040
movq 0xdb8b(%rip), %rdi      # 0x14ae0
testq %rdi, %rdi
je 0x6f5f
callq 0x2040
movq 0xdb82(%rip), %rdi      # 0x14ae8
testq %rdi, %rdi
je 0x6f70
callq 0x2040
movq 0xdb79(%rip), %rdi      # 0x14af0
testq %rdi, %rdi
je 0x6f81
callq 0x2040
movq 0xdb70(%rip), %rdi      # 0x14af8
testq %rdi, %rdi
je 0x6f92
callq 0x2040
movq 0xcf3f(%rip), %rax      # 0x13ed8
movl 0x14(%rax), %edi
shll $0x2, %edi
callq 0x2bd8
movq %rax, 0xdb1d(%rip)      # 0x14ac8
movl $0x0, 0xda9b(%rip)      # 0x14a50
movq 0xcf1c(%rip), %rcx      # 0x13ed8
movl 0x14(%rcx), %ebx
movl 0xd433(%rip), %edx      # 0x143f8
testl %ebx, %ebx
jle 0x7051
leaq 0x20(%rcx), %rdi
movslq 0xd5b8(%rip), %rsi      # 0x14590
leaq (%rsi,%rsi,4), %rsi
movq 0x40(%rcx,%rsi,8), %r8
leaq (,%rdx,4), %r9
xorl %r10d, %r10d
leaq 0xd73d(%rip), %r11      # 0x14730
xorl %esi, %esi
movl $0x0, (%rax,%r10,4)
movsd (%r8,%r10,8), %xmm0
ucomisd %xmm0, %xmm0
jp 0x7033
testl %edx, %edx
jle 0x7043
xorl %ebx, %ebx
movslq (%rbx,%r11), %r14
leaq (%r14,%r14,4), %r14
movq 0x20(%rdi,%r14,8), %r14
movsd (%r14,%r10,8), %xmm0
ucomisd %xmm0, %xmm0
jp 0x7033
addq $0x4, %rbx
cmpq %rbx, %r9
jne 0x700f
jmp 0x7043
movl $0x1, (%rax,%r10,4)
incl %esi
movl %esi, 0xda0d(%rip)      # 0x14a50
incq %r10
movslq 0x14(%rcx), %rbx
cmpq %rbx, %r10
jl 0x6ff5
jmp 0x7053
xorl %esi, %esi
subl %esi, %ebx
movl %ebx, 0xd9f9(%rip)      # 0x14a54
movl $0x1, 0xda9b(%rip)      # 0x14b00
testl %edx, %edx
jle 0x70a0
addq $0x20, %rcx
shlq $0x2, %rdx
movl $0x1, %edi
xorl %eax, %eax
leaq 0xd6b1(%rip), %rsi      # 0x14730
movslq (%rax,%rsi), %r8
leaq (%r8,%r8,4), %r8
addl 0xc(%rcx,%r8,8), %edi
movl %edi, 0xda6e(%rip)      # 0x14b00
addq $0x4, %rax
cmpq %rax, %rdx
jne 0x707f
shll $0x3, %edi
jmp 0x70a5
movl $0x8, %edi
callq 0x2bd8
movq %rax, 0xda1f(%rip)      # 0x14ad0
movl 0xda49(%rip), %edi      # 0x14b00
imull %edi, %edi
shll $0x3, %edi
callq 0x2bd8
movq %rax, 0xda0f(%rip)      # 0x14ad8
movl 0xda31(%rip), %edi      # 0x14b00
imull %edi, %edi
shll $0x3, %edi
callq 0x2bd8
movq %rax, 0xd9ff(%rip)      # 0x14ae0
movl 0xd96d(%rip), %edi      # 0x14a54
imull 0xda12(%rip), %edi      # 0x14b00
shll $0x3, %edi
callq 0x2bd8
movq %rax, 0xd9eb(%rip)      # 0x14ae8
movl 0xd951(%rip), %edi      # 0x14a54
shll $0x3, %edi
callq 0x2bd8
movq %rax, 0xd9de(%rip)      # 0x14af0
movl 0xd93c(%rip), %edi      # 0x14a54
shll $0x3, %edi
callq 0x2bd8
movq %rax, 0xd9d1(%rip)      # 0x14af8
movq 0xcdaa(%rip), %rdx      # 0x13ed8
movslq 0x14(%rdx), %rax
testq %rax, %rax
jle 0x7180
movq 0xd98a(%rip), %rcx      # 0x14ac8
movslq 0xd44b(%rip), %rsi      # 0x14590
leaq (%rsi,%rsi,4), %rsi
leaq (%rdx,%rsi,8), %rdx
addq $0x40, %rdx
xorl %esi, %esi
movq 0xd996(%rip), %rdi      # 0x14af0
xorl %r8d, %r8d
cmpl $0x0, (%rcx,%rsi,4)
jne 0x7178
movq (%rdx), %r9
movsd (%r9,%rsi,8), %xmm0
movslq %r8d, %r9
incl %r8d
movsd %xmm0, (%rdi,%r9,8)
incq %rsi
cmpq %rsi, %rax
jne 0x715d
movq $0x0, 0xd92d(%rip) # 0x14ab8
movslq 0xd8c2(%rip), %rax      # 0x14a54
testq %rax, %rax
jle 0x7208
xorpd %xmm0, %xmm0
movq 0xd94e(%rip), %rcx      # 0x14af0
xorl %edx, %edx
addsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, 0xd907(%rip)     # 0x14ab8
incq %rdx
cmpq %rdx, %rax
jne 0x71a4
cvtsi2sd %eax, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0xd8ef(%rip)     # 0x14ab8
movq $0x0, 0xd8cc(%rip) # 0x14aa0
testl %eax, %eax
jle 0x722a
xorpd %xmm1, %xmm1
movq 0xd90d(%rip), %rcx      # 0x14af0
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm2
subsd %xmm0, %xmm2
mulsd %xmm2, %xmm2
addsd %xmm2, %xmm1
movsd %xmm1, 0xd8a2(%rip)     # 0x14aa0
incq %rdx
cmpq %rdx, %rax
jne 0x71e5
jmp 0x722a
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
xorpd %xmm1, %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0xd899(%rip)     # 0x14ab8
movq $0x0, 0xd876(%rip) # 0x14aa0
popq %rbx
popq %r14
popq %rbp
retq