// File: /workspace/github_c_makefile_star2_O0/georgeweigt[P]sassafras/sassafras.c
// Function: proc_anova_add_interaction
void
proc_anova_add_interaction(int n)
{
	int i, j, k, len, m, x;
	char *name, *s;
	double d;

	len = n; // accommodate n - 1 asterisks and 1 end of line

	for (i = 0; i < n; i++) {
		x = xx[i];
		s = dataset->spec[x].name;
		len += strlen(s);
	}

	name = (char *) xmalloc(len);

	name[0] = 0;

	for (i = 0; i < n; i++) {
		if (i > 0)
			strcat(name, "*");
		x = xx[i];
		s = dataset->spec[x].name;
		strcat(name, s);
	}

	// is it already in the data set?

	for (m = 0; m < dataset->nvar; m++)
		if (strcmp(name, dataset->spec[m].name) == 0)
			break;

	if (m < dataset->nvar)
		free(name);
	else {
		if (dataset->nvar == MAXVAR)
			stop("Too many variable names");

		m = dataset->nvar++;

		dataset->spec[m].name = name;

		// number of levels

		k = 1;
		for (i = 0; i < n; i++) {
			x = xx[i];
			k *= dataset->spec[x].num_levels;
		}

		dataset->spec[m].ltab = (char **) xmalloc(k * sizeof (char *));
		dataset->spec[m].max_levels = k;
		dataset->spec[m].num_levels = k;
		dataset->spec[m].v = (double *) xmalloc(dataset->max * sizeof (double));

		proc_anova_create_interaction_level_names(n);

		// data values

		for (i = 0; i < dataset->nobs; i++) {
			d = 0;
			for (j = 0; j < n; j++) {
				x = xx[j];
				d = d * dataset->spec[x].num_levels + dataset->spec[x].v[i];
			}
			dataset->spec[m].v[i] = d;
		}
	}

	// is it already an explanatory variable?

	for (i = 0; i < nx; i++)
		if (xtab[i] == m)
			return;

	if (nx == MAXVAR)
		stop("Too many explanatory variables");

	xtab[nx++] = m;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movl -0x4(%rbp), %eax
movl %eax, -0x14(%rbp)
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x79af
movslq -0x8(%rbp), %rcx
leaq 0x10c15(%rip), %rax     # 0x18580
movl (%rax,%rcx,4), %eax
movl %eax, -0x1c(%rbp)
movq 0x10540(%rip), %rax     # 0x17eb8
addq $0x20, %rax
movslq -0x1c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
callq 0x2090
movq %rax, %rcx
movslq -0x14(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x14(%rbp)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x7958
movl -0x14(%rbp), %edi
callq 0x2da0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movb $0x0, (%rax)
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x7a2d
cmpl $0x0, -0x8(%rbp)
jle 0x79e7
movq -0x28(%rbp), %rdi
leaq 0x7e86(%rip), %rsi      # 0xf868
callq 0x21c0
movslq -0x8(%rbp), %rcx
leaq 0x10b8e(%rip), %rax     # 0x18580
movl (%rax,%rcx,4), %eax
movl %eax, -0x1c(%rbp)
movq 0x104b9(%rip), %rax     # 0x17eb8
addq $0x20, %rax
movslq -0x1c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x21c0
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x79c9
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movq 0x1047a(%rip), %rcx     # 0x17eb8
cmpl 0x10(%rcx), %eax
jge 0x7a79
movq -0x28(%rbp), %rdi
movq 0x1046a(%rip), %rax     # 0x17eb8
addq $0x20, %rax
movslq -0x18(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0x2140
cmpl $0x0, %eax
jne 0x7a6c
jmp 0x7a79
jmp 0x7a6e
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x7a34
movl -0x18(%rbp), %eax
movq 0x10435(%rip), %rcx     # 0x17eb8
cmpl 0x10(%rcx), %eax
jge 0x7a96
movq -0x28(%rbp), %rdi
callq 0x2030
jmp 0x7ca7
movq 0x1041b(%rip), %rax     # 0x17eb8
cmpl $0x64, 0x10(%rax)
jne 0x7aaf
leaq 0x7c62(%rip), %rdi      # 0xf70c
callq 0x2790
movq 0x10402(%rip), %rcx     # 0x17eb8
movl 0x10(%rcx), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, 0x10(%rcx)
movl %eax, -0x18(%rbp)
movq -0x28(%rbp), %rcx
movq 0x103e9(%rip), %rax     # 0x17eb8
addq $0x20, %rax
movslq -0x18(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq %rcx, (%rax)
movl $0x1, -0x10(%rbp)
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x7b33
movslq -0x8(%rbp), %rcx
leaq 0x10a7e(%rip), %rax     # 0x18580
movl (%rax,%rcx,4), %eax
movl %eax, -0x1c(%rbp)
movq 0x103a9(%rip), %rax     # 0x17eb8
addq $0x20, %rax
movslq -0x1c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movl 0xc(%rax), %eax
imull -0x10(%rbp), %eax
movl %eax, -0x10(%rbp)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x7aef
movslq -0x10(%rbp), %rax
shlq $0x3, %rax
movl %eax, %edi
callq 0x2da0
movq %rax, %rcx
movq 0x1036c(%rip), %rax     # 0x17eb8
addq $0x20, %rax
movslq -0x18(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x10(%rax)
movl -0x10(%rbp), %ecx
movq 0x1034f(%rip), %rax     # 0x17eb8
addq $0x20, %rax
movslq -0x18(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0x8(%rax)
movl -0x10(%rbp), %ecx
movq 0x10333(%rip), %rax     # 0x17eb8
addq $0x20, %rax
movslq -0x18(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movl %ecx, 0xc(%rax)
movq 0x1031a(%rip), %rax     # 0x17eb8
movslq 0x18(%rax), %rax
shlq $0x3, %rax
movl %eax, %edi
callq 0x2da0
movq %rax, %rcx
movq 0x10301(%rip), %rax     # 0x17eb8
addq $0x20, %rax
movslq -0x18(%rbp), %rdx
imulq $0x28, %rdx, %rdx
addq %rdx, %rax
movq %rcx, 0x20(%rax)
movl -0x4(%rbp), %edi
callq 0x7d40
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
movq 0x102d5(%rip), %rcx     # 0x17eb8
cmpl 0x14(%rcx), %eax
jge 0x7ca5
xorps %xmm0, %xmm0
movsd %xmm0, -0x38(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x7c6f
movslq -0xc(%rbp), %rcx
leaq 0x10972(%rip), %rax     # 0x18580
movl (%rax,%rcx,4), %eax
movl %eax, -0x1c(%rbp)
movsd -0x38(%rbp), %xmm0
movq 0x10298(%rip), %rax     # 0x17eb8
addq $0x20, %rax
movslq -0x1c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
cvtsi2sdl 0xc(%rax), %xmm2
movq 0x1027d(%rip), %rax     # 0x17eb8
addq $0x20, %rax
movslq -0x1c(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movslq -0x8(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x38(%rbp)
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x7bfb
movsd -0x38(%rbp), %xmm0
movq 0x1023d(%rip), %rax     # 0x17eb8
addq $0x20, %rax
movslq -0x18(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x20(%rax), %rax
movslq -0x8(%rbp), %rcx
movsd %xmm0, (%rax,%rcx,8)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x7bd9
jmp 0x7ca7
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
cmpl 0x10721(%rip), %eax     # 0x183d8
jge 0x7cdb
movslq -0x8(%rbp), %rcx
leaq 0x10a4c(%rip), %rax     # 0x18710
movl (%rax,%rcx,4), %eax
cmpl -0x18(%rbp), %eax
jne 0x7cce
jmp 0x7d11
jmp 0x7cd0
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x7cae
cmpl $0x64, 0x106f6(%rip)    # 0x183d8
jne 0x7cf0
leaq 0x7988(%rip), %rdi      # 0xf673
callq 0x2790
movl -0x18(%rbp), %edx
movl 0x106df(%rip), %eax     # 0x183d8
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, 0x106d4(%rip)     # 0x183d8
movslq %eax, %rcx
leaq 0x10a02(%rip), %rax     # 0x18710
movl %edx, (%rax,%rcx,4)
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)