// File: /workspace/github_c_makefile_star2_O1/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 0xdbb3(%rip), %rdi      # 0x14ab8
testq %rdi, %rdi
je 0x6f0f
callq 0x2040
movq 0xdbaa(%rip), %rdi      # 0x14ac0
testq %rdi, %rdi
je 0x6f20
callq 0x2040
movq 0xdba1(%rip), %rdi      # 0x14ac8
testq %rdi, %rdi
je 0x6f31
callq 0x2040
movq 0xdb98(%rip), %rdi      # 0x14ad0
testq %rdi, %rdi
je 0x6f42
callq 0x2040
movq 0xdb8f(%rip), %rdi      # 0x14ad8
testq %rdi, %rdi
je 0x6f53
callq 0x2040
movq 0xdb86(%rip), %rdi      # 0x14ae0
testq %rdi, %rdi
je 0x6f64
callq 0x2040
movq 0xdb7d(%rip), %rdi      # 0x14ae8
testq %rdi, %rdi
je 0x6f75
callq 0x2040
movq 0xcf4c(%rip), %rax      # 0x13ec8
movl 0x14(%rax), %edi
shll $0x2, %edi
callq 0x2bda
movq %rax, 0xdb2a(%rip)      # 0x14ab8
movl $0x0, 0xdaa8(%rip)      # 0x14a40
movq 0xcf29(%rip), %rcx      # 0x13ec8
movl 0x14(%rcx), %ebx
testl %ebx, %ebx
jle 0x7037
movl 0xda90(%rip), %edx      # 0x14a40
leaq 0x20(%rcx), %rsi
movslq 0xd5c5(%rip), %rdi      # 0x14580
leaq (%rdi,%rdi,4), %rdi
movq 0x40(%rcx,%rdi,8), %rdi
movl 0xd41d(%rip), %r8d      # 0x143e8
movq %r8, %r9
shlq $0x2, %r9
xorl %r10d, %r10d
leaq 0xd744(%rip), %r11      # 0x14720
movl $0x0, (%rax,%r10,4)
movsd (%rdi,%r10,8), %xmm0
ucomisd %xmm0, %xmm0
jp 0x701b
testl %r8d, %r8d
jle 0x702b
xorl %ebx, %ebx
movslq (%rbx,%r11), %r14
leaq (%r14,%r14,4), %r14
movq 0x20(%rsi,%r14,8), %r14
movsd (%r14,%r10,8), %xmm0
ucomisd %xmm0, %xmm0
jp 0x701b
addq $0x4, %rbx
cmpq %rbx, %r9
jne 0x6ff7
jmp 0x702b
movl $0x1, (%rax,%r10,4)
incl %edx
movl %edx, 0xda15(%rip)      # 0x14a40
incq %r10
movslq 0x14(%rcx), %rbx
cmpq %rbx, %r10
jl 0x6fdc
subl 0xda03(%rip), %ebx      # 0x14a40
movl %ebx, 0xda01(%rip)      # 0x14a44
movl $0x1, 0xdaa3(%rip)      # 0x14af0
movslq 0xd394(%rip), %rax      # 0x143e8
testq %rax, %rax
jle 0x708c
movl 0xda91(%rip), %edx      # 0x14af0
addq $0x20, %rcx
shlq $0x2, %rax
xorl %esi, %esi
leaq 0xd6b0(%rip), %rdi      # 0x14720
movslq (%rsi,%rdi), %r8
leaq (%r8,%r8,4), %r8
addl 0xc(%rcx,%r8,8), %edx
movl %edx, 0xda6d(%rip)      # 0x14af0
addq $0x4, %rsi
cmpq %rsi, %rax
jne 0x7070
movl 0xda5e(%rip), %edi      # 0x14af0
shll $0x3, %edi
callq 0x2bda
movq %rax, 0xda1f(%rip)      # 0x14ac0
movl 0xda49(%rip), %edi      # 0x14af0
imull %edi, %edi
shll $0x3, %edi
callq 0x2bda
movq %rax, 0xda0f(%rip)      # 0x14ac8
movl 0xda31(%rip), %edi      # 0x14af0
imull %edi, %edi
shll $0x3, %edi
callq 0x2bda
movq %rax, 0xd9ff(%rip)      # 0x14ad0
movl 0xd96d(%rip), %edi      # 0x14a44
imull 0xda12(%rip), %edi      # 0x14af0
shll $0x3, %edi
callq 0x2bda
movq %rax, 0xd9eb(%rip)      # 0x14ad8
movl 0xd951(%rip), %edi      # 0x14a44
shll $0x3, %edi
callq 0x2bda
movq %rax, 0xd9de(%rip)      # 0x14ae0
movl 0xd93c(%rip), %edi      # 0x14a44
shll $0x3, %edi
callq 0x2bda
movq %rax, 0xd9d1(%rip)      # 0x14ae8
movq 0xcdaa(%rip), %rdx      # 0x13ec8
movslq 0x14(%rdx), %rax
testq %rax, %rax
jle 0x7170
movq 0xd98a(%rip), %rcx      # 0x14ab8
movslq 0xd44b(%rip), %rsi      # 0x14580
leaq (%rsi,%rsi,4), %rsi
leaq (%rdx,%rsi,8), %rdx
addq $0x40, %rdx
xorl %esi, %esi
movq 0xd996(%rip), %rdi      # 0x14ae0
xorl %r8d, %r8d
cmpl $0x0, (%rcx,%rsi,4)
jne 0x7168
movq (%rdx), %r9
movsd (%r9,%rsi,8), %xmm0
movslq %r8d, %r9
incl %r8d
movsd %xmm0, (%rdi,%r9,8)
incq %rsi
cmpq %rsi, %rax
jne 0x714d
movq $0x0, 0xd92d(%rip) # 0x14aa8
movslq 0xd8c2(%rip), %rax      # 0x14a44
testq %rax, %rax
jle 0x71ad
movsd 0xd919(%rip), %xmm0     # 0x14aa8
movq 0xd94a(%rip), %rcx      # 0x14ae0
xorl %edx, %edx
addsd (%rcx,%rdx,8), %xmm0
movsd %xmm0, 0xd903(%rip)     # 0x14aa8
incq %rdx
cmpq %rdx, %rax
jne 0x7198
cvtsi2sd %eax, %xmm1
movsd 0xd8ef(%rip), %xmm0     # 0x14aa8
divsd %xmm1, %xmm0
movsd %xmm0, 0xd8e3(%rip)     # 0x14aa8
movq $0x0, 0xd8c0(%rip) # 0x14a90
testl %eax, %eax
jle 0x7206
movsd 0xd8b4(%rip), %xmm1     # 0x14a90
movq 0xd8fd(%rip), %rcx      # 0x14ae0
xorl %edx, %edx
movsd (%rcx,%rdx,8), %xmm2
subsd %xmm0, %xmm2
mulsd %xmm2, %xmm2
addsd %xmm2, %xmm1
movsd %xmm1, 0xd892(%rip)     # 0x14a90
incq %rdx
cmpq %rdx, %rax
jne 0x71e5
popq %rbx
popq %r14
popq %rbp
retq