// File: /workspace/github_c_makefile_star2_O3/georgeweigt[P]eigenmath/eigenmath.c
// Function: expform
void
expform(void)
{
	int h, i, n;
	struct atom *p1, *num, *den;

	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]);
			expform();
			p1->u.tensor->elem[i] = pop();
		}
		push(p1);
		return;
	}

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

	if (car(p1) == symbol(ADD)) {
		h = tos;
		p1 = cdr(p1);
		while (iscons(p1)) {
			push(car(p1));
			expform();
			p1 = cdr(p1);
		}
		add_terms(tos - h);
		return;
	}

	if (car(p1) == symbol(MULTIPLY)) {

		push(p1);
		numden();
		num = pop();
		den = pop();

		p1 = num;
		if (car(p1) == symbol(MULTIPLY)) {
			h = tos;
			p1 = cdr(p1);
			while (iscons(p1)) {
				push(car(p1));
				expform();
				p1 = cdr(p1);
			}
			multiply_factors(tos - h);
		} else {
			push(p1);
			expform();
		}
		num = pop();

		p1 = den;
		if (car(p1) == symbol(MULTIPLY)) {
			h = tos;
			p1 = cdr(p1);
			while (iscons(p1)) {
				push(car(p1));
				expform();
				p1 = cdr(p1);
			}
			multiply_factors(tos - h);
		} else {
			push(p1);
			expform();
		}
		den = pop();

		push(num);
		push(den);
		divide();
		return;
	}

	if (car(p1) == symbol(POWER)) {
		push(cadr(p1));
		expform();
		push(caddr(p1));
		expform();
		power();
		return;
	}

	if (car(p1) == symbol(COS)) {
		push(cadr(p1));
		expform();
		expcos();
		return;
	}

	if (car(p1) == symbol(SIN)) {
		push(cadr(p1));
		expform();
		expsin();
		return;
	}

	if (car(p1) == symbol(TAN)) {
		push(cadr(p1));
		expform();
		exptan();
		return;
	}

	if (car(p1) == symbol(COSH)) {
		push(cadr(p1));
		expform();
		expcosh();
		return;
	}

	if (car(p1) == symbol(SINH)) {
		push(cadr(p1));
		expform();
		expsinh();
		return;
	}

	if (car(p1) == symbol(TANH)) {
		push(cadr(p1));
		expform();
		exptanh();
		return;
	}

	h = tos;
	push(car(p1));
	p1 = cdr(p1);
	while (iscons(p1)) {
		push(car(p1));
		expform();
		p1 = cdr(p1);
	}
	list(tos - h);
	evalf();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x2ac01(%rip), %r14d    # 0x3f2b8
