// File: /workspace/github_c_makefile_star2_O3/georgeweigt[P]eigenmath/eigenmath.c
// Function: arctan_numbers
void
arctan_numbers(struct atom *X, struct atom *Y)
{
	double x, y;
	struct atom *T;

	if (iszero(X) && iszero(Y)) {
		push_integer(0);
		return;
	}

	if (isdouble(X) || isdouble(Y)) {
		push(X);
		x = pop_double();
		push(Y);
		y = pop_double();
		if (y == 0.0) {
			if (x < 0.0)
				push_double(-M_PI);
			else
				push_double(0.0);
		} else
			push_double(atan2(y, x));
		return;
	}

	// X and Y are rational numbers

	if (iszero(Y)) {
		if (isnegativenumber(X)) {
			push_symbol(PI);
			negate();
		} else
			push_integer(0);
		return;
	}

	if (iszero(X)) {
		if (isnegativenumber(Y))
			push_rational(-1, 2);
		else
			push_rational(1, 2);
		push_symbol(PI);
		multiply();
		return;
	}

	// convert fractions to integers

	push(Y);
	push(X);
	divide();
	absfunc();
	T = pop();

	push(T);
	numerator();
	if (isnegativenumber(Y))
		negate();
	Y = pop();

	push(T);
	denominator();
	if (isnegativenumber(X))
		negate();
	X = pop();

	// compare numerators and denominators, ignore signs

	if (mcmp(X->u.q.a, Y->u.q.a) != 0 || mcmp(X->u.q.b, Y->u.q.b) != 0) {
		// not equal
		if (isnegativenumber(Y)) {
			push_symbol(ARCTAN);
			push(Y);
			negate();
			push(X);
			list(3);
			negate();
		} else {
			push_symbol(ARCTAN);
			push(Y);
			push(X);
			list(3);
		}
		return;
	}

	// X = Y modulo sign

	if (isnegativenumber(X)) {
		if (isnegativenumber(Y))
			push_rational(-3, 4);
		else
			push_rational(3, 4);
	} else {
		if (isnegativenumber(Y))
			push_rational(-1, 4);
		else
			push_rational(1, 4);
	}

	push_symbol(PI);
	multiply();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
callq 0xb477
movl %eax, %r15d
testl %eax, %eax
je 0xde13
movq %r14, %rdi
callq 0xb477
testl %eax, %eax
je 0xde13
movq 0x35332(%rip), %rdi     # 0x43140
jmp 0xded3
movb 0x10(%rbx), %r12b
cmpb $0x5, %r12b
je 0xde27
movb 0x10(%r14), %r13b
cmpb $0x5, %r13b
jne 0xde98
movq %rbx, %rdi
callq 0x8ba5
callq 0x9128
movsd %xmm0, -0x30(%rbp)
movq %r14, %rdi
callq 0x8ba5
callq 0x9128
xorpd %xmm1, %xmm1
ucomisd %xmm1, %xmm0
jne 0xde75
jp 0xde75
callq 0x74dc
xorpd %xmm0, %xmm0
ucomisd -0x30(%rbp), %xmm0
movb $0x5, 0x10(%rax)
jbe 0xdec9
movabsq $-0x3ff6de04abbbd2e8, %rcx # imm = 0xC00921FB54442D18
movq %rcx, (%rax)
jmp 0xded0
movsd -0x30(%rbp), %xmm1
callq 0x72a0
movsd %xmm0, -0x30(%rbp)
callq 0x74dc
movb $0x5, 0x10(%rax)
movsd -0x30(%rbp), %xmm0
movsd %xmm0, (%rax)
jmp 0xded0
movq %r14, %rdi
callq 0xb477
testl %eax, %eax
je 0xdee6
cmpb $0x4, %r12b
jne 0xde07
cmpb $0x1, 0x12(%rbx)
jne 0xde07
movq 0x38191(%rip), %rdi     # 0x46050
callq 0x8ba5
jmp 0xe0f0
movq $0x0, (%rax)
movq %rax, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8ba5
testl %r15d, %r15d
je 0xdf18
cmpb $0x4, %r13b
jne 0xdefd
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
cmpb $0x1, 0x12(%r14)
je 0xdf02
movl $0x1, %edi
movl $0x2, %esi
callq 0xa533
movq 0x3813d(%rip), %rdi     # 0x46050
jmp 0xe0f7
movq %r14, %rdi
callq 0x8ba5
movq %rbx, %rdi
callq 0x8ba5
movq 0x1084c1(%rip), %rdi    # 0x1163f0
callq 0x8ba5
callq 0xa573
movl $0x2, %edi
callq 0xacef
callq 0x9e31
movl 0x3136a(%rip), %eax     # 0x3f2b8
movl $0xfffe795f, %r13d      # imm = 0xFFFE795F
leal (%rax,%r13), %ecx
cmpl %r13d, %ecx
jbe 0xe20c
decl %eax
movl %eax, 0x3134f(%rip)     # 0x3f2b8
leaq 0x3a650(%rip), %r12     # 0x485c0
movq (%r12,%rax,8), %r15
movq %r15, %rdi
callq 0x8ba5
callq 0xe915
callq 0xb238
movl 0x3132c(%rip), %eax     # 0x3f2b8
leal (%rax,%r13), %ecx
cmpl %r13d, %ecx
jbe 0xe20c
decl %eax
movl %eax, 0x31317(%rip)     # 0x3f2b8
movzbl 0x10(%r14), %ecx
cmpl $0x5, %ecx
je 0xe114
cmpl $0x4, %ecx
jne 0xdfd7
cmpb $0x1, 0x12(%r14)
jne 0xdfd7
movq 0x10842e(%rip), %rdi    # 0x1163f0
callq 0x8ba5
movl $0x2, %edi
callq 0xacef
movl 0x312e1(%rip), %eax     # 0x3f2b8
movl $0xfffe795f, %r13d      # imm = 0xFFFE795F
leal (%rax,%r13), %ecx
cmpl %r13d, %ecx
jbe 0xe20c
decl %eax
movl %eax, 0x312c6(%rip)     # 0x3f2b8
movq (%r12,%rax,8), %r14
movq %r15, %rdi
callq 0x8ba5
callq 0xe915
movl 0x312af(%rip), %eax     # 0x3f2b8
leal (%rax,%r13), %ecx
cmpl %r13d, %ecx
jbe 0xe20c
decl %eax
movl %eax, 0x3129a(%rip)     # 0x3f2b8
movzbl 0x10(%rbx), %ecx
cmpl $0x5, %ecx
je 0xe128
cmpl $0x4, %ecx
jne 0xe052
cmpb $0x1, 0x12(%rbx)
jne 0xe052
movq 0x1083b3(%rip), %rdi    # 0x1163f0
callq 0x8ba5
movl $0x2, %edi
callq 0xacef
movl 0x31266(%rip), %eax     # 0x3f2b8
movl $0xfffe795f, %ecx       # imm = 0xFFFE795F
leal (%rax,%rcx), %edx
cmpl %ecx, %edx
jbe 0xe20c
decl %eax
movl %eax, 0x3124e(%rip)     # 0x3f2b8
movq (%r12,%rax,8), %rbx
movq (%rbx), %rdi
movq (%r14), %rsi
callq 0x8704
testl %eax, %eax
jne 0xe092
movq 0x8(%rbx), %rdi
movq 0x8(%r14), %rsi
callq 0x8704
testl %eax, %eax
je 0xe17e
movzbl 0x10(%r14), %eax
cmpl $0x5, %eax
je 0xe13b
cmpl $0x4, %eax
jne 0xe14a
cmpb $0x1, 0x12(%r14)
jne 0xe14a
movq 0x350dd(%rip), %rdi     # 0x43198
callq 0x8ba5
movq %r14, %rdi
callq 0x8ba5
movq 0x108321(%rip), %rdi    # 0x1163f0
callq 0x8ba5
movl $0x2, %edi
callq 0xacef
movq %rbx, %rdi
callq 0x8ba5
movl $0x3, %edi
callq 0x8b7d
movq 0x1082f9(%rip), %rdi    # 0x1163f0
callq 0x8ba5
movl $0x2, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0xacef
xorpd %xmm0, %xmm0
ucomisd (%r14), %xmm0
ja 0xdfbb
jmp 0xdfd7
xorpd %xmm0, %xmm0
ucomisd (%rbx), %xmm0
ja 0xe036
jmp 0xe052
xorpd %xmm0, %xmm0
ucomisd (%r14), %xmm0
ja 0xe0b4
movq 0x35047(%rip), %rdi     # 0x43198
callq 0x8ba5
movq %r14, %rdi
callq 0x8ba5
movq %rbx, %rdi
callq 0x8ba5
movl $0x3, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8b7d
movzbl 0x10(%rbx), %eax
cmpl $0x5, %eax
je 0xe1af
cmpl $0x4, %eax
jne 0xe1b9
cmpb $0x1, 0x12(%rbx)
jne 0xe1b9
movzbl 0x10(%r14), %eax
cmpl $0x5, %eax
je 0xe1ed
cmpl $0x4, %eax
jne 0xe1fd
movl $0xfffffffd, %edi       # imm = 0xFFFFFFFD
cmpb $0x1, 0x12(%r14)
jne 0xe1fd
jmp 0xe202
xorpd %xmm0, %xmm0
ucomisd (%rbx), %xmm0
ja 0xe192
movzbl 0x10(%r14), %eax
cmpl $0x5, %eax
je 0xe1d6
cmpl $0x4, %eax
jne 0xe1e6
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
cmpb $0x1, 0x12(%r14)
jne 0xe1e6
jmp 0xe202
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorpd %xmm0, %xmm0
ucomisd (%r14), %xmm0
ja 0xe202
movl $0x1, %edi
jmp 0xe202
movl $0xfffffffd, %edi       # imm = 0xFFFFFFFD
xorpd %xmm0, %xmm0
ucomisd (%r14), %xmm0
ja 0xe202
movl $0x3, %edi
movl $0x4, %esi
jmp 0xdf07
leaq 0x20d2e(%rip), %rdi     # 0x2ef41
callq 0x780b