// File: /workspace/github_c_makefile_star2_O0/georgeweigt[P]eigenmath/eigenmath.c
// Function: gc
void
gc(void)
{
	int i, j;
	struct atom *p;

	gc_count++;
	alloc_count = 0;

	// tag everything

	for (i = 0; i < block_count; i++)
		for (j = 0; j < BLOCKSIZE; j++)
			mem[i][j].tag = 1;

	// untag what's used

	untag(zero);
	untag(one);
	untag(minusone);
	untag(imaginaryunit);

	for (i = 0; i < tos; i++)
		untag(stack[i]);

	for (i = 0; i < 27 * BUCKETSIZE; i++) {
		untag(symtab[i]);
		untag(binding[i]);
		untag(usrfunc[i]);
	}

	// collect everything that's still tagged

	free_list = NULL;
	free_count = 0;

	for (i = 0; i < block_count; i++)
		for (j = 0; j < BLOCKSIZE; j++) {

			p = mem[i] + j;

			if (p->tag == 0)
				continue;

			// still tagged so it's unused, put on free list

			switch (p->atomtype) {
			case KSYM:
				free(p->u.ksym.name);
				ksym_count--;
				break;
			case USYM:
				free(p->u.usym.name);
				usym_count--;
				break;
			case RATIONAL:
				mfree(p->u.q.a);
				mfree(p->u.q.b);
				break;
			case STR:
				if (p->u.str)
					free(p->u.str);
				string_count--;
				break;
			case TENSOR:
				free(p->u.tensor);
				tensor_count--;
				break;
			default:
				break; // FREEATOM, CONS, or DOUBLE
			}

			p->atomtype = FREEATOM;
			p->u.next = free_list;

			free_list = p;
			free_count++;
		}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl 0x127dc2(%rip), %eax    # 0x12f3e0
addl $0x1, %eax
movl %eax, 0x127db9(%rip)    # 0x12f3e0
movl $0x0, 0x50c7f(%rip)     # 0x582b0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0x50c73(%rip), %eax     # 0x582b4
jge 0x7689
movl $0x0, -0x8(%rbp)
cmpl $0x2710, -0x8(%rbp)     # imm = 0x2710
jge 0x767c
movslq -0x4(%rbp), %rcx
leaq 0x50c62(%rip), %rax     # 0x582c0
movq (%rax,%rcx,8), %rax
movslq -0x8(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movb $0x1, 0x11(%rax)
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x764a
jmp 0x767e
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x7638
movq 0x54ab0(%rip), %rdi     # 0x5c140
callq 0x41a30
movq 0x11d43c(%rip), %rdi    # 0x124ad8
callq 0x41a30
movq 0x127d48(%rip), %rdi    # 0x12f3f0
callq 0x41a30
movq 0x11d42c(%rip), %rdi    # 0x124ae0
callq 0x41a30
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0x50bef(%rip), %eax     # 0x582b8
jge 0x76ea
movslq -0x4(%rbp), %rcx
leaq 0x59eea(%rip), %rax     # 0x615c0
movq (%rax,%rcx,8), %rdi
callq 0x41a30
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x76c0
movl $0x0, -0x4(%rbp)
cmpl $0xa8c, -0x4(%rbp)      # imm = 0xA8C
jge 0x7741
movslq -0x4(%rbp), %rcx
leaq 0x54a5b(%rip), %rax     # 0x5c160
movq (%rax,%rcx,8), %rdi
callq 0x41a30
movslq -0x4(%rbp), %rcx
leaq 0x11d3d7(%rip), %rax    # 0x124af0
movq (%rax,%rcx,8), %rdi
callq 0x41a30
movslq -0x4(%rbp), %rcx
leaq 0x122823(%rip), %rax    # 0x129f50
movq (%rax,%rcx,8), %rdi
callq 0x41a30
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x76f1
movq $0x0, 0x50b5c(%rip) # 0x582a8
movl $0x0, 0x50b4a(%rip)     # 0x582a0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl 0x50b4e(%rip), %eax     # 0x582b4
jge 0x78c7
movl $0x0, -0x8(%rbp)
cmpl $0x2710, -0x8(%rbp)     # imm = 0x2710
jge 0x78b7
movslq -0x4(%rbp), %rcx
leaq 0x50b35(%rip), %rax     # 0x582c0
movq (%rax,%rcx,8), %rax
movslq -0x8(%rbp), %rcx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movzbl 0x11(%rax), %eax
cmpl $0x0, %eax
jne 0x77b0
jmp 0x78a9
movq -0x10(%rbp), %rax
movzbl 0x10(%rax), %eax
addl $-0x2, %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x5, %eax
ja 0x7877
movq -0x18(%rbp), %rax
leaq 0x3d82f(%rip), %rcx     # 0x45004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x7040
movl 0x127bf4(%rip), %eax    # 0x12f3e4
addl $-0x1, %eax
movl %eax, 0x127beb(%rip)    # 0x12f3e4
jmp 0x7879
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x7040
movl 0x127bdb(%rip), %eax    # 0x12f3e8
addl $-0x1, %eax
movl %eax, 0x127bd2(%rip)    # 0x12f3e8
jmp 0x7879
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x7e70
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7e70
jmp 0x7879
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x7849
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x7040
movl 0x548fd(%rip), %eax     # 0x5c14c
addl $-0x1, %eax
movl %eax, 0x548f4(%rip)     # 0x5c14c
jmp 0x7879
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x7040
movl 0x548dc(%rip), %eax     # 0x5c148
addl $-0x1, %eax
movl %eax, 0x548d3(%rip)     # 0x5c148
jmp 0x7879
jmp 0x7879
movq -0x10(%rbp), %rax
movb $0x0, 0x10(%rax)
movq 0x50a20(%rip), %rcx     # 0x582a8
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq %rax, 0x50a0e(%rip)     # 0x582a8
movl 0x50a00(%rip), %eax     # 0x582a0
addl $0x1, %eax
movl %eax, 0x509f7(%rip)     # 0x582a0
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x7773
jmp 0x78b9
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x775d
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)