// File: /workspace/github_c_makefile_star2_O0/georgeweigt[P]sassafras/sassafras.c
// Function: proc_anova_print_ttest
void
proc_anova_print_ttest(int x)
{
	int dfe, i, j, k, n, ncol, nrow;
	char **a, *s;
	double d, mse, pval, se, sse, t, tval;

	emit_line_center("Two Sample t-Test");
	emit_line("");

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

	nrow = 1 + n * (n - 1);

	ncol = 7;

	a = (char **) xmalloc(nrow * ncol * sizeof (char *));

	s = dataset->spec[x].name;
	A(0, 0) = strdup(s);
	A(0, 1) = strdup(s);

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

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

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

	A(0, 5) = strdup("t Value");
	A(0, 6) = strdup("Pr > |t|  ");

	k = 0;

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

			if (i == j)
				continue;

			k++;

			// Level

			s = dataset->spec[x].ltab[i];
			A(k, 0) = strdup(s);

			// Level

			s = dataset->spec[x].ltab[j];
			A(k, 1) = strdup(s);

			// Sanity check

			if (count[i] == 0 || count[j] == 0) {
				A(k, 2) = strdup(".");
				A(k, 3) = strdup(".");
				A(k, 4) = strdup(".");
				A(k, 5) = strdup(".");
				A(k, 6) = strdup(".  ");
				continue;
			}

			// Difference

			d = mean[i] - mean[j];
			snprintf(bigbuf, BIGBUFLEN, "%0.6f", d);
			A(k, 2) = strdup(bigbuf);

			// confidence interval

			if (count[i] + count[j] < 3) {
				A(k, 3) = strdup(".");
				A(k, 4) = strdup(".");
				A(k, 5) = strdup(".");
				A(k, 6) = strdup(".  ");
				continue;
			}

			sse = variance[i] * (count[i] - 1) + variance[j] * (count[j] - 1);

			dfe = count[i] + count[j] - 2;

			mse = sse / dfe;

			se = sqrt(mse * (1.0 / count[i] + 1.0 / count[j]));

			tval = d / se;

			pval = 2 * (1 - tdist(fabs(tval), dfe));

			t = qt(1 - alpha / 2, dfe) * se;

			snprintf(bigbuf, BIGBUFLEN, "%0.6f", d - t);
			A(k, 3) = strdup(bigbuf);

			snprintf(bigbuf, BIGBUFLEN, "%0.6f", d + t);
			A(k, 4) = strdup(bigbuf);

			snprintf(bigbuf, BIGBUFLEN, "%0.2f", tval);
			A(k, 5) = strdup(bigbuf);

			if (pval > alpha)
				snprintf(bigbuf, BIGBUFLEN, "%0.4f  ", pval);
			else
				snprintf(bigbuf, BIGBUFLEN, "%0.4f *", pval);
			A(k, 6) = strdup(bigbuf);
		}
	}

	bigbuf[0] = 1; // left justify
	bigbuf[1] = 1;
	bigbuf[2] = 0;
	bigbuf[3] = 0;
	bigbuf[4] = 0;
	bigbuf[5] = 0;
	bigbuf[6] = 0;

	print_table_and_free(a, nrow, ncol, bigbuf);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movl %edi, -0x4(%rbp)
