// File: /workspace/github_c_makefile_star2_O1/rsa9000[P]regfanalysistools/regftree.c
// Function: regf_parse_vk
static int regf_parse_vk(const char *pref, unsigned off)
{
#define VK_PR_WARN(__fmt, ...)	PR_WARN(off, "vk", __fmt, ##__VA_ARGS__)
	const struct regf_cell *rc = st.data + off;
	const struct regf_vk *vk = (void *)rc->data;
	size_t pref_len = strlen(pref);
	char __pref[pref_len + 3];
	struct cell *cell;
	int res, pos = strlen(pref);
	const wchar_t *__name;

	if (regf_cell_check_sign_len(st.data, off, "vk", sizeof(*vk)))
		return -1;

	if (!vk->name_sz) {
		pos += printf("(default)");
	} else if (vk->flags & REGF_VK_F_ASCII) {
		pos += printf("%.*s", vk->name_sz, vk->name);
	} else {
		__name = regf_unicode2wchar(vk->name, vk->name_sz);
		pos += wcslen(__name);
		printf("%ls", __name);
	}

	if (pos < 60)
		pos += printf("%*s", 60 - pos, " ");
	printf(" %-10s (0x%02X)", regf_parse_vk_type(vk->type),
	       vk->sz & ~0x80000000);

	if (vk->sz & 0x80000000) {	/* Embedded data */
		if ((vk->sz & ~0x80000000) > 4) {
			printf("\n");
			VK_PR_WARN("value legnth 0x%08X too big for embeded data\n",
				   vk->sz & ~0x80000000);
			return -1;
		}
		res = regf_print_data(" ", &vk->off, vk->type,
				      vk->sz & ~0x80000000);
		if (res) {
			VK_PR_WARN("could not parse embeded data\n");
			return -1;
		}
		return 0;
	}

	cell = cache_cell_find(vk->off);
	if (!cell) {
		printf("\n");
		VK_PR_WARN("could not find raw data cell 0x%08X\n", vk->off);
		return -1;
	}

	/**
	 * Data occupates only one cell if it small, also data blocks
	 * supported in 1.5
	 */
	if (vk->sz <= 16344 || st.version < VER_1_5) {
		cache_cell_updref(cell, CT_DATA);
		res = regf_parse_raw(" ", vk->off, vk->type, vk->sz);
		if (res) {
			VK_PR_WARN("could not parse raw data in cell 0x%08X\n",
				   vk->off);
			return -1;
		}
	} else {
		cache_cell_updref(cell, CT_DB);
		res = regf_parse_db(__pref, vk->off);
		if (res) {
			VK_PR_WARN("could not parse data block in cell 0x%08X\n",
				   vk->off);
			return -1;
		}
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %r14d
movq 0x4b65(%rip), %r15      # 0x7110
callq 0x1090
movq %rax, %r13
movq %rsp, %r12
addq $0x12, %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
leaq 0x20ac(%rip), %rdx      # 0x4677
movq %r15, %rdi
movl %r14d, %esi
movl $0x14, %ecx
callq 0x321f
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x28d5
movl %r14d, %eax
addq %rax, %r15
movzwl 0x6(%r15), %esi
testl %esi, %esi
je 0x262b
testb $0x1, 0x14(%r15)
jne 0x263b
leaq 0x18(%r15), %rdi
callq 0x1ca0
movq %rax, %rbx
movq %rax, %rdi
callq 0x10c0
addl %eax, %r13d
leaq 0x206d(%rip), %rdi      # 0x4689
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10b0
movl %r13d, %eax
jmp 0x2650
leaq 0x2048(%rip), %rdi      # 0x467a
xorl %eax, %eax
callq 0x10b0
jmp 0x264d
leaq 0x18(%r15), %rdx
leaq 0x203e(%rip), %rdi      # 0x4684
xorl %eax, %eax
callq 0x10b0
addl %r13d, %eax
cmpl $0x3b, %eax
jg 0x2671
movl $0x3c, %esi
subl %eax, %esi
leaq 0x202a(%rip), %rdi      # 0x468d
leaq 0x1ee0(%rip), %rdx      # 0x454a
xorl %eax, %eax
callq 0x10b0
movl 0x10(%r15), %eax
cmpq $0xb, %rax
ja 0x268b
leaq 0x241e(%rip), %rcx      # 0x4aa0
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
jmp 0x2692
leaq 0x21ac(%rip), %rsi      # 0x483e
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl 0x8(%r15), %edx
leaq 0x1fef(%rip), %rdi      # 0x4691
xorl %eax, %eax
callq 0x10b0
movl 0x8(%r15), %edx
testl %edx, %edx
js 0x26f2
movl 0xc(%r15), %esi
leaq 0x4a6c(%rip), %rdi      # 0x7128
callq 0x30ad
leaq 0x4a68(%rip), %rcx      # 0x7130
cmpq %rcx, %rax
setne %cl
testq %rax, %rax
setne %dl
testb %dl, %cl
jne 0x2720
movl $0xa, %edi
callq 0x1030
movl 0xc(%r15), %ecx
leaq 0x1ff2(%rip), %rdi      # 0x46df
jmp 0x28bf
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
cmpl $0x5, %edx
jb 0x27c6
movl $0xa, %edi
callq 0x1030
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl 0x8(%r15), %ecx
leaq 0x1f86(%rip), %rdi      # 0x46a1
jmp 0x28bf
movl 0x8(%r15), %esi
movl 0x49ee(%rip), %edx      # 0x7118
incl 0x24(%rax)
movl 0x28(%rax), %ecx
cmpl $0x3fd9, %esi           # imm = 0x3FD9
jb 0x27d3
cmpl $0x14, %edx
jbe 0x27d3
orl $0x100, %ecx            # imm = 0x100
movl %ecx, 0x28(%rax)
movl 0xc(%r15), %ebx
movq 0x49b7(%rip), %r13      # 0x7110
leaq 0x2131(%rip), %rdx      # 0x4891
movq %r13, %rdi
movl %ebx, %esi
movl $0x8, %ecx
callq 0x321f
testl %eax, %eax
jne 0x28b4
cmpw $0x0, 0x6(%r13,%rbx)
je 0x282c
movl 0x8(%r13,%rbx), %esi
leaq 0x4998(%rip), %rdi      # 0x7128
callq 0x30ad
leaq 0x4994(%rip), %rcx      # 0x7130
cmpq %rcx, %rax
setne %cl
testq %rax, %rax
setne %dl
testb %dl, %cl
jne 0x2833
movl $0xa, %edi
callq 0x1030
leaq 0x20d3(%rip), %rdi      # 0x4894
jmp 0x289f
movl 0x10(%r15), %esi
addq $0xc, %r15
movq %r15, %rdi
jmp 0x2827
orl $0x80, %ecx
movl %ecx, 0x28(%rax)
movl 0x8(%r15), %ebx
movl 0xc(%r15), %r13d
movl 0x10(%r15), %eax
movl %eax, -0x38(%rbp)
movq 0x491e(%rip), %r12      # 0x7110
leaq 0x2093(%rip), %rdx      # 0x488c
movq %r12, %rdi
movl %r13d, %esi
movl %ebx, %ecx
callq 0x31a2
testl %eax, %eax
je 0x281a
movl 0xc(%r15), %ecx
leaq 0x1eff(%rip), %rdi      # 0x4714
jmp 0x28bf
leaq (%r12,%r13), %rdi
addq $0x4, %rdi
movl -0x38(%rbp), %esi
movl %ebx, %edx
callq 0x2989
xorl %ecx, %ecx
jmp 0x28d5
incl 0x24(%rax)
orb $0x2, 0x29(%rax)
leaq 0x1d4e(%rip), %rdx      # 0x458f
leaq -0x60(%rbp), %rdi
movl $0x10, %esi
movq %r12, %rcx
xorl %eax, %eax
callq 0x10d0
movl 0x8(%r13,%rbx), %eax
movq %r13, -0x48(%rbp)
movq %rbx, -0x40(%rbp)
movzwl 0x6(%r13,%rbx), %r13d
movq %rax, %rsi
movq 0x489f(%rip), %rbx      # 0x7110
leal (,%r13,4), %ecx
leaq 0x2089(%rip), %rdx      # 0x4909
movq %rbx, %rdi
movq %rax, -0x50(%rbp)
callq 0x31a2
leaq 0x203b(%rip), %rdi      # 0x48ce
testl %eax, %eax
je 0x28e6
movq -0x48(%rbp), %r13
movq -0x40(%rbp), %rbx
movl 0x8(%r13,%rbx), %ecx
leaq 0x1fe6(%rip), %rdx      # 0x4891
movl %ebx, %esi
xorl %eax, %eax
callq 0x1359
movl 0xc(%r15), %ecx
leaq 0x1e8e(%rip), %rdi      # 0x474d
leaq 0x1db1(%rip), %rdx      # 0x4677
movl %r14d, %esi
xorl %eax, %eax
callq 0x1359
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
movl %ecx, %eax
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testq %r13, %r13
je 0x282c
movq %r13, -0x38(%rbp)
movq -0x50(%rbp), %rax
addq %rax, %rbx
addq $0x4, %rbx
xorl %r12d, %r12d
movl $0x0, -0x2c(%rbp)
movq %rbx, %r13
movl (%rbx,%r12,4), %esi
leaq 0x4812(%rip), %rdi      # 0x7128
callq 0x30ad
leaq 0x480e(%rip), %rcx      # 0x7130
cmpq %rcx, %rax
setne %cl
testq %rax, %rax
setne %dl
testb %dl, %cl
jne 0x2958
movl (%rbx,%r12,4), %ecx
leaq 0x1fd1(%rip), %rdi      # 0x490e
movq -0x50(%rbp), %rsi
leaq 0x1fc1(%rip), %rdx      # 0x4909
xorl %eax, %eax
callq 0x1359
movl $0xffffffff, -0x2c(%rbp) # imm = 0xFFFFFFFF
jmp 0x295f
incl 0x24(%rax)
orb $0x4, 0x29(%rax)
incq %r12
cmpq %r12, -0x38(%rbp)
movq %r13, %rbx
jne 0x290b
cmpl $0x0, -0x2c(%rbp)
movq -0x48(%rbp), %r13
movq -0x40(%rbp), %rbx
leaq 0x1f50(%rip), %rdi      # 0x48ce
jne 0x289f
jmp 0x282c