// File: /workspace/github_c_makefile_star2_O0/rsa9000[P]regfanalysistools/regfdump.c
// Function: regf_parse_cells
static int regf_parse_cells(unsigned off, unsigned len)
{
	unsigned end = off + len;
	char __pref[0x10];
	const struct regf_cell *rc;
	unsigned csz;
	const char *sign;

	snprintf(__pref, sizeof(__pref), "    ");

	off += sizeof(struct regf_hbin);
	while (off < end) {
		rc = (void *)(st.data + off);
		csz = rc->sz > 0 ? rc->sz : -rc->sz;
		sign = (char *)rc->data;

		if (rc->sz > 0) {
			printf("  [%07X:%03X]: free cell\n", off, csz);
		} else if (strncmp(sign, "nk", 2) == 0) {
			printf("  [%07X:%03X]: named key (nk) cell\n", off, csz);
			regf_parse_nk(__pref, off);
		} else if (strncmp(sign, "sk", 2) == 0) {
			printf("  [%07X:%03X]: security key (sk) cell\n", off, csz);
			regf_parse_sk(__pref, off);
		} else if (strncmp(sign, "lf", 2) == 0) {
			printf("  [%07X:%03X]: leaf fast (lf) cell\n", off, csz);
			regf_parse_lst_lf(__pref, off);
		} else if (strncmp(sign, "lh", 2) == 0) {
			printf("  [%07X:%03X]: leaf hash (lh) cell\n", off, csz);
			regf_parse_lst_lh(__pref, off);
		} else if (strncmp(sign, "li", 2) == 0) {
			printf("  [%07X:%03X]: index leaf (li) cell\n", off, csz);
			regf_parse_lst_li(__pref, off);
		} else if (strncmp(sign, "ri", 2) == 0) {
			printf("  [%07X:%03X]: index root (ri) cell\n", off, csz);
			regf_parse_lst_ri(__pref, off);
		} else if (strncmp(sign, "vk", 2) == 0) {
			printf("  [%07X:%03X]: value key (vk) cell\n", off, csz);
			regf_parse_vk(__pref, off);
		} else if (strncmp(sign, "db", 2) == 0) {
			printf("  [%07X:%03X]: data block (db) cell\n", off, csz);
			regf_parse_db(__pref, off);
		} else if (rc->data[0] >= 'a' && rc->data[0] <= 'z' &&
		           rc->data[1] >= 'a' && rc->data[1] <= 'z') {
			printf("  [%07X:%03X]: unknown cell (0x%02X 0x%02X)\n",
			       off, csz, rc->data[0], rc->data[1]);
		} else {
			printf("  [%07X:%03X]: raw data cell\n", off, csz);
		}

		off += csz;
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl -0x4(%rbp), %eax
addl -0x8(%rbp), %eax
movl %eax, -0xc(%rbp)
leaq -0x20(%rbp), %rdi
movl $0x10, %esi
leaq 0x36de(%rip), %rdx      # 0x5395
movb $0x0, %al
callq 0x10a0
movl -0x4(%rbp), %eax
addq $0x28, %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
cmpl -0xc(%rbp), %eax
jae 0x1fbc
movq 0x6415(%rip), %rax      # 0x80f0
movl -0x4(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
jle 0x1cf9
movq -0x28(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
jmp 0x1d04
movq -0x28(%rbp), %rcx
xorl %eax, %eax
subl (%rcx), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movq -0x28(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rax
cmpl $0x0, (%rax)
jle 0x1d38
movl -0x4(%rbp), %esi
movl -0x2c(%rbp), %edx
leaq 0x366e(%rip), %rdi      # 0x539a
movb $0x0, %al
callq 0x1090
jmp 0x1fae
movq -0x38(%rbp), %rdi
leaq 0x3ad4(%rip), %rsi      # 0x5817
movl $0x2, %edx
callq 0x1040
cmpl $0x0, %eax
jne 0x1d77
movl -0x4(%rbp), %esi
movl -0x2c(%rbp), %edx
leaq 0x3655(%rip), %rdi      # 0x53b4
movb $0x0, %al
callq 0x1090
leaq -0x20(%rbp), %rdi
movl -0x4(%rbp), %esi
callq 0x1fd0
jmp 0x1fac
movq -0x38(%rbp), %rdi
leaq 0x3656(%rip), %rsi      # 0x53d8
movl $0x2, %edx
callq 0x1040
cmpl $0x0, %eax
jne 0x1db6
movl -0x4(%rbp), %esi
movl -0x2c(%rbp), %edx
leaq 0x363d(%rip), %rdi      # 0x53db
movb $0x0, %al
callq 0x1090
leaq -0x20(%rbp), %rdi
movl -0x4(%rbp), %esi
callq 0x23c0
jmp 0x1faa
movq -0x38(%rbp), %rdi
leaq 0x3641(%rip), %rsi      # 0x5402
movl $0x2, %edx
callq 0x1040
cmpl $0x0, %eax
jne 0x1df5
movl -0x4(%rbp), %esi
movl -0x2c(%rbp), %edx
leaq 0x3628(%rip), %rdi      # 0x5405
movb $0x0, %al
callq 0x1090
leaq -0x20(%rbp), %rdi
movl -0x4(%rbp), %esi
callq 0x2430
jmp 0x1fa8
movq -0x38(%rbp), %rdi
leaq 0x3629(%rip), %rsi      # 0x5429
movl $0x2, %edx
callq 0x1040
cmpl $0x0, %eax
jne 0x1e34
movl -0x4(%rbp), %esi
movl -0x2c(%rbp), %edx
leaq 0x3610(%rip), %rdi      # 0x542c
movb $0x0, %al
callq 0x1090
leaq -0x20(%rbp), %rdi
movl -0x4(%rbp), %esi
callq 0x25a0
jmp 0x1fa6
movq -0x38(%rbp), %rdi
leaq 0x3611(%rip), %rsi      # 0x5450
movl $0x2, %edx
callq 0x1040
cmpl $0x0, %eax
jne 0x1e73
movl -0x4(%rbp), %esi
movl -0x2c(%rbp), %edx
leaq 0x35f8(%rip), %rdi      # 0x5453
movb $0x0, %al
callq 0x1090
leaq -0x20(%rbp), %rdi
movl -0x4(%rbp), %esi
callq 0x2700
jmp 0x1fa4
movq -0x38(%rbp), %rdi
leaq 0x35fa(%rip), %rsi      # 0x5478
movl $0x2, %edx
callq 0x1040
cmpl $0x0, %eax
jne 0x1eb2
movl -0x4(%rbp), %esi
movl -0x2c(%rbp), %edx
leaq 0x35e1(%rip), %rdi      # 0x547b
movb $0x0, %al
callq 0x1090
leaq -0x20(%rbp), %rdi
movl -0x4(%rbp), %esi
callq 0x2860
jmp 0x1fa2
movq -0x38(%rbp), %rdi
leaq 0x35e3(%rip), %rsi      # 0x54a0
movl $0x2, %edx
callq 0x1040
cmpl $0x0, %eax
jne 0x1ef1
movl -0x4(%rbp), %esi
movl -0x2c(%rbp), %edx
leaq 0x35ca(%rip), %rdi      # 0x54a3
movb $0x0, %al
callq 0x1090
leaq -0x20(%rbp), %rdi
movl -0x4(%rbp), %esi
callq 0x29c0
jmp 0x1fa0
movq -0x38(%rbp), %rdi
leaq 0x35cb(%rip), %rsi      # 0x54c7
movl $0x2, %edx
callq 0x1040
cmpl $0x0, %eax
jne 0x1f2d
movl -0x4(%rbp), %esi
movl -0x2c(%rbp), %edx
leaq 0x35b2(%rip), %rdi      # 0x54ca
movb $0x0, %al
callq 0x1090
leaq -0x20(%rbp), %rdi
movl -0x4(%rbp), %esi
callq 0x2bb0
jmp 0x1f9e
movq -0x28(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x61, %eax
jl 0x1f88
movq -0x28(%rbp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x7a, %eax
jg 0x1f88
movq -0x28(%rbp), %rax
movzbl 0x5(%rax), %eax
cmpl $0x61, %eax
jl 0x1f88
movq -0x28(%rbp), %rax
movzbl 0x5(%rax), %eax
cmpl $0x7a, %eax
jg 0x1f88
movl -0x4(%rbp), %esi
movl -0x2c(%rbp), %edx
movq -0x28(%rbp), %rax
movzbl 0x4(%rax), %ecx
movq -0x28(%rbp), %rax
movzbl 0x5(%rax), %r8d
leaq 0x3570(%rip), %rdi      # 0x54ef
movb $0x0, %al
callq 0x1090
jmp 0x1f9c
movl -0x4(%rbp), %esi
movl -0x2c(%rbp), %edx
leaq 0x3587(%rip), %rdi      # 0x551c
movb $0x0, %al
callq 0x1090
jmp 0x1f9e
jmp 0x1fa0
jmp 0x1fa2
jmp 0x1fa4
jmp 0x1fa6
jmp 0x1fa8
jmp 0x1faa
jmp 0x1fac
jmp 0x1fae
movl -0x2c(%rbp), %eax
addl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x1cc8
xorl %eax, %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)