// File: /workspace/github_c_makefile_star2_O1/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 $0x58, %rsp
movsd 0xecfc(%rip), %xmm0     # 0x13ed8
mulsd 0x614c(%rip), %xmm0     # 0xb330
movl %edi, %ebx
addsd 0x610a(%rip), %xmm0     # 0xb2f8
movsd 0xf85a(%rip), %xmm1     # 0x14a50
callq 0x7a76
movsd %xmm0, -0x60(%rbp)
leaq 0x66d8(%rip), %rdi      # 0xb8df
callq 0x408b
movl $0xa, %edi
callq 0x2050
movq 0xecab(%rip), %rax      # 0x13ec8
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 0x5259
incq %rdx
xorl %r14d, %r14d
xorl %edi, %edi
cmpb $0x2a, %sil
sete %dil
addl %edi, %r14d
movb (%rdx), %sil
incq %rdx
testb %sil, %sil
jne 0x523f
jmp 0x525c
xorl %r14d, %r14d
shlq $0x3, %rcx
leaq (%rcx,%rcx,4), %rbx
movl 0xc(%rax,%rbx), %eax
leal 0x5(%r14), %edi
movq %rax, -0x58(%rbp)
incl %eax
movl %edi, -0x2c(%rbp)
movl %eax, -0x4c(%rbp)
imull %eax, %edi
shll $0x3, %edi
callq 0x2bda
movq %rax, -0x40(%rbp)
movq 0xec3a(%rip), %rax      # 0x13ec8
movq 0x20(%rax,%rbx), %r13
addq $0x20, %rax
movq %rax, -0x48(%rbp)
leal 0x1(%r14), %r12d
xorl %r15d, %r15d
leaq 0xdc17(%rip), %rbx      # 0x12ec0
xorl %eax, %eax
movzbl (%r13,%rax), %ecx
testl %ecx, %ecx
je 0x52c2
cmpl $0x2a, %ecx
je 0x52c2
movb %cl, (%rax,%rbx)
incq %rax
jmp 0x52ab
cmpb $0x1, %cl
sbbq $-0x1, %r13
addq %rax, %r13
movb $0x0, (%rax,%rbx)
movq %rbx, %rdi
callq 0x2210
movq -0x40(%rbp), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
cmpq %r12, %r15
jne 0x52a9
movl %r14d, %r14d
leaq 0x6917(%rip), %rdi      # 0xbc09
callq 0x2210
movq -0x40(%rbp), %rbx
movq %rax, 0x8(%rbx,%r14,8)
movslq 0xf279(%rip), %rax      # 0x14580
leaq (%rax,%rax,4), %rax
movq -0x48(%rbp), %rcx
movq (%rcx,%rax,8), %rcx
leaq 0xdba6(%rip), %r13      # 0x12ec0
leaq 0x65cc(%rip), %rdx      # 0xb8ed
movl $0xfa0, %esi            # imm = 0xFA0
movq %r13, %rdi
xorl %eax, %eax
callq 0x20e0
movq %r13, %rdi
callq 0x2210
movq %rax, 0x10(%rbx,%r14,8)
movsd 0x5fb3(%rip), %xmm0     # 0xb2f8
subsd 0xeb8b(%rip), %xmm0     # 0x13ed8
mulsd 0x5fe3(%rip), %xmm0     # 0xb338
leaq 0x6599(%rip), %rdx      # 0xb8f5
movl $0xfa0, %esi            # imm = 0xFA0
movq %r13, %rdi
movb $0x1, %al
callq 0x20e0
movq %r13, %rdi
callq 0x2210
movq %rax, 0x18(%rbx,%r14,8)
movsd 0x5f78(%rip), %xmm0     # 0xb2f8
subsd 0xeb50(%rip), %xmm0     # 0x13ed8
mulsd 0x5fa8(%rip), %xmm0     # 0xb338
leaq 0x656a(%rip), %rdx      # 0xb901
movl $0xfa0, %esi            # imm = 0xFA0
movq %r13, %rdi
movb $0x1, %al
callq 0x20e0
movq %r13, %rdi
callq 0x2210
movq %rax, 0x20(%rbx,%r14,8)
cmpl $0x0, -0x58(%rbp)
jle 0x5585
movl -0x2c(%rbp), %eax
movq %rax, -0x68(%rbp)
xorl %eax, %eax
movq %r14, -0x38(%rbp)
movq %rax, %rdx
movq 0xeaf4(%rip), %rax      # 0x13ec8
movq -0x70(%rbp), %rcx
movq 0x30(%rax,%rcx,8), %rax
movq (%rax,%rdx,8), %rbx
movq %rdx, -0x80(%rbp)
leaq 0x1(%rdx), %rax
movq %rax, -0x48(%rbp)
imulq -0x68(%rbp), %rax
movq -0x40(%rbp), %rcx
leaq (%rcx,%rax,8), %r15
xorl %r14d, %r14d
xorl %eax, %eax
movzbl (%rbx,%rax), %ecx
testl %ecx, %ecx
je 0x5415
cmpl $0x2a, %ecx
je 0x5415
movb %cl, (%rax,%r13)
incq %rax
jmp 0x53ff
cmpb $0x1, %cl
sbbq $-0x1, %rbx
addq %rax, %rbx
movb $0x0, (%rax,%r13)
movq %r13, %rdi
callq 0x2210
movq %rax, (%r15,%r14,8)
incq %r14
cmpq %r12, %r14
jne 0x53fd
leaq 0x101c1(%rip), %rbx     # 0x15600
movq -0x80(%rbp), %r14
movl (%rbx,%r14,4), %ecx
movl $0xfa0, %esi            # imm = 0xFA0
movq %r13, %rdi
leaq 0x5ffe(%rip), %rdx      # 0xb454
xorl %eax, %eax
callq 0x20e0
movq %r13, %rdi
callq 0x2210
movq -0x38(%rbp), %rcx
movq %rax, 0x8(%r15,%rcx,8)
cmpl $0x0, (%rbx,%r14,4)
jle 0x54cb
leaq 0xfb44(%rip), %rax      # 0x14fc0
movsd (%rax,%r14,8), %xmm0
movl $0xfa0, %esi            # imm = 0xFA0
movq %r13, %rdi
leaq 0x5f0b(%rip), %rdx      # 0xb39c
movb $0x1, %al
callq 0x20e0
movq %r13, %rdi
callq 0x2210
movq -0x38(%rbp), %rcx
movq %rax, 0x10(%r15,%rcx,8)
cvtsi2sdl (%rbx,%r14,4), %xmm1
movsd 0xf5a9(%rip), %xmm0     # 0x14a60
divsd %xmm1, %xmm0
ucomisd 0x5e7d(%rip), %xmm0     # 0xb340
jb 0x54f5
sqrtsd %xmm0, %xmm0
jmp 0x54fa
leaq 0x63fb(%rip), %rbx      # 0xb8cd
movq %rbx, %rdi
callq 0x2210
movq -0x38(%rbp), %r14
movq %rax, 0x10(%r15,%r14,8)
movq %rbx, %rdi
callq 0x2210
movq %rax, 0x18(%r15,%r14,8)
movq %rbx, %rdi
jmp 0x556d
callq 0x2200
mulsd -0x60(%rbp), %xmm0
leaq 0xfaba(%rip), %rax      # 0x14fc0
movapd %xmm0, %xmm1
movsd %xmm0, -0x78(%rbp)
movsd (%rax,%r14,8), %xmm0
subsd %xmm1, %xmm0
movl $0xfa0, %esi            # imm = 0xFA0
movq %r13, %rdi
leaq 0x5e74(%rip), %rbx      # 0xb39c
movq %rbx, %rdx
movb $0x1, %al
callq 0x20e0
movq %r13, %rdi
callq 0x2210
movq -0x38(%rbp), %rcx
movq %rax, 0x18(%r15,%rcx,8)
movsd -0x78(%rbp), %xmm0
leaq 0xfa71(%rip), %rax      # 0x14fc0
addsd (%rax,%r14,8), %xmm0
movq %rcx, %r14
movl $0xfa0, %esi            # imm = 0xFA0
movq %r13, %rdi
movq %rbx, %rdx
movb $0x1, %al
callq 0x20e0
movq %r13, %rdi
callq 0x2210
movq %rax, 0x20(%r15,%r14,8)
movq -0x48(%rbp), %rax
cmpq -0x58(%rbp), %rax
jne 0x53ca
movq %r13, %rdi
movl $0x1, %esi
movq %r12, %rdx
callq 0x2100
xorl %eax, %eax
movb %al, 0x1(%r14,%r13)
movb %al, 0x2(%r14,%r13)
movb %al, 0x3(%r14,%r13)
movb %al, 0x4(%r14,%r13)
movq -0x40(%rbp), %rdi
movl -0x4c(%rbp), %esi
movl -0x2c(%rbp), %edx
movq %r13, %rcx
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x4767