// File: /workspace/github_c_makefile_star2_O0/georgeweigt[P]sassafras/sassafras.c
// Function: proc_reg_regress
void
proc_reg_regress(void)
{
	int i, x;

	nrow = dataset->nobs;

	// determine the number of design matrix columns

	if (noint)
		ncol = 0;
	else
		ncol = 1;

	for (i = 0; i < num_x; i++) {
		x = xtab[i];
		if (dataset->spec[x].ltab == NULL)
			ncol++;
		else
			ncol += dataset->spec[x].num_levels;
	}

	xfree(Z);
	xfree(Y);
	xfree(Yhat);
	xfree(B);
	xfree(SE);
	xfree(TVAL);
	xfree(PVAL);
	xfree(GG);
	xfree(TT);
	xfree(XX);

	Z = xmalloc(ncol * sizeof (int));
	Y = xmalloc(nrow * sizeof (double));
	Yhat = xmalloc(nrow * sizeof (double));
	B = xmalloc(ncol * sizeof (double));
	SE = xmalloc(ncol * sizeof (double));
	TVAL = xmalloc(ncol * sizeof (double));
	PVAL = xmalloc(ncol * sizeof (double));
	GG = xmalloc(ncol * ncol * sizeof (double));
	TT = xmalloc(ncol * ncol * sizeof (double));
	XX = xmalloc(nrow * ncol * sizeof (double));

	proc_reg_compute_X();

	npar = ncol;

	for (i = 0; i < ncol; i++)
		Z[i] = 0;

	proc_reg_compute_T();

	// if singular then put in columns one by one

	if (proc_reg_compute_G() == -1) {
		npar = 0;
		for (i = 0; i < ncol; i++)
			Z[i] = 1;
		for (i = 0; i < ncol; i++) {
			npar++;
			Z[i] = 0;
			proc_reg_compute_T();
			if (proc_reg_compute_G() == -1) {
				npar--;
				Z[i] = 1;
			}
		}

		// did last column get zapped?

		if (Z[ncol - 1]) {
			proc_reg_compute_T();
			proc_reg_compute_G();
		}
	}

	// sanity check

	if (npar < 1 || npar >= nrow) {
		snprintf(errbuf, ERRBUFLEN, "Regression model kaput, p = %d, n = %d, must have 0 < p < n", npar, nrow);
		stop(errbuf);
	}

	proc_reg_compute_B();

	proc_reg_compute_Yhat();

	proc_reg_compute_mse();

	proc_reg_compute_SE();

	proc_reg_compute_TVAL();

	proc_reg_compute_PVAL();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq 0xc739(%rip), %rax      # 0x17eb8
movl 0x14(%rax), %eax
movl %eax, 0xe038(%rip)      # 0x197c0
cmpl $0x0, 0xe269(%rip)      # 0x199f8
je 0xb79d
movl $0x0, 0xd345(%rip)      # 0x18ae0
jmp 0xb7a7
movl $0x1, 0xd339(%rip)      # 0x18ae0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0xe239(%rip), %eax      # 0x199f0
jge 0xb82a
movslq -0x4(%rbp), %rcx
leaq 0xcf4c(%rip), %rax      # 0x18710
movl (%rax,%rcx,4), %eax
movl %eax, -0x8(%rbp)
movq 0xc6e7(%rip), %rax      # 0x17eb8
addq $0x20, %rax
movslq -0x8(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
cmpq $0x0, 0x10(%rax)
jne 0xb7f8
movl 0xd2f3(%rip), %eax      # 0x18ae0
addl $0x1, %eax
movl %eax, 0xd2ea(%rip)      # 0x18ae0
jmp 0xb81d
movq 0xc6b9(%rip), %rax      # 0x17eb8
addq $0x20, %rax
movslq -0x8(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
addl 0xd2c9(%rip), %eax      # 0x18ae0
movl %eax, 0xd2c3(%rip)      # 0x18ae0
jmp 0xb81f
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xb7ae
movq 0xe35f(%rip), %rdi      # 0x19b90
callq 0x91b0
movq 0xd293(%rip), %rdi      # 0x18ad0
callq 0x91b0
movq 0xd28f(%rip), %rdi      # 0x18ad8
callq 0x91b0
movq 0xd25b(%rip), %rdi      # 0x18ab0
callq 0x91b0
movq 0xe337(%rip), %rdi      # 0x19b98
callq 0x91b0
movq 0xe333(%rip), %rdi      # 0x19ba0
callq 0x91b0
movq 0xe32f(%rip), %rdi      # 0x19ba8
callq 0x91b0
movq 0xd233(%rip), %rdi      # 0x18ab8
callq 0x91b0
movq 0xd22f(%rip), %rdi      # 0x18ac0
callq 0x91b0
movq 0xd22b(%rip), %rdi      # 0x18ac8
callq 0x91b0
movslq 0xd237(%rip), %rax      # 0x18ae0
shlq $0x2, %rax
movl %eax, %edi
callq 0x2da0
movq %rax, 0xe2d5(%rip)      # 0x19b90
movslq 0xdefe(%rip), %rax      # 0x197c0
shlq $0x3, %rax
movl %eax, %edi
callq 0x2da0
movq %rax, 0xd1fc(%rip)      # 0x18ad0
movslq 0xdee5(%rip), %rax      # 0x197c0
shlq $0x3, %rax
movl %eax, %edi
callq 0x2da0
movq %rax, 0xd1eb(%rip)      # 0x18ad8
movslq 0xd1ec(%rip), %rax      # 0x18ae0
shlq $0x3, %rax
movl %eax, %edi
callq 0x2da0
movq %rax, 0xd1aa(%rip)      # 0x18ab0
movslq 0xd1d3(%rip), %rax      # 0x18ae0
shlq $0x3, %rax
movl %eax, %edi
callq 0x2da0
movq %rax, 0xe279(%rip)      # 0x19b98
movslq 0xd1ba(%rip), %rax      # 0x18ae0
shlq $0x3, %rax
movl %eax, %edi
callq 0x2da0
movq %rax, 0xe268(%rip)      # 0x19ba0
movslq 0xd1a1(%rip), %rax      # 0x18ae0
shlq $0x3, %rax
movl %eax, %edi
callq 0x2da0
movq %rax, 0xe257(%rip)      # 0x19ba8
movl 0xd189(%rip), %eax      # 0x18ae0
imull 0xd182(%rip), %eax      # 0x18ae0
cltq
shlq $0x3, %rax
movl %eax, %edi
callq 0x2da0
movq %rax, 0xd146(%rip)      # 0x18ab8
movl 0xd168(%rip), %eax      # 0x18ae0
imull 0xd161(%rip), %eax      # 0x18ae0
cltq
shlq $0x3, %rax
movl %eax, %edi
callq 0x2da0
movq %rax, 0xd12d(%rip)      # 0x18ac0
movl 0xde27(%rip), %eax      # 0x197c0
imull 0xd140(%rip), %eax      # 0x18ae0
cltq
shlq $0x3, %rax
movl %eax, %edi
callq 0x2da0
movq %rax, 0xd114(%rip)      # 0x18ac8
callq 0xc860
movl 0xd121(%rip), %eax      # 0x18ae0
movl %eax, 0xd073(%rip)      # 0x18a38
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0xd10b(%rip), %eax      # 0x18ae0
jge 0xb9f4
movq 0xe1b2(%rip), %rax      # 0x19b90
movslq -0x4(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xb9cc
callq 0xcad0
callq 0xcc20
cmpl $-0x1, %eax
jne 0xbad5
movl $0x0, 0xd027(%rip)      # 0x18a38
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0xd0bf(%rip), %eax      # 0x18ae0
jge 0xba40
movq 0xe166(%rip), %rax      # 0x19b90
movslq -0x4(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xba18
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0xd090(%rip), %eax      # 0x18ae0
jge 0xbab0
movl 0xcfe0(%rip), %eax      # 0x18a38
addl $0x1, %eax
movl %eax, 0xcfd7(%rip)      # 0x18a38
movq 0xe128(%rip), %rax      # 0x19b90
movslq -0x4(%rbp), %rcx
movl $0x0, (%rax,%rcx,4)
callq 0xcad0
callq 0xcc20
cmpl $-0x1, %eax
jne 0xbaa3
movl 0xcfb0(%rip), %eax      # 0x18a38
addl $-0x1, %eax
movl %eax, 0xcfa7(%rip)      # 0x18a38
movq 0xe0f8(%rip), %rax      # 0x19b90
movslq -0x4(%rbp), %rcx
movl $0x1, (%rax,%rcx,4)
jmp 0xbaa5
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0xba47
movq 0xe0d9(%rip), %rax      # 0x19b90
movl 0xd023(%rip), %ecx      # 0x18ae0
subl $0x1, %ecx
movslq %ecx, %rcx
cmpl $0x0, (%rax,%rcx,4)
je 0xbad3
callq 0xcad0
callq 0xcc20
jmp 0xbad5
cmpl $0x1, 0xcf5c(%rip)      # 0x18a38
jl 0xbaec
movl 0xcf54(%rip), %eax      # 0x18a38
cmpl 0xdcd6(%rip), %eax      # 0x197c0
jl 0xbb1f
movl 0xcf46(%rip), %ecx      # 0x18a38
movl 0xdcc7(%rip), %r8d      # 0x197c0
leaq 0x7da0(%rip), %rdi      # 0x138a0
movl $0x7d0, %esi            # imm = 0x7D0
leaq 0x3e43(%rip), %rdx      # 0xf94f
movb $0x0, %al
callq 0x20c0
leaq 0x7d86(%rip), %rdi      # 0x138a0
callq 0x2790
callq 0xd2e0
callq 0xd480
callq 0xd550
callq 0xd820
callq 0xd890
callq 0xd8f0
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)