// File: /workspace/github_c_makefile_star2_O0/rsa9000[P]regfanalysistools/regfdump.c
// Function: regf_parse_nk
static int regf_parse_nk(const char *pref, unsigned off)
{
#define NK_PR_WARN(__fmt, ...)	PR_WARN(off, "nk", __fmt, ##__VA_ARGS__)
	const struct regf_cell *rc = st.data + off;
	const struct regf_nk *nk = (void *)rc->data;
	char __pref[0x10];
	struct cell *cell;
	int res, ret = 0;

	if (nk->flags & REGF_NK_F_ASCII)
		printf("%snk.name = %.*s\n", pref, nk->name_sz, nk->name);
	else
		printf("%snk.name = %ls\n", pref,
		       regf_unicode2wchar(nk->name, nk->name_sz));
	printf("%snk.flags = 0x%02X (%s)\n", pref, nk->flags, regf_parse_nk_flags(nk->flags));
	printf("%snk.cname{sz,off} = 0x%08X, 0x%08X\n", pref, nk->cname_sz, nk->cname_off);
	printf("%snk.timestamp = 0x%016"PRIX64"\n", pref, nk->timestamp);
	printf("%snk.parent = 0x%08X\n", pref, nk->parent_off);
	printf("%snk.security = 0x%08X\n", pref, nk->sec_off);
	printf("%snk.skeys{num,off,max(name),max(cname)} = 0x%08X, 0x%08X, 0x%08X, 0x%08X\n",
	       pref, nk->skey_num, nk->skey_off, nk->skey_name_max, nk->skey_cname_max);
	printf("%snk.vskeys{num,off} = 0x%08X 0x%08X\n", pref, nk->vskey_num,
	       nk->vskey_off);
	printf("%snk.vals{num,off,max(name),max(data)} = 0x%08X, 0x%08X, 0x%08X, 0x%08X\n",
	       pref, nk->val_num, nk->val_off, nk->val_name_max, nk->val_data_max);

	if (!(nk->flags & REGF_NK_F_ENTRY)) {
		cell = cache_cell_find(nk->parent_off);
		if (!cell) {
			NK_PR_WARN("could not find parent cell 0x%08X\n",
				   nk->parent_off);
			ret = -1;
		} else {
			cache_cell_updref(cell, CT_NK);
		}
	}

	if (nk->cname_off != ~0U) {
		cell = cache_cell_find(nk->cname_off);
		if (!cell) {
			NK_PR_WARN("could not find class name cell 0x%08X\n",
				   nk->cname_off);
			ret = -1;
		} else {
			cache_cell_updref(cell, CT_CNAME);
		}
	}

	cell = cache_cell_find(nk->sec_off);
	if (!cell) {
		NK_PR_WARN("could not find security descriptor cell 0x%08X\n",
			   nk->sec_off);
		ret = -1;
	} else {
		cache_cell_updref(cell, CT_SK);
	}

	if (nk->skey_num) {
		cell = cache_cell_find(nk->skey_off);
		if (!cell) {
			NK_PR_WARN("could not find subkeys list cell 0x%08X\n",
				   nk->skey_off);
			ret = -1;
		} else {
			cache_cell_updref(cell, CT_LST);
		}
	}

	if (nk->val_num) {
		cell = cache_cell_find(nk->val_off);
		if (!cell) {
			NK_PR_WARN("could not find values list cell 0x%08X\n",
				   nk->val_off);
			ret = -1;
		} else {
			cache_cell_updref(cell, CT_VLST);
			snprintf(__pref, sizeof(__pref), "%s  ", pref);
			res = regf_parse_vlst(__pref, nk->val_off, nk->val_num);
			if (res) {
				NK_PR_WARN("could not parse values list cell 0x%08X\n",
					   nk->val_off);
				ret = -1;
			}
		}
	}

	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq 0x610a(%rip), %rax      # 0x80f0
movl -0xc(%rbp), %ecx
addq %rcx, %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x40(%rbp)
movq -0x20(%rbp), %rax
movzwl 0x2(%rax), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x2037
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rax
movzwl 0x4c(%rax), %edx
movq -0x20(%rbp), %rcx
addq $0x50, %rcx
leaq 0x350c(%rip), %rdi      # 0x553a
movb $0x0, %al
callq 0x1090
jmp 0x2069
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x20(%rbp), %rdi
addq $0x50, %rdi
movq -0x20(%rbp), %rax
movzwl 0x4c(%rax), %esi
callq 0x2cd0
movq -0x48(%rbp), %rsi
movq %rax, %rdx
leaq 0x34ea(%rip), %rdi      # 0x554c
movb $0x0, %al
callq 0x1090
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x20(%rbp), %rax
movzwl 0x2(%rax), %eax
movl %eax, -0x4c(%rbp)
movq -0x20(%rbp), %rax
movzwl 0x2(%rax), %edi
callq 0x2e30
movq -0x58(%rbp), %rsi
movl -0x4c(%rbp), %edx
movq %rax, %rcx
leaq 0x34c3(%rip), %rdi      # 0x555d
movb $0x0, %al
callq 0x1090
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rax
movzwl 0x4e(%rax), %edx
movq -0x20(%rbp), %rax
movl 0x34(%rax), %ecx
leaq 0x34bc(%rip), %rdi      # 0x5577
movb $0x0, %al
callq 0x1090
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdx
leaq 0x34c7(%rip), %rdi      # 0x559c
movb $0x0, %al
callq 0x1090
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rax
movl 0x14(%rax), %edx
leaq 0x34c9(%rip), %rdi      # 0x55b7
movb $0x0, %al
callq 0x1090
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rax
movl 0x30(%rax), %edx
leaq 0x34c6(%rip), %rdi      # 0x55cd
movb $0x0, %al
callq 0x1090
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rax
movl 0x18(%rax), %edx
movq -0x20(%rbp), %rax
movl 0x20(%rax), %ecx
movq -0x20(%rbp), %rax
movl 0x38(%rax), %r8d
movq -0x20(%rbp), %rax
movl 0x3c(%rax), %r9d
leaq 0x34ae(%rip), %rdi      # 0x55e5
movb $0x0, %al
callq 0x1090
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rax
movl 0x1c(%rax), %edx
movq -0x20(%rbp), %rax
movl 0x24(%rax), %ecx
leaq 0x34d9(%rip), %rdi      # 0x5630
movb $0x0, %al
callq 0x1090
movq -0x8(%rbp), %rsi
movq -0x20(%rbp), %rax
movl 0x28(%rax), %edx
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %ecx
movq -0x20(%rbp), %rax
movl 0x40(%rax), %r8d
movq -0x20(%rbp), %rax
movl 0x44(%rax), %r9d
leaq 0x34cf(%rip), %rdi      # 0x5656
movb $0x0, %al
callq 0x1090
movq -0x20(%rbp), %rax
movzwl 0x2(%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
jne 0x21ed
movq -0x20(%rbp), %rax
movl 0x14(%rax), %edi
callq 0x3060
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x21dd
movl -0xc(%rbp), %esi
movq -0x20(%rbp), %rax
movl 0x14(%rax), %ecx
leaq 0x34d9(%rip), %rdi      # 0x569f
leaq 0x364a(%rip), %rdx      # 0x5817
movb $0x0, %al
callq 0x45e0
movl $0xffffffff, -0x40(%rbp) # imm = 0xFFFFFFFF
jmp 0x21eb
movq -0x38(%rbp), %rdi
movl $0x2, %esi
callq 0x30c0
jmp 0x21ed
movq -0x20(%rbp), %rax
cmpl $-0x1, 0x34(%rax)
je 0x2246
movq -0x20(%rbp), %rax
movl 0x34(%rax), %edi
callq 0x3060
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x2236
movl -0xc(%rbp), %esi
movq -0x20(%rbp), %rax
movl 0x34(%rax), %ecx
leaq 0x34b3(%rip), %rdi      # 0x56d2
leaq 0x35f1(%rip), %rdx      # 0x5817
movb $0x0, %al
callq 0x45e0
movl $0xffffffff, -0x40(%rbp) # imm = 0xFFFFFFFF
jmp 0x2244
movq -0x38(%rbp), %rdi
movl $0x8, %esi
callq 0x30c0
jmp 0x2246
movq -0x20(%rbp), %rax
movl 0x30(%rax), %edi
callq 0x3060
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x2285
movl -0xc(%rbp), %esi
movq -0x20(%rbp), %rax
movl 0x30(%rax), %ecx
leaq 0x349b(%rip), %rdi      # 0x5709
leaq 0x35a2(%rip), %rdx      # 0x5817
movb $0x0, %al
callq 0x45e0
movl $0xffffffff, -0x40(%rbp) # imm = 0xFFFFFFFF
jmp 0x2293
movq -0x38(%rbp), %rdi
movl $0x4, %esi
callq 0x30c0
movq -0x20(%rbp), %rax
cmpl $0x0, 0x18(%rax)
je 0x22ec
movq -0x20(%rbp), %rax
movl 0x20(%rax), %edi
callq 0x3060
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x22dc
movl -0xc(%rbp), %esi
movq -0x20(%rbp), %rax
movl 0x20(%rax), %ecx
leaq 0x3484(%rip), %rdi      # 0x5749
leaq 0x354b(%rip), %rdx      # 0x5817
movb $0x0, %al
callq 0x45e0
movl $0xffffffff, -0x40(%rbp) # imm = 0xFFFFFFFF
jmp 0x22ea
movq -0x38(%rbp), %rdi
movl $0x10, %esi
callq 0x30c0
jmp 0x22ec
movq -0x20(%rbp), %rax
cmpl $0x0, 0x28(%rax)
je 0x23ac
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %edi
callq 0x3060
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x2339
movl -0xc(%rbp), %esi
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %ecx
leaq 0x3460(%rip), %rdi      # 0x5782
leaq 0x34ee(%rip), %rdx      # 0x5817
movb $0x0, %al
callq 0x45e0
movl $0xffffffff, -0x40(%rbp) # imm = 0xFFFFFFFF
jmp 0x23aa
movq -0x38(%rbp), %rdi
movl $0x20, %esi
callq 0x30c0
leaq -0x30(%rbp), %rdi
movq -0x8(%rbp), %rcx
movl $0x10, %esi
leaq 0x345f(%rip), %rdx      # 0x57ba
movb $0x0, %al
callq 0x10a0
leaq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %esi
movq -0x20(%rbp), %rax
movl 0x28(%rax), %edx
callq 0x30f0
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x3c(%rbp)
je 0x23a8
movl -0xc(%rbp), %esi
movq -0x20(%rbp), %rax
movl 0x2c(%rax), %ecx
leaq 0x342c(%rip), %rdi      # 0x57bf
leaq 0x347d(%rip), %rdx      # 0x5817
movb $0x0, %al
callq 0x45e0
movl $0xffffffff, -0x40(%rbp) # imm = 0xFFFFFFFF
jmp 0x23aa
jmp 0x23ac
movl -0x40(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)