// File: /workspace/github_c_makefile_star2_O3/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 0x6014(%rip), %rax      # 0x1da8f
leaq 0x8(%rsp), %rdi
movq %rax, (%rdi)
leaq 0xb8a6(%rip), %r12      # 0x23330
movq (%r12), %rax
movq 0x50(%rax), %rax
movl 0x8(%rax), %ecx
movl %ecx, 0x8(%rdi)
movl $0x9c, 0xc(%rdi)
leaq 0x48a4(%rip), %r14      # 0x1c34a
movq %r14, 0x10(%rdi)
leaq 0xb7cf(%rip), %rcx      # 0x23280
movq %rcx, 0x18(%rdi)
movq %rax, 0x20(%rdi)
callq 0x1ba26
movq 0xb7cb(%rip), %rcx      # 0x23290
movq %rcx, %rdx
btcq $0x1f, %rdx
movq 0xb7c4(%rip), %rax      # 0x23298
leaq 0x40000000(%r15), %rsi
xorq %rax, %rsi
orq %rdx, %rsi
je 0x17afc
leaq 0x40000000(%r15), %rdx
cmpq %rdx, %rcx
jne 0x17cb7
cmpq %r15, %rax
jne 0x17cb7
leaq 0xbe2d(%rip), %r13      # 0x23930
cmpl $0x0, (%r13)
je 0x17b42
movq (%r12), %rax
movq 0x50(%rax), %rax
movq %r14, 0x10(%rax)
movq %r14, %rdi
callq 0x1b188
testl %eax, %eax
je 0x17b42
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0xa0, 0xc(%rax)
leaq 0x6012(%rip), %rdi      # 0x1db4a
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1ba97
testq %rbx, %rbx
je 0x17c5a
testb $0x7, %bl
jne 0x17c79
xorl %r15d, %r15d
movq %rbx, %rcx
movq 0x18(%rcx), %rdx
leaq (,%rdx,4), %rax
testq %rax, %rax
je 0x17bfd
testb $0x1, %dl
jne 0x17c3b
movq 0x10(%rax), %rdx
shlq $0x2, %rdx
cmpq %rdx, %rcx
jne 0x17c1c
cmpq %rbx, %rax
je 0x17b96
incq %r15
movq %rax, %rcx
jmp 0x17b5a
cmpl $0x0, (%r13)
je 0x17bd5
movq (%r12), %rax
movq 0x50(%rax), %rax
movq %r14, 0x10(%rax)
movq %r14, %rdi
callq 0x1b188
testl %eax, %eax
je 0x17bd5
movq (%r12), %rax
movq 0x50(%rax), %rax
movl $0xb1, 0xc(%rax)
leaq 0x5ff1(%rip), %rdi      # 0x1dbbc
movq %r15, %rsi
xorl %eax, %eax
callq 0x1ba97
cmpq %r15, (%rbx)
jne 0x17c98
leaq 0x8(%rsp), %rdi
movl $0xb3, 0xc(%rdi)
callq 0x1bbab
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x5f77(%rip), %rdi      # 0x1db7b
leaq 0x5f1d(%rip), %rsi      # 0x1db28
leaq 0x5f1b(%rip), %rcx      # 0x1db2d
movl $0xa8, %edx
callq 0x2100
leaq 0x5f89(%rip), %rdi      # 0x1dbac
leaq 0x5efe(%rip), %rsi      # 0x1db28
leaq 0x5efc(%rip), %rcx      # 0x1db2d
movl $0xaa, %edx
callq 0x2100
leaq 0x5f43(%rip), %rdi      # 0x1db85
leaq 0x5edf(%rip), %rsi      # 0x1db28
leaq 0x5edd(%rip), %rcx      # 0x1db2d
movl $0xa9, %edx
callq 0x2100
leaq 0x66ba(%rip), %rdi      # 0x1e31b
leaq 0x5ec0(%rip), %rsi      # 0x1db28
leaq 0x5ebe(%rip), %rcx      # 0x1db2d
movl $0xa4, %edx
callq 0x2100
leaq 0x5ed4(%rip), %rdi      # 0x1db54
leaq 0x5ea1(%rip), %rsi      # 0x1db28
leaq 0x5e9f(%rip), %rcx      # 0x1db2d
movl $0xa5, %edx
callq 0x2100
leaq 0x5f28(%rip), %rdi      # 0x1dbc7
leaq 0x5e82(%rip), %rsi      # 0x1db28
leaq 0x5e80(%rip), %rcx      # 0x1db2d
movl $0xb2, %edx
callq 0x2100
leaq 0x5de1(%rip), %rdi      # 0x1da9f
leaq 0x5e63(%rip), %rsi      # 0x1db28
leaq 0x5e61(%rip), %rcx      # 0x1db2d
movl $0x9f, %edx
callq 0x2100