// File: /workspace/github_c_makefile_star2_O1/georgeweigt[P]sassafras/sassafras.c
// Function: run_proc_print
void
run_proc_print(void)
{
	int i, j, nobs, w, x;
	double d;
	char **a, *s;

	print_title();

	nobs = dataset->nobs;

	// print all variables if not specified with VAR

	if (nvar == 0) {
		nvar = dataset->nvar;
		for (i = 0; i < nvar; i++)
			var[i] = i;
	}

	// create array

	a = (char **) xmalloc((nobs + 1) * (nvar + 1) * sizeof (char *));

	// column names

	A(0, 0) = strdup("Obs");

	for (j = 0; j < nvar; j++) {
		x = var[j];
		A(0, j + 1) = strdup(dataset->spec[x].name);
	}

	// for each row

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

		// observation number

		snprintf(bigbuf, BIGBUFLEN, "%d", i + 1);

		A(i + 1, 0) = strdup(bigbuf);

		// for each variable

		for (j = 0; j < nvar; j++) {

			x = var[j];

			d = dataset->spec[x].v[i];

			if (isnan(d))
				s = ".";
			else {
				if (dataset->spec[x].ltab == NULL) {
					w = dataset->spec[x].w;
					snprintf(bigbuf, BIGBUFLEN, fmt[w], d);
					s = bigbuf;
				} else
					s = dataset->spec[x].ltab[(int) d];
			}

			A(i + 1, j + 1) = strdup(s);
		}
	}

	s = (char *) xmalloc(nvar + 1);

	s[0] = 0; // observation numbers are right justified

	for (j = 0; j < nvar; j++) {
		x = var[j];
		if (dataset->spec[x].ltab == NULL)
			s[j + 1] = 0;
		else
			s[j + 1] = 1;
	}

	print_table(a, nobs + 1, nvar + 1, s);

	free(s);

	for (i = 0; i < nobs + 1; i++)
		for (j = 0; j < nvar + 1; j++)
			free(A(i, j));

	free(a);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
