// File: /workspace/github_c_makefile_star2_O1/georgeweigt[P]sassafras/sassafras.c
// Function: run_proc_means
void
run_proc_means(void)
{
	int i, j, k, n;
	char *t;
	char buf[100];

	// print all numeric variables if not specified with VAR

	if (nvar == 0) {
		k = 0;
		for (i = 0; i < dataset->nvar; i++)
			if (dataset->spec[i].ltab == NULL)
				var[k++] = i;
		nvar = k;
	}

	// default statistics

	if (nstats == 0) {
		nstats = 5;
		stats[0] = KN;
		stats[1] = KMEAN;
		stats[2] = KSTD;
		stats[3] = KMIN;
		stats[4] = KMAX;
	}

	ncol = nclass + nstats + 1;

	nrow = nvar;

	for (i = 0; i < nclass; i++) {
		k = class[i];
		n = dataset->spec[k].num_levels;
		nrow *= n;
	}

	nrow++; // for header row

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

	// table header line

	// categorical variable names, if any

	for (i = 0; i < nclass; i++) {
		k = class[i];
		t = dataset->spec[k].name;
		A(0, i) = strdup(t);
	}

	// variable name column

	A(0, nclass) = strdup("Variable");

	// statistic names

	for (i = 0; i < nstats; i++) {
		switch (stats[i]) {
		case KCLM1:
			snprintf(buf, sizeof buf, "%g%% CLM MIN", 100 * (1 - alpha));
			t = buf;
			break;
		case KCLM2:
			snprintf(buf, sizeof buf, "%g%% CLM MAX", 100 * (1 - alpha));
			t = buf;
			break;
		case KLCLM:
			snprintf(buf, sizeof buf, "%g%% LCLM", 100 * (1 - alpha));
			t = buf;
			break;
		case KMAX:
			t = "Maximum";
			break;
		case KMEAN:
			t = "Mean";
			break;
		case KMIN:
			t = "Minimum";
			break;
		case KN:
			t = "N";
			break;
		case KRANGE:
			t = "Range";
			break;
		case KSUM:
			t = "Sum";
			break;
		case KSTD:
		case KSTDDEV:
			t = "Std Dev";
			break;
		case KSTDERR:
		case KSTDMEAN:
			t = "Std Err";
			break;
		case KUCLM:
			snprintf(buf, sizeof buf, "%g%% UCLM", 100 * (1 - alpha));
			t = buf;
			break;
		case KVAR:
			t = "Variance";
			break;
		default:
			t = ".";
			break;
		}
		A(0, nclass + 1 + i) = strdup(t);
	}

	row = 1;

	f(0);

	// right justify variable names

	for (i = 0; i < ncol; i++) {
		if (i < nclass + 1)
			tblfmt[i] = 1;
		else
			tblfmt[i] = 0;
	}

	print_table(a, nrow, ncol, tblfmt);

	for (i = 0; i < nrow; i++)
		for (j = 0; j < ncol; j++)
			free(A(i, j));

	free(a);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
cmpl $0x0, 0xc4ec(%rip)      # 0x143c0
jne 0x7f1b
movq 0xbfeb(%rip), %rax      # 0x13ec8
cmpl $0x0, 0x10(%rax)
jle 0x7f13
leaq 0x30(%rax), %rcx
xorl %edx, %edx
leaq 0xc340(%rip), %rdi      # 0x14230
xorl %esi, %esi
cmpq $0x0, (%rcx)
jne 0x7f01
movslq %esi, %r8
incl %esi
movl %edx, (%rdi,%r8,4)
incq %rdx
movslq 0x10(%rax), %r8
addq $0x28, %rcx
cmpq %r8, %rdx
jl 0x7ef2
jmp 0x7f15
xorl %esi, %esi
movl %esi, 0xc4a5(%rip)      # 0x143c0
cmpl $0x0, 0xd86e(%rip)      # 0x15790
jne 0x7f48
movl $0x5, 0xd862(%rip)      # 0x15790
movapd 0x33aa(%rip), %xmm0     # 0xb2e0
movapd %xmm0, 0xd862(%rip)     # 0x157a0
movl $0x13e, 0xd868(%rip)    # imm = 0x13E
movslq 0xc2d1(%rip), %rax      # 0x14220
movl 0xd83b(%rip), %ecx      # 0x15790
leal (%rax,%rcx), %edi
incl %edi
movl %edi, 0xcb90(%rip)      # 0x14af0
movl 0xc45a(%rip), %ecx      # 0x143c0
movl %ecx, 0xd864(%rip)      # 0x157d0
testq %rax, %rax
jle 0x7fac
movl 0xd859(%rip), %ecx      # 0x157d0
movq 0xbf4a(%rip), %rdx      # 0x13ec8
addq $0x20, %rdx
shlq $0x2, %rax
xorl %esi, %esi
leaq 0xc101(%rip), %r8       # 0x14090
movslq (%rsi,%r8), %r9
leaq (%r9,%r9,4), %r9
imull 0xc(%rdx,%r9,8), %ecx
movl %ecx, 0xd82d(%rip)      # 0x157d0
addq $0x4, %rsi
cmpq %rsi, %rax
jne 0x7f8f
movl 0xd81e(%rip), %eax      # 0x157d0
incl %eax
movl %eax, 0xd816(%rip)      # 0x157d0
imull %eax, %edi
shll $0x3, %edi
callq 0x2bda
movq %rax, 0xd80c(%rip)      # 0x157d8
movslq 0xc24d(%rip), %rbx      # 0x14220
testq %rbx, %rbx
jle 0x8017
leaq (,%rbx,4), %r14
xorl %r15d, %r15d
leaq 0xc0a6(%rip), %r12      # 0x14090
movslq (%r15,%r12), %rax
movq 0xbed3(%rip), %rcx      # 0x13ec8
leaq (%rax,%rax,4), %rax
movq 0x20(%rcx,%rax,8), %rdi
callq 0x2210
movq 0xd7ce(%rip), %rcx      # 0x157d8
movq %rax, (%rcx,%r15,2)
addq $0x4, %r15
cmpq %r15, %r14
jne 0x7fea
leaq 0x3982(%rip), %rdi      # 0xb9a0
callq 0x2210
movq 0xd7ae(%rip), %rcx      # 0x157d8
movq %rax, (%rcx,%rbx,8)
cmpl $0x0, 0xd75b(%rip)      # 0x15790
jle 0x81e4
leaq 0xd75e(%rip), %rbx      # 0x157a0
xorl %r14d, %r14d
leaq 0x3981(%rip), %r15      # 0xb9cd
movl $0xfffffecd, %r12d      # imm = 0xFFFFFECD
leaq 0x30c3(%rip), %r13      # 0xb11c
movl (%rbx), %eax
addl %r12d, %eax
cmpl $0x24, %eax
ja 0x810a
movslq (%r13,%rax,4), %rax
addq %r13, %rax
movq %r15, %rdi
jmpq *%rax
leaq 0x396c(%rip), %rdi      # 0xb9e7
jmp 0x81a0
leaq 0x3968(%rip), %rdi      # 0xb9ef
jmp 0x81a0
movsd 0x3264(%rip), %xmm0     # 0xb2f8
subsd 0xbe3c(%rip), %xmm0     # 0x13ed8
mulsd 0x3294(%rip), %xmm0     # 0xb338
movl $0x64, %esi
leaq -0x90(%rbp), %r15
movq %r15, %rdi
leaq 0x393d(%rip), %rdx      # 0xb9f7
jmp 0x818f
leaq 0x391d(%rip), %rdi      # 0xb9e3
jmp 0x81a0
movsd 0x3225(%rip), %xmm0     # 0xb2f8
subsd 0xbdfd(%rip), %xmm0     # 0x13ed8
mulsd 0x3255(%rip), %xmm0     # 0xb338
movl $0x64, %esi
leaq -0x90(%rbp), %r15
movq %r15, %rdi
leaq 0x38bd(%rip), %rdx      # 0xb9b6
jmp 0x818f
leaq 0x38d0(%rip), %rdi      # 0xb9d5
jmp 0x81a0
leaq 0x37bc(%rip), %rdi      # 0xb8cd
jmp 0x81a0
movsd 0x31da(%rip), %xmm0     # 0xb2f8
subsd 0xbdb2(%rip), %xmm0     # 0x13ed8
mulsd 0x320a(%rip), %xmm0     # 0xb338
movl $0x64, %esi
leaq -0x90(%rbp), %r15
movq %r15, %rdi
leaq 0x3865(%rip), %rdx      # 0xb9a9
jmp 0x818f
leaq 0x3abc(%rip), %rdi      # 0xbc09
jmp 0x81a0
leaq 0x3887(%rip), %rdi      # 0xb9dd
jmp 0x81a0
leaq 0x36f2(%rip), %rdi      # 0xb851
jmp 0x81a0
movsd 0x318f(%rip), %xmm0     # 0xb2f8
subsd 0xbd67(%rip), %xmm0     # 0x13ed8
mulsd 0x31bf(%rip), %xmm0     # 0xb338
movl $0x64, %esi
leaq -0x90(%rbp), %r15
movq %r15, %rdi
leaq 0x3834(%rip), %rdx      # 0xb9c3
movb $0x1, %al
callq 0x20e0
movq %r15, %rdi
leaq 0x382d(%rip), %r15      # 0xb9cd
callq 0x2210
movq 0xd62c(%rip), %rcx      # 0x157d8
movl 0xc06e(%rip), %edx      # 0x14220
addl %r14d, %edx
incl %edx
leaq 0x1(%r14), %rsi
movslq %edx, %rdx
movq %rax, (%rcx,%rdx,8)
movslq 0xd5c7(%rip), %rax      # 0x15790
addq $0x4, %rbx
movq %rsi, %r14
cmpq %rax, %rsi
jl 0x8059
jmp 0x81e4
leaq 0x36dd(%rip), %rdi      # 0xb8bf
jmp 0x81a0
movl $0x1, 0xd5f2(%rip)      # 0x157e0
xorl %edi, %edi
callq 0x829d
movslq 0xc8f4(%rip), %rdx      # 0x14af0
testq %rdx, %rdx
jle 0x8220
leaq 0xd5e8(%rip), %rax      # 0x157f0
movslq 0xc011(%rip), %rcx      # 0x14220
xorl %esi, %esi
cmpq %rcx, %rsi
setle (%rsi,%rax)
incq %rsi
cmpq %rsi, %rdx
jne 0x8211
movq 0xd5b1(%rip), %rdi      # 0x157d8
movl 0xd5a3(%rip), %esi      # 0x157d0
leaq 0xd5bc(%rip), %rcx      # 0x157f0
callq 0x47e3
cmpl $0x0, 0xd590(%rip)      # 0x157d0
jle 0x8283
xorl %ebx, %ebx
movl 0xc8a6(%rip), %eax      # 0x14af0
testl %eax, %eax
jle 0x8279
xorl %r14d, %r14d
imull %ebx, %eax
cltq
shlq $0x3, %rax
addq 0xd577(%rip), %rax      # 0x157d8
movq (%rax,%r14,8), %rdi
callq 0x2040
incq %r14
movslq 0xc87c(%rip), %rax      # 0x14af0
cmpq %rax, %r14
jl 0x8251
incl %ebx
cmpl 0xd54f(%rip), %ebx      # 0x157d0
jl 0x8244
movq 0xd54e(%rip), %rdi      # 0x157d8
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2040