// File: /workspace/github_c_makefile_star2_O0/blakemcbride[P]LISP9/ls9.c
// Function: gc
int gc(void) {
	int	i, n, k, sk;
	char	buf[100];
	cell	*a;
	byte	*m;

	for (i=0; i<NPORTS; i++) {
		if (Port_flags[i] & LOCK_TAG)
			Port_flags[i] |= USED_TAG;
		else if (i == Inport || i == Outport)
			Port_flags[i] |= USED_TAG;
		else
			Port_flags[i] &= ~USED_TAG;
	}
	if (Rts != NIL) {
		sk = stringlen(Rts);
		stringlen(Rts) = (1 + Sp) * sizeof(cell);
	}
	for (i=0; GC_roots[i] != NULL; i++) {
		mark(*GC_roots[i]);
	}
	if (Rts != NIL) {
		stringlen(Rts) = sk;
	}
	k = 0;
	Freelist = NIL;
	for (i=0; i<NNODES; i++) {
		if (!(tag(i) & MARK_TAG)) {
			cdr(i) = Freelist;
			Freelist = i;
			k++;
		}
		else {
			tag(i) &= ~MARK_TAG;
		}
	}
	for (i=0; i<NPORTS; i++) {
		if (!(Port_flags[i] & USED_TAG) && Ports[i] != NULL) {
			fclose(Ports[i]);
			Ports[i] = NULL;
		}
	}
	n = NIL == Obarray? 0: veclen(Obarray);
	a = NIL == Obarray? NULL: vector(Obarray);
	m = NIL == Obmap? NULL: string(Obmap);
	for (i=0; i<n; i++) {
		if (OBUSED  == m[i]) {
			m[i] = OBALLOC;
		}
		else {
			m[i] = OBFREE;
			a[i] = NIL;
		}
	}
	if (GC_verbose) {
		sprintf(buf, "GC: %d nodes reclaimed", k);
		prints(buf); nl();
		flush();
	}
	return k;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movl $0x0, -0x4(%rbp)
cmpl $0x14, -0x4(%rbp)
jge 0x3639
movslq -0x4(%rbp), %rcx
leaq 0x1d059(%rip), %rax     # 0x20600
movsbl (%rax,%rcx), %eax
andl $0x40, %eax
cmpl $0x0, %eax
je 0x35d3
movslq -0x4(%rbp), %rcx
leaq 0x1d042(%rip), %rax     # 0x20600
movsbl (%rax,%rcx), %eax
orl $0x20, %eax
movb %al, %dl
leaq 0x1d032(%rip), %rax     # 0x20600
movb %dl, (%rax,%rcx)
jmp 0x3629
movl -0x4(%rbp), %eax
cmpl 0x1cf6c(%rip), %eax     # 0x20548
je 0x35e9
movl -0x4(%rbp), %eax
cmpl 0x1cb61(%rip), %eax     # 0x20148
jne 0x3609
movslq -0x4(%rbp), %rcx
leaq 0x1d00c(%rip), %rax     # 0x20600
movsbl (%rax,%rcx), %eax
orl $0x20, %eax
movb %al, %dl
leaq 0x1cffc(%rip), %rax     # 0x20600
movb %dl, (%rax,%rcx)
jmp 0x3627
movslq -0x4(%rbp), %rcx
leaq 0x1cfec(%rip), %rax     # 0x20600
movsbl (%rax,%rcx), %eax
andl $-0x21, %eax
movb %al, %dl
leaq 0x1cfdc(%rip), %rax     # 0x20600
movb %dl, (%rax,%rcx)
jmp 0x3629
jmp 0x362b
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x3592
cmpl $-0x1, 0x1cb1c(%rip)    # 0x2015c
je 0x3698
movq 0x1cd0f(%rip), %rax     # 0x20358
movq 0x1ccf8(%rip), %rcx     # 0x20348
movslq 0x1cb05(%rip), %rdx     # 0x2015c
movl (%rcx,%rdx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x10(%rbp)
movl 0x1caf4(%rip), %eax     # 0x20160
addl $0x1, %eax
cltq
shlq $0x2, %rax
movl %eax, %edx
movq 0x1ccda(%rip), %rax     # 0x20358
movq 0x1ccc3(%rip), %rcx     # 0x20348
movslq 0x1cad0(%rip), %rsi     # 0x2015c
movl (%rcx,%rsi,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl $0x0, -0x4(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0x1cb96(%rip), %rax     # 0x20240
cmpq $0x0, (%rax,%rcx,8)
je 0x36d2
movslq -0x4(%rbp), %rcx
leaq 0x1cb84(%rip), %rax     # 0x20240
movq (%rax,%rcx,8), %rax
movl (%rax), %edi
callq 0x30a0
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x369f
cmpl $-0x1, 0x1ca83(%rip)    # 0x2015c
je 0x36ff
movl -0x10(%rbp), %edx
movq 0x1cc73(%rip), %rax     # 0x20358
movq 0x1cc5c(%rip), %rcx     # 0x20348
movslq 0x1ca69(%rip), %rsi     # 0x2015c
movl (%rcx,%rsi,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movl %edx, (%rax,%rcx,4)
movl $0x0, -0xc(%rbp)
movl $0xffffffff, 0x1ca20(%rip) # imm = 0xFFFFFFFF
movl $0x0, -0x4(%rbp)
cmpl $0x40000, -0x4(%rbp)    # imm = 0x40000
jge 0x3781
movq 0x1cc29(%rip), %rax     # 0x20350
movslq -0x4(%rbp), %rcx
movzbl (%rax,%rcx), %eax
andl $0x2, %eax
cmpl $0x0, %eax
jne 0x375f
movl 0x1c9f3(%rip), %edx     # 0x20130
movq 0x1cc04(%rip), %rax     # 0x20348
movslq -0x4(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movl -0x4(%rbp), %eax
movl %eax, 0x1c9dc(%rip)     # 0x20130
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x3774
movq 0x1cbea(%rip), %rax     # 0x20350
movslq -0x4(%rbp), %rcx
movzbl (%rax,%rcx), %edx
andl $-0x3, %edx
movb %dl, (%rax,%rcx)
jmp 0x3776
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x3717
movl $0x0, -0x4(%rbp)
cmpl $0x14, -0x4(%rbp)
jge 0x37eb
movslq -0x4(%rbp), %rcx
leaq 0x1ce67(%rip), %rax     # 0x20600
movsbl (%rax,%rcx), %eax
andl $0x20, %eax
cmpl $0x0, %eax
jne 0x37de
movslq -0x4(%rbp), %rcx
leaq 0x1cdb0(%rip), %rax     # 0x20560
cmpq $0x0, (%rax,%rcx,8)
je 0x37de
movslq -0x4(%rbp), %rcx
leaq 0x1cd9e(%rip), %rax     # 0x20560
movq (%rax,%rcx,8), %rdi
callq 0x2080
movslq -0x4(%rbp), %rcx
leaq 0x1cd8a(%rip), %rax     # 0x20560
movq $0x0, (%rax,%rcx,8)
jmp 0x37e0
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x3788
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x1c96e(%rip), %eax     # 0x20164
jne 0x3803
xorl %eax, %eax
movq %rax, -0x98(%rbp)
jmp 0x3840
movq 0x1cb4e(%rip), %rax     # 0x20358
movq 0x1cb37(%rip), %rcx     # 0x20348
movslq 0x1c94c(%rip), %rdx     # 0x20164
movl (%rcx,%rdx,4), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movslq (%rax,%rcx,4), %rax
addq $0x4, %rax
subq $0x1, %rax
shrq $0x2, %rax
addq $0x2, %rax
subq $0x2, %rax
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movl %eax, -0x8(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x1c90f(%rip), %eax     # 0x20164
jne 0x3862
xorl %eax, %eax
movq %rax, -0xa0(%rbp)
jmp 0x3889
movq 0x1caef(%rip), %rax     # 0x20358
movq 0x1cad8(%rip), %rcx     # 0x20348
movslq 0x1c8ed(%rip), %rdx     # 0x20164
movslq (%rcx,%rdx,4), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0x88(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x1c8b6(%rip), %eax     # 0x20158
jne 0x38af
xorl %eax, %eax
movq %rax, -0xa8(%rbp)
jmp 0x38d6
movq 0x1caa2(%rip), %rax     # 0x20358
movq 0x1ca8b(%rip), %rcx     # 0x20348
movslq 0x1c894(%rip), %rdx     # 0x20158
movslq (%rcx,%rdx,4), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
movq -0xa8(%rbp), %rax
movq %rax, -0x90(%rbp)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x394a
movq -0x90(%rbp), %rax
movslq -0x4(%rbp), %rcx
movzbl (%rax,%rcx), %ecx
movl $0x2, %eax
cmpl %ecx, %eax
jne 0x391c
movq -0x90(%rbp), %rax
movslq -0x4(%rbp), %rcx
movb $0x1, (%rax,%rcx)
jmp 0x393d
movq -0x90(%rbp), %rax
movslq -0x4(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x88(%rbp), %rax
movslq -0x4(%rbp), %rcx
movl $0xffffffff, (%rax,%rcx,4) # imm = 0xFFFFFFFF
jmp 0x393f
movl -0x4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4(%rbp)
jmp 0x38eb
cmpl $0x0, 0x1ccc3(%rip)     # 0x20614
je 0x3982
leaq -0x80(%rbp), %rdi
movl -0xc(%rbp), %edx
leaq 0x17b26(%rip), %rsi     # 0x1b487
movb $0x0, %al
callq 0x21f0
leaq -0x80(%rbp), %rdi
callq 0x25a0
leaq 0x18908(%rip), %rdi     # 0x1c280
callq 0x25a0
callq 0x2af0
movl -0xc(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nop