// File: /workspace/github_c_makefile_star2_O0/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
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq 0x54ea(%rip), %rax      # 0x8100
movl -0x14(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1080
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdx
movq %rdx, %rax
addq $0x3, %rax
movq %rsp, %rcx
movq %rcx, -0x38(%rbp)
addq $0x12, %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x68(%rbp)
movq %rcx, %rsp
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1080
movl %eax, -0x50(%rbp)
movq 0x5489(%rip), %rdi      # 0x8100
movl -0x14(%rbp), %esi
leaq 0x2a2b(%rip), %rdx      # 0x56ac
movl $0x14, %ecx
callq 0x4b20
cmpl $0x0, %eax
je 0x2ca3
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x5c(%rbp)
jmp 0x2fa7
movq -0x28(%rbp), %rax
cmpw $0x0, 0x2(%rax)
jne 0x2cc4
leaq 0x29fa(%rip), %rdi      # 0x56af
movb $0x0, %al
callq 0x10a0
addl -0x50(%rbp), %eax
movl %eax, -0x50(%rbp)
jmp 0x2d3d
movq -0x28(%rbp), %rax
movzwl 0x10(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2cfa
movq -0x28(%rbp), %rax
movzwl 0x2(%rax), %esi
movq -0x28(%rbp), %rdx
addq $0x14, %rdx
leaq 0x29ce(%rip), %rdi      # 0x56b9
movb $0x0, %al
callq 0x10a0
addl -0x50(%rbp), %eax
movl %eax, -0x50(%rbp)
jmp 0x2d3b
movq -0x28(%rbp), %rdi
addq $0x14, %rdi
movq -0x28(%rbp), %rax
movzwl 0x2(%rax), %esi
callq 0x2050
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rdi
callq 0x10b0
movq %rax, %rcx
movslq -0x50(%rbp), %rax
addq %rcx, %rax
movl %eax, -0x50(%rbp)
movq -0x58(%rbp), %rsi
leaq 0x298a(%rip), %rdi      # 0x56be
movb $0x0, %al
callq 0x10a0
jmp 0x2d3d
cmpl $0x3c, -0x50(%rbp)
jge 0x2d66
movl $0x3c, %esi
subl -0x50(%rbp), %esi
leaq 0x2970(%rip), %rdi      # 0x56c2
leaq 0x2826(%rip), %rdx      # 0x557f
movb $0x0, %al
callq 0x10a0
addl -0x50(%rbp), %eax
movl %eax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x2fc0
movq %rax, %rsi
movq -0x28(%rbp), %rax
movl 0x4(%rax), %edx
andl $0x7fffffff, %edx       # imm = 0x7FFFFFFF
leaq 0x293d(%rip), %rdi      # 0x56c6
movb $0x0, %al
callq 0x10a0
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x80000000, %eax       # imm = 0x80000000
cmpl $0x0, %eax
je 0x2e6b
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl $0x4, %eax
jbe 0x2dfc
leaq 0x24da(%rip), %rdi      # 0x5297
movb $0x0, %al
callq 0x10a0
movl -0x14(%rbp), %esi
movq -0x28(%rbp), %rax
movl 0x4(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
leaq 0x28fb(%rip), %rdi      # 0x56d6
leaq 0x28ca(%rip), %rdx      # 0x56ac
movb $0x0, %al
callq 0x4760
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x5c(%rbp)
jmp 0x2fa7
movq -0x28(%rbp), %rsi
addq $0x8, %rsi
movq -0x28(%rbp), %rax
movl 0xc(%rax), %edx
movq -0x28(%rbp), %rax
movl 0x4(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
leaq 0x2760(%rip), %rdi      # 0x557f
callq 0x30b0
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x2e58
movl -0x14(%rbp), %esi
leaq 0x28dd(%rip), %rdi      # 0x5714
leaq 0x286e(%rip), %rdx      # 0x56ac
movb $0x0, %al
callq 0x4760
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x5c(%rbp)
jmp 0x2fa7
movl $0x0, -0x4(%rbp)
movl $0x1, -0x5c(%rbp)
jmp 0x2fa7
movq -0x28(%rbp), %rax
movl 0x8(%rax), %edi
callq 0x1c20
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x2ec2
leaq 0x240e(%rip), %rdi      # 0x5297
movb $0x0, %al
callq 0x10a0
movl -0x14(%rbp), %esi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %ecx
leaq 0x28a1(%rip), %rdi      # 0x5742
leaq 0x2804(%rip), %rdx      # 0x56ac
movb $0x0, %al
callq 0x4760
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x5c(%rbp)
jmp 0x2fa7
movq -0x28(%rbp), %rax
cmpl $0x3fd8, 0x4(%rax)      # imm = 0x3FD8
jbe 0x2ed8
cmpl $0x15, 0x5232(%rip)     # 0x8108
jae 0x2f41
movq -0x48(%rbp), %rdi
movl $0x80, %esi
callq 0x1c80
movq -0x28(%rbp), %rax
movl 0x8(%rax), %esi
movq -0x28(%rbp), %rax
movl 0xc(%rax), %edx
movq -0x28(%rbp), %rax
movl 0x4(%rax), %ecx
leaq 0x267d(%rip), %rdi      # 0x557f
callq 0x31a0
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x2f3f
movl -0x14(%rbp), %esi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %ecx
leaq 0x2856(%rip), %rdi      # 0x5777
leaq 0x2784(%rip), %rdx      # 0x56ac
movb $0x0, %al
callq 0x4760
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x5c(%rbp)
jmp 0x2fa7
jmp 0x2f99
movq -0x48(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x1c80
movq -0x68(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x3210
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x2f97
movl -0x14(%rbp), %esi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %ecx
leaq 0x2837(%rip), %rdi      # 0x57b0
leaq 0x272c(%rip), %rdx      # 0x56ac
movb $0x0, %al
callq 0x4760
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x5c(%rbp)
jmp 0x2fa7
jmp 0x2f99
movl $0x0, -0x4(%rbp)
movl $0x1, -0x5c(%rbp)
movq -0x38(%rbp), %rax
movq %rax, %rsp
movl -0x4(%rbp), %eax
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)