// File: /workspace/github_c_makefile_star2_O0/rsa9000[P]regfanalysistools/regfwalk.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 + 5];
	struct cell *cell;
	int res;

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

	printf("%svk.{off,len} = 0x%08X, 0x%08X\n", pref, off, -rc->sz);

	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));

	snprintf(__pref, sizeof(__pref), "%sval.", pref);

	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;
		}
		res = regf_print_data(__pref, &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) {
		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(__pref, 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 $0x80, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq 0x60d7(%rip), %rax      # 0x9100
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 $0x5, %rax
movq %rax, -0x60(%rbp)
movq %rsp, %rcx
movq %rcx, -0x38(%rbp)
addq $0x14, %rdx
andq $-0x10, %rdx
movq %rsp, %rcx
subq %rdx, %rcx
movq %rcx, -0x58(%rbp)
movq %rcx, %rsp
movq %rax, -0x40(%rbp)
movq 0x607e(%rip), %rdi      # 0x9100
movl -0x14(%rbp), %esi
leaq 0x396f(%rip), %rdx      # 0x69fb
movl $0x14, %ecx
callq 0x4fd0
cmpl $0x0, %eax
je 0x30ae
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x50(%rbp)
jmp 0x33b2
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
movq -0x20(%rbp), %rax
xorl %ecx, %ecx
subl (%rax), %ecx
leaq 0x393a(%rip), %rdi      # 0x69fe
movb $0x0, %al
callq 0x10a0
movq -0x28(%rbp), %rax
cmpw $0x0, 0x2(%rax)
jne 0x30ea
movq -0x10(%rbp), %rsi
leaq 0x393e(%rip), %rdi      # 0x6a1f
movb $0x0, %al
callq 0x10a0
jmp 0x3152
movq -0x28(%rbp), %rax
movzwl 0x10(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x311e
movq -0x10(%rbp), %rsi
movq -0x28(%rbp), %rax
movzwl 0x2(%rax), %edx
movq -0x28(%rbp), %rcx
addq $0x14, %rcx
leaq 0x3921(%rip), %rdi      # 0x6a36
movb $0x0, %al
callq 0x10a0
jmp 0x3150
movq -0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x28(%rbp), %rdi
addq $0x14, %rdi
movq -0x28(%rbp), %rax
movzwl 0x2(%rax), %esi
callq 0x21e0
movq -0x68(%rbp), %rsi
movq %rax, %rdx
leaq 0x38ff(%rip), %rdi      # 0x6a48
movb $0x0, %al
callq 0x10a0
jmp 0x3152
movq -0x10(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x28(%rbp), %rax
movl 0xc(%rax), %eax
movl %eax, -0x74(%rbp)
movq -0x28(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x70(%rbp)
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
movl %eax, -0x6c(%rbp)
movq -0x28(%rbp), %rax
movl 0xc(%rax), %edi
callq 0x33d0
movq -0x80(%rbp), %rsi
movl -0x74(%rbp), %edx
movl -0x70(%rbp), %ecx
movl -0x6c(%rbp), %r8d
movq %rax, %r9
leaq 0x38bd(%rip), %rdi      # 0x6a59
movb $0x0, %al
callq 0x10a0
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq -0x10(%rbp), %rcx
leaq 0x38db(%rip), %rdx      # 0x6a91
movb $0x0, %al
callq 0x10b0
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x80000000, %eax       # imm = 0x80000000
cmpl $0x0, %eax
je 0x3287
movq -0x28(%rbp), %rax
movl 0x4(%rax), %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
cmpl $0x4, %eax
jbe 0x321b
movl -0x14(%rbp), %esi
movq -0x28(%rbp), %rax
movl 0x4(%rax), %ecx
andl $0x7fffffff, %ecx       # imm = 0x7FFFFFFF
leaq 0x389e(%rip), %rdi      # 0x6a98
leaq 0x37fa(%rip), %rdx      # 0x69fb
movb $0x0, %al
callq 0x4c10
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x50(%rbp)
jmp 0x33b2
movq -0x58(%rbp), %rdi
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
callq 0x34c0
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x3274
movl -0x14(%rbp), %esi
leaq 0x3883(%rip), %rdi      # 0x6ad6
leaq 0x37a1(%rip), %rdx      # 0x69fb
movb $0x0, %al
callq 0x4c10
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x50(%rbp)
jmp 0x33b2
movl $0x0, -0x4(%rbp)
movl $0x1, -0x50(%rbp)
jmp 0x33b2
movq -0x28(%rbp), %rax
movl 0x8(%rax), %edi
callq 0x1c10
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
jne 0x32d0
movl -0x14(%rbp), %esi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %ecx
leaq 0x3855(%rip), %rdi      # 0x6b04
leaq 0x3745(%rip), %rdx      # 0x69fb
movb $0x0, %al
callq 0x4c10
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x50(%rbp)
jmp 0x33b2
movq -0x28(%rbp), %rax
cmpl $0x3fd8, 0x4(%rax)      # imm = 0x3FD8
jbe 0x32e6
cmpl $0x15, 0x5e24(%rip)     # 0x9108
jae 0x334c
movq -0x48(%rbp), %rdi
movl $0x80, %esi
callq 0x1c70
movq -0x58(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %esi
movq -0x28(%rbp), %rax
movl 0xc(%rax), %edx
movq -0x28(%rbp), %rax
movl 0x4(%rax), %ecx
callq 0x35e0
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x334a
movl -0x14(%rbp), %esi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %ecx
leaq 0x380d(%rip), %rdi      # 0x6b39
leaq 0x36c8(%rip), %rdx      # 0x69fb
movb $0x0, %al
callq 0x4c10
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x50(%rbp)
jmp 0x33b2
jmp 0x33a4
movq -0x48(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
callq 0x1c70
movq -0x58(%rbp), %rdi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %esi
callq 0x3650
movl %eax, -0x4c(%rbp)
cmpl $0x0, -0x4c(%rbp)
je 0x33a2
movl -0x14(%rbp), %esi
movq -0x28(%rbp), %rax
movl 0x8(%rax), %ecx
leaq 0x37ee(%rip), %rdi      # 0x6b72
leaq 0x3670(%rip), %rdx      # 0x69fb
movb $0x0, %al
callq 0x4c10
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x50(%rbp)
jmp 0x33b2
jmp 0x33a4
movl $0x0, -0x4(%rbp)
movl $0x1, -0x50(%rbp)
movq -0x38(%rbp), %rax
movq %rax, %rsp
movl -0x4(%rbp), %eax
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)