// File: /workspace/github_c_makefile_star2_O3/georgeweigt[P]sassafras/sassafras.c
// Function: proc_anova_print_means
void
proc_anova_print_means(int x)
{
	int i, j, m, n;
	double q, t;
	char **a, *b, *s;

	q = qt(1 - alpha / 2, dfe);

	emit_line_center("Mean Response");
	emit_line("");

	// count the number of interactions

	m = 0;
	s = dataset->spec[x].name;
	while (*s)
		if (*s++ == '*')
			m++;

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

	a = (char **) xmalloc((5 + m) * (n + 1) * sizeof (char *));

	// split up interaction string

	s = dataset->spec[x].name;
	for (i = 0; i < m + 1; i++) {
		b = bigbuf;
		while (*s && *s != '*')
			*b++ = *s++;
		if (*s)
			s++;
		*b = 0;
		A(0, i) = strdup(bigbuf);
	}

	A(0, m + 1) = strdup("N");

	s = dataset->spec[yvar].name;
	snprintf(bigbuf, BIGBUFLEN, "Mean %s", s);
	A(0, m + 2) = strdup(bigbuf);

	snprintf(bigbuf, BIGBUFLEN, "%g%% CI MIN", 100 * (1 - alpha));
	A(0, m + 3) = strdup(bigbuf);

	snprintf(bigbuf, BIGBUFLEN, "%g%% CI MAX", 100 * (1 - alpha));
	A(0, m + 4) = strdup(bigbuf);

	for (i = 0; i < n; i++) {

		// Level (decompose interactions)

		s = dataset->spec[x].ltab[i];
		for (j = 0; j < m + 1; j++) {
			b = bigbuf;
			while (*s && *s != '*')
				*b++ = *s++;
			if (*s)
				s++;
			*b = 0;
			A(i + 1, j) = strdup(bigbuf);
		}

		// N

		snprintf(bigbuf, BIGBUFLEN, "%d", count[i]);
		A(i + 1, m + 1) = strdup(bigbuf);

		if (count[i] < 1) {
			A(i + 1, m + 2) = strdup(".");
			A(i + 1, m + 3) = strdup(".");
			A(i + 1, m + 4) = strdup(".");
			continue;
		}

		// Mean

		snprintf(bigbuf, BIGBUFLEN, "%0.6f", mean[i]);
		A(i + 1, m + 2) = strdup(bigbuf);

		// Confidence Interval

		t = q * sqrt(mse / count[i]);

		snprintf(bigbuf, BIGBUFLEN, "%0.6f", mean[i] - t);
		A(i + 1, m + 3) = strdup(bigbuf);

		snprintf(bigbuf, BIGBUFLEN, "%0.6f", mean[i] + t);
		A(i + 1, m + 4) = strdup(bigbuf);
	}

	for (i = 0; i < m + 1; i++)
		bigbuf[i] = 1;
	bigbuf[m + 1] = 0;
	bigbuf[m + 2] = 0;
	bigbuf[m + 3] = 0;
	bigbuf[m + 4] = 0;

	print_table_and_free(a, n + 1, 5 + m, bigbuf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movsd 0xed39(%rip), %xmm0     # 0x13ee8
mulsd 0x6149(%rip), %xmm0     # 0xb300
movl %edi, %ebx
addsd 0x6107(%rip), %xmm0     # 0xb2c8
movsd 0xf897(%rip), %xmm1     # 0x14a60
callq 0x7aad
movsd %xmm0, -0x60(%rbp)
leaq 0x66d5(%rip), %rdi      # 0xb8af
callq 0x4043
movl $0xa, %edi
callq 0x2050
movq 0xece8(%rip), %rax      # 0x13ed8
movslq %ebx, %rcx
leaq (%rcx,%rcx,4), %rdx
movq %rdx, -0x70(%rbp)
movq 0x20(%rax,%rdx,8), %rdx
addq $0x20, %rax
movb (%rdx), %sil
testb %sil, %sil
je 0x522a
incq %rdx
xorl %ebx, %ebx
xorl %edi, %edi
cmpb $0x2a, %sil
sete %dil
addl %edi, %ebx
movb (%rdx), %sil
incq %rdx
testb %sil, %sil
jne 0x5211
jmp 0x522c
xorl %ebx, %ebx
shlq $0x3, %rcx
leaq (%rcx,%rcx,4), %r15
movl 0xc(%rax,%r15), %eax
leal 0x5(%rbx), %edi
movq %rax, -0x50(%rbp)
incl %eax
movl %edi, -0x2c(%rbp)
movl %eax, -0x44(%rbp)
imull %eax, %edi
shll $0x3, %edi
callq 0x2bd8
movq %rax, -0x38(%rbp)
movq 0xec7a(%rip), %r14      # 0x13ed8
movq 0x20(%r14,%r15), %r15
addq $0x20, %r14
movl %ebx, %eax
movq %rax, -0x40(%rbp)
leaq 0x1(%rax), %r12
xorl %r13d, %r13d
leaq 0xdc55(%rip), %rbx      # 0x12ed0
xorl %eax, %eax
movzbl (%r15,%rax), %ecx
testl %ecx, %ecx
je 0x5293
cmpl $0x2a, %ecx
je 0x5293
movb %cl, (%rax,%rbx)
incq %rax
jmp 0x527d
cmpb $0x1, %cl
sbbq $-0x1, %r15
addq %rax, %r15
movb $0x0, (%rax,%rbx)
movq %rbx, %rdi
callq 0x2220
movq -0x38(%rbp), %rcx
movq %rax, (%rcx,%r13,8)
incq %r13
cmpq %r12, %r13
jne 0x527b
leaq 0x6919(%rip), %rdi      # 0xbbd9
callq 0x2220
movq -0x38(%rbp), %rbx
movq -0x40(%rbp), %r15
movq %rax, 0x8(%rbx,%r15,8)
movslq 0xf2b7(%rip), %rax      # 0x14590
leaq (%rax,%rax,4), %rax
movq (%r14,%rax,8), %rcx
leaq 0xdbe8(%rip), %r13      # 0x12ed0
leaq 0x65ce(%rip), %rdx      # 0xb8bd
movl $0xfa0, %esi            # imm = 0xFA0
movq %r13, %rdi
xorl %eax, %eax
callq 0x20e0
movq %r13, %rdi
callq 0x2220
movq %rax, 0x10(%rbx,%r15,8)
movsd 0x5fb5(%rip), %xmm0     # 0xb2c8
subsd 0xebcd(%rip), %xmm0     # 0x13ee8
mulsd 0x5fe5(%rip), %xmm0     # 0xb308
leaq 0x659b(%rip), %rdx      # 0xb8c5
movl $0xfa0, %esi            # imm = 0xFA0
movq %r13, %rdi
movb $0x1, %al
callq 0x20e0
movq %r13, %rdi
callq 0x2220
movq %rax, 0x18(%rbx,%r15,8)
movsd 0x5f7a(%rip), %xmm0     # 0xb2c8
subsd 0xeb92(%rip), %xmm0     # 0x13ee8
mulsd 0x5faa(%rip), %xmm0     # 0xb308
leaq 0x656c(%rip), %rdx      # 0xb8d1
movl $0xfa0, %esi            # imm = 0xFA0
movq %r13, %rdi
movb $0x1, %al
callq 0x20e0
movq %r13, %rdi
callq 0x2220
movq %rax, 0x20(%rbx,%r15,8)
cmpl $0x0, -0x50(%rbp)
jle 0x5557
movl -0x2c(%rbp), %eax
movq %rax, -0x68(%rbp)
xorl %eax, %eax
movq %rax, %rdx
movq 0xeb3a(%rip), %rax      # 0x13ed8
movq -0x70(%rbp), %rcx
movq 0x30(%rax,%rcx,8), %rax
movq (%rax,%rdx,8), %r14
movq %rdx, -0x80(%rbp)
leaq 0x1(%rdx), %rax
movq %rax, -0x88(%rbp)
imulq -0x68(%rbp), %rax
movq -0x38(%rbp), %rcx
leaq (%rcx,%rax,8), %rbx
xorl %r15d, %r15d
xorl %eax, %eax
movzbl (%r14,%rax), %ecx
testl %ecx, %ecx
je 0x53e3
cmpl $0x2a, %ecx
je 0x53e3
movb %cl, (%rax,%r13)
incq %rax
jmp 0x53cc
cmpb $0x1, %cl
sbbq $-0x1, %r14
addq %rax, %r14
movb $0x0, (%rax,%r13)
movq %r13, %rdi
callq 0x2220
movq %rax, (%rbx,%r15,8)
incq %r15
cmpq %r12, %r15
jne 0x53ca
leaq 0x10203(%rip), %r14     # 0x15610
movq -0x80(%rbp), %r15
movl (%r14,%r15,4), %ecx
movl $0xfa0, %esi            # imm = 0xFA0
movq %r13, %rdi
leaq 0x6000(%rip), %rdx      # 0xb424
xorl %eax, %eax
callq 0x20e0
movq %r13, %rdi
callq 0x2220
movq -0x40(%rbp), %rcx
movq %rax, 0x8(%rbx,%rcx,8)
cmpl $0x0, (%r14,%r15,4)
jle 0x5493
leaq 0xfb86(%rip), %rax      # 0x14fd0
movsd (%rax,%r15,8), %xmm0
movl $0xfa0, %esi            # imm = 0xFA0
movq %r13, %rdi
leaq 0x5f0d(%rip), %rdx      # 0xb36c
movb $0x1, %al
callq 0x20e0
movq %r13, %rdi
callq 0x2220
cvtsi2sdl (%r14,%r15,4), %xmm1
movsd 0xf5f4(%rip), %xmm0     # 0x14a70
divsd %xmm1, %xmm0
ucomisd 0x5e88(%rip), %xmm0     # 0xb310
jb 0x54b6
movq %rax, %r14
sqrtsd %xmm0, %xmm0
jmp 0x54be
leaq 0x6403(%rip), %r15      # 0xb89d
movq %r15, %rdi
callq 0x2220
movq %rax, %r14
movq %r15, %rdi
callq 0x2220
movq %rax, -0x58(%rbp)
movq %r15, %rdi
jmp 0x552a
movq %rax, %r14
callq 0x2210
mulsd -0x60(%rbp), %xmm0
leaq 0xfb06(%rip), %rax      # 0x14fd0
movapd %xmm0, %xmm1
movsd %xmm0, -0x78(%rbp)
movsd (%rax,%r15,8), %xmm0
subsd %xmm1, %xmm0
movl $0xfa0, %esi            # imm = 0xFA0
movq %r13, %rdi
leaq 0x5e80(%rip), %rdx      # 0xb36c
movb $0x1, %al
callq 0x20e0
movq %r13, %rdi
callq 0x2220
movq %rax, -0x58(%rbp)
movsd -0x78(%rbp), %xmm0
leaq 0xfac5(%rip), %rax      # 0x14fd0
addsd (%rax,%r15,8), %xmm0
movl $0xfa0, %esi            # imm = 0xFA0
movq %r13, %rdi
leaq 0x5e4c(%rip), %rdx      # 0xb36c
movb $0x1, %al
callq 0x20e0
movq %r13, %rdi
callq 0x2220
movq -0x40(%rbp), %r15
movq %r14, 0x10(%rbx,%r15,8)
movq -0x58(%rbp), %rcx
movq %rcx, 0x18(%rbx,%r15,8)
movq %rax, 0x20(%rbx,%r15,8)
movq -0x88(%rbp), %rax
cmpq -0x50(%rbp), %rax
jne 0x5394
movq %r13, %rdi
movl $0x1, %esi
movq %r12, %rdx
callq 0x2100
xorl %eax, %eax
movb %al, (%r12,%r13)
movb %al, 0x2(%r15,%r13)
movb %al, 0x3(%r15,%r13)
movb %al, 0x4(%r15,%r13)
movq -0x38(%rbp), %rdi
movl -0x44(%rbp), %esi
movl -0x2c(%rbp), %edx
movq %r13, %rcx
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x470d