// File: bluesky466[P]ResourcesParser/ResourcesParser.cpp
// Function: ResourcesParser::getNameForId[abi:cxx11](unsigned int) const
string ResourcesParser::getNameForId(uint32_t id) const {
	PackageResourcePtr pPackage = getPackageResouceForId(id);
	if(pPackage == nullptr) {
		RETURN_UNKNOWN_ID(id);
	}
	uint32_t typeId = TYPE_ID(id);
	if(pPackage->resTablePtrs.find(typeId)==pPackage->resTablePtrs.end()) {
		RETURN_UNKNOWN_ID(id);
	}

	uint32_t entryId = ENTRY_ID(id);

	if(pPackage->resTablePtrs[typeId][0]->header.entryCount<=(entryId)){
		RETURN_UNKNOWN_ID(id);
	}

	const ResTable_entry* pEntry = nullptr;
	for(ResTableTypePtr  pResTableType : pPackage->resTablePtrs[typeId]) {
		pEntry = pResTableType->entries[entryId];
		if(pEntry) {
			break;
		}
	}

	if(pEntry == nullptr) {
		RETURN_UNKNOWN_ID(id);
	}
	return getStringFromResStringPool(getPackageResouceForId(id)->pKeys, pEntry->key.index);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x810, %rsp            # imm = 0x810
movq %rdi, -0x710(%rbp)
movq %rdi, %rax
movq %rax, -0x708(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rsi
movq %rsi, -0x700(%rbp)
movl -0x14(%rbp), %edx
leaq -0x28(%rbp), %rdi
callq 0xae30
leaq -0x28(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xb930
testb $0x1, %al
jne 0x9134
jmp 0x9284
leaq -0x1b0(%rbp), %rdi
callq 0x3190
jmp 0x9142
leaq -0x1a0(%rbp), %rdi
leaq 0x11160(%rip), %rsi     # 0x1a2b0
callq 0x3260
movq %rax, -0x718(%rbp)
jmp 0x915e
movq -0x718(%rbp), %rdi
leaq -0x269c(%rip), %rsi     # 0x6ad0
callq 0x30b0
movq %rax, -0x720(%rbp)
jmp 0x917a
movl $0x8, %edi
callq 0xb7f0
movl %eax, -0x724(%rbp)
jmp 0x918c
movq -0x720(%rbp), %rdi
movl -0x724(%rbp), %eax
movl %eax, -0x1c0(%rbp)
movl -0x1c0(%rbp), %esi
callq 0x32b0
movq %rax, -0x730(%rbp)
jmp 0x91b3
movl $0x30, %edi
callq 0xb810
movb %al, -0x731(%rbp)
jmp 0x91c5
movq -0x730(%rbp), %rdi
movb -0x731(%rbp), %al
movb %al, -0x1c1(%rbp)
movzbl -0x1c1(%rbp), %esi
callq 0x33d0
movq %rax, -0x740(%rbp)
jmp 0x91ed
movq -0x740(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x3340
movq %rax, -0x748(%rbp)
jmp 0x9205
movq -0x748(%rbp), %rdi
leaq 0x10f8b(%rip), %rsi     # 0x1a19e
callq 0x3260
jmp 0x921a
movq -0x710(%rbp), %rdi
leaq -0x1b0(%rbp), %rsi
callq 0x3250
jmp 0x922f
movl $0x1, -0x1c8(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x31d0
jmp 0x98fa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
jmp 0x9913
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
leaq -0x1b0(%rbp), %rdi
callq 0x31d0
jmp 0x9913
movzbl -0x12(%rbp), %eax
movl %eax, -0x1cc(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x6550
movq %rax, %rdi
addq $0x140, %rdi            # imm = 0x140
movl -0x1cc(%rbp), %eax
movl %eax, -0x1dc(%rbp)
leaq -0x1dc(%rbp), %rsi
callq 0xc400
movq %rax, -0x750(%rbp)
jmp 0x92c2
movq -0x750(%rbp), %rax
movq %rax, -0x1d8(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x6550
movq %rax, %rdi
addq $0x140, %rdi            # imm = 0x140
callq 0x7100
movq %rax, -0x1e8(%rbp)
leaq -0x1d8(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
callq 0x70d0
testb $0x1, %al
jne 0x930b
jmp 0x9444
leaq -0x370(%rbp), %rdi
callq 0x3190
jmp 0x9319
leaq -0x360(%rbp), %rdi
leaq 0x10f89(%rip), %rsi     # 0x1a2b0
callq 0x3260
movq %rax, -0x758(%rbp)
jmp 0x9335
movq -0x758(%rbp), %rdi
leaq -0x2873(%rip), %rsi     # 0x6ad0
callq 0x30b0
movq %rax, -0x760(%rbp)
jmp 0x9351
movl $0x8, %edi
callq 0xb7f0
movl %eax, -0x764(%rbp)
jmp 0x9363
movq -0x760(%rbp), %rdi
movl -0x764(%rbp), %eax
movl %eax, -0x374(%rbp)
movl -0x374(%rbp), %esi
callq 0x32b0
movq %rax, -0x770(%rbp)
jmp 0x938a
movl $0x30, %edi
callq 0xb810
movb %al, -0x771(%rbp)
jmp 0x939c
movq -0x770(%rbp), %rdi
movb -0x771(%rbp), %al
movb %al, -0x375(%rbp)
movzbl -0x375(%rbp), %esi
callq 0x33d0
movq %rax, -0x780(%rbp)
jmp 0x93c4
movq -0x780(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x3340
movq %rax, -0x788(%rbp)
jmp 0x93dc
movq -0x788(%rbp), %rdi
leaq 0x10db4(%rip), %rsi     # 0x1a19e
callq 0x3260
jmp 0x93f1
movq -0x710(%rbp), %rdi
leaq -0x370(%rbp), %rsi
callq 0x3250
jmp 0x9406
movl $0x1, -0x1c8(%rbp)
leaq -0x370(%rbp), %rdi
callq 0x31d0
jmp 0x98fa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
leaq -0x370(%rbp), %rdi
callq 0x31d0
jmp 0x9913
movzwl -0x14(%rbp), %eax
movl %eax, -0x37c(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x6550
movq %rax, %rdi
addq $0x140, %rdi            # imm = 0x140
movl -0x1cc(%rbp), %eax
movl %eax, -0x380(%rbp)
leaq -0x380(%rbp), %rsi
callq 0x66b0
movq %rax, -0x790(%rbp)
jmp 0x9482
movq -0x790(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0xc430
movq %rax, %rdi
callq 0x6880
movl 0xc(%rax), %eax
cmpl -0x37c(%rbp), %eax
ja 0x95e2
leaq -0x508(%rbp), %rdi
callq 0x3190
jmp 0x94b7
leaq -0x4f8(%rbp), %rdi
leaq 0x10deb(%rip), %rsi     # 0x1a2b0
callq 0x3260
movq %rax, -0x798(%rbp)
jmp 0x94d3
movq -0x798(%rbp), %rdi
leaq -0x2a11(%rip), %rsi     # 0x6ad0
callq 0x30b0
movq %rax, -0x7a0(%rbp)
jmp 0x94ef
movl $0x8, %edi
callq 0xb7f0
movl %eax, -0x7a4(%rbp)
jmp 0x9501
movq -0x7a0(%rbp), %rdi
movl -0x7a4(%rbp), %eax
movl %eax, -0x50c(%rbp)
movl -0x50c(%rbp), %esi
callq 0x32b0
movq %rax, -0x7b0(%rbp)
jmp 0x9528
movl $0x30, %edi
callq 0xb810
movb %al, -0x7b1(%rbp)
jmp 0x953a
movq -0x7b0(%rbp), %rdi
movb -0x7b1(%rbp), %al
movb %al, -0x50d(%rbp)
movzbl -0x50d(%rbp), %esi
callq 0x33d0
movq %rax, -0x7c0(%rbp)
jmp 0x9562
movq -0x7c0(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x3340
movq %rax, -0x7c8(%rbp)
jmp 0x957a
movq -0x7c8(%rbp), %rdi
leaq 0x10c16(%rip), %rsi     # 0x1a19e
callq 0x3260
jmp 0x958f
movq -0x710(%rbp), %rdi
leaq -0x508(%rbp), %rsi
callq 0x3250
jmp 0x95a4
movl $0x1, -0x1c8(%rbp)
leaq -0x508(%rbp), %rdi
callq 0x31d0
jmp 0x98fa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
leaq -0x508(%rbp), %rdi
callq 0x31d0
jmp 0x9913
movq $0x0, -0x518(%rbp)
leaq -0x28(%rbp), %rdi
callq 0x6550
movq %rax, %rdi
addq $0x140, %rdi            # imm = 0x140
movl -0x1cc(%rbp), %eax
movl %eax, -0x524(%rbp)
leaq -0x524(%rbp), %rsi
callq 0x66b0
movq %rax, -0x7d0(%rbp)
jmp 0x9621
movq -0x7d0(%rbp), %rax
movq %rax, -0x520(%rbp)
movq -0x520(%rbp), %rdi
callq 0x6790
movq %rax, -0x530(%rbp)
movq -0x520(%rbp), %rdi
callq 0x67c0
movq %rax, -0x538(%rbp)
leaq -0x530(%rbp), %rdi
leaq -0x538(%rbp), %rsi
callq 0x67f0
testb $0x1, %al
jne 0x9671
jmp 0x9703
leaq -0x530(%rbp), %rdi
callq 0x6830
movq %rax, %rsi
leaq -0x548(%rbp), %rdi
callq 0x6850
leaq -0x548(%rbp), %rdi
callq 0x6880
movq %rax, %rdi
addq $0x60, %rdi
movl -0x37c(%rbp), %eax
movl %eax, %esi
callq 0x68c0
movq (%rax), %rax
movq %rax, -0x518(%rbp)
cmpq $0x0, -0x518(%rbp)
je 0x96cc
movl $0x2, -0x1c8(%rbp)
jmp 0x96d6
movl $0x0, -0x1c8(%rbp)
leaq -0x548(%rbp), %rdi
callq 0x6a60
movl -0x1c8(%rbp), %eax
testl %eax, %eax
je 0x96f0
jmp 0x96ee
jmp 0x9703
jmp 0x96f2
leaq -0x530(%rbp), %rdi
callq 0x6a80
jmp 0x9655
cmpq $0x0, -0x518(%rbp)
jne 0x984a
leaq -0x6d0(%rbp), %rdi
callq 0x3190
jmp 0x971f
leaq -0x6c0(%rbp), %rdi
leaq 0x10b83(%rip), %rsi     # 0x1a2b0
callq 0x3260
movq %rax, -0x7d8(%rbp)
jmp 0x973b
movq -0x7d8(%rbp), %rdi
leaq -0x2c79(%rip), %rsi     # 0x6ad0
callq 0x30b0
movq %rax, -0x7e0(%rbp)
jmp 0x9757
movl $0x8, %edi
callq 0xb7f0
movl %eax, -0x7e4(%rbp)
jmp 0x9769
movq -0x7e0(%rbp), %rdi
movl -0x7e4(%rbp), %eax
movl %eax, -0x6d4(%rbp)
movl -0x6d4(%rbp), %esi
callq 0x32b0
movq %rax, -0x7f0(%rbp)
jmp 0x9790
movl $0x30, %edi
callq 0xb810
movb %al, -0x7f1(%rbp)
jmp 0x97a2
movq -0x7f0(%rbp), %rdi
movb -0x7f1(%rbp), %al
movb %al, -0x6d5(%rbp)
movzbl -0x6d5(%rbp), %esi
callq 0x33d0
movq %rax, -0x800(%rbp)
jmp 0x97ca
movq -0x800(%rbp), %rdi
movl -0x14(%rbp), %esi
callq 0x3340
movq %rax, -0x808(%rbp)
jmp 0x97e2
movq -0x808(%rbp), %rdi
leaq 0x109ae(%rip), %rsi     # 0x1a19e
callq 0x3260
jmp 0x97f7
movq -0x710(%rbp), %rdi
leaq -0x6d0(%rbp), %rsi
callq 0x3250
jmp 0x980c
movl $0x1, -0x1c8(%rbp)
leaq -0x6d0(%rbp), %rdi
callq 0x31d0
jmp 0x98fa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
leaq -0x6d0(%rbp), %rdi
callq 0x31d0
jmp 0x9913
movq -0x700(%rbp), %rsi
movl -0x14(%rbp), %edx
leaq -0x6f8(%rbp), %rdi
callq 0xae30
jmp 0x9862
leaq -0x6f8(%rbp), %rdi
callq 0x6550
movq %rax, %rsi
addq $0x130, %rsi            # imm = 0x130
leaq -0x6e8(%rbp), %rdi
movq %rdi, -0x810(%rbp)
callq 0x6570
movq -0x710(%rbp), %rdi
movq -0x810(%rbp), %rsi
movq -0x518(%rbp), %rax
movl 0x4(%rax), %edx
callq 0xa9b0
jmp 0x98aa
leaq -0x6e8(%rbp), %rdi
callq 0x43a0
leaq -0x6f8(%rbp), %rdi
callq 0x4820
movl $0x1, -0x1c8(%rbp)
jmp 0x98fa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b8(%rbp)
movl %eax, -0x1bc(%rbp)
leaq -0x6e8(%rbp), %rdi
callq 0x43a0
leaq -0x6f8(%rbp), %rdi
callq 0x4820
jmp 0x9913
leaq -0x28(%rbp), %rdi
callq 0x4820
movq -0x708(%rbp), %rax
addq $0x810, %rsp            # imm = 0x810
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x4820
movq -0x1b8(%rbp), %rdi
callq 0x3450
nopl (%rax,%rax)