//
// BrowseSmartKeyLayer::addChanceToSelected from 0x10007374c to 0x10007385c (272 bytes)
//
// 1 xrefs:
// > BrowseSmartKeyLayer::onButton @ 0x100073448
//
// 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 BrowseSmartKeyLayer::addChanceToSelected(BrowseSmartKeyLayer *a1, int a2, bool a3)
{
cocos2d::CCArray *AllSelectedBlocks; // x22
__int64 v7; // x23
__int64 v8; // x25
GJSmartTemplate *m_template; // x24
int v10; // w0
__int64 PrefabWithID; // x0
__int64 v12; // x24
int v13; // w8
void *__p[2]; // [xsp+0h] [xbp-60h] BYREF
char *longStorage; // [xsp+10h] [xbp-50h]
AllSelectedBlocks = BrowseSmartKeyLayer::getAllSelectedBlocks(a1);
if ( (unsigned int)sub_10024A36C(AllSelectedBlocks) )
{
v7 = 0;
do
{
v8 = sub_10024A388(AllSelectedBlocks, v7);
m_template = a1->m_template;
if ( a1->m_prefabKey.m_data.m_short.shortStorage.__elems_[22] < 0 )
{
sub_1000097D0(__p, (void *)a1->m_prefabKey.m_data.m_long.capacitym1, a1->m_prefabKey.m_data.m_long.size);
}
else
{
*(_OWORD *)__p = *(_OWORD *)&a1->m_prefabKey.m_data.m_short.sizex2;
longStorage = a1->m_prefabKey.m_data.m_long.longStorage;
}
v10 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 64LL))(v8);
PrefabWithID = GJSmartTemplate::getPrefabWithID((__int64)m_template, (__int64)__p, v10);
v12 = PrefabWithID;
if ( SHIBYTE(longStorage) < 0 )
{
operator delete(__p[0]);
if ( v12 )
{
LABEL_10:
if ( a3 )
v13 = 0;
else
v13 = *(_DWORD *)(v12 + 108) + a2;
*(_DWORD *)(v12 + 108) = v13;
}
}
else if ( PrefabWithID )
{
goto LABEL_10;
}
v7 = (unsigned int)(v7 + 1);
}
while ( (unsigned int)v7 < (unsigned int)sub_10024A36C(AllSelectedBlocks) );
}
BrowseSmartKeyLayer::updateChanceValues(a1);
}