// File: /workspace/github_c_makefile_star2_O3/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 0x4b9e(%rip), %r15      # 0x7110
callq 0x1090
movq %rax, %r13
movq %rsp, %r12
addq $0x12, %rax
andq $-0x10, %rax
subq %rax, %r12
movq %r12, %rsp
leaq 0x20e5(%rip), %rdx      # 0x4677
movq %r15, %rdi
movl %r14d, %esi
movl $0x14, %ecx
callq 0x3208
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x289b
movl %r14d, %eax
addq %rax, %r15
movzwl 0x6(%r15), %esi
testl %esi, %esi
je 0x25f2
testb $0x1, 0x14(%r15)
jne 0x2602
leaq 0x18(%r15), %rdi
callq 0x1ca7
movq %rax, %rbx
movq %rax, %rdi
callq 0x10c0
addl %eax, %r13d
leaq 0x20a6(%rip), %rdi      # 0x4689
movq %rbx, %rsi
xorl %eax, %eax
callq 0x10b0
movl %r13d, %eax
jmp 0x2617
leaq 0x2081(%rip), %rdi      # 0x467a
xorl %eax, %eax
callq 0x10b0
jmp 0x2614
leaq 0x18(%r15), %rdx
leaq 0x2077(%rip), %rdi      # 0x4684
xorl %eax, %eax
callq 0x10b0
addl %r13d, %eax
cmpl $0x3b, %eax
jg 0x2638
movl $0x3c, %esi
subl %eax, %esi
leaq 0x2063(%rip), %rdi      # 0x468d
leaq 0x1f19(%rip), %rdx      # 0x454a
xorl %eax, %eax
callq 0x10b0
movl 0x10(%r15), %eax
cmpq $0xb, %rax
ja 0x2652
leaq 0x2457(%rip), %rcx      # 0x4aa0
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
jmp 0x2659
leaq 0x21e5(%rip), %rsi      # 0x483e
movl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
andl 0x8(%r15), %edx
leaq 0x2028(%rip), %rdi      # 0x4691
xorl %eax, %eax
callq 0x10b0
movl 0x8(%r15), %edx
testl %edx, %edx
js 0x26b9
movl 0xc(%r15), %esi
leaq 0x4aa5(%rip), %rdi      # 0x7128
callq 0x3095
leaq 0x4aa1(%rip), %rcx      # 0x7130
cmpq %rcx, %rax
setne %cl
testq %rax, %rax
setne %dl
testb %dl, %cl
jne 0x26e7
movl $0xa, %edi
callq 0x1030
movl 0xc(%r15), %ecx
leaq 0x202b(%rip), %rdi      # 0x46df
jmp 0x2885
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
cmpl $0x5, %edx
jb 0x278d
movl $0xa, %edi
callq 0x1030
movl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
andl 0x8(%r15), %ecx
leaq 0x1fbf(%rip), %rdi      # 0x46a1
jmp 0x2885
movl 0x8(%r15), %esi
movl 0x4a27(%rip), %edx      # 0x7118
incl 0x24(%rax)
movl 0x28(%rax), %ecx
cmpl $0x3fd9, %esi           # imm = 0x3FD9
jb 0x279a
cmpl $0x14, %edx
jbe 0x279a
orl $0x100, %ecx            # imm = 0x100
movl %ecx, 0x28(%rax)
movl 0xc(%r15), %ebx
movq 0x49f0(%rip), %r13      # 0x7110
leaq 0x216a(%rip), %rdx      # 0x4891
movq %r13, %rdi
movl %ebx, %esi
movl $0x8, %ecx
callq 0x3208
testl %eax, %eax
jne 0x287a
cmpw $0x0, 0x6(%r13,%rbx)
je 0x27f3
movl 0x8(%r13,%rbx), %esi
leaq 0x49d1(%rip), %rdi      # 0x7128
callq 0x3095
leaq 0x49cd(%rip), %rcx      # 0x7130
cmpq %rcx, %rax
setne %cl
testq %rax, %rax
setne %dl
testb %dl, %cl
jne 0x27fa
movl $0xa, %edi
callq 0x1030
leaq 0x210c(%rip), %rdi      # 0x4894
jmp 0x2865
movl 0x10(%r15), %esi
addq $0xc, %r15
movq %r15, %rdi
jmp 0x27ee
orl $0x80, %ecx
movl %ecx, 0x28(%rax)
movl 0x8(%r15), %ebx
movl 0xc(%r15), %r13d
movl 0x10(%r15), %eax
movl %eax, -0x38(%rbp)
movq 0x4957(%rip), %r12      # 0x7110
leaq 0x20cc(%rip), %rdx      # 0x488c
movq %r12, %rdi
movl %r13d, %esi
movl %ebx, %ecx
callq 0x3192
testl %eax, %eax
je 0x27e1
movl 0xc(%r15), %ecx
leaq 0x1f38(%rip), %rdi      # 0x4714
jmp 0x2885
leaq (%r12,%r13), %rdi
addq $0x4, %rdi
movl -0x38(%rbp), %esi
movl %ebx, %edx
callq 0x296f
xorl %ecx, %ecx
jmp 0x289b
incl 0x24(%rax)
orb $0x2, 0x29(%rax)
leaq 0x1d87(%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), %r12d
movq %rax, %r13
movq 0x48d8(%rip), %rbx      # 0x7110
leal (,%r12,4), %ecx
leaq 0x20c2(%rip), %rdx      # 0x4909
movq %rbx, %rdi
movl %r13d, %esi
callq 0x3192
leaq 0x2075(%rip), %rdi      # 0x48ce
testl %eax, %eax
je 0x28ac
movq -0x48(%rbp), %r13
movq -0x40(%rbp), %rbx
movl 0x8(%r13,%rbx), %ecx
leaq 0x2020(%rip), %rdx      # 0x4891
movl %ebx, %esi
xorl %eax, %eax
callq 0x1359
movl 0xc(%r15), %ecx
leaq 0x1ec8(%rip), %rdi      # 0x474d
leaq 0x1deb(%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 %r12, %r12
je 0x27f3
movq %r13, -0x50(%rbp)
addq %r13, %rbx
movq %rbx, %r13
negq %r12
movq %r12, -0x38(%rbp)
movb $0x1, %al
movl %eax, -0x2c(%rbp)
xorl %r12d, %r12d
leaq 0x485b(%rip), %rbx      # 0x7130
incq %r12
movl (%r13,%r12,4), %esi
leaq 0x4844(%rip), %rdi      # 0x7128
callq 0x3095
cmpq %rbx, %rax
je 0x290f
testq %rax, %rax
je 0x290f
incl 0x24(%rax)
orb $0x4, 0x29(%rax)
movq -0x38(%rbp), %rax
addq %r12, %rax
incq %rax
incq %r12
cmpq $0x1, %rax
jne 0x28d8
jmp 0x2951
movl (%r13,%r12,4), %ecx
movl $0x0, -0x2c(%rbp)
leaq 0x1fec(%rip), %rdi      # 0x490e
movq -0x50(%rbp), %rsi
leaq 0x1fdc(%rip), %rdx      # 0x4909
xorl %eax, %eax
callq 0x1359
movq -0x38(%rbp), %rax
addq %r12, %rax
jne 0x28d5
movq -0x48(%rbp), %r13
movq -0x40(%rbp), %rbx
leaq 0x1f82(%rip), %rdi      # 0x48ce
jmp 0x2865
testb $0x1, -0x2c(%rbp)
movq -0x48(%rbp), %r13
movq -0x40(%rbp), %rbx
leaq 0x1f6a(%rip), %rdi      # 0x48ce
jne 0x27f3
jmp 0x2865