//
// GJPathRewardPopup::init from 0xba4638 to 0xba4b24 (1260 bytes)
//
// 2 xrefs:
// > GJPathRewardPopup::create @ 0xba4c68
// > ??> @ 0xe4ad8
//
// This function is hookable on this platform (idp: arm, 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 13:02:48 +0000
//
__int64 __fastcall GJPathRewardPopup::init(GJPathRewardPopup *this, int a2)
{
unsigned __int8 v3; // w0
unsigned int v4; // w24
__int64 v5; // x2
cocos2d::CCDirector *v6; // x0
cocos2d::CCDirector *v7; // x0
cocos2d::CCLayer *WinSize; // x0
__int64 v9; // x0
cocos2d::CCNode *v10; // x0
__int64 v11; // x23
void (__fastcall *v12)(__int64, __int64 *); // x22
cocos2d::CCMenu *v13; // x0
__int64 v14; // x22
float v15; // s2
void (__fastcall *v16)(__int64, __int64 *); // x25
cocos2d::CCNode *v17; // x0
cocos2d::CCNode *v18; // x20
void (__fastcall *v19)(cocos2d::CCNode *, __int64 *); // x22
const char *v20; // x2
__int64 v21; // x22
const char *v22; // x2
__int64 v23; // x23
void (__fastcall *v24)(__int64); // x25
__int64 v25; // x0
__int64 (__fastcall *v26)(__int64); // x1
void (__fastcall *v27)(__int64, __int64 *); // x22
__int64 v28; // x0
__int64 v29; // x23
void (__fastcall *v30)(__int64, __int64 *); // x22
__int64 v31; // x22
void (__fastcall *v32)(__int64); // x26
__int64 v33; // x0
__int64 (__fastcall *v34)(__int64); // x1
void (__fastcall *v35)(__int64, __int64 *); // x23
__int64 v36; // x0
cocos2d::CCArray *v37; // x0
__int64 v38; // x0
cocos2d::CCArray *v39; // x0
__int64 v40; // x0
const cocos2d::CCPoint *v41; // x1
cocos2d::CCEaseInOut *v42; // x0
cocos2d::CCActionInterval *v43; // x1
cocos2d::CCSequence *v44; // x22
const cocos2d::CCPoint *v45; // x1
cocos2d::CCEaseInOut *v46; // x0
cocos2d::CCActionInterval *v47; // x1
cocos2d::CCFiniteTimeAction *v48; // x0
cocos2d::CCRepeatForever *v49; // x0
cocos2d::CCActionInterval *v50; // x1
cocos2d::CCAction *v51; // x0
void (__fastcall *v53)(__int64, __int64 *); // [xsp+68h] [xbp+68h]
__int64 v54; // [xsp+70h] [xbp+70h] BYREF
_BYTE v55[8]; // [xsp+78h] [xbp+78h] BYREF
_BYTE v56[8]; // [xsp+80h] [xbp+80h] BYREF
__int64 v57; // [xsp+88h] [xbp+88h] BYREF
__int64 v58; // [xsp+90h] [xbp+90h] BYREF
*((_DWORD *)this + 165) = a2;
FLAlertLayer::incrementForcePrio(this);
LODWORD(v58) = 2097152000;
v3 = cocos2d::CCLayerColor::initWithColor(this, &v58);
v4 = v3;
if ( v3 )
{
v5 = *(_QWORD *)this;
*((_BYTE *)this + 596) = 1;
(*(void (__fastcall **)(GJPathRewardPopup *, __int64))(v5 + 1000))(this, 1);
v6 = (cocos2d::CCDirector *)(*(__int64 (__fastcall **)(GJPathRewardPopup *, __int64))(*(_QWORD *)this + 1072LL))(
this,
1);
v7 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v6);
WinSize = (cocos2d::CCLayer *)cocos2d::CCDirector::getWinSize(&v54, v7);
v9 = cocos2d::CCLayer::create(WinSize);
*((_QWORD *)this + 73) = v9;
v10 = (cocos2d::CCNode *)(*(__int64 (__fastcall **)(GJPathRewardPopup *, __int64))(*(_QWORD *)this + 456LL))(
this,
v9);
v11 = cocos2d::CCNode::create(v10);
v12 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v11 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v58, 100.0, 100.0);
v12(v11, &v58);
v13 = (cocos2d::CCMenu *)CCMenuItemSpriteExtra::create(
v11,
0,
(__int64)this,
(__int64)GJPathRewardPopup::onClaim,
0);
v14 = cocos2d::CCMenu::create(v13, nullptr);
v15 = *((float *)&v54 + 1);
*((_QWORD *)this + 69) = v14;
v16 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v14 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, *(float *)&v54 * 0.5, v15 * 0.5);
v16(v14, &v58);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**((_QWORD **)this + 73) + 464LL))(
*((_QWORD *)this + 73),
*((_QWORD *)this + 69),
10);
v17 = (cocos2d::CCNode *)cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v55, 0.0, 10.0);
v18 = (cocos2d::CCNode *)cocos2d::CCNode::create(v17);
(*(void (__fastcall **)(cocos2d::CCNode *, void *))(*(_QWORD *)v18 + 320LL))(v18, &unk_155E878);
(*(void (__fastcall **)(__int64, cocos2d::CCNode *))(*(_QWORD *)v11 + 456LL))(v11, v18);
v19 = *(void (__fastcall **)(cocos2d::CCNode *, __int64 *))(*(_QWORD *)v18 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, 50.0, 50.0);
v19(v18, &v58);
v21 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Reward!", "goldFont.fnt", v20);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v21 + 160LL))(v21, 0.65);
(*(void (__fastcall **)(cocos2d::CCNode *, __int64, __int64))(*(_QWORD *)v18 + 464LL))(v18, v21, 22);
v53 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v21 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, 0.0, 40.0);
cocos2d::CCPoint::operator+(&v57, v55);
v53(v21, &v57);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v56, 0.0, -5.0);
v23 = cocos2d::CCLabelBMFont::create((cocos2d::CCLabelBMFont *)"Reward!", "goldFont.fnt", v22);
v24 = *(void (__fastcall **)(__int64))(*(_QWORD *)v23 + 160LL);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v21 + 168LL))(v21);
v24(v23);
(*(void (__fastcall **)(cocos2d::CCNode *, __int64, __int64))(*(_QWORD *)v18 + 464LL))(v18, v23, 21);
v25 = v21;
v26 = *(__int64 (__fastcall **)(__int64))(*(_QWORD *)v21 + 192LL);
v27 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v23 + 184LL);
v28 = v26(v25);
cocos2d::CCPoint::operator+(&v58, v28);
v27(v23, &v58);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v23 + 1072LL))(v23, &unk_1195F90);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v23 + 1024LL))(v23, 50);
v29 = GJChestSprite::create((GJChestSprite *)&byte_6);
(*(void (__fastcall **)(cocos2d::CCNode *, __int64, __int64))(*(_QWORD *)v18 + 464LL))(v18, v29, 22);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v29 + 160LL))(v29, 0.6);
v30 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v29 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, 0.0, -6.0);
cocos2d::CCPoint::operator+(&v57, v55);
v30(v29, &v57);
v31 = GJChestSprite::create((GJChestSprite *)&byte_6);
(*(void (__fastcall **)(cocos2d::CCNode *, __int64, __int64))(*(_QWORD *)v18 + 464LL))(v18, v31, 21);
v32 = *(void (__fastcall **)(__int64))(*(_QWORD *)v31 + 160LL);
(*(void (__fastcall **)(__int64))(*(_QWORD *)v29 + 168LL))(v29);
v32(v31);
v33 = v29;
v34 = *(__int64 (__fastcall **)(__int64))(*(_QWORD *)v29 + 192LL);
v35 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v31 + 184LL);
v36 = v34(v33);
cocos2d::CCPoint::operator+(&v58, v36);
v35(v31, &v58);
v37 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v31 + 488LL))(v31);
v38 = cocos2d::CCArray::objectAtIndex(v37, 0);
(*(void (__fastcall **)(__int64, void *))(*(_QWORD *)v38 + 960LL))(v38, &unk_1195F90);
v39 = (cocos2d::CCArray *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v31 + 488LL))(v31);
v40 = cocos2d::CCArray::objectAtIndex(v39, 0);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v40 + 912LL))(v40, 50);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, 0.0, 5.0);
v42 = (cocos2d::CCEaseInOut *)cocos2d::CCMoveBy::create((cocos2d::CCMoveBy *)&v58, 1.0, v41);
v44 = (cocos2d::CCSequence *)cocos2d::CCEaseInOut::create(v42, v43, 2.0);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v58, 0.0, -5.0);
v46 = (cocos2d::CCEaseInOut *)cocos2d::CCMoveBy::create((cocos2d::CCMoveBy *)&v58, 1.0, v45);
v48 = (cocos2d::CCFiniteTimeAction *)cocos2d::CCEaseInOut::create(v46, v47, 2.0);
v49 = (cocos2d::CCRepeatForever *)cocos2d::CCSequence::create(v44, v48, 0);
v51 = (cocos2d::CCAction *)cocos2d::CCRepeatForever::create(v49, v50);
cocos2d::CCNode::runAction(v18, v51);
}
return v4;
}