// File: /workspace/github_c_makefile_star2_O0/rsa9000[P]regfanalysistools/regfwalk.c
// Function: regf_cells_stat
static void regf_cells_stat(void)
{
	struct cell *cell;
	int cnt_tot = 0, cnt_free = 0, cnt_orph = 0;

	rbt_inorder_walk_entry(cell, &st.cells, tree) {
		cnt_tot++;
		if (cell->type & CT_FREE) {
			cnt_free++;
			if (cell->type & ~CT_FREE || cell->refcnt)
				PR_WARN(cell->tree.key, "unkn", "someone reference free cell (type = 0x%04X, cnt = %u)\n",
					cell->type, cell->refcnt);
			continue;
		}
		if (cell->refcnt == 0) {
			PR_WARN(cell->tree.key, "unkn", "orphaned cell\n");
			cnt_orph++;
		}
		if (cell->type & (cell->type - 1)) {
			PR_WARN(cell->tree.key, "unkn", "cell referenced in different ways (type = 0x%04X, cnt = %u)\n",
				cell->type, cell->refcnt);
			continue;
		}
		if (cell->type & ~(CT_NK | CT_SK) && cell->refcnt > 1) {
			PR_WARN(cell->tree.key, "unkn", "cell referenced multiple times (type = 0x%04X, cnt = %u)\n",
				cell->type, cell->refcnt);
			continue;
		}
	}

	PR_LINE("Total cells: %d, free cell: %d, orphaned cells: %d\n",
		cnt_tot, cnt_free, cnt_orph);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl $0x0, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
leaq 0x76cc(%rip), %rdi      # 0x90f0
addq $0x28, %rdi
callq 0x3ae0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
leaq 0x76b4(%rip), %rcx      # 0x90f0
addq $0x28, %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x1b90
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x1ab7
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
andl $-0x2, %eax
cmpl $0x0, %eax
jne 0x1a87
movq -0x8(%rbp), %rax
cmpl $0x0, 0x24(%rax)
je 0x1ab2
movq -0x8(%rbp), %rax
movl 0x18(%rax), %esi
movq -0x8(%rbp), %rax
movl 0x28(%rax), %ecx
movq -0x8(%rbp), %rax
movl 0x24(%rax), %r8d
leaq 0x5363(%rip), %rdi      # 0x6e07
leaq 0x4c08(%rip), %rdx      # 0x66b3
movb $0x0, %al
callq 0x4c10
jmp 0x1b73
movq -0x8(%rbp), %rax
cmpl $0x0, 0x24(%rax)
jne 0x1ae6
movq -0x8(%rbp), %rax
movl 0x18(%rax), %esi
leaq 0x537f(%rip), %rdi      # 0x6e4e
leaq 0x4bdd(%rip), %rdx      # 0x66b3
movb $0x0, %al
callq 0x4c10
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
movq -0x8(%rbp), %rcx
movl 0x28(%rcx), %ecx
subl $0x1, %ecx
andl %ecx, %eax
cmpl $0x0, %eax
je 0x1b2b
movq -0x8(%rbp), %rax
movl 0x18(%rax), %esi
movq -0x8(%rbp), %rax
movl 0x28(%rax), %ecx
movq -0x8(%rbp), %rax
movl 0x24(%rax), %r8d
leaq 0x5352(%rip), %rdi      # 0x6e6d
leaq 0x4b91(%rip), %rdx      # 0x66b3
movb $0x0, %al
callq 0x4c10
jmp 0x1b73
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
andl $-0x7, %eax
cmpl $0x0, %eax
je 0x1b71
movq -0x8(%rbp), %rax
cmpl $0x1, 0x24(%rax)
jbe 0x1b71
movq -0x8(%rbp), %rax
movl 0x18(%rax), %esi
movq -0x8(%rbp), %rax
movl 0x28(%rax), %ecx
movq -0x8(%rbp), %rax
movl 0x24(%rax), %r8d
leaq 0x5359(%rip), %rdi      # 0x6eba
leaq 0x4b4b(%rip), %rdx      # 0x66b3
movb $0x0, %al
callq 0x4c10
jmp 0x1b73
jmp 0x1b73
movq -0x8(%rbp), %rsi
leaq 0x7572(%rip), %rdi      # 0x90f0
addq $0x28, %rdi
callq 0x3b30
movq %rax, -0x8(%rbp)
jmp 0x1a31
movl -0xc(%rbp), %esi
movl -0x10(%rbp), %edx
movl -0x14(%rbp), %ecx
leaq 0x5364(%rip), %rdi      # 0x6f04
movb $0x0, %al
callq 0x4c10
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)