leaq 0x89d8(%rip), %rdi      # 0xf86a
callq 0x4c20
leaq 0x8541(%rip), %rdi      # 0xf3df
callq 0x4bf0
movq 0x1100e(%rip), %rax     # 0x17eb8
addq $0x20, %rax
movslq -0x4(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
imull %ecx, %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl $0x7, -0x1c(%rbp)
movl -0x20(%rbp), %eax
imull -0x1c(%rbp), %eax
cltq
shlq $0x3, %rax
movl %eax, %edi
callq 0x2da0
movq %rax, -0x28(%rbp)
movq 0x10fc1(%rip), %rax     # 0x17eb8
addq $0x20, %rax
movslq -0x4(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
imull $0x0, -0x1c(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x30(%rbp), %rdi
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
imull $0x0, -0x1c(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, 0x8(%rax,%rcx,8)
movq 0x10f6d(%rip), %rax     # 0x17eb8
addq $0x20, %rax
movslq 0x1161a(%rip), %rcx     # 0x18570
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rcx
leaq 0xff41(%rip), %rdi      # 0x16eb0
movl $0xfa0, %esi            # imm = 0xFA0
leaq 0x88bf(%rip), %rdx      # 0xf83a
movb $0x0, %al
callq 0x20c0
leaq 0xff27(%rip), %rdi      # 0x16eb0
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
imull $0x0, -0x1c(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, 0x10(%rax,%rcx,8)
movsd 0x8237(%rip), %xmm1     # 0xf1e0
subsd 0x10f17(%rip), %xmm1    # 0x17ec8
movsd 0x8257(%rip), %xmm0     # 0xf210
mulsd %xmm1, %xmm0
leaq 0xfeec(%rip), %rdi      # 0x16eb0
movl $0xfa0, %esi            # imm = 0xFA0
leaq 0x8830(%rip), %rdx      # 0xf800
movb $0x1, %al
callq 0x20c0
leaq 0xfed2(%rip), %rdi      # 0x16eb0
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
imull $0x0, -0x1c(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, 0x18(%rax,%rcx,8)
movsd 0x81e2(%rip), %xmm1     # 0xf1e0
subsd 0x10ec2(%rip), %xmm1    # 0x17ec8
movsd 0x8202(%rip), %xmm0     # 0xf210
mulsd %xmm1, %xmm0
leaq 0xfe97(%rip), %rdi      # 0x16eb0
movl $0xfa0, %esi            # imm = 0xFA0
leaq 0x87e7(%rip), %rdx      # 0xf80c
movb $0x1, %al
callq 0x20c0
leaq 0xfe7d(%rip), %rdi      # 0x16eb0
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
imull $0x0, -0x1c(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, 0x20(%rax,%rcx,8)
leaq 0x87f1(%rip), %rdi      # 0xf843
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
imull $0x0, -0x1c(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, 0x28(%rax,%rcx,8)
leaq 0x87da(%rip), %rdi      # 0xf84b
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
imull $0x0, -0x1c(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, 0x30(%rax,%rcx,8)
movl $0x0, -0x14(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x75f7
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x18(%rbp), %eax
jge 0x75e7
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jne 0x70c3
jmp 0x75d9
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movq 0x10de5(%rip), %rax     # 0x17eb8
addq $0x20, %rax
movslq -0x4(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x14(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq 0x10da1(%rip), %rax     # 0x17eb8
addq $0x20, %rax
movslq -0x4(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x14(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, 0x8(%rax,%rcx,8)
movslq -0xc(%rbp), %rcx
leaq 0x12490(%rip), %rax     # 0x195f0
cmpl $0x0, (%rax,%rcx,4)
je 0x717b
movslq -0x10(%rbp), %rcx
leaq 0x1247f(%rip), %rax     # 0x195f0
cmpl $0x0, (%rax,%rcx,4)
jne 0x722a
leaq 0x8656(%rip), %rdi      # 0xf7d8
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x14(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, 0x10(%rax,%rcx,8)
leaq 0x8634(%rip), %rdi      # 0xf7d8
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x14(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, 0x18(%rax,%rcx,8)
leaq 0x8612(%rip), %rdi      # 0xf7d8
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x14(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, 0x20(%rax,%rcx,8)
leaq 0x85f0(%rip), %rdi      # 0xf7d8
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x14(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, 0x28(%rax,%rcx,8)
leaq 0x864c(%rip), %rdi      # 0xf856
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x14(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, 0x30(%rax,%rcx,8)
jmp 0x75d9
movslq -0xc(%rbp), %rcx
leaq 0x11d7b(%rip), %rax     # 0x18fb0
movsd (%rax,%rcx,8), %xmm0
movslq -0x10(%rbp), %rcx
leaq 0x11d6b(%rip), %rax     # 0x18fb0
subsd (%rax,%rcx,8), %xmm0
movsd %xmm0, -0x38(%rbp)
movsd -0x38(%rbp), %xmm0
leaq 0xfc55(%rip), %rdi      # 0x16eb0
movl $0xfa0, %esi            # imm = 0xFA0
leaq 0x801d(%rip), %rdx      # 0xf284
movb $0x1, %al
callq 0x20c0
leaq 0xfc3b(%rip), %rdi      # 0x16eb0
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x14(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, 0x10(%rax,%rcx,8)
movslq -0xc(%rbp), %rcx
leaq 0x12355(%rip), %rax     # 0x195f0
movl (%rax,%rcx,4), %eax
movslq -0x10(%rbp), %rdx
leaq 0x12347(%rip), %rcx     # 0x195f0
addl (%rcx,%rdx,4), %eax
cmpl $0x3, %eax
jge 0x7342
leaq 0x851c(%rip), %rdi      # 0xf7d8
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x14(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, 0x18(%rax,%rcx,8)
leaq 0x84fa(%rip), %rdi      # 0xf7d8
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x14(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, 0x20(%rax,%rcx,8)
leaq 0x84d8(%rip), %rdi      # 0xf7d8
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x14(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, 0x28(%rax,%rcx,8)
leaq 0x8534(%rip), %rdi      # 0xf856
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x14(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, 0x30(%rax,%rcx,8)
jmp 0x75d9
movslq -0xc(%rbp), %rcx
leaq 0x11f83(%rip), %rax     # 0x192d0
movsd (%rax,%rcx,8), %xmm0
movslq -0xc(%rbp), %rcx
leaq 0x12293(%rip), %rax     # 0x195f0
movl (%rax,%rcx,4), %eax
subl $0x1, %eax
cvtsi2sd %eax, %xmm2
movslq -0x10(%rbp), %rcx
leaq 0x11f5e(%rip), %rax     # 0x192d0
movsd (%rax,%rcx,8), %xmm1
movslq -0x10(%rbp), %rcx
leaq 0x1226e(%rip), %rax     # 0x195f0
movl (%rax,%rcx,4), %eax
subl $0x1, %eax
cvtsi2sd %eax, %xmm3
mulsd %xmm3, %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x58(%rbp)
movslq -0xc(%rbp), %rcx
leaq 0x12248(%rip), %rax     # 0x195f0
movl (%rax,%rcx,4), %eax
movslq -0x10(%rbp), %rdx
leaq 0x1223a(%rip), %rcx     # 0x195f0
addl (%rcx,%rdx,4), %eax
subl $0x2, %eax
movl %eax, -0x8(%rbp)
movsd -0x58(%rbp), %xmm0
cvtsi2sdl -0x8(%rbp), %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, -0x40(%rbp)
movsd -0x40(%rbp), %xmm0
movslq -0xc(%rbp), %rcx
leaq 0x1220e(%rip), %rax     # 0x195f0
cvtsi2sdl (%rax,%rcx,4), %xmm2
movsd 0x7df1(%rip), %xmm1     # 0xf1e0
divsd %xmm2, %xmm1
movslq -0x10(%rbp), %rcx
leaq 0x121f2(%rip), %rax     # 0x195f0
cvtsi2sdl (%rax,%rcx,4), %xmm3
movsd 0x7dd5(%rip), %xmm2     # 0xf1e0
divsd %xmm3, %xmm2
addsd %xmm2, %xmm1
mulsd %xmm1, %xmm0
callq 0x21e0
movsd %xmm0, -0x50(%rbp)
movsd -0x38(%rbp), %xmm0
divsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
movsd -0x68(%rbp), %xmm0
movaps 0x7e14(%rip), %xmm1     # 0xf250
pand %xmm1, %xmm0
cvtsi2sdl -0x8(%rbp), %xmm1
callq 0x9f40
movsd 0x7d8e(%rip), %xmm1     # 0xf1e0
subsd %xmm0, %xmm1
movsd 0x7d8a(%rip), %xmm0     # 0xf1e8
mulsd %xmm1, %xmm0
movsd %xmm0, -0x48(%rbp)
movsd 0x10a59(%rip), %xmm1    # 0x17ec8
movsd 0x7d71(%rip), %xmm0     # 0xf1e8
divsd %xmm0, %xmm1
movsd 0x7d5d(%rip), %xmm0     # 0xf1e0
subsd %xmm1, %xmm0
cvtsi2sdl -0x8(%rbp), %xmm1
callq 0x9da0
mulsd -0x50(%rbp), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x38(%rbp), %xmm0
subsd -0x60(%rbp), %xmm0
leaq 0xfa04(%rip), %rdi      # 0x16eb0
movl $0xfa0, %esi            # imm = 0xFA0
leaq 0x7dcc(%rip), %rdx      # 0xf284
movb $0x1, %al
callq 0x20c0
leaq 0xf9ea(%rip), %rdi      # 0x16eb0
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x14(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, 0x18(%rax,%rcx,8)
movsd -0x38(%rbp), %xmm0
addsd -0x60(%rbp), %xmm0
leaq 0xf9be(%rip), %rdi      # 0x16eb0
movl $0xfa0, %esi            # imm = 0xFA0
leaq 0x7d86(%rip), %rdx      # 0xf284
movb $0x1, %al
callq 0x20c0
leaq 0xf9a4(%rip), %rdi      # 0x16eb0
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x14(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, 0x20(%rax,%rcx,8)
movsd -0x68(%rbp), %xmm0
leaq 0xf97d(%rip), %rdi      # 0x16eb0
movl $0xfa0, %esi            # imm = 0xFA0
leaq 0x7d2d(%rip), %rdx      # 0xf26c
movb $0x1, %al
callq 0x20c0
leaq 0xf963(%rip), %rdi      # 0x16eb0
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x14(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, 0x28(%rax,%rcx,8)
movsd -0x48(%rbp), %xmm0
ucomisd 0x10953(%rip), %xmm0    # 0x17ec8
jbe 0x7598
movsd -0x48(%rbp), %xmm0
leaq 0xf92d(%rip), %rdi      # 0x16eb0
movl $0xfa0, %esi            # imm = 0xFA0
leaq 0x82cb(%rip), %rdx      # 0xf85a
movb $0x1, %al
callq 0x20c0
jmp 0x75b7
movsd -0x48(%rbp), %xmm0
leaq 0xf90c(%rip), %rdi      # 0x16eb0
movl $0xfa0, %esi            # imm = 0xFA0
leaq 0x82b2(%rip), %rdx      # 0xf862
movb $0x1, %al
callq 0x20c0
leaq 0xf8f2(%rip), %rdi      # 0x16eb0
callq 0x21f0
movq %rax, %rdx
movq -0x28(%rbp), %rax
movl -0x1c(%rbp), %ecx
imull -0x14(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, 0x30(%rax,%rcx,8)
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x70aa
jmp 0x75e9
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x7097
movb $0x1, 0xf8b2(%rip)      # 0x16eb0
movb $0x1, 0xf8ac(%rip)      # 0x16eb1
movb $0x0, 0xf8a6(%rip)      # 0x16eb2
movb $0x0, 0xf8a0(%rip)      # 0x16eb3
movb $0x0, 0xf89a(%rip)      # 0x16eb4
movb $0x0, 0xf894(%rip)      # 0x16eb5
movb $0x0, 0xf88e(%rip)      # 0x16eb6
movq -0x28(%rbp), %rdi
movl -0x20(%rbp), %esi
movl -0x1c(%rbp), %edx
leaq 0xf877(%rip), %rcx      # 0x16eb0
callq 0x53f0
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)