#include "classes.h" // 00828e50 void * RoomSet::GetVariantSet(uint type) { undefined4 *variantSet; qword *allocatedBytes; uint insertKey; undefined4 *insertValue; undefined1 local_14 [8]; RoomSet local_c; qword prevAllocatedBytes; uint roomType; _Find_lower_bound<>(local_14,&type); roomType = type; if (((*GHIDRA_CAST((GHIDRA_CAST(local_c) + 0xd)) == '\0') && (*GHIDRA_CAST((GHIDRA_CAST(local_c) + 0x10)) <= type)) && (local_c != this[8])) { return *(void **)(GHIDRA_CAST(local_c) + 0x14); } if (g_mainHeap == (void *)0x0) { allocatedBytes = &g_allocatedBytesNoHeap; } else { allocatedBytes = GHIDRA_CAST((GHIDRA_INT(g_mainHeap) + 0x30)); } variantSet = malloc(8); if (variantSet == GHIDRA_CAST(0x0)) { FUN_00a23200(0x7fcb9dd6); } else { prevAllocatedBytes = *allocatedBytes; *GHIDRA_CAST(allocatedBytes) = GHIDRA_UINT(*allocatedBytes) + 8; *variantSet = 8; *GHIDRA_CAST((GHIDRA_CAST(allocatedBytes) + 4)) = *GHIDRA_CAST((GHIDRA_CAST(allocatedBytes) + 4)) + GHIDRA_UINT((0xfffffff7 < GHIDRA_UINT(prevAllocatedBytes))); variantSet = variantSet + 1; if (variantSet != GHIDRA_CAST(0x0)) { *variantSet = 0; goto LAB_00828ec0; } } variantSet = GHIDRA_CAST(0x0); LAB_00828ec0: insertKey = roomType; insertValue = variantSet; std::map::insert(local_14,&insertKey); return variantSet; }