// File: /workspace/github_c_makefile_star2_O1/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 0x8b78
movq %rax, %rbx
movb 0x10(%rax), %r14b
movzbl %r14b, %eax
leal -0x4(%rax), %ecx
cmpl $0x2, %ecx
jae 0x17891
movq %rbx, %rdi
callq 0x8b01
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x9be7
movq %rbx, %rcx
cmpl $0x1, %eax
je 0x178a0
leaq 0x29160(%rip), %rcx     # 0x40a00
movq 0x2ba09(%rip), %r12     # 0x432b0
cmpq %r12, (%rcx)
je 0x17922
cmpb $0x1, %r14b
leaq 0x29149(%rip), %r15     # 0x40a00
movq %r15, %rax
cmoveq %rbx, %rax
movq (%rax), %r13
cmpq %r12, %r13
jne 0x178f2
leaq 0x8(%rbx), %rax
cmpb $0x1, %r14b
cmovneq %r15, %rax
movq (%rax), %rax
movb 0x10(%rax), %cl
cmpb $0x1, %cl
movq %r15, %rdx
cmoveq %rax, %rdx
movq (%rdx), %rdx
cmpq 0x2b9dc(%rip), %rdx     # 0x432c8
je 0x17a04
cmpq 0x2b9af(%rip), %r13     # 0x432a8
je 0x17966
movq 0x2b99e(%rip), %r14     # 0x432a0
movq %rbx, %rdi
callq 0x8b01
cmpq %r14, %r13
je 0x179bc
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8(%rbx), %rax
cmpb $0x1, %r14b
leaq 0x290cf(%rip), %rcx     # 0x40a00
cmovneq %rcx, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmoveq %rax, %rcx
movq (%rcx), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x1, %edx
callq 0xcb82
testl %eax, %eax
je 0x178ac
movq 0xef177(%rip), %rdi     # 0x106ad8
jmp 0x17a6c
addq $0x8, %rbx
cmpb $0x1, %r14b
cmovneq %r15, %rbx
movl 0x2293f(%rip), %r14d    # 0x3a2b8
movq (%rbx), %rbx
cmpb $0x1, 0x10(%rbx)
jne 0x179a0
movq (%rbx), %rdi
callq 0x8b01
callq 0x17850
leaq 0x8(%rbx), %rax
cmpb $0x1, 0x10(%rbx)
cmovneq %r15, %rax
movq (%rax), %rbx
jmp 0x1797c
movl 0x22912(%rip), %edi     # 0x3a2b8
subl %r14d, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa8bb
callq 0x145aa
callq 0x8b78
movq %rax, %rbx
movq %rax, %rdi
callq 0x8b01
callq 0xe371
callq 0x8b78
movq %rax, %r14
movq %rbx, %rdi
callq 0x8b01
callq 0xe28b
callq 0x8b78
movq %rax, %rbx
movq %rax, %rdi
callq 0xaece
testl %eax, %eax
je 0x17a5d
movq %r14, %rdi
jmp 0x17a6c
addq $0x8, %rax
cmpb $0x1, %cl
movq %r15, %rdx
cmoveq %rax, %rdx
movq (%rdx), %rdx
cmpb $0x1, 0x10(%rdx)
jne 0x17a2c
cmpb $0x1, %cl
leaq 0x28fdb(%rip), %rcx     # 0x40a00
cmoveq %rax, %rcx
movq (%rcx), %r15
movq (%r15), %rdi
callq 0x8b01
callq 0xe371
movq 0x2b888(%rip), %rdi     # 0x432c8
callq 0x8b01
callq 0xad38
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xa234
movq %r14, %rdi
callq 0xaece
testl %eax, %eax
je 0x17a7f
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8b01
movq %r14, %rdi
callq 0x8b01
movq %r14, %rdi
callq 0x8b01
movl $0x2, %edi
callq 0xa8bb
movq %rbx, %rdi
callq 0x8b01
movq %rbx, %rdi
callq 0x8b01
movl $0x2, %edi
callq 0xa8bb
movl $0x2, %edi
callq 0xa975
movl $0x1, %edi
movl $0x2, %esi
callq 0xa1f4
jmp 0x17a4a