//
// GJSmartTemplate::getPrefabWithID from 0x100412f60 to 0x100412fd0 (112 bytes)
//
// 4 xrefs:
// > EditorUI::createPrefab @ 0x100014bfa
// > BrowseSmartKeyLayer::addChanceToSelected @ 0x1004e672a
// > BrowseSmartKeyLayer::addChanceToSelected @ 0x1004e67da
// > BrowseSmartKeyLayer::updateChanceValues @ 0x1004e6a79
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:30:10 +0000
//
__int64 __fastcall GJSmartTemplate::getPrefabWithID(__int64 a1, char *a2, int a3)
{
__int64 v4; // rax
__int64 v5; // r14
int v6; // ecx
__int64 result; // rax
unsigned int v8; // r15d
if ( a3 <= 0 )
return 0;
v4 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 56), a2);
if ( !v4 )
return 0;
v5 = v4;
if ( !(unsigned int)sub_1007FEF90(v4) )
return 0;
v6 = sub_1007FEF90(v5);
result = 0;
if ( v6 )
{
v8 = 0;
while ( 1 )
{
result = sub_1007FEFE0(v5, v8);
if ( *(_DWORD *)(result + 104) == a3 )
break;
if ( ++v8 >= (unsigned int)sub_1007FEF90(v5) )
return 0;
}
}
return result;
}