// File: /workspace/github_c_makefile_star2_O0/rsa9000[P]regfanalysistools/regfdump.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;
	struct cell *cell;

	if (!vk->name_sz)
		printf("%svk.name = (default)\n", pref);
	else if (vk->flags & REGF_VK_F_ASCII)
		printf("%svk.name = %.*s\n", pref, vk->name_sz, vk->name);
	else
		printf("%svk.name = %ls\n", pref,
		       regf_unicode2wchar(vk->name, vk->name_sz));
	printf("%svk.data{type,off,size} = 0x%08X, 0x%08X, 0x%08X - %s\n", pref,
	       vk->type, vk->off, vk->sz, regf_parse_vk_type(vk->type));

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

	cell = cache_cell_find(vk->off);
	if (!cell) {
		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);
	} else {
		cache_cell_updref(cell, CT_DB);
	}

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq 0x571a(%rip), %rax      # 0x80f0
movl -0x14(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpw $0x0, 0x2(%rax)
jne 0x2a0b
movq -0x10(%rbp), %rsi
leaq 0x308f(%rip), %rdi      # 0x5a91
movb $0x0, %al
callq 0x1090
jmp 0x2a73
movq -0x28(%rbp), %rax
movzwl 0x10(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x2a3f
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rax
movzwl 0x2(%rax), %edx
movq -0x28(%rbp), %rcx
addq $0x14, %rcx
leaq 0x3072(%rip), %rdi      # 0x5aa8
movb $0x0, %al
callq 0x1090
jmp 0x2a71
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x28(%rbp), %rdi
addq $0x14, %rdi
movq -0x28(%rbp), %rax
movzwl 0x2(%rax), %esi
callq 0x2cd0
movq -0x38(%rbp), %rsi
movq %rax, %rdx
leaq 0x3050(%rip), %rdi      # 0x5aba
movb $0x0, %al
callq 0x1090
jmp 0x2a73
movq -0x10(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x28(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x28(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x3270
movq -0x50(%rbp), %rsi
movl -0x44(%rbp), %edx
movl -0x40(%rbp), %ecx
movl -0x3c(%rbp), %r8d
movq %rax, %r9
leaq 0x300e(%rip), %rdi      # 0x5acb
movb $0x0, %al
callq 0x1090
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x80000000, %eax       # imm = 0x80000000
cmpl $0x0, %eax
je 0x2b20
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl $0x4, %eax
jbe 0x2b17
movl -0x14(%rbp), %esi
movq -0x28(%rbp), %rax
movl 0x4(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
leaq 0x3006(%rip), %rdi      # 0x5b03
leaq 0x299c(%rip), %rdx      # 0x54a0
movb $0x0, %al
callq 0x45e0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2b9a
movl $0x0, -0x4(%rbp)
jmp 0x2b9a
movq -0x28(%rbp), %rax
movl 0x8(%rax), %edi
callq 0x3060
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x2b5f
movl -0x14(%rbp), %esi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %ecx
leaq 0x2ff9(%rip), %rdi      # 0x5b41
leaq 0x2951(%rip), %rdx      # 0x54a0
movb $0x0, %al
callq 0x45e0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x2b9a
movq -0x28(%rbp), %rax
cmpl $0x3fd8, 0x4(%rax)      # imm = 0x3FD8
jbe 0x2b75
cmpl $0x15, 0x5585(%rip)     # 0x80f8
jae 0x2b85
movq -0x30(%rbp), %rdi
movl $0x80, %esi
callq 0x30c0
jmp 0x2b93
movq -0x30(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x30c0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)