//
// GJRewardItem::init from 0x10033ff80 to 0x1003400f0 (368 bytes)
//
// 1 xrefs:
// > GJRewardItem::create @ 0x100333334
//
// 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
//
__int64 __fastcall GJRewardItem::init(__int64 a1, int a2, int a3, __int64 a4)
{
__int64 v5; // x8
cocos2d::CCArray *v6; // x20
cocos2d::CCString *v7; // x0
int v8; // w25
cocos2d::CCString *v9; // x0
int v10; // w23
cocos2d::CCString *v11; // x0
SpecialRewardItem v12; // w22
cocos2d::CCString *v13; // x0
int v14; // w0
int v15; // w24
SpecialRewardItem v16; // w21
cocos2d::CCObject *v17; // x20
*(_DWORD *)(a1 + 56) = a2;
*(_DWORD *)(a1 + 60) = a3;
v5 = *(char *)(a4 + 23);
if ( v5 < 0 )
v5 = *(_QWORD *)(a4 + 8);
if ( v5 )
{
v6 = (cocos2d::CCArray *)sub_1003316D4((std::string *)a4, ",");
if ( (unsigned int)sub_10024A36C((__int64)v6) >= 4 )
{
v7 = cocos2d::CCArray::stringAtIndex(v6, 0);
v8 = cocos2d::CCString::intValue(v7);
v9 = cocos2d::CCArray::stringAtIndex(v6, 1u);
v10 = cocos2d::CCString::intValue(v9);
v11 = cocos2d::CCArray::stringAtIndex(v6, 2u);
v12 = cocos2d::CCString::intValue(v11);
v13 = cocos2d::CCArray::stringAtIndex(v6, 3u);
v14 = cocos2d::CCString::intValue(v13);
if ( v12 == v14 )
v15 = 2;
else
v15 = 1;
if ( v12 == v14 )
v16 = 0;
else
v16 = v14;
v17 = sub_10024A15C();
if ( v8 >= 1 )
{
GJRewardObject::create(BonusKey|FireShard, v8, 0);
sub_10024A2D0((__int64)v17);
}
if ( v10 >= 1 )
{
GJRewardObject::create(Diamonds, v10, 0);
sub_10024A2D0((__int64)v17);
}
if ( v12 )
{
GJRewardObject::create(v12, v15, 0);
sub_10024A2D0((__int64)v17);
}
if ( v16 )
{
GJRewardObject::create(v16, 1, 0);
sub_10024A2D0((__int64)v17);
}
if ( (unsigned int)sub_10024A36C((__int64)v17) )
sub_10015C71C(a1, v17);
}
}
return 1;
}