// File: /workspace/github_c_makefile_star2_O0/georgeweigt[P]eigenmath/eigenmath.c
// Function: decomp_sum
void
decomp_sum(struct atom *F, struct atom *X)
{
	int h, i, j, k, n;
	struct atom *p1, *p2;

	h = tos;

	// partition terms

	p1 = cdr(F);

	while (iscons(p1)) {
		p2 = car(p1);
		if (dependent(p2, X)) {
			if (car(p2) == symbol(MULTIPLY)) {
				push(p2);
				push(X);
				partition_term();	// push const part then push var part
			} else {
				push_integer(1);	// const part
				push(p2);		// var part
			}
		}
		p1 = cdr(p1);
	}

	// combine const parts of matching var parts

	n = tos - h;

	for (i = 0; i < n - 2; i += 2)
		for (j = i + 2; j < n; j += 2) {
			if (!equal(stack[h + i + 1], stack[h + j + 1]))
				continue;
			push(stack[h + i]); // add const parts
			push(stack[h + j]);
			add();
			stack[h + i] = pop();
			for (k = j; k < n - 2; k++)
				stack[h + k] = stack[h + k + 2];
			j -= 2; // use same j again
			n -= 2;
			tos -= 2; // pop
		}

	// push const parts, decomp var parts

	list(tos - h);
	p1 = pop();

	while (iscons(p1)) {
		push(car(p1)); // const part
		push(cadr(p1)); // var part
		push(X);
		decomp();
		p1 = cddr(p1);
	}

	// add together all constant terms

	h = tos;
	p1 = cdr(F);
	while (iscons(p1)) {
		if (!dependent(car(p1), X))
			push(car(p1));
		p1 = cdr(p1);
	}

	n = tos - h;

	if (n > 1) {
		list(n);
		push_symbol(ADD);
		swap();
		cons(); // makes ADD head of list
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl 0x3492f(%rip), %eax     # 0x582b8
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x239a7
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x239b2
movq 0x3b052(%rip), %rax     # 0x5ea00
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x23a9d
movq -0x30(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x239e5
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x239f0
movq 0x3b014(%rip), %rax     # 0x5ea00
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x23860
cmpl $0x0, %eax
je 0x23a6a
movq -0x38(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x23a24
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x23a2f
movq 0x3afd5(%rip), %rax     # 0x5ea00
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
cmpq 0x3d86e(%rip), %rax     # 0x612a8
jne 0x23a55
movq -0x38(%rbp), %rdi
callq 0x9110
movq -0x10(%rbp), %rdi
callq 0x9110
callq 0x225b0
jmp 0x23a68
movl $0x1, %edi
callq 0xca50
movq -0x38(%rbp), %rdi
callq 0x9110
jmp 0x23a6a
movq -0x30(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x23a85
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0x23a90
movq 0x3af74(%rip), %rax     # 0x5ea00
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x239ba
movl 0x34815(%rip), %eax     # 0x582b8
subl -0x14(%rbp), %eax
movl %eax, -0x24(%rbp)
movl $0x0, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl -0x24(%rbp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x23bee
movl -0x18(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jge 0x23bde
movl -0x14(%rbp), %eax
addl -0x18(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x3dad7(%rip), %rax     # 0x615c0
movq (%rax,%rcx,8), %rdi
movl -0x14(%rbp), %eax
addl -0x1c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x3dac0(%rip), %rax     # 0x615c0
movq (%rax,%rcx,8), %rsi
callq 0x93b0
cmpl $0x0, %eax
je 0x23b13
jmp 0x23bd0
movl -0x14(%rbp), %eax
addl -0x18(%rbp), %eax
movslq %eax, %rcx
leaq 0x3da9d(%rip), %rax     # 0x615c0
movq (%rax,%rcx,8), %rdi
callq 0x9110
movl -0x14(%rbp), %eax
addl -0x1c(%rbp), %eax
movslq %eax, %rcx
leaq 0x3da84(%rip), %rax     # 0x615c0
movq (%rax,%rcx,8), %rdi
callq 0x9110
callq 0xc660
callq 0x91d0
movq %rax, %rdx
movl -0x14(%rbp), %eax
addl -0x18(%rbp), %eax
movslq %eax, %rcx
leaq 0x3da5e(%rip), %rax     # 0x615c0
movq %rdx, (%rax,%rcx,8)
movl -0x1c(%rbp), %eax
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl -0x24(%rbp), %ecx
subl $0x2, %ecx
cmpl %ecx, %eax
jge 0x23baf
movl -0x14(%rbp), %eax
addl -0x20(%rbp), %eax
addl $0x2, %eax
movslq %eax, %rcx
leaq 0x3da34(%rip), %rax     # 0x615c0
movq (%rax,%rcx,8), %rdx
movl -0x14(%rbp), %eax
addl -0x20(%rbp), %eax
movslq %eax, %rcx
leaq 0x3da20(%rip), %rax     # 0x615c0
movq %rdx, (%rax,%rcx,8)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x23b6c
movl -0x1c(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x1c(%rbp)
movl -0x24(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x24(%rbp)
movl 0x346f1(%rip), %eax     # 0x582b8
subl $0x2, %eax
movl %eax, 0x346e8(%rip)     # 0x582b8
movl -0x1c(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x1c(%rbp)
jmp 0x23aca
jmp 0x23be0
movl -0x18(%rbp), %eax
addl $0x2, %eax
movl %eax, -0x18(%rbp)
jmp 0x23ab0
movl 0x346c4(%rip), %edi     # 0x582b8
subl -0x14(%rbp), %edi
callq 0x90d0
callq 0x91d0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x23d5d
movq -0x30(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x23c30
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x23c3b
movq 0x3adc9(%rip), %rax     # 0x5ea00
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rdi
callq 0x9110
movq -0x30(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x23c5f
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x68(%rbp)
jmp 0x23c6a
movq 0x3ad9a(%rip), %rax     # 0x5ea00
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x23caa
movq -0x30(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x23c92
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x70(%rbp)
jmp 0x23c9d
movq 0x3ad67(%rip), %rax     # 0x5ea00
movq %rax, -0x70(%rbp)
movq -0x70(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x78(%rbp)
jmp 0x23cb5
movq 0x3ad4f(%rip), %rax     # 0x5ea00
movq %rax, -0x78(%rbp)
movq -0x78(%rbp), %rdi
callq 0x9110
movq -0x10(%rbp), %rdi
callq 0x9110
callq 0x233c0
movq -0x30(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x23ce7
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x80(%rbp)
jmp 0x23cf2
movq 0x3ad12(%rip), %rax     # 0x5ea00
movq %rax, -0x80(%rbp)
movq -0x80(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x23d3f
movq -0x30(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x23d1d
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x88(%rbp)
jmp 0x23d2b
movq 0x3acdc(%rip), %rax     # 0x5ea00
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x90(%rbp)
jmp 0x23d4d
movq 0x3acba(%rip), %rax     # 0x5ea00
movq %rax, -0x90(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x23c05
movl 0x34555(%rip), %eax     # 0x582b8
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x23d84
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x98(%rbp)
jmp 0x23d92
movq 0x3ac75(%rip), %rax     # 0x5ea00
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x23e61
movq -0x30(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x23dcb
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xa0(%rbp)
jmp 0x23dd9
movq 0x3ac2e(%rip), %rax     # 0x5ea00
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x23860
cmpl $0x0, %eax
jne 0x23e25
movq -0x30(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x23e0b
movq -0x30(%rbp), %rax
movq (%rax), %rax
movq %rax, -0xa8(%rbp)
jmp 0x23e19
movq 0x3abee(%rip), %rax     # 0x5ea00
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rdi
callq 0x9110
movq -0x30(%rbp), %rax
movzbl 0x10(%rax), %eax
cmpl $0x1, %eax
jne 0x23e43
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xb0(%rbp)
jmp 0x23e51
movq 0x3abb6(%rip), %rax     # 0x5ea00
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x23d9d
movl 0x34451(%rip), %eax     # 0x582b8
subl -0x14(%rbp), %eax
movl %eax, -0x24(%rbp)
cmpl $0x1, -0x24(%rbp)
jle 0x23e91
movl -0x24(%rbp), %edi
callq 0x90d0
movq 0x3d41e(%rip), %rdi     # 0x612a0
callq 0x9110
callq 0xcb10
callq 0x9180
addq $0xb0, %rsp
popq %rbp
retq
nopw (%rax,%rax)