// File: /workspace/github_c_makefile_star2_O3/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
movl 0xc4c6(%rip), %eax      # 0x143d0
testl %eax, %eax
jne 0x7f56
movq 0xbfc3(%rip), %rcx      # 0x13ed8
movl 0x10(%rcx), %edi
testl %edi, %edi
jle 0x7f4e
leaq 0x30(%rcx), %rdx
xorl %esi, %esi
leaq 0xc317(%rip), %r8       # 0x14240
xorl %eax, %eax
cmpq $0x0, (%rdx)
jne 0x7f3d
movslq %eax, %rdi
incl %eax
movl %esi, (%r8,%rdi,4)
movl 0x10(%rcx), %edi
incq %rsi
movslq %edi, %r9
addq $0x28, %rdx
cmpq %r9, %rsi
jl 0x7f2b
jmp 0x7f50
xorl %eax, %eax
movl %eax, 0xc47a(%rip)      # 0x143d0
movl 0xd844(%rip), %edx      # 0x157a0
testl %edx, %edx
jne 0x7f89
movl $0x5, 0xd836(%rip)      # 0x157a0
movapd 0x333e(%rip), %xmm0     # 0xb2b0
movapd %xmm0, 0xd836(%rip)     # 0x157b0
movl $0x13e, 0xd83c(%rip)    # imm = 0x13E
movl $0x5, %edx
movslq 0xc2a0(%rip), %rcx      # 0x14230
leal (%rcx,%rdx), %edi
incl %edi
movl %edi, 0xcb65(%rip)      # 0x14b00
movl %eax, 0xd83f(%rip)      # 0x157e0
testq %rcx, %rcx
jle 0x7fdb
movq 0xbf2b(%rip), %rdx      # 0x13ed8
addq $0x20, %rdx
shlq $0x2, %rcx
xorl %esi, %esi
leaq 0xc0e2(%rip), %r8       # 0x140a0
movslq (%rsi,%r8), %r9
leaq (%r9,%r9,4), %r9
imull 0xc(%rdx,%r9,8), %eax
movl %eax, 0xd80e(%rip)      # 0x157e0
addq $0x4, %rsi
cmpq %rsi, %rcx
jne 0x7fbe
incl %eax
movl %eax, 0xd7fd(%rip)      # 0x157e0
imull %eax, %edi
shll $0x3, %edi
callq 0x2bd8
movq %rax, 0xd7f3(%rip)      # 0x157e8
movslq 0xc234(%rip), %r14      # 0x14230
testq %r14, %r14
jle 0x8049
leaq (,%r14,4), %rbx
xorl %r15d, %r15d
leaq 0xc08d(%rip), %r12      # 0x140a0
movslq (%r15,%r12), %rax
movq 0xbeba(%rip), %rcx      # 0x13ed8
leaq (%rax,%rax,4), %rax
movq 0x20(%rcx,%rax,8), %rdi
callq 0x2220
movq 0xd7b5(%rip), %rcx      # 0x157e8
movq %rax, (%rcx,%r15,2)
addq $0x4, %r15
cmpq %r15, %rbx
jne 0x8013
movq 0xd7a1(%rip), %rbx      # 0x157e8
jmp 0x804c
movq %rax, %rbx
leaq 0x391d(%rip), %rdi      # 0xb970
callq 0x2220
movq %rax, (%rbx,%r14,8)
cmpl $0x0, 0xd73d(%rip)      # 0x157a0
jle 0x8212
leaq 0xd740(%rip), %rbx      # 0x157b0
xorl %r14d, %r14d
leaq 0x3923(%rip), %r15      # 0xb99d
movl $0xfffffecd, %r12d      # imm = 0xFFFFFECD
leaq 0x3095(%rip), %r13      # 0xb11c
movl (%rbx), %eax
addl %r12d, %eax
cmpl $0x24, %eax
ja 0x8138
movslq (%r13,%rax,4), %rax
addq %r13, %rax
movq %r15, %rdi
jmpq *%rax
leaq 0x390e(%rip), %rdi      # 0xb9b7
jmp 0x81ce
leaq 0x390a(%rip), %rdi      # 0xb9bf
jmp 0x81ce
movsd 0x3206(%rip), %xmm0     # 0xb2c8
subsd 0xbe1e(%rip), %xmm0     # 0x13ee8
mulsd 0x3236(%rip), %xmm0     # 0xb308
movl $0x64, %esi
leaq -0x90(%rbp), %r15
movq %r15, %rdi
leaq 0x38df(%rip), %rdx      # 0xb9c7
jmp 0x81bd
leaq 0x38bf(%rip), %rdi      # 0xb9b3
jmp 0x81ce
movsd 0x31c7(%rip), %xmm0     # 0xb2c8
subsd 0xbddf(%rip), %xmm0     # 0x13ee8
mulsd 0x31f7(%rip), %xmm0     # 0xb308
movl $0x64, %esi
leaq -0x90(%rbp), %r15
movq %r15, %rdi
leaq 0x385f(%rip), %rdx      # 0xb986
jmp 0x81bd
leaq 0x3872(%rip), %rdi      # 0xb9a5
jmp 0x81ce
leaq 0x375e(%rip), %rdi      # 0xb89d
jmp 0x81ce
movsd 0x317c(%rip), %xmm0     # 0xb2c8
subsd 0xbd94(%rip), %xmm0     # 0x13ee8
mulsd 0x31ac(%rip), %xmm0     # 0xb308
movl $0x64, %esi
leaq -0x90(%rbp), %r15
movq %r15, %rdi
leaq 0x3807(%rip), %rdx      # 0xb979
jmp 0x81bd
leaq 0x3a5e(%rip), %rdi      # 0xbbd9
jmp 0x81ce
leaq 0x3829(%rip), %rdi      # 0xb9ad
jmp 0x81ce
leaq 0x3694(%rip), %rdi      # 0xb821
jmp 0x81ce
movsd 0x3131(%rip), %xmm0     # 0xb2c8
subsd 0xbd49(%rip), %xmm0     # 0x13ee8
mulsd 0x3161(%rip), %xmm0     # 0xb308
movl $0x64, %esi
leaq -0x90(%rbp), %r15
movq %r15, %rdi
leaq 0x37d6(%rip), %rdx      # 0xb993
movb $0x1, %al
callq 0x20e0
movq %r15, %rdi
leaq 0x37cf(%rip), %r15      # 0xb99d
callq 0x2220
movq 0xd60e(%rip), %rcx      # 0x157e8
movl 0xc050(%rip), %edx      # 0x14230
addl %r14d, %edx
incl %edx
leaq 0x1(%r14), %rsi
movslq %edx, %rdx
movq %rax, (%rcx,%rdx,8)
movslq 0xd5a9(%rip), %rax      # 0x157a0
addq $0x4, %rbx
movq %rsi, %r14
cmpq %rax, %rsi
jl 0x8087
jmp 0x8212
leaq 0x367f(%rip), %rdi      # 0xb88f
jmp 0x81ce
movl $0x1, 0xd5d4(%rip)      # 0x157f0
xorl %edi, %edi
callq 0x82ce
movslq 0xc8d6(%rip), %rdx      # 0x14b00
testq %rdx, %rdx
jle 0x824e
leaq 0xd5ca(%rip), %rax      # 0x15800
movslq 0xbff3(%rip), %rcx      # 0x14230
xorl %esi, %esi
cmpq %rcx, %rsi
setle (%rsi,%rax)
incq %rsi
cmpq %rsi, %rdx
jne 0x823f
movq 0xd593(%rip), %rdi      # 0x157e8
movl 0xd585(%rip), %esi      # 0x157e0
leaq 0xd59e(%rip), %rcx      # 0x15800
callq 0x4789
movl 0xd573(%rip), %ecx      # 0x157e0
testl %ecx, %ecx
jle 0x82b4
xorl %ebx, %ebx
movl 0xc887(%rip), %eax      # 0x14b00
testl %eax, %eax
jle 0x82ae
xorl %r14d, %r14d
imull %ebx, %eax
cltq
shlq $0x3, %rax
addq 0xd558(%rip), %rax      # 0x157e8
movq (%rax,%r14,8), %rdi
callq 0x2040
incq %r14
movslq 0xc85d(%rip), %rax      # 0x14b00
cmpq %rax, %r14
jl 0x8280
movl 0xd532(%rip), %ecx      # 0x157e0
incl %ebx
cmpl %ecx, %ebx
jl 0x8279
movq 0xd52d(%rip), %rdi      # 0x157e8
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2040