callq 0x4a74
movq 0xb51b(%rip), %rax      # 0x13ec8
movl 0x14(%rax), %r13d
cmpl $0x0, 0xba08(%rip)      # 0x143c0
jne 0x89e0
movslq 0x10(%rax), %rax
movl %eax, 0xb9fc(%rip)      # 0x143c0
testq %rax, %rax
jle 0x89e0
leaq 0xb860(%rip), %rcx      # 0x14230
xorl %edx, %edx
movl %edx, (%rcx)
incq %rdx
addq $0x4, %rcx
cmpq %rdx, %rax
jne 0x89d2
leal 0x1(%r13), %eax
movl 0xb9d6(%rip), %edi      # 0x143c0
incl %edi
movl %eax, -0x3c(%rbp)
imull %eax, %edi
shll $0x3, %edi
callq 0x2bda
movq %rax, %r12
leaq 0x2ffd(%rip), %rdi      # 0xba01
callq 0x2210
movq %rax, (%r12)
movslq 0xb9ac(%rip), %rbx      # 0x143c0
testq %rbx, %rbx
jle 0x8a51
movq 0xb4a8(%rip), %r14      # 0x13ec8
addq $0x20, %r14
shlq $0x2, %rbx
xorl %r15d, %r15d
leaq 0xb7fe(%rip), %rax      # 0x14230
movslq (%r15,%rax), %rax
leaq (%rax,%rax,4), %rax
movq (%r14,%rax,8), %rdi
callq 0x2210
movq %rax, 0x8(%r12,%r15,2)
addq $0x4, %r15
cmpq %r15, %rbx
jne 0x8a2b
movq %r12, -0x38(%rbp)
testl %r13d, %r13d
jle 0x8ba5
movq -0x38(%rbp), %rax
leaq 0x8(%rax), %r12
movl $0x1, -0x2c(%rbp)
leaq 0x2e59(%rip), %r14      # 0xb8cd
xorl %eax, %eax
movq %r13, -0x48(%rbp)
movq %rax, %r13
leaq 0x1(%rax), %r15
movl $0xfa0, %esi            # imm = 0xFA0
leaq 0xa433(%rip), %rbx      # 0x12ec0
movq %rbx, %rdi
leaq 0x29bd(%rip), %rdx      # 0xb454
movl %r15d, %ecx
xorl %eax, %eax
callq 0x20e0
movq %rbx, %rdi
callq 0x2210
movl 0xb911(%rip), %ecx      # 0x143c0
leal 0x1(%rcx), %edx
movq %r15, -0x50(%rbp)
imull %r15d, %edx
movslq %edx, %rdx
movq -0x38(%rbp), %rsi
movq %rax, (%rsi,%rdx,8)
testl %ecx, %ecx
jle 0x8b91
movq %r13, %r15
movslq -0x2c(%rbp), %rax
movq %rax, -0x60(%rbp)
leaq 0xb751(%rip), %r13      # 0x14230
xorl %ebx, %ebx
movq %r15, -0x58(%rbp)
movslq (%r13), %rcx
movq 0xb3d8(%rip), %rax      # 0x13ec8
leaq (%rcx,%rcx,4), %rcx
movq 0x40(%rax,%rcx,8), %rdx
movsd (%rdx,%r15,8), %xmm0
ucomisd %xmm0, %xmm0
movq %r14, %rdi
jp 0x8b5e
leaq (%rax,%rcx,8), %rcx
addq $0x20, %rcx
movq 0x10(%rcx), %rax
testq %rax, %rax
je 0x8b26
cvttsd2si %xmm0, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
jmp 0x8b5e
movslq 0x18(%rcx), %rax
leaq 0x65ff(%rip), %rcx      # 0xf130
movq (%rcx,%rax,8), %rdx
movl $0xfa0, %esi            # imm = 0xFA0
movq %r14, %r15
movq %r12, %r14
leaq 0xa379(%rip), %r12      # 0x12ec0
movq %r12, %rdi
movb $0x1, %al
callq 0x20e0
movq %r12, %rdi
movq %r14, %r12
movq %r15, %r14
movq -0x58(%rbp), %r15
callq 0x2210
movslq 0xb856(%rip), %rcx      # 0x143c0
incq %rcx
imulq -0x60(%rbp), %rcx
leaq (%r12,%rcx,8), %rcx
movq %rax, (%rcx,%rbx,8)
incq %rbx
movslq 0xb83c(%rip), %rax      # 0x143c0
addq $0x4, %r13
cmpq %rax, %rbx
jl 0x8ae5
incl -0x2c(%rbp)
movq -0x48(%rbp), %r13
movq -0x50(%rbp), %rax
cmpq %r13, %rax
jne 0x8a7a
movl 0xb815(%rip), %edi      # 0x143c0
incl %edi
callq 0x2bda
movq %rax, %r15
movb $0x0, (%rax)
movslq 0xb801(%rip), %rdx      # 0x143c0
testq %rdx, %rdx
jle 0x8c03
movq 0xb2fd(%rip), %rax      # 0x13ec8
addq $0x20, %rax
movq %r15, %rcx
incq %rcx
leaq (,%rdx,4), %rsi
xorl %edi, %edi
leaq 0xb64a(%rip), %r8       # 0x14230
movslq (%rdi,%r8), %r9
leaq (%r9,%r9,4), %r9
cmpq $0x0, 0x10(%rax,%r9,8)
setne (%rcx)
incq %rcx
addq $0x4, %rdi
cmpq %rdi, %rsi
jne 0x8be6
incl %edx
movq -0x38(%rbp), %r12
movq %r12, %rdi
movl -0x3c(%rbp), %esi
movq %r15, %rcx
callq 0x47e3
movq %r15, %rdi
callq 0x2040
testl %r13d, %r13d
js 0x8c65
xorl %ebx, %ebx
movl 0xb794(%rip), %eax      # 0x143c0
testl %eax, %eax
js 0x8c5b
movq $-0x1, %r14
incl %eax
imull %ebx, %eax
cltq
leaq (%r12,%rax,8), %rax
movq 0x8(%rax,%r14,8), %rdi
callq 0x2040
movslq 0xb76d(%rip), %rax      # 0x143c0
incq %r14
cmpq %rax, %r14
jl 0x8c37
leal 0x1(%rbx), %eax
cmpl %r13d, %ebx
movl %eax, %ebx
jne 0x8c26
movq %r12, %rdi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2040