// File: /workspace/github_c_makefile_star2_O2/dalnefre[P]kernel_abe/gc.c
// Function: gc_sanity_check
void
gc_sanity_check(CELL* list)
/* check <list> for internal consistency */
{
	long n = 0;
	CELL* p = list;
	CELL* q = NULL;

	DBUG_ENTER("gc_sanity_check");
	XDBUG_PRINT("", ("gc_phase = 0x%x", gc_phase__mark));
	assert(((gc_phase__prev == GC_PHASE_0) && (gc_phase__mark == GC_PHASE_1))
	    || ((gc_phase__prev == GC_PHASE_1) && (gc_phase__mark == GC_PHASE_0)));
	DBUG_PRINT("", ("list = %p", list));
	for (;;) {
/*		DBUG_HEXDUMP(p, sizeof(CELL)); */
		assert(n >= 0);				/* prevent possible endless loop */
		assert(p != NULL);
		assert((as_word(p) & (sizeof(WORD) - 1)) == 0);	/* alignment */
		q = GC_NEXT(p);
		XDBUG_PRINT("", ("q = %p", q));
		assert(q != NULL);
		assert((as_word(q) & (sizeof(WORD) - 1)) == 0);	/* alignment */
		assert(GC_PREV(q) == p);
		if (q == list) {
			break;		/* done */
		}
		++n;
		p = q;
	}
	DBUG_PRINT("", ("count = %u", n));
	assert(n == GC_SIZE(list));		/* cached size mismatch */
	DBUG_RETURN;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rdi, %rbx
movl $0x80000000, %r15d      # imm = 0x80000000
leaq 0x692a(%rip), %rax      # 0x1da6f
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
leaq 0xd1dc(%rip), %r12      # 0x24330
movq (%r12), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x9c, 0xc(%rdi)
leaq 0x51da(%rip), %r14      # 0x1c34a
movq %r14, 0x10(%rdi)
leaq 0xd105(%rip), %rcx      # 0x24280
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0x1b079
movq 0xd101(%rip), %rcx      # 0x24290
movq %rcx, %rdx
btcq $0x1f, %rdx
movq 0xd0fa(%rip), %rax      # 0x24298
leaq 0x40000000(%r15), %rsi
xorq %rax, %rsi
orq %rdx, %rsi
je 0x171c6
leaq 0x40000000(%r15), %rdx
cmpq %rdx, %rcx
jne 0x17380
cmpq %r15, %rax
jne 0x17380
leaq 0xd763(%rip), %r13      # 0x24930
cmpl $0x0, (%r13)
je 0x1720c
movq (%r12), %rax
movq 0x50(%rax), %rax
movq %r14, 0x10(%rax)
movq %r14, %rdi
callq 0x1a7f4
testl %eax, %eax
je 0x1720c
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0xa0, 0xc(%rax)
leaq 0x6928(%rip), %rdi      # 0x1db2a
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1b0f0
xorl %r15d, %r15d
movq %rbx, %rax
testq %rax, %rax
je 0x172c6
testb $0x7, %al
jne 0x17342
movq 0x18(%rax), %rdx
leaq (,%rdx,4), %rcx
testq %rcx, %rcx
je 0x172e5
testb $0x1, %dl
jne 0x17323
movq 0x10(%rcx), %rdx
shlq $0x2, %rdx
cmpq %rdx, %rax
jne 0x17304
cmpq %rbx, %rcx
je 0x1725f
incq %r15
movq %rcx, %rax
jmp 0x17212
cmpl $0x0, (%r13)
je 0x1729e
movq (%r12), %rax
movq 0x50(%rax), %rax
movq %r14, 0x10(%rax)
movq %r14, %rdi
callq 0x1a7f4
testl %eax, %eax
je 0x1729e
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0xb1, 0xc(%rax)
leaq 0x6908(%rip), %rdi      # 0x1db9c
movq %r15, %rsi
xorl %eax, %eax
callq 0x1b0f0
cmpq %r15, (%rbx)
jne 0x17361
leaq 0x8(%rsp), %rdi
movl $0xb3, 0xc(%rdi)
callq 0x1b1f2
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x702e(%rip), %rdi      # 0x1e2fb
leaq 0x6834(%rip), %rsi      # 0x1db08
leaq 0x6832(%rip), %rcx      # 0x1db0d
movl $0xa4, %edx
callq 0x2100
leaq 0x686f(%rip), %rdi      # 0x1db5b
leaq 0x6815(%rip), %rsi      # 0x1db08
leaq 0x6813(%rip), %rcx      # 0x1db0d
movl $0xa8, %edx
callq 0x2100
leaq 0x6881(%rip), %rdi      # 0x1db8c
leaq 0x67f6(%rip), %rsi      # 0x1db08
leaq 0x67f4(%rip), %rcx      # 0x1db0d
movl $0xaa, %edx
callq 0x2100
leaq 0x683b(%rip), %rdi      # 0x1db65
leaq 0x67d7(%rip), %rsi      # 0x1db08
leaq 0x67d5(%rip), %rcx      # 0x1db0d
movl $0xa9, %edx
callq 0x2100
leaq 0x67eb(%rip), %rdi      # 0x1db34
leaq 0x67b8(%rip), %rsi      # 0x1db08
leaq 0x67b6(%rip), %rcx      # 0x1db0d
movl $0xa5, %edx
callq 0x2100
leaq 0x683f(%rip), %rdi      # 0x1dba7
leaq 0x6799(%rip), %rsi      # 0x1db08
leaq 0x6797(%rip), %rcx      # 0x1db0d
movl $0xb2, %edx
callq 0x2100
leaq 0x66f8(%rip), %rdi      # 0x1da7f
leaq 0x677a(%rip), %rsi      # 0x1db08
leaq 0x6778(%rip), %rcx      # 0x1db0d
movl $0x9f, %edx
callq 0x2100