#include "classes.h" // 009c6c90 void PreloadManager::load_group(std_string *groupName) { uint uVar1; uint uVar2; std_string *psVar3; char cVar4; byte *path; void *pvVar5; uint *puVar6; byte *pbVar7; undefined1 auStackY_cc [128]; int *imageRefCount; undefined1 loadedImage [4]; int *loadedImageRefCount; undefined1 swapImage [4]; int *swapImageRefCount; void *entryImage; int *entryImageRefCount; void *local_10; undefined1 *puStack_c; undefined4 local_8; psVar3 = groupName; local_8 = 0xffffffff; puStack_c = &LAB_00b0f05d; local_10 = ExceptionList; ExceptionList = &local_10; std::map::find(); if ((groupName != *GHIDRA_CAST(this)) && ((char)groupName[1]._size == '\0')) { pbVar7 = GHIDRA_CAST(groupName[2]._capacity); if (pbVar7 != *GHIDRA_CAST(groupName[3]._buf)) { groupName = GHIDRA_CAST((pbVar7 + 0x1c)); do { path = pbVar7; if (0xf < groupName[-1]._size) { path = *GHIDRA_CAST(pbVar7); } pvVar5 = Manager::LoadImage(loadedImage,path); local_8 = 0; puVar6 = (GHIDRA_CAST((swapImage)))->KAGE::SmartPointer::operator_assign(pvVar5); uVar1 = puVar6[1]; puVar6[1] = *GHIDRA_CAST(groupName->_buf); uVar2 = groupName[-1]._capacity; *GHIDRA_CAST(groupName->_buf) = uVar1; uVar1 = *puVar6; *puVar6 = uVar2; groupName[-1]._capacity = uVar1; local_8 = CONCAT31((*GHIDRA_CAST((GHIDRA_CAST(&(local_8)) + 0x1))),1); if (swapImageRefCount != GHIDRA_CAST(0x0)) { cVar4 = (**(code **)(*swapImageRefCount + 0xc))(); if ((cVar4 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } } local_8 = 2; if (loadedImageRefCount != GHIDRA_CAST(0x0)) { cVar4 = (**(code **)(*loadedImageRefCount + 0xc))(); if ((cVar4 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(); } } local_8 = 0xffffffff; pvVar5 = (void *)0x0; imageRefCount = GHIDRA_CAST(0x0); entryImageRefCount = *GHIDRA_CAST(groupName->_buf); entryImage = (void *)groupName[-1]._capacity; if (entryImageRefCount != GHIDRA_CAST(0x0)) { cVar4 = (**(code **)(*entryImageRefCount + 4))(); if (cVar4 != '\0') { if (imageRefCount != GHIDRA_CAST(0x0)) { cVar4 = (**(code **)(*imageRefCount + 0xc))(); if ((cVar4 != '\0') && (g_imageReleaseFn != (void *)0x0)) { (*g_imageReleaseFn)(auStackY_cc + 0x84); } } pvVar5 = entryImage; imageRefCount = entryImageRefCount; } } TextureCache::Add(pvVar5,imageRefCount); pbVar7 = pbVar7 + 0x20; groupName = GHIDRA_CAST((groupName[1]._buf + 8)); } while (pbVar7 != *GHIDRA_CAST(psVar3[3]._buf)); } *GHIDRA_CAST(&psVar3[1]._size) = 1; } ExceptionList = local_10; return; }