// File: /workspace/github_cpp_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1c8, %rsp            # imm = 0x1C8
movl %edx, %r12d
movq %rsi, %r13
movq %rdi, %r15
leaq -0x48(%rbp), %rbx
movq %rbx, %rdi
callq 0x5f94
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x5332
movl %r12d, %eax
shrl $0x10, %eax
movzbl %al, %ebx
addq $0x140, %rdi            # imm = 0x140
leaq -0x1e8(%rbp), %rsi
movl %ebx, (%rsi)
callq 0x81dc
movq -0x48(%rbp), %rdi
leaq 0x148(%rdi), %rcx
cmpq %rcx, %rax
je 0x53ac
addq $0x140, %rdi            # imm = 0x140
leaq -0x1e8(%rbp), %rsi
movl %ebx, (%rsi)
callq 0x4882
movzwl %r12w, %r14d
movq (%rax), %rax
movq (%rax), %rax
cmpl %r14d, 0xc(%rax)
jbe 0x5426
movq %r13, -0x50(%rbp)
movl %r12d, -0x2c(%rbp)
movq %r15, -0x38(%rbp)
movl $0x140, %edi            # imm = 0x140
addq -0x48(%rbp), %rdi
leaq -0x1e8(%rbp), %rsi
movl %ebx, (%rsi)
callq 0x4882
movq (%rax), %r12
movq 0x8(%rax), %r15
movl %r14d, %r13d
leaq -0x1e8(%rbp), %rbx
cmpq %r15, %r12
je 0x549d
movq %rbx, %rdi
movq %r12, %rsi
callq 0x4a22
movq -0x1e8(%rbp), %rax
movq 0x60(%rax), %rax
movq (%rax,%r13,8), %r14
leaq -0x1e0(%rbp), %rdi
callq 0x3ac4
addq $0x10, %r12
testq %r14, %r14
je 0x52a2
leaq -0x1e8(%rbp), %rdi
movq -0x50(%rbp), %rsi
movl -0x2c(%rbp), %edx
callq 0x5f94
movl $0x130, %esi            # imm = 0x130
addq -0x1e8(%rbp), %rsi
leaq -0x60(%rbp), %rbx
movq %rbx, %rdi
callq 0x49cc
movl 0x4(%r14), %edx
movq -0x38(%rbp), %r15
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5dde
leaq -0x58(%rbp), %rdi
callq 0x3ac4
leaq -0x1e0(%rbp), %rdi
callq 0x3ac4
jmp 0x5524
leaq -0x1e8(%rbp), %rdi
callq 0x3120
leaq -0x1d8(%rbp), %rdi
leaq 0x4fa3(%rip), %rsi      # 0xa2ef
callq 0x31e0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movl 0x18(%rax,%rdx), %esi
andl $-0x4b, %esi
orl $0x8, %esi
movl %esi, 0x18(%rax,%rdx)
movq -0x18(%rcx), %rcx
movq $0x8, 0x10(%rax,%rcx)
pushq $0x30
popq %rsi
movq %rax, %rdi
callq 0x32c0
movl %r12d, %esi
movq %rax, %rdi
callq 0x3100
leaq 0x4e4d(%rip), %rsi      # 0xa1dd
movq %rax, %rdi
callq 0x31e0
leaq -0x1d0(%rbp), %rsi
movq %r15, %rdi
callq 0x32d0
jmp 0x5518
leaq -0x1e8(%rbp), %rdi
callq 0x3120
leaq -0x1d8(%rbp), %rdi
leaq 0x4f29(%rip), %rsi      # 0xa2ef
callq 0x31e0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movl 0x18(%rax,%rdx), %esi
andl $-0x4b, %esi
orl $0x8, %esi
movl %esi, 0x18(%rax,%rdx)
movq -0x18(%rcx), %rcx
movq $0x8, 0x10(%rax,%rcx)
pushq $0x30
popq %rsi
movq %rax, %rdi
callq 0x32c0
movl %r12d, %esi
movq %rax, %rdi
callq 0x3100
leaq 0x4dd3(%rip), %rsi      # 0xa1dd
movq %rax, %rdi
callq 0x31e0
leaq -0x1d0(%rbp), %rsi
movq %r15, %rdi
callq 0x32d0
jmp 0x5518
leaq -0x1e8(%rbp), %rdi
callq 0x3120
leaq -0x1d8(%rbp), %rdi
leaq 0x4eaf(%rip), %rsi      # 0xa2ef
callq 0x31e0
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movl 0x18(%rax,%rdx), %esi
andl $-0x4b, %esi
orl $0x8, %esi
movl %esi, 0x18(%rax,%rdx)
movq -0x18(%rcx), %rcx
movq $0x8, 0x10(%rax,%rcx)
pushq $0x30
popq %rsi
movq %rax, %rdi
callq 0x32c0
movl %r12d, %esi
movq %rax, %rdi
callq 0x3100
leaq 0x4d59(%rip), %rsi      # 0xa1dd
movq %rax, %rdi
callq 0x31e0
leaq -0x1d0(%rbp), %rsi
movq %r15, %rdi
callq 0x32d0
jmp 0x5518
leaq -0x1e8(%rbp), %rdi
callq 0x3120
movq -0x38(%rbp), %r15
leaq -0x1d8(%rbp), %rdi
leaq 0x4e34(%rip), %rsi      # 0xa2ef
callq 0x31e0
movl -0x2c(%rbp), %ebx
movq (%rax), %rcx
movq -0x18(%rcx), %rdx
movl 0x18(%rax,%rdx), %esi
andl $-0x4b, %esi
orl $0x8, %esi
movl %esi, 0x18(%rax,%rdx)
movq -0x18(%rcx), %rcx
movq $0x8, 0x10(%rax,%rcx)
pushq $0x30
popq %rsi
movq %rax, %rdi
callq 0x32c0
movl %ebx, %esi
movq %rax, %rdi
callq 0x3100
leaq 0x4cdc(%rip), %rsi      # 0xa1dd
movq %rax, %rdi
callq 0x31e0
leaq -0x1d0(%rbp), %rsi
movq %r15, %rdi
callq 0x32d0
leaq -0x1e8(%rbp), %rdi
callq 0x3150
leaq -0x40(%rbp), %rdi
callq 0x3ac4
movq %r15, %rax
addq $0x1c8, %rsp            # imm = 0x1C8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq -0x58(%rbp), %rdi
callq 0x3ac4
leaq -0x1e0(%rbp), %rdi
callq 0x3ac4
jmp 0x5584
jmp 0x556c
jmp 0x556c
jmp 0x556c
jmp 0x556c
jmp 0x556c
jmp 0x556c
jmp 0x556c
jmp 0x5575
movq %rax, %rbx
jmp 0x5584
jmp 0x5575
jmp 0x5575
movq %rax, %rbx
leaq -0x1e8(%rbp), %rdi
callq 0x3150
leaq -0x40(%rbp), %rdi
callq 0x3ac4
movq %rbx, %rdi
callq 0x3340
nop