//
// GJRewardItem::getRewardObjectForType from 0x100072c40 to 0x100072d32 (242 bytes)
//
// 1 xrefs:
// > GameStatsManager::preProcessReward @ 0x100072a73
//
// 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
//
// local variable allocation has failed, the output may be wrong!
GJRewardObject *__fastcall GJRewardItem::getRewardObjectForType(GJRewardItem *a1, SpecialRewardItem a2)
{
cocos2d::CCArray *m_rewardObjects; // rdi
cocos2d::CCArray *v4; // rax
unsigned int v5; // r15d
GJRewardObject *result; // rax
GJRewardObject *v7; // r15
m_rewardObjects = a1->m_rewardObjects;
if ( m_rewardObjects )
goto LABEL_8;
m_rewardObjects = (cocos2d::CCArray *)sub_10071F9E0(0, *(_QWORD *)&a2);
v4 = a1->m_rewardObjects;
if ( v4 != m_rewardObjects )
{
if ( m_rewardObjects )
{
cocos2d::CCObject::retain(m_rewardObjects);
v4 = a1->m_rewardObjects;
}
if ( v4 )
cocos2d::CCObject::release(v4);
a1->m_rewardObjects = m_rewardObjects;
LABEL_8:
if ( (unsigned int)sub_100720070(m_rewardObjects) )
goto LABEL_9;
LABEL_12:
v7 = (GJRewardObject *)operator new(0x48u);
cocos2d::CCObject::CCObject(v7);
v7->__vftable = (GJRewardObject_vtbl *)off_1008B38A8;
v7->m_specialRewardItem = a2;
*(_QWORD *)&v7->m_itemID = 0;
cocos2d::CCObject::autorelease(v7);
sub_10071FCD0(a1->m_rewardObjects, v7);
return v7;
}
if ( !(unsigned int)sub_100720070(a1->m_rewardObjects) )
goto LABEL_12;
LABEL_9:
v5 = 0;
while ( 1 )
{
result = (GJRewardObject *)sub_1007200C0(a1->m_rewardObjects, v5);
if ( result->m_specialRewardItem == a2 )
return result;
if ( ++v5 >= (unsigned int)sub_100720070(a1->m_rewardObjects) )
goto LABEL_12;
}
}