// File: /workspace/github_c_makefile_star2_O0/georgeweigt[P]sassafras/sassafras.c
// Function: proc_anova_compute_means
void
proc_anova_compute_means(int x)
{
	int i, level, n;
	double t, y;

	n = dataset->spec[x].num_levels;

	if (n > MAXLVL)
		stop("Too many levels");

	for (i = 0; i < n; i++) {
		mean[i] = 0;
		variance[i] = 0;
		count[i] = 0;
	}

	for (i = 0; i < dataset->nobs; i++) {
		if (miss[i])
			continue;
		y = dataset->spec[yvar].v[i];
		level = dataset->spec[x].v[i];
		count[level]++;
		t = mean[level];
		mean[level] += (y - t) / count[level];
		variance[level] += (y - t) * (y - mean[level]);
	}

	for (i = 0; i < n; i++)
		variance[i] /= (count[i] - 1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq 0x12076(%rip), %rax     # 0x17eb8
addq $0x20, %rax
movslq -0x4(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, -0x10(%rbp)
cmpl $0x64, -0x10(%rbp)
jle 0x5e69
leaq 0x9976(%rip), %rdi      # 0xf7da
callq 0x2790
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x5ebb
movslq -0x8(%rbp), %rcx
leaq 0x1312d(%rip), %rax     # 0x18fb0
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movslq -0x8(%rbp), %rcx
leaq 0x1343a(%rip), %rax     # 0x192d0
xorps %xmm0, %xmm0
movsd %xmm0, (%rax,%rcx,8)
movslq -0x8(%rbp), %rcx
leaq 0x13747(%rip), %rax     # 0x195f0
movl $0x0, (%rax,%rcx,4)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x5e70
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
movq 0x11fec(%rip), %rcx     # 0x17eb8
cmpl 0x14(%rcx), %eax
jge 0x5ff7
movq 0x12bcc(%rip), %rax     # 0x18aa8
movslq -0x8(%rbp), %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0x5eeb
jmp 0x5fe9
movq 0x11fc6(%rip), %rax     # 0x17eb8
addq $0x20, %rax
movslq 0x12673(%rip), %rcx     # 0x18570
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movslq -0x8(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x20(%rbp)
movq 0x11f9b(%rip), %rax     # 0x17eb8
addq $0x20, %rax
movslq -0x4(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movslq -0x8(%rbp), %rcx
cvttsd2si (%rax,%rcx,8), %eax
movl %eax, -0xc(%rbp)
movslq -0xc(%rbp), %rcx
leaq 0x136a9(%rip), %rax     # 0x195f0
movl (%rax,%rcx,4), %edx
addl $0x1, %edx
leaq 0x1369c(%rip), %rax     # 0x195f0
movl %edx, (%rax,%rcx,4)
movslq -0xc(%rbp), %rcx
leaq 0x1304e(%rip), %rax     # 0x18fb0
movsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x18(%rbp)
movsd -0x20(%rbp), %xmm0
subsd -0x18(%rbp), %xmm0
movslq -0xc(%rbp), %rcx
leaq 0x1366f(%rip), %rax     # 0x195f0
cvtsi2sdl (%rax,%rcx,4), %xmm1
divsd %xmm1, %xmm0
movslq -0xc(%rbp), %rcx
leaq 0x1301b(%rip), %rax     # 0x18fb0
addsd (%rax,%rcx,8), %xmm0
leaq 0x1300f(%rip), %rax     # 0x18fb0
movsd %xmm0, (%rax,%rcx,8)
movsd -0x20(%rbp), %xmm0
subsd -0x18(%rbp), %xmm0
movsd -0x20(%rbp), %xmm2
movslq -0xc(%rbp), %rcx
leaq 0x12ff0(%rip), %rax     # 0x18fb0
subsd (%rax,%rcx,8), %xmm2
movslq -0xc(%rbp), %rcx
leaq 0x13300(%rip), %rax     # 0x192d0
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
leaq 0x132ec(%rip), %rax     # 0x192d0
movsd %xmm0, (%rax,%rcx,8)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x5ec2
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x6046
movslq -0x8(%rbp), %rcx
leaq 0x135df(%rip), %rax     # 0x195f0
movl (%rax,%rcx,4), %eax
subl $0x1, %eax
cvtsi2sd %eax, %xmm1
movslq -0x8(%rbp), %rcx
leaq 0x132aa(%rip), %rax     # 0x192d0
movsd (%rax,%rcx,8), %xmm0
divsd %xmm1, %xmm0
leaq 0x1329a(%rip), %rax     # 0x192d0
movsd %xmm0, (%rax,%rcx,8)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x5ffe
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)