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

	p1 = pop();

	if (isrational(p1)) {
		if (isnegativenumber(p1)) {
			push_symbol(PI);
			negate(); // see comment above
		} else
			push_integer(0);
		return;
	}

	if (isdouble(p1)) {
		if (isnegativenumber(p1))
			push_double(-M_PI);
		else
			push_double(0.0);
		return;
	}

	// (-1) ^ expr

	if (car(p1) == symbol(POWER) && isminusone(cadr(p1))) {
		push_symbol(PI);
		push(caddr(p1));
		multiply();
		return;
	}

	// e ^ expr

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

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

	if (car(p1) == symbol(ADD)) {
		push(p1);
		real();
		x = pop();
		push(p1);
		imag();
		y = pop();
		if (iszero(y)) {
			push_integer(0);
			return;
		}
		if (iszero(x)) {
			push_rational(1, 2);
			push_symbol(PI);
			multiply();
			return;
		}
		push(y);
		push(x);
		arctan();
		return;
	}

	push_integer(0); // p1 is real
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl 0x3087c(%rip), %r14d    # 0x3f2b8
movl $0xfffe795f, %eax       # imm = 0xFFFE795F
leal (%r14,%rax), %ecx
cmpl %eax, %ecx
jbe 0xed5b
decl %r14d
movl %r14d, 0x30861(%rip)    # 0x3f2b8
leaq 0x39b62(%rip), %rax     # 0x485c0
movq (%rax,%r14,8), %rbx
movzbl 0x10(%rbx), %r12d
movq %rbx, %rax
cmpl $0x1, %r12d
je 0xead2
cmpl $0x5, %r12d
je 0xea9e
cmpl $0x4, %r12d
jne 0xeacb
cmpb $0x1, 0x12(%rbx)
jne 0xeb8b
movq 0x375c3(%rip), %rdi     # 0x46050
callq 0x8ba5
movq 0x107957(%rip), %rdi    # 0x1163f0
jmp 0xecf7
movsd (%rbx), %xmm0
movsd %xmm0, -0x30(%rbp)
callq 0x74dc
xorpd %xmm0, %xmm0
ucomisd -0x30(%rbp), %xmm0
movb $0x5, 0x10(%rax)
ja 0xec36
movq $0x0, (%rax)
jmp 0xec43
leaq 0x36f2e(%rip), %rax     # 0x45a00
movq 0x397d7(%rip), %r15     # 0x482b0
cmpq %r15, (%rax)
je 0xeb97
cmpb $0x1, %r12b
leaq 0x36f13(%rip), %r13     # 0x45a00
movq %r13, %rax
cmoveq %rbx, %rax
movq (%rax), %rax
cmpq %r15, %rax
je 0xec04
cmpq 0x397a1(%rip), %rax     # 0x482a8
je 0xec59
cmpq 0x3978c(%rip), %rax     # 0x482a0
jne 0xeb8b
movq %rbx, %rdi
callq 0x8ba5
callq 0xeef9
movl 0x3078f(%rip), %eax     # 0x3f2b8
movl $0xfffe795f, %r15d      # imm = 0xFFFE795F
leal (%rax,%r15), %ecx
cmpl %r15d, %ecx
jbe 0xed5b
decl %eax
movl %eax, 0x30774(%rip)     # 0x3f2b8
leaq 0x39a75(%rip), %r12     # 0x485c0
movq (%r12,%rax,8), %r14
movq %rbx, %rdi
callq 0x8ba5
callq 0xeda7
movl 0x30756(%rip), %eax     # 0x3f2b8
leal (%rax,%r15), %ecx
cmpl %r15d, %ecx
jbe 0xed5b
decl %eax
movl %eax, 0x30741(%rip)     # 0x3f2b8
movq (%r12,%rax,8), %rbx
movq %rbx, %rdi
callq 0xb477
testl %eax, %eax
je 0xed14
movq 0x345ae(%rip), %rdi     # 0x43140
jmp 0xec46
leaq 0x8(%rbx), %r13
cmpb $0x1, %r12b
leaq 0x36e5a(%rip), %rcx     # 0x45a00
movq %rcx, %rax
cmoveq %r13, %rax
movq (%rax), %rax
cmpb $0x1, 0x10(%rax)
cmovneq %rcx, %rax
movq (%rax), %rdi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
movl $0x1, %edx
callq 0xd1c4
testl %eax, %eax
je 0xeae2
movq 0x37477(%rip), %rdi     # 0x46050
callq 0x8ba5
cmpb $0x1, 0x10(%rbx)
leaq 0x36e17(%rip), %rcx     # 0x45a00
cmovneq %rcx, %r13
movq (%r13), %rax
cmpb $0x1, 0x10(%rax)
jne 0xece4
movq 0x8(%rax), %rax
jmp 0xeceb
leaq 0x8(%rbx), %rcx
cmpb $0x1, %r12b
cmovneq %r13, %rcx
movq (%rcx), %rcx
cmpb $0x1, 0x10(%rcx)
movq 0x396aa(%rip), %rdx     # 0x482c8
jne 0xecaf
cmpq %rdx, (%rcx)
jne 0xeb00
movq 0x8(%rcx), %rcx
jmp 0xecbf
movabsq $-0x3ff6de04abbbd2e8, %rcx # imm = 0xC00921FB54442D18
movq %rcx, (%rax)
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8ba5
addq $0x8, %rbx
cmpb $0x1, %r12b
cmovneq %r13, %rbx
movq (%rbx), %rbx
cmpb $0x1, 0x10(%rbx)
movl %r14d, %edi
jne 0xec99
movq (%rbx), %rdi
callq 0x8ba5
callq 0xea27
leaq 0x8(%rbx), %rax
cmpb $0x1, 0x10(%rbx)
cmovneq %r13, %rax
movq (%rax), %rbx
cmpb $0x1, 0x10(%rbx)
je 0xec71
movl 0x3061f(%rip), %edi     # 0x3f2b8
subl %r14d, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xadb3
movq 0x36d4a(%rip), %rcx     # 0x45a00
cmpq %rdx, %rcx
jne 0xeb00
cmpb $0x1, 0x10(%rcx)
jne 0xecc8
movq %rcx, %r13
movq (%r13), %rdi
callq 0x8ba5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xeda7
movq 0x36d15(%rip), %rax     # 0x45a00
cmpb $0x1, 0x10(%rax)
jne 0xecf4
movq %rax, %rcx
movq (%rcx), %rdi
callq 0x8ba5
movl $0x2, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xacef
movq %r14, %rdi
callq 0xb477
testl %eax, %eax
je 0xed38
movl $0x1, %edi
movl $0x2, %esi
callq 0xa533
movq 0x3731a(%rip), %rdi     # 0x46050
jmp 0xecf7
movq %rbx, %rdi
callq 0x8ba5
movq %r14, %rdi
callq 0x8ba5
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xdab9
leaq 0x201df(%rip), %rdi     # 0x2ef41
callq 0x780b