movl $0xfffe795f, %eax       # imm = 0xFFFE795F
leal (%r14,%rax), %ecx
cmpl %eax, %ecx
jbe 0x14bcf
decl %r14d
movl %r14d, 0x2abe6(%rip)    # 0x3f2b8
leaq 0x33ee7(%rip), %r15     # 0x485c0
movq (%r15,%r14,8), %rbx
movzbl 0x10(%rbx), %eax
cmpl $0x1, %eax
je 0x14762
cmpl $0x7, %eax
jne 0x1474c
movq %rbx, %rdi
callq 0x9638
movq %rax, %rbx
movq (%rax), %rax
movslq 0x64(%rax), %r14
testq %r14, %r14
jle 0x1474c
xorl %r12d, %r12d
movl $0xfffe795f, %r13d      # imm = 0xFFFE795F
movq (%rbx), %rax
movq 0x68(%rax,%r12,8), %rdi
callq 0x8ba5
callq 0x146a2
movl 0x2ab95(%rip), %eax     # 0x3f2b8
leal (%rax,%r13), %ecx
cmpl %r13d, %ecx
jbe 0x14bcf
decl %eax
movl %eax, 0x2ab80(%rip)     # 0x3f2b8
movq (%r15,%rax,8), %rax
movq (%rbx), %rcx
movq %rax, 0x68(%rcx,%r12,8)
incq %r12
cmpq %r12, %r14
jne 0x1470b
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8ba5
movq (%rbx), %rdi
cmpq 0x33b34(%rip), %rdi     # 0x482a0
je 0x14818
cmpq 0x33b2f(%rip), %rdi     # 0x482a8
je 0x1486a
cmpq 0x33b2a(%rip), %rdi     # 0x482b0
je 0x148e8
cmpq 0x2f05d(%rip), %rdi     # 0x437f0
je 0x1492a
cmpq 0x32220(%rip), %rdi     # 0x469c0
je 0x14aaf
cmpq 0x32523(%rip), %rdi     # 0x46cd0
je 0x14ae2
cmpq 0x2f03e(%rip), %rdi     # 0x437f8
je 0x14b15
cmpq 0x32201(%rip), %rdi     # 0x469c8
je 0x14b69
cmpq 0x32504(%rip), %rdi     # 0x46cd8
je 0x14b9c
callq 0x8ba5
cmpb $0x1, 0x10(%rbx)
leaq 0x8(%rbx), %rax
leaq 0x31212(%rip), %rbx     # 0x45a00
cmovneq %rbx, %rax
movq (%rax), %r15
cmpb $0x1, 0x10(%r15)
jne 0x14b48
movq (%r15), %rdi
callq 0x8ba5
callq 0x146a2
leaq 0x8(%r15), %rax
cmpb $0x1, 0x10(%r15)
jmp 0x147ee
movq 0x8(%rbx), %rbx
cmpb $0x1, 0x10(%rbx)
movl %r14d, %edi
jne 0x14854
leaq 0x311d4(%rip), %r15     # 0x45a00
movq (%rbx), %rdi
callq 0x8ba5
callq 0x146a2
leaq 0x8(%rbx), %rax
cmpb $0x1, 0x10(%rbx)
cmovneq %r15, %rax
movq (%rax), %rbx
cmpb $0x1, 0x10(%rbx)
je 0x1482c
movl 0x2aa64(%rip), %edi     # 0x3f2b8
subl %r14d, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xadb3
movq %rbx, %rdi
callq 0x8ba5
callq 0xe915
movl 0x2aa3a(%rip), %r14d    # 0x3f2b8
movl $0xfffe795f, %eax       # imm = 0xFFFE795F
leal (%r14,%rax), %ecx
cmpl %eax, %ecx
jbe 0x14bcf
leal -0x1(%r14), %eax
movl %eax, 0x2aa1f(%rip)     # 0x3f2b8
cmpl $0x1, %r14d
jbe 0x14bcf
movq (%r15,%rax,8), %rdi
addl $-0x2, %r14d
movl %r14d, 0x2aa06(%rip)    # 0x3f2b8
movb 0x10(%rdi), %al
cmpb $0x1, %al
leaq 0x31142(%rip), %r12     # 0x45a00
movq %r12, %rcx
cmoveq %rdi, %rcx
movq (%r15,%r14,8), %rbx
movq (%rcx), %rcx
cmpq 0x339d5(%rip), %rcx     # 0x482a8
je 0x1495d
callq 0x8ba5
callq 0x146a2
jmp 0x149a7
leaq 0x8(%rbx), %r15
movq 0x8(%rbx), %rax
cmpb $0x1, 0x10(%rax)
leaq 0x31105(%rip), %r14     # 0x45a00
cmovneq %r14, %rax
movq (%rax), %rdi
callq 0x8ba5
callq 0x146a2
cmpb $0x1, 0x10(%rbx)
cmovneq %r14, %r15
movq (%r15), %rax
cmpb $0x1, 0x10(%rax)
jne 0x14a7f
movq 0x8(%rax), %rax
jmp 0x14a86
movq 0x8(%rbx), %rax
cmpb $0x1, 0x10(%rax)
leaq 0x310c7(%rip), %rcx     # 0x45a00
cmoveq %rax, %rcx
movq (%rcx), %rdi
callq 0x8ba5
callq 0x146a2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x14487
addq $0x8, %rdi
cmpb $0x1, %al
cmovneq %r12, %rdi
movq (%rdi), %r13
cmpb $0x1, 0x10(%r13)
movl %r14d, %edi
jne 0x1499f
movq (%r13), %rdi
callq 0x8ba5
callq 0x146a2
leaq 0x8(%r13), %rax
cmpb $0x1, 0x10(%r13)
cmovneq %r12, %rax
movq (%rax), %r13
cmpb $0x1, 0x10(%r13)
je 0x14974
movl 0x2a919(%rip), %edi     # 0x3f2b8
subl %r14d, %edi
callq 0xacef
movl 0x2a90a(%rip), %r13d    # 0x3f2b8
movl $0xfffe795f, %eax       # imm = 0xFFFE795F
leal (%rax,%r13), %ecx
cmpl %eax, %ecx
jbe 0x14bcf
decl %r13d
movl %r13d, 0x2a8ef(%rip)    # 0x3f2b8
movb 0x10(%rbx), %al
cmpb $0x1, %al
movq %r12, %rcx
cmoveq %rbx, %rcx
movq (%r15,%r13,8), %r14
movq (%rcx), %rcx
cmpq 0x338c5(%rip), %rcx     # 0x482a8
je 0x149f4
movq %rbx, %rdi
callq 0x8ba5
callq 0x146a2
jmp 0x14a3a
addq $0x8, %rbx
cmpb $0x1, %al
cmovneq %r12, %rbx
movq (%rbx), %rbx
cmpb $0x1, 0x10(%rbx)
movl %r13d, %edi
jne 0x14a32
movq (%rbx), %rdi
callq 0x8ba5
callq 0x146a2
leaq 0x8(%rbx), %rax
cmpb $0x1, 0x10(%rbx)
cmovneq %r12, %rax
movq (%rax), %rbx
cmpb $0x1, 0x10(%rbx)
je 0x14a0a
movl 0x2a886(%rip), %edi     # 0x3f2b8
subl %r13d, %edi
callq 0xacef
movl 0x2a878(%rip), %eax     # 0x3f2b8
movl $0xfffe795f, %ecx       # imm = 0xFFFE795F
leal (%rax,%rcx), %edx
cmpl %ecx, %edx
jbe 0x14bcf
decl %eax
movl %eax, 0x2a860(%rip)     # 0x3f2b8
movq (%r15,%rax,8), %rbx
movq %r14, %rdi
callq 0x8ba5
movq %rbx, %rdi
callq 0x8ba5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe218
movq 0x30f7a(%rip), %rax     # 0x45a00
cmpb $0x1, 0x10(%rax)
jne 0x14a8f
movq %rax, %r14
movq (%r14), %rdi
callq 0x8ba5
callq 0x146a2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa573
movq 0x8(%rbx), %rax
cmpb $0x1, 0x10(%rax)
leaq 0x30f42(%rip), %rcx     # 0x45a00
cmoveq %rax, %rcx
movq (%rcx), %rdi
callq 0x8ba5
callq 0x146a2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x14bdb
movq 0x8(%rbx), %rax
cmpb $0x1, 0x10(%rax)
leaq 0x30f0f(%rip), %rcx     # 0x45a00
cmoveq %rax, %rcx
movq (%rcx), %rdi
callq 0x8ba5
callq 0x146a2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x14cf3
movq 0x8(%rbx), %rax
cmpb $0x1, 0x10(%rax)
leaq 0x30edc(%rip), %rcx     # 0x45a00
cmoveq %rax, %rcx
movq (%rcx), %rdi
callq 0x8ba5
callq 0x146a2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x145b7
movl 0x2a76a(%rip), %edi     # 0x3f2b8
subl %r14d, %edi
callq 0x8b7d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x96e2
movq 0x8(%rbx), %rax
cmpb $0x1, 0x10(%rax)
leaq 0x30e88(%rip), %rcx     # 0x45a00
cmoveq %rax, %rcx
movq (%rcx), %rdi
callq 0x8ba5
callq 0x146a2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x14db8
movq 0x8(%rbx), %rax
cmpb $0x1, 0x10(%rax)
leaq 0x30e55(%rip), %rcx     # 0x45a00
cmoveq %rax, %rcx
movq (%rcx), %rdi
callq 0x8ba5
callq 0x146a2
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x14e69
leaq 0x1a36b(%rip), %rdi     # 0x2ef41
callq 0x780b