// File: /workspace/github_c_makefile_star2_O2/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 0xe18c(%rip), %rdi      # 0x14ab8
callq 0x2040
movq 0xe188(%rip), %rdi      # 0x14ac0
callq 0x2040
movq 0xe184(%rip), %rdi      # 0x14ac8
callq 0x2040
movq 0xe180(%rip), %rdi      # 0x14ad0
callq 0x2040
movq 0xe17c(%rip), %rdi      # 0x14ad8
callq 0x2040
movq 0xe178(%rip), %rdi      # 0x14ae0
callq 0x2040
movq 0xe174(%rip), %rdi      # 0x14ae8
callq 0x2040
movq 0xd548(%rip), %rax      # 0x13ec8
movl 0x14(%rax), %edi
shll $0x2, %edi
callq 0x2a9b
movq %rax, 0xe126(%rip)      # 0x14ab8
andl $0x0, 0xe0a7(%rip)      # 0x14a40
movq 0xd528(%rip), %rdi      # 0x13ec8
leaq 0x20(%rdi), %rcx
movslq 0xdbd5(%rip), %rdx      # 0x14580
imulq $0x28, %rdx, %rdx
movl 0xda33(%rip), %esi      # 0x143e8
xorl %r8d, %r8d
testl %esi, %esi
cmovlel %r8d, %esi
leaq (%rdi,%rdx), %r9
addq $0x40, %r9
leaq (,%rsi,4), %r10
leaq 0xdd4b(%rip), %rdx      # 0x14720
xorl %r11d, %r11d
movslq 0x14(%rdi), %rbx
cmpq %rbx, %r8
jge 0x6a30
andl $0x0, (%rax,%r8,4)
movq (%r9), %rbx
movsd (%rbx,%r8,8), %xmm0
ucomisd %xmm0, %xmm0
jp 0x6a19
xorl %ebx, %ebx
cmpq %rbx, %r10
je 0x6a2b
movslq (%rbx,%rdx), %r14
imulq $0x28, %r14, %r14
movq 0x20(%rcx,%r14), %r14
movsd (%r14,%r8,8), %xmm0
addq $0x4, %rbx
ucomisd %xmm0, %xmm0
jnp 0x69f7
movl $0x1, (%rax,%r8,4)
incl %r11d
movl %r11d, 0xe015(%rip)     # 0x14a40
incq %r8
jmp 0x69d8
subl %r11d, %ebx
movl %ebx, 0xe00b(%rip)      # 0x14a44
movl $0x1, 0xe0ad(%rip)      # 0x14af0
movl %esi, %eax
shlq $0x2, %rax
pushq $0x1
popq %rdi
xorl %esi, %esi
cmpq %rsi, %rax
je 0x6a6c
movslq (%rsi,%rdx), %r8
imulq $0x28, %r8, %r8
addl 0xc(%rcx,%r8), %edi
movl %edi, 0xe08a(%rip)      # 0x14af0
addq $0x4, %rsi
jmp 0x6a4e
shll $0x3, %edi
callq 0x2a9b
movq %rax, 0xe045(%rip)      # 0x14ac0
movl 0xe06f(%rip), %edi      # 0x14af0
imull %edi, %edi
shll $0x3, %edi
callq 0x2a9b
movq %rax, 0xe035(%rip)      # 0x14ac8
movl 0xe057(%rip), %edi      # 0x14af0
imull %edi, %edi
shll $0x3, %edi
callq 0x2a9b
movq %rax, 0xe025(%rip)      # 0x14ad0
movl 0xdf93(%rip), %edi      # 0x14a44
imull 0xe038(%rip), %edi      # 0x14af0
shll $0x3, %edi
callq 0x2a9b
movq %rax, 0xe011(%rip)      # 0x14ad8
movl 0xdf77(%rip), %edi      # 0x14a44
shll $0x3, %edi
callq 0x2a9b
movq %rax, 0xe004(%rip)      # 0x14ae0
movl 0xdf62(%rip), %edi      # 0x14a44
shll $0x3, %edi
callq 0x2a9b
movq %rax, 0xdff7(%rip)      # 0x14ae8
movq 0xd3d0(%rip), %rdx      # 0x13ec8
movl 0x14(%rdx), %eax
movq 0xdfb6(%rip), %rcx      # 0x14ab8
movslq 0xda77(%rip), %rsi      # 0x14580
imulq $0x28, %rsi, %rsi
addq %rsi, %rdx
addq $0x40, %rdx
movq 0xdfc5(%rip), %rsi      # 0x14ae0
xorl %edi, %edi
testl %eax, %eax
cmovlel %edi, %eax
xorl %r8d, %r8d
cmpq %rdi, %rax
je 0x6b4a
cmpl $0x0, (%rcx,%rdi,4)
jne 0x6b45
movq (%rdx), %r9
movsd (%r9,%rdi,8), %xmm0
movslq %r8d, %r9
incl %r8d
movsd %xmm0, (%rsi,%r9,8)
incq %rdi
jmp 0x6b25
andq $0x0, 0xdf56(%rip)      # 0x14aa8
movl 0xdeec(%rip), %edx      # 0x14a44
movq 0xdf81(%rip), %rax      # 0x14ae0
xorl %esi, %esi
testl %edx, %edx
movl $0x0, %ecx
cmovgl %edx, %ecx
xorpd %xmm0, %xmm0
cmpq %rsi, %rcx
je 0x6b86
addsd (%rax,%rsi,8), %xmm0
movsd %xmm0, 0xdf27(%rip)     # 0x14aa8
incq %rsi
jmp 0x6b6f
cvtsi2sd %edx, %xmm1
andq $0x0, 0xdefe(%rip)      # 0x14a90
divsd %xmm1, %xmm0
movsd %xmm0, 0xdf0a(%rip)     # 0x14aa8
xorpd %xmm1, %xmm1
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x6bc7
movsd (%rax,%rdx,8), %xmm2
subsd %xmm0, %xmm2
mulsd %xmm2, %xmm2
addsd %xmm2, %xmm1
movsd %xmm1, 0xdece(%rip)     # 0x14a90
incq %rdx
jmp 0x6ba4
popq %rbx
popq %r14
popq %rbp
retq