#include "classes.h" // 006eee10 void EntitySaveStateRef::Set(void *state) { char isReleased; uint32_t uVar1; ReferenceCountBase *refCount; void *local_10; uint8_t *puStack_c; uint32_t local_8; local_8 = 0xffffffff; puStack_c = &LAB_00af0d44; local_10 = ExceptionList; uVar1 = __security_cookie ^ GHIDRA_INT(register0x00000010) - 4U; ExceptionList = &local_10; refCount = operator_new(0x18); local_8 = 0; if (refCount == GHIDRA_CAST(0x0)) { refCount = GHIDRA_CAST(0x0); } else { (GHIDRA_CAST((refCount)))->ReferenceCountBase::ReferenceCountBase(); *GHIDRA_CAST(refCount) = ReferenceCount::vftable; *(void **)(refCount + 0x14) = state; } local_8 = 0xffffffff; if (*GHIDRA_CAST((GHIDRA_CAST(this) + 4)) != GHIDRA_CAST(0x0)) { isReleased = (**(code **)(**GHIDRA_CAST((GHIDRA_CAST(this) + 4)) + 0xc))(uVar1); if ((isReleased != '\0') && (g_entitySaveStateReleaseFn != (void *)0x0)) { (*g_entitySaveStateReleaseFn)(this); } } *GHIDRA_CAST((GHIDRA_CAST(this) + 4)) = refCount; *(void **)this = state; ExceptionList = local_10; return; }