// File: /workspace/github_c_makefile_star2_O2/georgeweigt[P]eigenmath/eigenmath.c
// Function: magfunc_nib
void
magfunc_nib(void)
{
	int h;
	struct atom *p1, *x, *y;

	p1 = pop();

	if (isnum(p1)) {
		push(p1);
		absfunc();
		return;
	}

	// -1 to a power

	if (car(p1) == symbol(POWER) && isminusone(cadr(p1))) {
		push_integer(1);
		return;
	}

	// exponential

	if (car(p1) == symbol(POWER) && cadr(p1) == symbol(EXP1)) {
		push(caddr(p1));
		real();
		expfunc();
		return;
	}

	// product

	if (car(p1) == symbol(MULTIPLY)) {
		p1 = cdr(p1);
		h = tos;
		while (iscons(p1)) {
			push(car(p1));
			magfunc_nib();
			p1 = cdr(p1);
		}
		multiply_factors(tos - h);
		return;
	}

	// sum

	if (car(p1) == symbol(ADD)) {
		push(p1);
		rect(); // convert polar terms, if any
		p1 = pop();
		push(p1);
		real();
		x = pop();
		push(p1);
		imag();
		y = pop();
		if (iszero(y)) {
			push(x);
			return;
		}
		if (iszero(x)) {
			push(y);
			return;
		}
		push(x);
		push(x);
		multiply();
		push(y);
		push(y);
		multiply();
		add();
		sqrtfunc();
		return;
	}

	// real

	push(p1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
callq 0x868d
movq %rax, %rbx
movb 0x10(%rax), %r14b
movzbl %r14b, %eax
leal -0x4(%rax), %ecx
cmpl $0x2, %ecx
jae 0x156c3
movq %rbx, %rdi
callq 0x861b
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x94f7
movq %rbx, %rcx
cmpl $0x1, %eax
je 0x156d2
leaq 0x2931e(%rip), %rcx     # 0x3e9f0
movq 0x2bbc7(%rip), %r13     # 0x412a0
cmpq %r13, (%rcx)
je 0x1572c
cmpb $0x1, %r14b
leaq 0x29307(%rip), %r15     # 0x3e9f0
movq %r15, %rax
cmoveq %rbx, %rax
movq (%rax), %r12
cmpq %r13, %r12
je 0x1576c
cmpq 0x2bb99(%rip), %r12     # 0x41298
je 0x1579e
movq 0x2bb84(%rip), %r14     # 0x41290
movq %rbx, %rdi
callq 0x861b
cmpq %r14, %r12
je 0x157f7
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8(%rbx), %rax
cmpb $0x1, %r14b
leaq 0x292b5(%rip), %rcx     # 0x3e9f0
cmovneq %rcx, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmoveq %rax, %rcx
movq (%rcx), %rdi
callq 0xbfac
testl %eax, %eax
je 0x156de
pushq $0x1
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa426
leaq 0x8(%rbx), %rax
cmpb $0x1, %r14b
cmovneq %r15, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
movq 0x2bb32(%rip), %rcx     # 0x412b8
jne 0x1583f
cmpq %rcx, (%rax)
jne 0x156f8
movq 0x8(%rax), %rax
jmp 0x1584f
addq $0x8, %rbx
cmpb $0x1, %r14b
cmovneq %r15, %rbx
movl 0x22af7(%rip), %r14d    # 0x382a8
movq (%rbx), %r12
cmpb $0x1, 0x10(%r12)
jne 0x157db
movq (%r12), %rdi
callq 0x861b
callq 0x15682
leaq 0x8(%r12), %rbx
cmpb $0x1, 0x10(%r12)
cmovneq %r15, %rbx
jmp 0x157b1
movl 0x22ac7(%rip), %edi     # 0x382a8
subl %r14d, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa04c
callq 0x128dd
callq 0x868d
movq %rax, %r14
movq %rax, %rdi
callq 0x861b
callq 0xd2cc
callq 0x868d
movq %rax, %rbx
movq %r14, %rdi
callq 0x861b
callq 0xd208
callq 0x868d
movq %rax, %r14
movq %rax, %rdi
callq 0xa641
testl %eax, %eax
je 0x15878
movq %rbx, %rdi
jmp 0x15887
movq 0x291aa(%rip), %rax     # 0x3e9f0
cmpq %rcx, %rax
jne 0x156f8
cmpb $0x1, 0x10(%rax)
jne 0x15858
movq %rax, %r15
movq (%r15), %rdi
callq 0x861b
callq 0xd2cc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xe4ce
movq %rbx, %rdi
callq 0xa641
testl %eax, %eax
je 0x1589a
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x861b
movq %rbx, %rdi
callq 0x861b
movq %rbx, %rdi
callq 0x861b
callq 0x9fae
movq %r14, %rdi
callq 0x861b
movq %r14, %rdi
callq 0x861b
callq 0x9fae
callq 0xa1f6
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xba06