// File: /workspace/github_c_makefile_star2_O1/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 0x609c(%rip), %rax      # 0x1da8f
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
leaq 0xb92e(%rip), %r12      # 0x23330
movq (%r12), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x9c, 0xc(%rdi)
leaq 0x492c(%rip), %r14      # 0x1c34a
movq %r14, 0x10(%rdi)
leaq 0xb857(%rip), %rcx      # 0x23280
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0x1b912
movq 0xb853(%rip), %rcx      # 0x23290
movq %rcx, %rdx
btcq $0x1f, %rdx
movq 0xb84c(%rip), %rax      # 0x23298
leaq 0x40000000(%r15), %rsi
xorq %rax, %rsi
orq %rdx, %rsi
je 0x17a74
leaq 0x40000000(%r15), %rdx
cmpq %rdx, %rcx
jne 0x17c2f
cmpq %r15, %rax
jne 0x17c2f
leaq 0xbeb5(%rip), %r13      # 0x23930
cmpl $0x0, (%r13)
je 0x17aba
movq (%r12), %rax
movq 0x50(%rax), %rax
movq %r14, 0x10(%rax)
movq %r14, %rdi
callq 0x1b084
testl %eax, %eax
je 0x17aba
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0xa0, 0xc(%rax)
leaq 0x609a(%rip), %rdi      # 0x1db4a
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1b983
testq %rbx, %rbx
je 0x17bd2
testb $0x7, %bl
jne 0x17bf1
xorl %r15d, %r15d
movq %rbx, %rcx
movq 0x18(%rcx), %rdx
leaq (,%rdx,4), %rax
testq %rax, %rax
je 0x17b75
testb $0x1, %dl
jne 0x17bb3
movq 0x10(%rax), %rdx
shlq $0x2, %rdx
cmpq %rdx, %rcx
jne 0x17b94
cmpq %rbx, %rax
je 0x17b0e
incq %r15
movq %rax, %rcx
jmp 0x17ad2
cmpl $0x0, (%r13)
je 0x17b4d
movq (%r12), %rax
movq 0x50(%rax), %rax
movq %r14, 0x10(%rax)
movq %r14, %rdi
callq 0x1b084
testl %eax, %eax
je 0x17b4d
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0xb1, 0xc(%rax)
leaq 0x6079(%rip), %rdi      # 0x1dbbc
movq %r15, %rsi
xorl %eax, %eax
callq 0x1b983
cmpq %r15, (%rbx)
jne 0x17c10
leaq 0x8(%rsp), %rdi
movl $0xb3, 0xc(%rdi)
callq 0x1ba97
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x5fff(%rip), %rdi      # 0x1db7b
leaq 0x5fa5(%rip), %rsi      # 0x1db28
leaq 0x5fa3(%rip), %rcx      # 0x1db2d
movl $0xa8, %edx
callq 0x2100
leaq 0x6011(%rip), %rdi      # 0x1dbac
leaq 0x5f86(%rip), %rsi      # 0x1db28
leaq 0x5f84(%rip), %rcx      # 0x1db2d
movl $0xaa, %edx
callq 0x2100
leaq 0x5fcb(%rip), %rdi      # 0x1db85
leaq 0x5f67(%rip), %rsi      # 0x1db28
leaq 0x5f65(%rip), %rcx      # 0x1db2d
movl $0xa9, %edx
callq 0x2100
leaq 0x6742(%rip), %rdi      # 0x1e31b
leaq 0x5f48(%rip), %rsi      # 0x1db28
leaq 0x5f46(%rip), %rcx      # 0x1db2d
movl $0xa4, %edx
callq 0x2100
leaq 0x5f5c(%rip), %rdi      # 0x1db54
leaq 0x5f29(%rip), %rsi      # 0x1db28
leaq 0x5f27(%rip), %rcx      # 0x1db2d
movl $0xa5, %edx
callq 0x2100
leaq 0x5fb0(%rip), %rdi      # 0x1dbc7
leaq 0x5f0a(%rip), %rsi      # 0x1db28
leaq 0x5f08(%rip), %rcx      # 0x1db2d
movl $0xb2, %edx
callq 0x2100
leaq 0x5e69(%rip), %rdi      # 0x1da9f
leaq 0x5eeb(%rip), %rsi      # 0x1db28
leaq 0x5ee9(%rip), %rcx      # 0x1db2d
movl $0x9f, %edx
callq 0x2100