LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: eval_roots
void
eval_roots(struct atom *p1)
{
	push(cadr(p1));
	evalf();

	p1 = cddr(p1);

	if (iscons(p1)) {
		push(car(p1));
		evalf();
	} else
		push_symbol(X_LOWER);

	roots();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x8(%rdi), %r14
cmpb $0x1, 0x10(%rdi)
leaq 0x24a28(%rip), %r15     # 0x3e9f0
movq %r15, %rax
cmoveq %r14, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %r15, %rax
movq (%rax), %rdi
callq 0x861b
callq 0x8fbb
cmpb $0x1, 0x10(%rbx)
cmovneq %r15, %r14
movq (%r14), %rax
leaq 0x8(%rax), %rcx
cmpb $0x1, 0x10(%rax)
cmovneq %r15, %rcx
movq (%rcx), %rax
cmpb $0x1, 0x10(%rax)
jne 0x1a016
movq (%rax), %rdi
callq 0x861b
callq 0x8fbb
jmp 0x1a022
movq 0x2691b(%rip), %rdi     # 0x40938
callq 0x861b
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1a031
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: reduce
void
reduce(int h, int n, struct atom *A)
{
	int i;

	for (i = n - 1; i > 0; i--) {
		push(A);
		push(stack[h + i]);
		multiply();
		push(stack[h + i - 1]);
		add();
		stack[h + i - 1] = pop();
	}

	if (!iszero(stack[h]))
		stopf("roots: residual error"); // not a root

	// move

	for (i = 0; i < n - 1; i++)
		stack[h + i] = stack[h + i + 1];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r14
movl %esi, %ebx
decl %ebx
movslq %ebx, %r13
movslq %edi, %r15
leaq 0x2717f(%rip), %rax     # 0x415b0
leaq (%rax,%r15,8), %r12
addq $-0x8, %r12
testq %r13, %r13
jle 0x1a471
movq %r14, %rdi
callq 0x861b
movq 0x8(%r12,%r13,8), %rdi
callq 0x861b
callq 0x9fae
movq (%r12,%r13,8), %rdi
callq 0x861b
callq 0xa1f6
callq 0x868d
movq %rax, (%r12,%r13,8)
decq %r13
jmp 0x1a439
leaq 0x27138(%rip), %r14     # 0x415b0
movq (%r14,%r15,8), %rdi
callq 0xa641
testl %eax, %eax
je 0x1a4b6
xorl %eax, %eax
testl %ebx, %ebx
cmovlel %eax, %ebx
leaq (%r14,%r15,8), %rcx
addq $0x8, %rcx
cmpq %rax, %rbx
je 0x1a4a7
movq (%rcx,%rax,8), %rdx
movq %rdx, -0x8(%rcx,%rax,8)
incq %rax
jmp 0x1a494
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd468(%rip), %rdi      # 0x27925
callq 0x7756
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: divisors
void
divisors(int n)
{
	int h, i, k;

	h = tos;

	factor_int(n);

	k = tos;

	// contruct divisors by recursive descent

	push_integer(1);

	divisors_nib(h, k);

	// move

	n = tos - k;

	for (i = 0; i < n; i++)
		stack[h + i] = stack[k + i];

	tos = h + n; // pop all
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movslq 0x1ddd8(%rip), %rbx     # 0x382a8
callq 0x1a5a9
movslq 0x1ddcc(%rip), %r14     # 0x382a8
pushq $0x1
popq %rdi
callq 0xa426
movl %ebx, %edi
movl %r14d, %esi
callq 0x1a626
movl 0x1ddb4(%rip), %eax     # 0x382a8
subl %r14d, %eax
xorl %ecx, %ecx
testl %eax, %eax
movl $0x0, %edx
cmovgl %eax, %edx
shlq $0x3, %r14
movq %rbx, %rsi
shlq $0x3, %rsi
leaq 0x2709b(%rip), %rdi     # 0x415b0
cmpq %rcx, %rdx
je 0x1a52f
leaq (%r14,%rcx,8), %r8
movq (%rdi,%r8), %r8
leaq (%rsi,%rcx,8), %r9
movq %r8, (%rdi,%r9)
incq %rcx
jmp 0x1a515
addl %ebx, %eax
movl %eax, 0x1dd71(%rip)     # 0x382a8
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: horner
void
horner(int h, int n, struct atom *A)
{
	int i;

	push(stack[h + n - 1]);

	for (i = n - 2; i >= 0; i--) {
		push(A);
		multiply();
		push(stack[h + i]);
		add();
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdx, %rbx
movl %esi, %r14d
movl %edi, %r15d
leal -0x1(%r15,%r14), %eax
cltq
leaq 0x27052(%rip), %r12     # 0x415b0
movq (%r12,%rax,8), %rdi
callq 0x861b
addl $-0x2, %r14d
movslq %r14d, %r14
movslq %r15d, %rax
addq %r14, %rax
leaq (%r12,%rax,8), %r15
testq %r14, %r14
js 0x1a5a0
movq %rbx, %rdi
callq 0x861b
callq 0x9fae
movq (%r15), %rdi
callq 0x861b
callq 0xa1f6
decq %r14
addq $-0x8, %r15
jmp 0x1a578
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: factor_int
void
factor_int(int n)
{
	int d, k, m;

	n = abs(n);

	if (n < 2)
		return;

	for (k = 0; k < NPRIME; k++) {

		d = primetab[k];

		m = 0;

		while (n % d == 0) {
			n /= d;
			m++;
		}

		if (m == 0)
			continue;

		push_integer(d);
		push_integer(m);

		if (n == 1)
			return;
	}

	push_integer(n);
	push_integer(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edi, %ebx
negl %ebx
cmovsl %edi, %ebx
cmpl $0x2, %ebx
jae 0x1a5c9
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %r15d, %r15d
leaq 0x180ad(%rip), %r12     # 0x32680
cmpq $0x12b8, %r15           # imm = 0x12B8
je 0x1a60f
movl (%r12,%r15,4), %edi
xorl %r14d, %r14d
movl %ebx, %eax
cltd
idivl %edi
testl %edx, %edx
jne 0x1a5f3
incl %r14d
movl %eax, %ebx
jmp 0x1a5e3
testl %r14d, %r14d
je 0x1a60a
callq 0xa426
movl %r14d, %edi
callq 0xa426
cmpl $0x1, %ebx
je 0x1a5c0
incq %r15
jmp 0x1a5d3
movl %ebx, %edi
callq 0xa426
pushq $0x1
popq %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xa426
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: divisors_nib
void
divisors_nib(int h, int k)
{
	int i, n;
	struct atom *ACCUM, *BASE, *EXPO;

	if (h == k)
		return;

	ACCUM = pop();

	BASE = stack[h + 0];
	EXPO = stack[h + 1];

	push(EXPO);
	n = pop_integer();

	for (i = 0; i <= n; i++) {
		push(ACCUM);
		push(BASE);
		push_integer(i);
		power();
		multiply();
		divisors_nib(h + 2, k);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %esi, -0x2c(%rbp)
cmpl %esi, %edi
jne 0x1a64a
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %edi, %r14d
callq 0x868d
movq %rax, %r15
movslq %r14d, %rax
leaq 0x26f51(%rip), %rcx     # 0x415b0
movq (%rcx,%rax,8), %r12
movq 0x8(%rcx,%rax,8), %rdi
callq 0x861b
callq 0xd9d9
movl %eax, %r13d
addl $0x2, %r14d
xorl %ebx, %ebx
cmpl %r13d, %ebx
jg 0x1a63b
movq %r15, %rdi
callq 0x861b
movq %r12, %rdi
callq 0x861b
movl %ebx, %edi
callq 0xa426
callq 0x9a87
callq 0x9fae
movl %r14d, %edi
movl -0x2c(%rbp), %esi
callq 0x1a626
incl %ebx
jmp 0x1a67b
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: rotate_h
void
rotate_h(struct atom *PSI, uint32_t c, int n)
{
	int i;
	n = 1 << n;
	for (i = 0; i < NUMQBITS; i++) {
		if ((i & c) != c)
			continue;
		if (i & n) {
			push(KET0);
			push(KET1);
			add();
			push_rational(1, 2);
			sqrtfunc();
			multiply();
			push(KET0);
			push(KET1);
			subtract();
			push_rational(1, 2);
			sqrtfunc();
			multiply();
			KET1 = pop();
			KET0 = pop();
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ecx
pushq $0x1
popq %r13
shll %cl, %r13d
movq %rdi, %r15
xorl %ebx, %ebx
movl %esi, -0x30(%rbp)
movl %r13d, -0x2c(%rbp)
pushq $0x1
popq %r14
movq (%r15), %rax
movslq 0x64(%rax), %rcx
cmpq %rcx, %rbx
jge 0x1aaba
movl %ebx, %ecx
notl %ecx
testl %ecx, %esi
setne %cl
testl %ebx, %r13d
sete %dl
orb %cl, %dl
jne 0x1aab2
movl %r13d, %ecx
xorl %ebx, %ecx
movslq %ecx, %r12
movq 0x68(%rax,%r12,8), %rdi
callq 0x861b
movq (%r15), %rax
movq 0x68(%rax,%rbx,8), %rdi
callq 0x861b
callq 0xa1f6
movl %r14d, %edi
pushq $0x2
popq %r13
movl %r13d, %esi
callq 0x9a47
callq 0xba06
callq 0x9fae
movq (%r15), %rax
movq 0x68(%rax,%r12,8), %rdi
callq 0x861b
movq (%r15), %rax
movq 0x68(%rax,%rbx,8), %rdi
callq 0x861b
callq 0xb07f
movl %r14d, %edi
movl %r13d, %esi
callq 0x9a47
callq 0xba06
callq 0x9fae
callq 0x868d
movq (%r15), %rcx
movq %rax, 0x68(%rcx,%rbx,8)
callq 0x868d
movl -0x2c(%rbp), %r13d
movl -0x30(%rbp), %esi
movq (%r15), %rcx
movq %rax, 0x68(%rcx,%r12,8)
incq %rbx
jmp 0x1a9f9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: rotate_p
void
rotate_p(struct atom *PSI, struct atom *PHASE, uint32_t c, int n)
{
	int i;
	n = 1 << n;
	for (i = 0; i < NUMQBITS; i++) {
		if ((i & c) != c)
			continue;
		if (i & n) {
			push(KET1);
			push(PHASE);
			multiply();
			KET1 = pop();
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ebx
movq %rsi, %r14
movq %rdi, %r15
pushq $0x1
popq %r12
shll %cl, %r12d
xorl %r13d, %r13d
movq (%r15), %rax
movslq 0x64(%rax), %rcx
cmpq %rcx, %r13
jge 0x1ab2f
movl %r13d, %ecx
notl %ecx
testl %ecx, %ebx
jne 0x1ab2a
movl %r12d, %ecx
andl %r13d, %ecx
je 0x1ab2a
movq 0x68(%rax,%r13,8), %rdi
callq 0x861b
movq %r14, %rdi
callq 0x861b
callq 0x9fae
callq 0x868d
movq (%r15), %rcx
movq %rax, 0x68(%rcx,%r13,8)
incq %r13
jmp 0x1aae9
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: rotate_q
void
rotate_q(struct atom *PSI, int n)
{
	int i, j;
	struct atom *PHASE;
	for (i = n; i >= 0; i--) {
		rotate_h(PSI, 0, i);
		for (j = 0; j < i; j++) {
			push_rational(1, 2);
			push_integer(i - j);
			power();
			push(imaginaryunit);
			push_symbol(PI);
			evalf(); // in case PI is numerical
			multiply_factors(3);
			expfunc();
			PHASE = pop();
			rotate_p(PSI, PHASE, 1 << j, i);
		}
	}
	for (i = 0; i < (n + 1) / 2; i++)
		rotate_w(PSI, 0, i, n - i);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, -0x30(%rbp)
pushq $0x1
popq %r12
movq %rsi, -0x38(%rbp)
movl %esi, %r14d
testl %r14d, %r14d
js 0x1abf1
xorl %r15d, %r15d
movq -0x30(%rbp), %rdi
xorl %esi, %esi
movl %r14d, %edx
callq 0x1a9d2
movl %r14d, %r13d
movl %r14d, %ebx
subl $0x1, %ebx
jb 0x1abe9
movl %r12d, %edi
pushq $0x2
popq %rsi
callq 0x9a47
movl %r13d, %edi
callq 0xa426
callq 0x9a87
movq 0xe9f2e(%rip), %rdi     # 0x104ad0
callq 0x861b
movq 0x24492(%rip), %rdi     # 0x3f040
callq 0x861b
callq 0x8fbb
pushq $0x3
popq %rdi
callq 0xa04c
callq 0xe4ce
callq 0x868d
movl %r12d, %edx
movl %r15d, %ecx
shll %cl, %edx
movq -0x30(%rbp), %rdi
movq %rax, %rsi
movl %r14d, %ecx
callq 0x1aac9
incl %r15d
movl %ebx, %r13d
jmp 0x1ab7e
decl %r14d
jmp 0x1ab5e
movq -0x38(%rbp), %r14
leal 0x1(%r14), %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
movl %eax, %ebx
xorl %r15d, %r15d
testl %eax, %eax
cmovlel %r15d, %ebx
cmpl %r15d, %ebx
je 0x1ac28
movq -0x30(%rbp), %rdi
xorl %esi, %esi
movl %r15d, %edx
movl %r14d, %ecx
callq 0x1ad25
incl %r15d
decl %r14d
jmp 0x1ac0a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: rotate_v
void
rotate_v(struct atom *PSI, int n)
{
	int i, j;
	struct atom *PHASE;
	for (i = 0; i < (n + 1) / 2; i++)
		rotate_w(PSI, 0, i, n - i);
	for (i = 0; i <= n; i++) {
		for (j = i - 1; j >= 0; j--) {
			push_rational(1, 2);
			push_integer(i - j);
			power();
			push(imaginaryunit);
			push_symbol(PI);
			evalf(); // in case PI is numerical
			multiply_factors(3);
			negate();
			expfunc();
			PHASE = pop();
			rotate_p(PSI, PHASE, 1 << j, i);
		}
		rotate_h(PSI, 0, i);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leal 0x1(%rsi), %eax
pushq $0x2
popq %rcx
cltd
idivl %ecx
movl %eax, %ebx
xorl %r15d, %r15d
testl %eax, %eax
cmovlel %r15d, %ebx
movq %rsi, -0x30(%rbp)
movl %esi, %r12d
cmpl %r15d, %ebx
je 0x1ac80
movq %r14, %rdi
xorl %esi, %esi
movl %r15d, %edx
movl %r12d, %ecx
callq 0x1ad25
incl %r15d
decl %r12d
jmp 0x1ac63
xorl %ebx, %ebx
pushq $0x1
popq %r13
cmpl -0x30(%rbp), %ebx
jg 0x1ad16
movl %r13d, %r12d
movl %ebx, %r15d
testl %r15d, %r15d
jle 0x1ad03
decl %r15d
movl %r13d, %edi
pushq $0x2
popq %rsi
callq 0x9a47
movl %r12d, %edi
callq 0xa426
callq 0x9a87
movq 0xe9e14(%rip), %rdi     # 0x104ad0
callq 0x861b
movq 0x24378(%rip), %rdi     # 0x3f040
callq 0x861b
callq 0x8fbb
pushq $0x3
popq %rdi
callq 0xa04c
callq 0x975f
callq 0xe4ce
callq 0x868d
movl %r13d, %edx
movl %r15d, %ecx
shll %cl, %edx
movq %r14, %rdi
movq %rax, %rsi
movl %ebx, %ecx
callq 0x1aac9
incl %r12d
jmp 0x1ac95
movq %r14, %rdi
xorl %esi, %esi
movl %ebx, %edx
callq 0x1a9d2
incl %ebx
jmp 0x1ac86
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: rotate_w
void
rotate_w(struct atom *PSI, uint32_t c, int m, int n)
{
	int i;
	m = 1 << m;
	n = 1 << n;
	for (i = 0; i < NUMQBITS; i++) {
		if ((i & c) != c)
			continue;
		if ((i & m) && !(i & n)) {
			push(PSI->u.tensor->elem[i]);
			push(PSI->u.tensor->elem[i ^ m ^ n]);
			PSI->u.tensor->elem[i] = pop();
			PSI->u.tensor->elem[i ^ m ^ n] = pop();
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %eax
pushq $0x1
popq %r12
movl %r12d, %r15d
movl %edx, %ecx
shll %cl, %r15d
movl %eax, %ecx
shll %cl, %r12d
movq %rdi, %r14
movl %r12d, %eax
btcl %edx, %eax
movl %eax, -0x2c(%rbp)
xorl %r13d, %r13d
movl %esi, -0x30(%rbp)
movq (%r14), %rax
movslq 0x64(%rax), %rcx
cmpq %rcx, %r13
jge 0x1adc5
movl %r13d, %ecx
notl %ecx
andl %esi, %ecx
testl %r13d, %r15d
setne %dl
movl %r12d, %edi
andl %r13d, %edi
orl %ecx, %edi
sete %cl
andb %dl, %cl
cmpb $0x1, %cl
jne 0x1adc0
movq 0x68(%rax,%r13,8), %rdi
callq 0x861b
movq (%r14), %rax
movl -0x2c(%rbp), %ecx
xorl %r13d, %ecx
movslq %ecx, %rbx
movq 0x68(%rax,%rbx,8), %rdi
callq 0x861b
callq 0x868d
movq (%r14), %rcx
movq %rax, 0x68(%rcx,%r13,8)
callq 0x868d
movl -0x30(%rbp), %esi
movq (%r14), %rcx
movq %rax, 0x68(%rcx,%rbx,8)
incq %r13
jmp 0x1ad58
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: rotate_x
void
rotate_x(struct atom *PSI, uint32_t c, int n)
{
	int i;
	n = 1 << n;
	for (i = 0; i < NUMQBITS; i++) {
		if ((i & c) != c)
			continue;
		if (i & n) {
			push(KET0);
			push(KET1);
			KET0 = pop();
			KET1 = pop();
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ecx
movl %esi, %ebx
movq %rdi, %r14
pushq $0x1
popq %r15
shll %cl, %r15d
xorl %r12d, %r12d
movq (%r14), %rax
movslq 0x64(%rax), %rcx
cmpq %rcx, %r12
jge 0x1ae52
movl %r12d, %ecx
notl %ecx
testl %ecx, %ebx
setne %cl
testl %r12d, %r15d
sete %dl
orb %cl, %dl
jne 0x1ae4d
movl %r15d, %ecx
xorl %r12d, %ecx
movslq %ecx, %r13
movq 0x68(%rax,%r13,8), %rdi
callq 0x861b
movq (%r14), %rax
movq 0x68(%rax,%r12,8), %rdi
callq 0x861b
callq 0x868d
movq (%r14), %rcx
movq %rax, 0x68(%rcx,%r13,8)
callq 0x868d
movq (%r14), %rcx
movq %rax, 0x68(%rcx,%r12,8)
incq %r12
jmp 0x1adf3
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: rotate_y
void
rotate_y(struct atom *PSI, uint32_t c, int n)
{
	int i;
	n = 1 << n;
	for (i = 0; i < NUMQBITS; i++) {
		if ((i & c) != c)
			continue;
		if (i & n) {
			push(imaginaryunit);
			push(KET0);
			multiply();
			push(imaginaryunit);
			negate();
			push(KET1);
			multiply();
			KET0 = pop();
			KET1 = pop();
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %ecx
movl %esi, %ebx
movq %rdi, %r14
pushq $0x1
popq %r15
shll %cl, %r15d
xorl %r12d, %r12d
movq (%r14), %rax
movslq 0x64(%rax), %rax
cmpq %rax, %r12
jge 0x1af10
movl %r12d, %eax
notl %eax
testl %eax, %ebx
setne %al
testl %r12d, %r15d
sete %cl
orb %al, %cl
jne 0x1af08
movq 0xe9c25(%rip), %rdi     # 0x104ad0
callq 0x861b
movq (%r14), %rax
movl %r15d, %ecx
xorl %r12d, %ecx
movslq %ecx, %r13
movq 0x68(%rax,%r13,8), %rdi
callq 0x861b
callq 0x9fae
movq 0xe9bfe(%rip), %rdi     # 0x104ad0
callq 0x861b
callq 0x975f
movq (%r14), %rax
movq 0x68(%rax,%r12,8), %rdi
callq 0x861b
callq 0x9fae
callq 0x868d
movq (%r14), %rcx
movq %rax, 0x68(%rcx,%r13,8)
callq 0x868d
movq (%r14), %rcx
movq %rax, 0x68(%rcx,%r12,8)
incq %r12
jmp 0x1ae80
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: rotate_z
void
rotate_z(struct atom *PSI, uint32_t c, int n)
{
	int i;
	n = 1 << n;
	for (i = 0; i < NUMQBITS; i++) {
		if ((i & c) != c)
			continue;
		if (i & n) {
			push(KET1);
			negate();
			KET1 = pop();
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ecx
movl %esi, %ebx
movq %rdi, %r14
pushq $0x1
popq %r15
shll %cl, %r15d
xorl %r12d, %r12d
movq (%r14), %rax
movslq 0x64(%rax), %rcx
cmpq %rcx, %r12
jge 0x1af79
movl %r12d, %ecx
notl %ecx
testl %ecx, %ebx
jne 0x1af74
movl %r15d, %ecx
andl %r12d, %ecx
je 0x1af74
movq 0x68(%rax,%r12,8), %rdi
callq 0x861b
callq 0x975f
callq 0x868d
movq (%r14), %rcx
movq %rax, 0x68(%rcx,%r12,8)
incq %r12
jmp 0x1af3b
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: eval_run
void
eval_run(struct atom *p1)
{
	char *buf;
	struct atom *p2;

	push(cadr(p1));
	evalf();
	p1 = pop();
	if (!isstr(p1))
		stopf("run: file name expected");

	p2 = alloc_str();
	buf = read_file(p1->u.str);
	if (buf == NULL)
		stopf("run: cannot read file");
	p2->u.str = buf;

	push(p2); // make visible to garbage collector
	run_buf(buf);
	pop(); // buf is freed on next gc

	push_symbol(NIL); // return value
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpb $0x1, 0x10(%rdi)
leaq 0x8(%rdi), %rax
leaq 0x23a58(%rip), %rcx     # 0x3e9f0
cmovneq %rcx, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmoveq %rax, %rcx
movq (%rcx), %rdi
callq 0x861b
callq 0x8fbb
callq 0x868d
cmpb $0x6, 0x10(%rax)
jne 0x1b002
movq %rax, %r14
callq 0x785f
movq %rax, %rbx
movq (%r14), %rdi
callq 0x1b01a
testq %rax, %rax
je 0x1b00e
movq %rax, %r14
movq %rax, (%rbx)
movq %rbx, %rdi
callq 0x861b
movq %r14, %rdi
callq 0x1b0b0
callq 0x868d
movq 0x239f7(%rip), %rdi     # 0x3e9f0
popq %rbx
popq %r14
popq %rbp
jmp 0x861b
leaq 0xca54(%rip), %rdi      # 0x27a5d
callq 0x7756
leaq 0xca60(%rip), %rdi      # 0x27a75
callq 0x7756
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: read_file
char *
read_file(char *filename)
{
	int fd, n;
	char *buf;
	off_t t;

	fd = open(filename, O_RDONLY);

	if (fd < 0)
		return NULL;

	t = lseek(fd, 0, SEEK_END);

	if (t < 0 || t > 0x1000000) { // 16 MB max
		close(fd);
		return NULL;
	}

	if (lseek(fd, 0, SEEK_SET)) {
		close(fd);
		return NULL;
	}

	n = (int) t;

	buf = malloc(n + 1);

	if (buf == NULL) {
		close(fd);
		return NULL;
	}

	if (read(fd, buf, n) != n) {
		free(buf);
		close(fd);
		return NULL;
	}

	close(fd);

	buf[n] = '\0';

	return buf;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
xorl %r14d, %r14d
xorl %esi, %esi
xorl %eax, %eax
callq 0x72d0
testl %eax, %eax
js 0x1b067
movl %eax, %ebx
pushq $0x2
popq %rdx
movl %eax, %edi
xorl %esi, %esi
callq 0x7110
cmpq $0x1000001, %rax        # imm = 0x1000001
jae 0x1b05d
movq %rax, %r15
movl %ebx, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x7110
testq %rax, %rax
je 0x1b075
movl %ebx, %edi
callq 0x7140
xorl %r14d, %r14d
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1(%r15), %rdi
callq 0x7250
testq %rax, %rax
je 0x1b05d
movq %rax, %r14
movl %ebx, %edi
movq %rax, %rsi
movq %r15, %rdx
callq 0x7190
cmpq %r15, %rax
jne 0x1b0a6
movl %ebx, %edi
callq 0x7140
movb $0x0, (%r14,%r15)
jmp 0x1b067
movq %r14, %rdi
callq 0x7040
jmp 0x1b05d
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: run_buf
void
run_buf(char *buf)
{
	char *s, *save_trace1, *save_trace2;
	struct atom *p1;

	save_trace1 = trace1;
	save_trace2 = trace2;

	s = buf;

	for (;;) {

		s = scan_input(s); // also updates trace1 and trace2

		if (s == NULL)
			break; // end of input

		dupl();
		evalg();

		// update last

		dupl();
		p1 = pop();

		if (p1 != symbol(NIL))
			set_symbol(symbol(LAST), p1, symbol(NIL));

		print_result();
	}

	trace1 = save_trace1;
	trace2 = save_trace2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0xf47fc(%rip), %r14     # 0x10f8c0
movq 0xf47fd(%rip), %r15     # 0x10f8c8
movq %rbx, %rdi
callq 0x21328
testq %rax, %rax
je 0x1b111
movq %rax, %rbx
callq 0x17833
callq 0x8f7d
callq 0x17833
callq 0x868d
movq 0x238fa(%rip), %rdx     # 0x3e9f0
cmpq %rdx, %rax
je 0x1b10a
movq 0x232ae(%rip), %rdi     # 0x3e3b0
movq %rax, %rsi
callq 0x12721
callq 0x1992d
jmp 0x1b0cb
movq %r14, 0xf47a8(%rip)     # 0x10f8c0
movq %r15, 0xf47a9(%rip)     # 0x10f8c8
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: eval_setq
void
eval_setq(struct atom *p1)
{
	struct atom *p2;

	push_symbol(NIL); // return value

	if (caadr(p1) == symbol(INDEX)) {
		setq_indexed(p1);
		return;
	}

	if (iscons(cadr(p1))) {
		setq_usrfunc(p1);
		return;
	}

	if (!isusersymbol(cadr(p1)))
		stopf("user symbol expected");

	push(caddr(p1));
	evalg();
	p2 = pop();

	set_symbol(cadr(p1), p2, symbol(NIL));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x238b2(%rip), %r14     # 0x3e9f0
movq 0x238ab(%rip), %rdi     # 0x3e9f0
callq 0x861b
cmpb $0x1, 0x10(%rbx)
leaq 0x8(%rbx), %r15
movq %r14, %rax
cmoveq %r15, %rax
movq (%rax), %rax
movb 0x10(%rax), %cl
cmpb $0x1, %cl
jne 0x1b19d
movq (%rax), %rdx
cmpb $0x1, 0x10(%rdx)
leaq 0x2387e(%rip), %rsi     # 0x3e9f0
cmoveq %rdx, %rsi
movq (%rsi), %rdx
cmpq 0x26128(%rip), %rdx     # 0x412a8
je 0x1b1f2
cmpb $0x1, %cl
jne 0x1b1b8
movq (%rax), %rcx
movzbl 0x10(%rcx), %ecx
cmpl $0x3, %ecx
je 0x1b1ec
cmpl $0x1, %ecx
je 0x1b1c7
jmp 0x1b258
movq 0x2384c(%rip), %rsi     # 0x3e9f0
movb 0x10(%rsi), %dl
cmpb $0x1, %dl
jne 0x1b1d9
movq (%rsi), %rdx
cmpq 0x260f2(%rip), %rdx     # 0x412a8
je 0x1b1f2
movq 0x23831(%rip), %rdx     # 0x3e9f0
movb 0x10(%rdx), %dl
cmpb $0x1, %dl
jne 0x1b1e2
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1b441
cmpq 0x260c8(%rip), %rsi     # 0x412a8
je 0x1b1f2
cmpb $0x3, %dl
jne 0x1b258
cmpb $0x1, %cl
jne 0x1b204
movq 0x8(%rax), %rax
jmp 0x1b20b
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1b264
movq 0x237e5(%rip), %rax     # 0x3e9f0
cmpb $0x1, 0x10(%rax)
movq %r14, %rcx
jne 0x1b217
movq %rax, %rcx
movq (%rcx), %rdi
callq 0x861b
callq 0x8f7d
callq 0x868d
cmpb $0x1, 0x10(%rbx)
cmovneq %r14, %r15
movq (%r15), %rcx
cmpb $0x1, 0x10(%rcx)
cmoveq %rcx, %r14
movq (%r14), %rdi
movq 0x237aa(%rip), %rdx     # 0x3e9f0
movq %rax, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x12721
leaq 0xc82c(%rip), %rdi      # 0x27a8b
callq 0x7756
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: setq_indexed
void
setq_indexed(struct atom *p1)
{
	int h;
	struct atom *S, *LVAL, *RVAL;

	S = cadadr(p1);

	if (!isusersymbol(S))
		stopf("user symbol expected");

	push(S);
	evalg();

	push(caddr(p1));
	evalg();

	RVAL = pop();
	LVAL = pop();

	// eval indices

	p1 = cddadr(p1);

	h = tos;

	while (iscons(p1)) {
		push(car(p1));
		evalf();
		p1 = cdr(p1);
	}

	set_component(LVAL, RVAL, h);

	set_symbol(S, LVAL, symbol(NIL));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
leaq 0x8(%rdi), %r12
cmpb $0x1, 0x10(%rdi)
leaq 0x2376c(%rip), %rax     # 0x3e9f0
movq %rax, %rcx
cmoveq %r12, %rcx
movq (%rcx), %rcx
cmpb $0x1, 0x10(%rcx)
jne 0x1b2a3
movq (%rcx), %rdx
cmpb $0x1, 0x10(%rdx)
jne 0x1b2c3
movq 0x8(%rdx), %rdx
jmp 0x1b2ca
movq 0x23746(%rip), %rcx     # 0x3e9f0
cmpb $0x1, 0x10(%rcx)
jne 0x1b2e9
movq 0x8(%rcx), %rcx
cmpb $0x1, 0x10(%rcx)
jne 0x1b2e9
movq 0x2372f(%rip), %rax     # 0x3e9f0
jmp 0x1b2d3
movq 0x23726(%rip), %rdx     # 0x3e9f0
cmpb $0x1, 0x10(%rdx)
jne 0x1b2e9
movq (%rcx), %rax
cmpb $0x1, 0x10(%rax)
jne 0x1b2df
addq $0x8, %rax
jmp 0x1b2e6
leaq 0x2370a(%rip), %rax     # 0x3e9f0
movq (%rax), %rax
movq (%rax), %rbx
cmpb $0x3, 0x10(%rbx)
jne 0x1b435
movq %rbx, %rdi
callq 0x861b
callq 0x8f7d
cmpb $0x1, 0x10(%r14)
leaq 0x236e1(%rip), %r13     # 0x3e9f0
movq %r13, %rax
cmoveq %r12, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
jne 0x1b325
movq 0x8(%rax), %rax
jmp 0x1b32c
movq 0x236c4(%rip), %rax     # 0x3e9f0
cmpb $0x1, 0x10(%rax)
movq %r13, %rcx
jne 0x1b338
movq %rax, %rcx
movq (%rcx), %rdi
callq 0x861b
callq 0x8f7d
callq 0x868d
movq %rax, -0x30(%rbp)
callq 0x868d
cmpb $0x1, 0x10(%r14)
cmoveq %r12, %r13
movq %rax, %r14
movq (%r13), %rax
cmpb $0x1, 0x10(%rax)
jne 0x1b378
movq (%rax), %rcx
cmpb $0x1, 0x10(%rcx)
jne 0x1b39f
movq 0x8(%rcx), %rcx
jmp 0x1b3a6
movq 0x23671(%rip), %rcx     # 0x3e9f0
leaq 0x2366a(%rip), %rax     # 0x3e9f0
cmpb $0x1, 0x10(%rcx)
jne 0x1b3d2
movq 0x8(%rcx), %rcx
cmpb $0x1, 0x10(%rcx)
jne 0x1b3d2
movq 0x23653(%rip), %rax     # 0x3e9f0
jmp 0x1b3af
movq 0x2364a(%rip), %rcx     # 0x3e9f0
cmpb $0x1, 0x10(%rcx)
jne 0x1b3bb
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
jne 0x1b3c4
addq $0x8, %rax
jmp 0x1b3cb
leaq 0x2362e(%rip), %rax     # 0x3e9f0
jmp 0x1b3d2
leaq 0x23625(%rip), %rax     # 0x3e9f0
movq (%rax), %rax
addq $0x8, %rax
movl 0x1cecf(%rip), %r12d    # 0x382a8
leaq 0x23610(%rip), %r13     # 0x3e9f0
movq (%rax), %r15
cmpb $0x1, 0x10(%r15)
jne 0x1b406
movq (%r15), %rdi
callq 0x861b
callq 0x8fbb
leaq 0x8(%r15), %rax
cmpb $0x1, 0x10(%r15)
cmovneq %r13, %rax
jmp 0x1b3e0
movq %r14, %rdi
movq -0x30(%rbp), %rsi
movl %r12d, %edx
callq 0x1b533
movq 0x235d4(%rip), %rdx     # 0x3e9f0
movq %rbx, %rdi
movq %r14, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x12721
leaq 0xc64f(%rip), %rdi      # 0x27a8b
callq 0x7756
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: setq_usrfunc
void
setq_usrfunc(struct atom *p1)
{
	struct atom *F, *A, *B, *C;

	F = caadr(p1);
	A = cdadr(p1);
	B = caddr(p1);

	if (!isusersymbol(F))
		stopf("user symbol expected");

	if (lengthf(A) > 9)
		stopf("more than 9 arguments");

	push(B);
	convert_body(A);
	C = pop();

	set_symbol(F, B, C);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x1, 0x10(%rdi)
leaq 0x8(%rdi), %rcx
leaq 0x23596(%rip), %rax     # 0x3e9f0
cmovneq %rax, %rcx
movq (%rcx), %rcx
cmpb $0x1, 0x10(%rcx)
jne 0x1b49a
movq (%rcx), %rdx
movq 0x8(%rcx), %rsi
leaq 0x8(%rdx), %rdi
cmpb $0x1, 0x10(%rdx)
leaq 0x23573(%rip), %rax     # 0x3e9f0
cmovneq %rax, %rdx
cmovneq %rax, %rdi
movq (%rdx), %rbx
movq (%rdi), %r14
cmpb $0x1, 0x10(%rsi)
jne 0x1b4d8
addq $0x8, %rcx
movq %rcx, %rax
jmp 0x1b4d5
movq 0x2354f(%rip), %rbx     # 0x3e9f0
cmpb $0x1, 0x10(%rbx)
jne 0x1b4c5
movq (%rbx), %rbx
movq 0x2353f(%rip), %r14     # 0x3e9f0
cmpb $0x1, 0x10(%r14)
jne 0x1b4c8
movq 0x23531(%rip), %rcx     # 0x3e9f0
movq 0x8(%rcx), %r14
jmp 0x1b4c8
movq %rbx, %r14
movq 0x23521(%rip), %rcx     # 0x3e9f0
cmpb $0x1, 0x10(%rcx)
jne 0x1b4d8
movq (%rax), %rax
cmpb $0x3, 0x10(%rbx)
jne 0x1b51b
movq (%rax), %r15
movq %r14, %rdi
callq 0x86c3
cmpl $0xa, %eax
jge 0x1b527
movq %r15, %rdi
callq 0x861b
movq %r14, %rdi
callq 0x1b66c
callq 0x868d
movq %rbx, %rdi
movq %r15, %rsi
movq %rax, %rdx
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x12721
leaq 0xc569(%rip), %rdi      # 0x27a8b
callq 0x7756
leaq 0xc572(%rip), %rdi      # 0x27aa0
callq 0x7756
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: set_component
void
set_component(struct atom *LVAL, struct atom *RVAL, int h)
{
	int i, k, m, n, t;

	if (!istensor(LVAL))
		stopf("index error");

	// n is the number of indices

	n = tos - h;

	if (n < 1 || n > LVAL->u.tensor->ndim)
		stopf("index error");

	// k is the combined index

	k = 0;

	for (i = 0; i < n; i++) {
		push(stack[h + i]);
		t = pop_integer();
		if (t < 1 || t > LVAL->u.tensor->dim[i])
			stopf("index error");
		k = k * LVAL->u.tensor->dim[i] + t - 1;
	}

	tos = h; // pop all

	if (istensor(RVAL)) {
		m = RVAL->u.tensor->ndim;
		if (n + m != LVAL->u.tensor->ndim)
			stopf("index error");
		for (i = 0; i < m; i++)
			if (LVAL->u.tensor->dim[n + i] != RVAL->u.tensor->dim[i])
				stopf("index error");
		m = RVAL->u.tensor->nelem;
		for (i = 0; i < m; i++)
			LVAL->u.tensor->elem[m * k + i] = RVAL->u.tensor->elem[i];
	} else {
		if (n != LVAL->u.tensor->ndim)
			stopf("index error");
		LVAL->u.tensor->elem[k] = RVAL;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpb $0x7, 0x10(%rdi)
jne 0x1b60d
movq %rsi, -0x38(%rbp)
movl 0x1cd50(%rip), %eax     # 0x382a8
subl %edx, %eax
jle 0x1b60d
movq %rdi, %r14
movq (%rdi), %rcx
cmpl (%rcx), %eax
jg 0x1b60d
movl %edx, -0x30(%rbp)
movslq %edx, %r13
movl %eax, -0x2c(%rbp)
movl %eax, %r15d
shlq $0x3, %r13
xorl %ebx, %ebx
xorl %r12d, %r12d
cmpq %rbx, %r15
je 0x1b5c7
leaq (,%rbx,8), %rax
addq %r13, %rax
leaq 0x26016(%rip), %rcx     # 0x415b0
movq (%rcx,%rax), %rdi
callq 0x861b
callq 0xd9d9
testl %eax, %eax
jle 0x1b60d
movq (%r14), %rcx
movl 0x4(%rcx,%rbx,4), %edx
cmpl %edx, %eax
jg 0x1b60d
imull %r12d, %edx
leal (%rax,%rdx), %r12d
decl %r12d
incq %rbx
jmp 0x1b583
movl -0x30(%rbp), %eax
movl %eax, 0x1ccd8(%rip)     # 0x382a8
movq -0x38(%rbp), %r9
cmpb $0x7, 0x10(%r9)
jne 0x1b619
movq (%r9), %rax
movl (%rax), %edx
movl -0x2c(%rbp), %esi
addl %edx, %esi
cmpl (%rcx), %esi
jne 0x1b60d
xorl %esi, %esi
testl %edx, %edx
cmovlel %esi, %edx
leaq (%rcx,%r15,4), %rcx
addq $0x4, %rcx
cmpq %rsi, %rdx
je 0x1b637
movl (%rcx,%rsi,4), %edi
leaq 0x1(%rsi), %r8
cmpl 0x4(%rax,%rsi,4), %edi
movq %r8, %rsi
je 0x1b5f8
leaq 0xc5cb(%rip), %rdi      # 0x27bdf
callq 0x7756
movl -0x2c(%rbp), %eax
cmpl (%rcx), %eax
jne 0x1b60d
movslq %r12d, %rax
movq %r9, 0x68(%rcx,%rax,8)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x64(%rax), %eax
imull %eax, %r12d
movslq %r12d, %rdx
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
leaq 0x68(,%rdx,8), %rdx
cmpq %rcx, %rax
je 0x1b628
movq (%r9), %rsi
movq 0x68(%rsi,%rcx,8), %rsi
movq (%r14), %rdi
addq %rdx, %rdi
movq %rsi, (%rdi,%rcx,8)
incq %rcx
jmp 0x1b650
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: convert_body
void
convert_body(struct atom *A)
{
	if (!iscons(A))
		return;

	push(car(A));
	push_symbol(ARG1);
	subst();

	A = cdr(A);
	if (!iscons(A))
		return;

	push(car(A));
	push_symbol(ARG2);
	subst();

	A = cdr(A);
	if (!iscons(A))
		return;

	push(car(A));
	push_symbol(ARG3);
	subst();

	A = cdr(A);
	if (!iscons(A))
		return;

	push(car(A));
	push_symbol(ARG4);
	subst();

	A = cdr(A);
	if (!iscons(A))
		return;

	push(car(A));
	push_symbol(ARG5);
	subst();

	A = cdr(A);

	if (!iscons(A))
		return;

	push(car(A));
	push_symbol(ARG6);
	subst();

	A = cdr(A);
	if (!iscons(A))
		return;

	push(car(A));
	push_symbol(ARG7);
	subst();

	A = cdr(A);
	if (!iscons(A))
		return;

	push(car(A));
	push_symbol(ARG8);
	subst();

	A = cdr(A);
	if (!iscons(A))
		return;

	push(car(A));
	push_symbol(ARG9);
	subst();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
cmpb $0x1, 0x10(%rdi)
jne 0x1b836
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x861b
movq 0x25c49(%rip), %rdi     # 0x412d8
callq 0x861b
callq 0x8de5
cmpb $0x1, 0x10(%rbx)
leaq 0x8(%rbx), %rax
leaq 0x23348(%rip), %rbx     # 0x3e9f0
cmovneq %rbx, %rax
movq (%rax), %r14
cmpb $0x1, 0x10(%r14)
jne 0x1b836
movq (%r14), %rdi
callq 0x861b
movq 0x25c17(%rip), %rdi     # 0x412e0
callq 0x861b
callq 0x8de5
leaq 0x8(%r14), %rax
cmpb $0x1, 0x10(%r14)
cmovneq %rbx, %rax
movq (%rax), %r14
cmpb $0x1, 0x10(%r14)
jne 0x1b836
movq (%r14), %rdi
callq 0x861b
movq 0x25beb(%rip), %rdi     # 0x412e8
callq 0x861b
callq 0x8de5
leaq 0x8(%r14), %rax
cmpb $0x1, 0x10(%r14)
cmovneq %rbx, %rax
movq (%rax), %r14
cmpb $0x1, 0x10(%r14)
jne 0x1b836
movq (%r14), %rdi
callq 0x861b
movq 0x25bbf(%rip), %rdi     # 0x412f0
callq 0x861b
callq 0x8de5
leaq 0x8(%r14), %rax
cmpb $0x1, 0x10(%r14)
cmovneq %rbx, %rax
movq (%rax), %r14
cmpb $0x1, 0x10(%r14)
jne 0x1b836
movq (%r14), %rdi
callq 0x861b
movq 0x25b93(%rip), %rdi     # 0x412f8
callq 0x861b
callq 0x8de5
leaq 0x8(%r14), %rax
cmpb $0x1, 0x10(%r14)
cmovneq %rbx, %rax
movq (%rax), %r14
cmpb $0x1, 0x10(%r14)
jne 0x1b836
movq (%r14), %rdi
callq 0x861b
movq 0x25b67(%rip), %rdi     # 0x41300
callq 0x861b
callq 0x8de5
leaq 0x8(%r14), %rax
cmpb $0x1, 0x10(%r14)
cmovneq %rbx, %rax
movq (%rax), %r14
cmpb $0x1, 0x10(%r14)
jne 0x1b836
movq (%r14), %rdi
callq 0x861b
movq 0x25b3f(%rip), %rdi     # 0x41308
callq 0x861b
callq 0x8de5
leaq 0x8(%r14), %rax
cmpb $0x1, 0x10(%r14)
cmovneq %rbx, %rax
movq (%rax), %r14
cmpb $0x1, 0x10(%r14)
jne 0x1b836
movq (%r14), %rdi
callq 0x861b
movq 0x25b17(%rip), %rdi     # 0x41310
callq 0x861b
callq 0x8de5
leaq 0x8(%r14), %rax
cmpb $0x1, 0x10(%r14)
cmoveq %rax, %rbx
movq (%rbx), %rax
cmpb $0x1, 0x10(%rax)
jne 0x1b836
movq (%rax), %rdi
callq 0x861b
movq 0x25af0(%rip), %rdi     # 0x41318
callq 0x861b
popq %rbx
popq %r14
popq %rbp
jmp 0x8de5
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: sgnfunc
void
sgnfunc(void)
{
	int i, n;
	struct atom *p1, *p2;

	p1 = pop();

	if (istensor(p1)) {
		p1 = copy_tensor(p1);
		n = p1->u.tensor->nelem;
		for (i = 0; i < n; i++) {
			push(p1->u.tensor->elem[i]);
			sgnfunc();
			p1->u.tensor->elem[i] = pop();
		}
		push(p1);
		return;
	}

	p2 = p1;

	if (!isnum(p2)) {
		push(p2);
		floatfunc();
		p2 = pop();
	}

	if (!isnum(p2)) {
		push_symbol(SGN);
		push(p1);
		list(2);
		return;
	}

	if (iszero(p2)) {
		push_integer(0);
		return;
	}

	if (isnegativenumber(p2))
		push_integer(-1);
	else
		push_integer(1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
callq 0x868d
movq %rax, %rbx
movb 0x10(%rax), %al
movzbl %al, %ecx
leal -0x4(%rcx), %edx
movq %rbx, %r14
cmpl $0x2, %edx
jb 0x1b8f5
cmpl $0x7, %ecx
jne 0x1b8dd
movq %rbx, %rdi
callq 0x8f1b
movq %rax, %rbx
movq (%rax), %rax
movl 0x64(%rax), %r14d
xorl %r15d, %r15d
testl %r14d, %r14d
cmovlel %r15d, %r14d
cmpq %r15, %r14
je 0x1b931
movq (%rbx), %rax
movq 0x68(%rax,%r15,8), %rdi
callq 0x861b
callq 0x1b870
callq 0x868d
movq (%rbx), %rcx
movq %rax, 0x68(%rcx,%r15,8)
incq %r15
jmp 0x1b8b4
movq %rbx, %rdi
callq 0x861b
callq 0x9fbd
callq 0x868d
movq %rax, %r14
movb 0x10(%rax), %al
andb $-0x2, %al
cmpb $0x4, %al
jne 0x1b90b
movq %r14, %rdi
callq 0xa641
testl %eax, %eax
je 0x1b943
xorl %edi, %edi
jmp 0x1b956
movq 0x2408e(%rip), %rdi     # 0x3f9a0
callq 0x861b
movq %rbx, %rdi
callq 0x861b
pushq $0x2
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x85eb
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x861b
movq %r14, %rdi
callq 0x8c2a
testl %eax, %eax
je 0x1b953
pushq $-0x1
jmp 0x1b955
pushq $0x1
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xa426
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: simplify
void
simplify(void)
{
	int i, n;
	struct atom *p1;

	p1 = pop();

	if (istensor(p1)) {
		p1 = copy_tensor(p1);
		n = p1->u.tensor->nelem;
		for (i = 0; i < n; i++) {
			push(p1->u.tensor->elem[i]);
			simplify();
			p1->u.tensor->elem[i] = pop();
		}
		push(p1);
		return;
	}

	push(p1);
	simplify_trig(); // do this first otherwise compton-demo runs out of memory
	simplify_nib();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
callq 0x868d
cmpb $0x7, 0x10(%rax)
jne 0x1b9f4
movq %rax, %rdi
callq 0x8f1b
movq %rax, %rbx
movq (%rax), %rax
movl 0x64(%rax), %r14d
xorl %r15d, %r15d
testl %r14d, %r14d
cmovlel %r15d, %r14d
cmpq %r15, %r14
je 0x1ba10
movq (%rbx), %rax
movq 0x68(%rax,%r15,8), %rdi
callq 0x861b
callq 0x1b99a
callq 0x868d
movq (%rbx), %rcx
movq %rax, 0x68(%rcx,%r15,8)
incq %r15
jmp 0x1b9cb
movq %rax, %rdi
callq 0x861b
callq 0x1ba22
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1ba84
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x861b
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: simplify_trig
void
simplify_trig(void)
{
	struct atom *p1, *p2;

	p1 = pop();

	if (!iscons(p1)) {
		push(p1);
		return;
	}

	push(p1);
	expform();
	numden();
	swap();
	divide();
	p2 = pop();

	if (simpler(p2, p1))
		push(p2);
	else
		push(p1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
callq 0x868d
movq %rax, %rbx
movb 0x10(%rax), %r14b
movq %rax, %rdi
callq 0x861b
cmpb $0x1, %r14b
jne 0x1ba73
callq 0x11798
callq 0xcea2
callq 0xa49b
callq 0xca0b
callq 0x868d
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x1bd50
testl %eax, %eax
je 0x1ba78
movq %r14, %rdi
jmp 0x1ba7b
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x861b
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: simpler
int
simpler(struct atom *p1, struct atom *p2)
{
	int d1, d2;

	d1 = diameter(p1);
	d2 = diameter(p2);

	if (d1 == d2) {
		d1 = mass(p1);
		d2 = mass(p2);
	}

	return d1 < d2;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %r15
callq 0x1bd99
movl %eax, %ebx
movq %r14, %rdi
callq 0x1bd99
cmpl %eax, %ebx
jne 0x1bd85
movq %r15, %rdi
callq 0x1be75
movl %eax, %ebx
movq %r14, %rdi
callq 0x1be75
xorl %ecx, %ecx
cmpl %eax, %ebx
setl %cl
movl %ecx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: diameter
int
diameter(struct atom *p)
{
	int max = 0, n;

	if (car(p) == symbol(POWER) && isnegativenumber(caddr(p)))
		return 1 + diameter(cadr(p));

	while (iscons(p)) {
		n = diameter(car(p));
		if (n > max)
			max = n;
		p = cdr(p);
	}

	return max;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %r14
movq 0x254ec(%rip), %rax     # 0x412a0
movq %rax, -0x40(%rbp)
movl $0x0, -0x2c(%rbp)
movq 0x22c2a(%rip), %rax     # 0x3e9f0
movq %rax, -0x38(%rbp)
leaq 0x22c1f(%rip), %r13     # 0x3e9f0
movb 0x10(%r14), %r12b
cmpb $0x1, %r12b
movq %r13, %rax
cmoveq %r14, %rax
movq -0x40(%rbp), %rcx
cmpq %rcx, (%rax)
jne 0x1be42
leaq 0x8(%r14), %rax
cmpb $0x1, %r12b
cmovneq %r13, %rax
movq (%rax), %r15
movb 0x10(%r15), %bl
cmpb $0x1, %bl
jne 0x1be14
movq 0x8(%r15), %rax
cmpb $0x1, 0x10(%rax)
movq %r13, %rcx
jne 0x1be27
leaq 0x8(%r15), %rax
jmp 0x1be24
movq -0x38(%rbp), %rax
cmpb $0x1, 0x10(%rax)
movq %r13, %rax
movq %r13, %rcx
jne 0x1be27
movq (%rax), %rcx
movq (%rcx), %rdi
callq 0x8c2a
testl %eax, %eax
je 0x1be42
cmpb $0x1, %bl
cmovneq %r13, %r15
movq (%r15), %r14
incl -0x2c(%rbp)
jmp 0x1bdd1
xorl %ebx, %ebx
cmpb $0x1, %r12b
jne 0x1be61
movq (%r14), %rdi
callq 0x1bd99
cmpl %ebx, %eax
cmovgl %eax, %ebx
movq 0x8(%r14), %r14
movb 0x10(%r14), %r12b
jmp 0x1be44
movl -0x2c(%rbp), %eax
addl %ebx, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: mass
int
mass(struct atom *p)
{
	int n = 1;
	while (iscons(p)) {
		n += mass(car(p));
		p = cdr(p);
	}
	return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %r14
pushq $0x1
popq %rbx
cmpb $0x1, 0x10(%r14)
jne 0x1be99
movq (%r14), %rdi
callq 0x1be75
addl %eax, %ebx
movq 0x8(%r14), %r14
jmp 0x1be82
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: sinfunc_sum
void
sinfunc_sum(struct atom *p1)
{
	struct atom *p2, *p3;
	p2 = cdr(p1);
	while (iscons(p2)) {
		push_integer(2);
		push(car(p2));
		multiply();
		push_symbol(PI);
		divide();
		p3 = pop();
		if (isinteger(p3)) {
			push(p1);
			push(car(p2));
			subtract();
			p3 = pop();
			push(p3);
			sinfunc();
			push(car(p2));
			cosfunc();
			multiply();
			push(p3);
			cosfunc();
			push(car(p2));
			sinfunc();
			multiply();
			add();
			return;
		}
		p2 = cdr(p2);
	}
	push_symbol(SIN);
	push(p1);
	list(2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x22b06(%rip), %r15     # 0x3e9f0
pushq $0x2
popq %r14
movq %rdi, %r12
leaq 0x8(%r12), %rax
cmpb $0x1, 0x10(%r12)
cmovneq %r15, %rax
movq (%rax), %r12
cmpb $0x1, 0x10(%r12)
jne 0x1bfdf
movl %r14d, %edi
callq 0xa426
cmpb $0x1, 0x10(%r12)
movq %r15, %rax
cmoveq %r12, %rax
movq (%rax), %rdi
callq 0x861b
callq 0x9fae
movq 0x23108(%rip), %rdi     # 0x3f040
callq 0x861b
callq 0xca0b
callq 0x868d
movq %rax, %rdi
callq 0x8b5d
testl %eax, %eax
je 0x1bef1
movq %rbx, %rdi
callq 0x861b
cmpb $0x1, 0x10(%r12)
movq %r15, %rax
cmoveq %r12, %rax
movq (%rax), %rdi
callq 0x861b
callq 0xb07f
callq 0x868d
movq %rax, %rbx
movq %rax, %rdi
callq 0x861b
callq 0xe75b
cmpb $0x1, 0x10(%r12)
movq %r15, %rax
cmoveq %r12, %rax
movq (%rax), %rdi
callq 0x861b
callq 0xe086
callq 0x9fae
movq %rbx, %rdi
callq 0x861b
callq 0xe086
cmpb $0x1, 0x10(%r12)
cmoveq %r12, %r15
movq (%r15), %rdi
callq 0x861b
callq 0xe75b
callq 0x9fae
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0xa1f6
movq 0x239ca(%rip), %rdi     # 0x3f9b0
callq 0x861b
movq %rbx, %rdi
callq 0x861b
pushq $0x2
popq %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x85eb
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: tanfunc_sum
void
tanfunc_sum(struct atom *p1)
{
	struct atom *p2, *p3;
	p2 = cdr(p1);
	while (iscons(p2)) {
		push(car(p2));
		push_symbol(PI);
		divide();
		p3 = pop();
		if (isinteger(p3)) {
			push(p1);
			push(car(p2));
			subtract();
			tanfunc();
			return;
		}
		p2 = cdr(p2);
	}
	push_symbol(TAN);
	push(p1);
	list(2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
leaq 0x2205c(%rip), %r14     # 0x3e9f0
movq %rdi, %r15
leaq 0x8(%r15), %rax
cmpb $0x1, 0x10(%r15)
cmovneq %r14, %rax
movq (%rax), %r15
cmpb $0x1, 0x10(%r15)
jne 0x1ca05
movq (%r15), %rdi
callq 0x861b
movq 0x22683(%rip), %rdi     # 0x3f040
callq 0x861b
callq 0xca0b
callq 0x868d
movq %rax, %rdi
callq 0x8b5d
testl %eax, %eax
je 0x1c997
movq %rbx, %rdi
callq 0x861b
cmpb $0x1, 0x10(%r15)
cmoveq %r15, %r14
movq (%r14), %rdi
callq 0x861b
callq 0xb07f
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x1c620
movq 0x232b4(%rip), %rdi     # 0x3fcc0
callq 0x861b
movq %rbx, %rdi
callq 0x861b
pushq $0x2
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x85eb
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: tanhfunc
void
tanhfunc(void)
{
	int i, n;
	double d;
	struct atom *p1;

	p1 = pop();

	if (istensor(p1)) {
		p1 = copy_tensor(p1);
		n = p1->u.tensor->nelem;
		for (i = 0; i < n; i++) {
			push(p1->u.tensor->elem[i]);
			tanhfunc();
			p1->u.tensor->elem[i] = pop();
		}
		push(p1);
		return;
	}

	if (isdouble(p1)) {
		push(p1);
		d = pop_double();
		d = tanh(d);
		push_double(d);
		return;
	}

	if (isdoublez(p1)) {
		push(p1);
		sinhfunc();
		push(p1);
		coshfunc();
		divide();
		return;
	}

	if (iszero(p1)) {
		push_integer(0);
		return;
	}

	// tanh(-x) = -tanh(x)

	if (isnegativeterm(p1)) {
		push(p1);
		negate();
		tanhfunc();
		negate();
		return;
	}

	if (car(p1) == symbol(ARCTANH)) {
		push(cadr(p1));
		return;
	}

	push_symbol(TANH);
	push(p1);
	list(2);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
callq 0x868d
movq %rax, %rbx
movzbl 0x10(%rax), %r14d
cmpl $0x5, %r14d
je 0x1cada
cmpl $0x7, %r14d
jne 0x1cafb
movq %rbx, %rdi
callq 0x8f1b
movq %rax, %rbx
movq (%rax), %rax
movl 0x64(%rax), %r14d
xorl %r15d, %r15d
testl %r14d, %r14d
cmovlel %r15d, %r14d
cmpq %r15, %r14
je 0x1cac8
movq (%rbx), %rax
movq 0x68(%rax,%r15,8), %rdi
callq 0x861b
callq 0x1ca60
callq 0x868d
movq (%rbx), %rcx
movq %rax, 0x68(%rcx,%r15,8)
incq %r15
jmp 0x1ca9f
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x861b
movq %rbx, %rdi
callq 0x861b
callq 0x8ae1
callq 0x7300
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xaf59
movq %rbx, %rdi
callq 0xb876
movq %rbx, %rdi
testl %eax, %eax
je 0x1cb30
callq 0x861b
callq 0x10567
movq %rbx, %rdi
callq 0x861b
callq 0xebf7
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xca0b
callq 0xa641
testl %eax, %eax
je 0x1cb4a
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0xa426
movq %rbx, %rdi
callq 0x9fd6
testl %eax, %eax
je 0x1cb77
movq %rbx, %rdi
callq 0x861b
callq 0x975f
callq 0x1ca60
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x975f
cmpb $0x1, %r14b
leaq 0x21e6e(%rip), %rax     # 0x3e9f0
movq %rax, %rcx
cmoveq %rbx, %rcx
movq (%rcx), %rcx
cmpq 0x1f5fd(%rip), %rcx     # 0x3c190
je 0x1cbbb
movq 0x2312c(%rip), %rdi     # 0x3fcc8
callq 0x861b
movq %rbx, %rdi
callq 0x861b
pushq $0x2
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x85eb
addq $0x8, %rbx
cmpb $0x1, %r14b
cmovneq %rax, %rbx
movq (%rbx), %rcx
cmpb $0x1, 0x10(%rcx)
cmoveq %rcx, %rax
movq (%rax), %rdi
jmp 0x1cacb
// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: promote_tensor
void
promote_tensor(void)
{
	int i, j, k, ndim1, ndim2, nelem1, nelem2;
	struct atom *p1, *p2, *p3;

	p1 = pop();

	if (!istensor(p1)) {
		push(p1);
		return;
	}

	ndim1 = p1->u.tensor->ndim;
	nelem1 = p1->u.tensor->nelem;

	// check

	p2 = p1->u.tensor->elem[0];

	for (i = 1; i < nelem1; i++) {
		p3 = p1->u.tensor->elem[i];
		if (!compatible_dimensions(p2, p3))
			stopf("tensor dimensions");
	}

	if (!istensor(p2)) {
		push(p1);
		return; // all elements are scalars
	}

	ndim2 = p2->u.tensor->ndim;
	nelem2 = p2->u.tensor->nelem;

	if (ndim1 + ndim2 > MAXDIM)
		stopf("rank exceeds max");

	// alloc

	p3 = alloc_tensor(nelem1 * nelem2);

	// merge dimensions

	k = 0;

	for (i = 0; i < ndim1; i++)
		p3->u.tensor->dim[k++] = p1->u.tensor->dim[i];

	for (i = 0; i < ndim2; i++)
		p3->u.tensor->dim[k++] = p2->u.tensor->dim[i];

	p3->u.tensor->ndim = ndim1 + ndim2;

	// merge elements

	k = 0;

	for (i = 0; i < nelem1; i++) {
		p2 = p1->u.tensor->elem[i];
		for (j = 0; j < nelem2; j++)
			p3->u.tensor->elem[k++] = p2->u.tensor->elem[j];
	}

	push(p3);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
callq 0x868d
cmpb $0x7, 0x10(%rax)
jne 0x1cf86
movq %rax, -0x30(%rbp)
movq (%rax), %r12
movl (%r12), %ebx
movslq 0x64(%r12), %r15
movq 0x68(%r12), %r14
pushq $0xe
popq %r13
leaq -0xd(%r13), %rax
cmpq %r15, %rax
jge 0x1cf32
movq (%r12,%r13,8), %rsi
movq %r14, %rdi
callq 0xa5bd
incq %r13
testl %eax, %eax
jne 0x1cf0a
leaq 0x63cc(%rip), %rdi      # 0x232f9
callq 0x7756
cmpb $0x7, 0x10(%r14)
jne 0x1cf82
movq (%r14), %rax
movl (%rax), %r13d
leal (%rbx,%r13), %edx
movl %edx, -0x34(%rbp)
cmpl $0x19, %edx
jge 0x1d023
movl 0x64(%rax), %r12d
movl %r15d, %edi
imull %r12d, %edi
callq 0x77da
xorl %ecx, %ecx
testl %ebx, %ebx
cmovlel %ecx, %ebx
cmpq %rcx, %rbx
je 0x1cf9c
movq -0x30(%rbp), %rdx
movq (%rdx), %rdx
movl 0x4(%rdx,%rcx,4), %edx
movq (%rax), %rsi
movl %edx, 0x4(%rsi,%rcx,4)
incq %rcx
jmp 0x1cf66
movq -0x30(%rbp), %rax
movq %rax, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x861b
xorl %ecx, %ecx
testl %r13d, %r13d
cmovlel %ecx, %r13d
leaq 0x4(,%rbx,4), %rdx
cmpq %rcx, %r13
je 0x1cfc7
movq (%r14), %rsi
movl 0x4(%rsi,%rcx,4), %esi
movq (%rax), %rdi
addq %rdx, %rdi
movl %esi, (%rdi,%rcx,4)
incq %rcx
jmp 0x1cfad
movq (%rax), %rcx
movl -0x34(%rbp), %edx
movl %edx, (%rcx)
xorl %ecx, %ecx
testl %r12d, %r12d
cmovlel %ecx, %r12d
testl %r15d, %r15d
cmovlel %ecx, %r15d
xorl %edx, %edx
movq -0x30(%rbp), %r11
cmpq %r15, %rcx
je 0x1cf86
movq (%r11), %rsi
movq 0x68(%rsi,%rcx,8), %rsi
movslq %edx, %rdx
leaq 0x68(,%rdx,8), %r8
xorl %edi, %edi
cmpq %rdi, %r12
je 0x1d01b
movq (%rsi), %r9
movq 0x68(%r9,%rdi,8), %r9
movq (%rax), %r10
addq %r8, %r10
movq %r9, (%r10,%rdi,8)
incq %rdi
jmp 0x1cfff
incq %rcx
addq %rdi, %rdx
jmp 0x1cfe5
leaq 0x6417(%rip), %rdi      # 0x23441
callq 0x7756