//
// TutorialPopup::init from 0x32a498 to 0x32a618 (384 bytes)
//
// 1 xrefs:
// > TutorialPopup::create @ 0x32a6f8
//
// 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
//
int __fastcall TutorialPopup::init(int *a1, cocos2d::CCSprite **a2)
{
int v4; // r9
cocos2d::CCDirector *v5; // r0
cocos2d::CCLayer *v6; // r0
int v7; // r3
const char *v8; // r1
float *v9; // r6
void (__fastcall *v10)(float *, cocos2d::CCPoint *); // r10
cocos2d::CCSprite *v11; // r0
CCMenuItemSpriteExtra *v12; // r0
int v13; // r0
int v14; // r10
int v15; // r11
void (__fastcall *v17)(int, _BYTE *); // [sp+Ch] [bp-30h]
cocos2d::CCSize v18; // [sp+14h] [bp-28h] BYREF
void (*v19)(TutorialPopup *, cocos2d::CCObject *); // [sp+1Ch] [bp-20h]
int v20; // [sp+20h] [bp-1Ch]
_BYTE v21[8]; // [sp+24h] [bp-18h] BYREF
cocos2d::CCPoint v22; // [sp+2Ch] [bp-10h] BYREF
v22.x = -1.034e-25;
v4 = cocos2d::CCLayerColor::initWithColor((cocos2d::CCLayerColor *)a1, (const cocos2d::_ccColor4B *)&v22);
if ( v4 )
{
(*(void (__fastcall **)(int *, int))(*a1 + 492))(a1, 1);
(*(void (__fastcall **)(int *, int))(*a1 + 528))(a1, 1);
sub_775D40(a1 + 124, a2);
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v18, v5);
v6 = cocos2d::CCLayer::create();
v7 = *a1;
a1[114] = (int)v6;
(*(void (__fastcall **)(int *, cocos2d::CCLayer *))(v7 + 220))(a1, v6);
v9 = (float *)cocos2d::CCSprite::create(*a2, v8);
v10 = *(void (__fastcall **)(float *, cocos2d::CCPoint *))(*(_DWORD *)v9 + 92);
cocos2d::CCPoint::CCPoint(&v22, v18.width * 0.5, (float)(v18.height * 0.5) + 30.0);
v10(v9, &v22);
(*(void (__fastcall **)(int, float *, int))(*(_DWORD *)a1[114] + 224))(a1[114], v9, 1);
v11 = cocos2d::CCSprite::createWithSpriteFrameName("NextBtn_001.png");
v19 = TutorialPopup::closeTutorial;
v20 = 0;
v12 = CCMenuItemSpriteExtra::create(
v11,
nullptr,
(cocos2d::SEL_MenuHandler)__PAIR64__(TutorialPopup::closeTutorial, (unsigned int)a1));
a1[128] = (int)v12;
v13 = cocos2d::CCMenu::create((cocos2d::CCMenu *)v12, nullptr);
a1[110] = v13;
(*(void (__fastcall **)(int, int, int))(*(_DWORD *)a1[114] + 224))(a1[114], v13, 10);
v14 = a1[110];
v17 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v14 + 92);
v15 = (*(int (__fastcall **)(float *))(*(_DWORD *)v9 + 96))(v9);
cocos2d::CCPoint::CCPoint(&v22, 0.0, (float)-(float)(v9[87] * 0.5) - 35.0);
cocos2d::CCPoint::operator+(v21, v15, &v22);
v17(v14, v21);
(*(void (__fastcall **)(int, int))(*(_DWORD *)a1[128] + 80))(a1[128], 1061997773);
(*(void (__fastcall **)(int, _DWORD))(*(_DWORD *)a1[128] + 164))(a1[128], 0);
a1[122] = -1;
}
return v4;
}