//
// BrowseSmartKeyLayer::updateChanceValues from 0x53fb20 to 0x53fbf0 (208 bytes)
//
// 2 xrefs:
// > BrowseSmartKeyLayer::deletedSelectedItems @ 0x53fc98
// > BrowseSmartKeyLayer::addChanceToSelected @ 0x53fd42
//
// 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 BrowseSmartKeyLayer::updateChanceValues(BrowseSmartKeyLayer *a1)
{
GJSmartTemplate *m_template; // r7
unsigned int i; // r6
unsigned int v4; // r7
cocos2d::CCArray *v5; // r10
int v6; // r0
int v7; // r0
GJSmartTemplate *v8; // r11
GJSmartBlockPreview *v9; // r8
int v10; // r0
int PrefabWithID; // r11
unsigned int TotalChanceForPrefab; // [sp+0h] [bp-14h]
std::string v13; // [sp+8h] [bp-Ch] BYREF
m_template = a1->m_template;
sub_775C20(&v13);
TotalChanceForPrefab = GJSmartTemplate::getTotalChanceForPrefab(
(stl::StringData::Internal *)m_template,
(stl::StringData::Internal *)&v13);
sub_774008(&v13);
for ( i = 0; i < cocos2d::CCArray::count(a1->m_pages); ++i )
{
v4 = 0;
v5 = (cocos2d::CCArray *)cocos2d::CCArray::objectAtIndex(a1->m_pages, i);
while ( v4 < cocos2d::CCArray::count(v5) )
{
v6 = cocos2d::CCArray::objectAtIndex(v5, v4);
v7 = (*(int (__fastcall **)(int))(*(_DWORD *)v6 + 528))(v6);
v8 = a1->m_template;
v9 = (GJSmartBlockPreview *)v7;
sub_775C20(&v13);
v10 = v9->getTag(v9);
PrefabWithID = GJSmartTemplate::getPrefabWithID((int)v8, &v13, v10);
sub_774008(&v13);
if ( PrefabWithID )
GJSmartBlockPreview::addChance(v9, *(_DWORD *)(PrefabWithID + 64), TotalChanceForPrefab);
++v4;
}
}
}