//
// sub_4DD560 from 0x4dd560 to 0x4dd5a0 (64 bytes)
//
// 107 xrefs:
// > prefabKeyFromBinary @ 0x9d0710
// > GJSmartTemplate::getNoCornerKey @ 0x9d0d64
// > GJSmartTemplate::getTotalChanceForPrefab @ 0x9d0eb8
// > GJSmartTemplate::getRandomPrefab @ 0x9d10d8
// > GJSmartTemplate::getRandomPrefab @ 0x9d1104
// > GJSmartTemplate::keyFromNeighbors @ 0x9d1df0
// > GJSmartTemplate::saveRemap @ 0x9d3184
// > GJSmartTemplate::saveRemap @ 0x9d31a0
// > GJSmartTemplate::saveRemap @ 0x9d31d0
// > GJSmartTemplate::saveRemap @ 0x9d31ec
// > GJSmartTemplate::saveRemap @ 0x9d3214
// > GJSmartTemplate::saveRemap @ 0x9d3230
// > GJSmartTemplate::saveRemap @ 0x9d326c
// > GJSmartTemplate::saveRemap @ 0x9d3290
// > GJSmartTemplate::saveRemap @ 0x9d32b4
// > GJSmartTemplate::saveRemap @ 0x9d32d8
// > GJSmartTemplate::saveRemap @ 0x9d32fc
// > GJSmartTemplate::saveRemap @ 0x9d3318
// > GJSmartTemplate::saveRemap @ 0x9d3334
// > GJSmartTemplate::saveRemap @ 0x9d3378
// > GJSmartTemplate::saveRemap @ 0x9d33b0
// > GJSmartTemplate::saveRemap @ 0x9d33f0
// > GJSmartTemplate::saveRemap @ 0x9d3440
// > GJSmartTemplate::saveRemap @ 0x9d3464
// > GJSmartTemplate::saveRemap @ 0x9d3480
// > GJSmartTemplate::getPrefab @ 0x9d3890
// > GJSmartTemplate::getPrefab @ 0x9d40dc
// > GJSmartTemplate::getPrefab @ 0x9d4104
// > GJSmartTemplate::getPrefab @ 0x9d4120
// > GJSmartTemplate::getPrefab @ 0x9d413c
// > GJSmartTemplate::getPrefab @ 0x9d4158
// > GJSmartTemplate::getPrefab @ 0x9d417c
// > GJSmartTemplate::getPrefab @ 0x9d4198
// > GJSmartTemplate::getPrefab @ 0x9d4210
// > GJSmartTemplate::getPrefab @ 0x9d423c
// > GJSmartTemplate::getPrefab @ 0x9d4258
// > GJSmartTemplate::getPrefab @ 0x9d42a0
// > GJSmartTemplate::getPrefab @ 0x9d42bc
// > GJSmartTemplate::getPrefab @ 0x9d4314
// > GJSmartTemplate::getPrefab @ 0x9d4354
// > GJSmartTemplate::getPrefab @ 0x9d4394
// > GJSmartTemplate::getPrefab @ 0x9d43b0
// > GJSmartTemplate::getPrefab @ 0x9d4884
// > GJSmartTemplate::dataLoaded @ 0x9d59cc
// > GJSmartTemplate::dataLoaded @ 0x9d59f8
// > GJSmartTemplate::dataLoaded @ 0x9d5a14
// > GJSmartTemplate::savePrefab @ 0x9d5d00
// > GJSmartPrefab::dataLoaded @ 0x9d5e14
// > GJSmartBlockPreview::create @ 0x9d6044
// > GJSmartBlockPreview::addPreview @ 0x9d6288
// > GJSmartBlockPreview::addChance @ 0x9d659c
// > GJSmartBlockPreview::addTemplateGuide @ 0x9d6ca8
// > GJSmartBlockPreview::addTemplateGuide @ 0x9d7118
// > GJSmartBlockPreview::addTemplateGuide @ 0x9d7148
// > GJSmartBlockPreview::addTemplateGuide @ 0x9d7164
// > GJSmartBlockPreview::addTemplateGuide @ 0x9d7190
// > GJSmartBlockPreview::addTemplateGuide @ 0x9d71c0
// > std::vector>::_M_emplace_back_aux @ 0x9d7b78
// > std::vector>::_M_emplace_back_aux @ 0x9d7bf0
// > std::vector>::_M_emplace_back_aux @ 0x9d7c0c
// > GJSmartTemplate::scanForPrefab @ 0x9d9350
// > GJSmartTemplate::scanForPrefab @ 0x9d9778
// > GJSmartTemplate::scanForPrefab @ 0x9d9798
// > GJSmartTemplate::scanForPrefab @ 0x9d98b8
// > GJSmartTemplate::scanForPrefab @ 0x9d993c
// > GJSmartTemplate::scanForPrefab @ 0x9d995c
// > GJSmartTemplate::scanForPrefab @ 0x9d9ab4
// > GJSmartTemplate::scanForPrefab @ 0x9d9ad4
// > GJSmartTemplate::scanForPrefab @ 0x9d9c1c
// > GJSmartTemplate::scanForPrefab @ 0x9d9c78
// > GJSmartTemplate::scanForPrefab @ 0x9d9c94
// > GJSmartTemplate::scanForPrefab @ 0x9d9cb0
// > GJSmartTemplate::scanForPrefab @ 0x9d9cd8
// > GJSmartTemplate::scanForPrefab @ 0x9d9cfc
// > GJSmartTemplate::scanForPrefab @ 0x9d9d20
// > GJSmartTemplate::scanForPrefab @ 0x9d9da4
// > GJSmartTemplate::scanForPrefab @ 0x9d9dc4
// > GJSmartTemplate::scanForPrefab @ 0x9d9ef4
// > GJSmartTemplate::scanForPrefab @ 0x9d9f78
// > GJSmartTemplate::scanForPrefab @ 0x9d9f98
// > GJSmartTemplate::scanForPrefab @ 0x9da0c8
// > GJSmartTemplate::scanForPrefab @ 0x9da108
// > GJSmartTemplate::scanForPrefab @ 0x9da164
// > GJSmartTemplate::scanForPrefab @ 0x9da1a8
// > GJSmartTemplate::scanForPrefab @ 0x9da1cc
// > GJSmartTemplate::scanForPrefab @ 0x9da1f0
// > GJSmartTemplate::scanForPrefab @ 0x9da20c
// > GJSmartTemplate::scanForPrefab @ 0x9da294
// > GJSmartTemplate::scanForPrefab @ 0x9da2b0
// > generateAllBinaryStrings @ 0x9da648
// > GJSmartTemplate::logTemplateStatus @ 0x9da9f8
// > GJSmartTemplate::logTemplateStatus @ 0x9daa28
// > GJSmartTemplate::logTemplateStatus @ 0x9daa48
// > GJSmartTemplate::logTemplateStatus @ 0x9daa7c
// > GJSmartTemplate::getTemplateState @ 0x9db090
// > GJSmartTemplate::getTemplateState @ 0x9db0ac
// > GJSmartTemplate::getTemplateState @ 0x9db0c8
// > GJSmartTemplate::getTemplateState @ 0x9db0e4
// > GJSmartTemplate::getTemplateState @ 0x9db100
// > GJSmartTemplate::getTemplateState @ 0x9db11c
// > GJSmartTemplate::getTemplateState @ 0x9db138
// > GJSmartTemplate::getTemplateState @ 0x9db168
// > GJSmartTemplate::getTemplateState @ 0x9db1b0
// > GJSmartTemplate::getTemplateState @ 0x9db1e0
// > GJSmartTemplate::generateRemapDict @ 0x9db964
// > GJSmartTemplate::generateRemapDict @ 0x9dba04
// > GJSmartTemplate::generateRemapDict @ 0x9dba20
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall sub_4DD560(void *p)
{
unsigned int *v1; // x3
int v2; // w2
if ( &pthread_create )
{
v1 = (unsigned int *)((char *)p + 16);
do
v2 = __ldaxr(v1);
while ( __stlxr(v2 - 1, v1) );
}
else
{
v2 = *((_DWORD *)p + 4);
*((_DWORD *)p + 4) = v2 - 1;
}
if ( v2 <= 0 )
operator delete(p);
}