//
// TutorialPopup::init from 0x41e89c to 0x41ea24 (392 bytes)
//
// 1 xrefs:
// > TutorialPopup::create @ 0x41ebe6
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 11:48:00 +0000
//
int __fastcall TutorialPopup::init(int a1, int a2)
{
int v4; // r9
unsigned __int8 *v5; // r0
cocos2d::CCLayer *WinSize; // r0
int v7; // r0
int v8; // r3
const char *v9; // r1
cocos2d::CCSprite *v10; // r0
float *v11; // r5
void (__fastcall *v12)(float *, _BYTE *); // r7
const char *v13; // r1
int v14; // r0
cocos2d::CCMenu *v15; // r0
int v16; // r0
int v17; // r10
int v18; // r11
void (__fastcall *v20)(int, _BYTE *); // [sp+Ch] [bp-30h]
float v21[4]; // [sp+14h] [bp-28h] BYREF
_BYTE v22[8]; // [sp+24h] [bp-18h] BYREF
_BYTE v23[8]; // [sp+2Ch] [bp-10h] BYREF
v23[0] = 0;
v23[1] = 0;
v23[2] = 0;
v23[3] = -106;
v4 = cocos2d::CCLayerColor::initWithColor(a1, v23);
if ( v4 )
{
(*(void (__fastcall **)(int, int))(*(_DWORD *)a1 + 500))(a1, 1);
(*(void (__fastcall **)(int, int))(*(_DWORD *)a1 + 536))(a1, 1);
v5 = std::string::operator=((unsigned __int8 *)(a1 + 520), (unsigned __int8 *)a2);
cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v5);
WinSize = (cocos2d::CCLayer *)cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)v21);
v7 = cocos2d::CCLayer::create(WinSize);
v8 = *(_DWORD *)a1;
*(_DWORD *)(a1 + 460) = v7;
(*(void (__fastcall **)(int, int))(v8 + 228))(a1, v7);
if ( (*(_BYTE *)a2 & 1) != 0 )
v10 = *(cocos2d::CCSprite **)(a2 + 8);
else
v10 = (cocos2d::CCSprite *)(a2 + 1);
v11 = (float *)cocos2d::CCSprite::create(v10, v9);
v12 = *(void (__fastcall **)(float *, _BYTE *))(*(_DWORD *)v11 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v23, v21[0] * 0.5, (float)(v21[1] * 0.5) + 30.0);
v12(v11, v23);
(*(void (__fastcall **)(_DWORD, float *, int))(**(_DWORD **)(a1 + 460) + 232))(*(_DWORD *)(a1 + 460), v11, 1);
v14 = cocos2d::CCSprite::createWithSpriteFrameName((cocos2d::CCSprite *)"NextBtn_001.png", v13);
LODWORD(v21[2]) = TutorialPopup::closeTutorial;
v21[3] = 0.0;
v15 = (cocos2d::CCMenu *)CCMenuItemSpriteExtra::create(v14, 0, a1, (int)TutorialPopup::closeTutorial, 0);
*(_DWORD *)(a1 + 544) = v15;
v16 = cocos2d::CCMenu::create(v15, nullptr);
*(_DWORD *)(a1 + 444) = v16;
(*(void (__fastcall **)(_DWORD, int, int))(**(_DWORD **)(a1 + 460) + 232))(*(_DWORD *)(a1 + 460), v16, 10);
v17 = *(_DWORD *)(a1 + 444);
v20 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v17 + 92);
v18 = (*(int (__fastcall **)(float *))(*(_DWORD *)v11 + 96))(v11);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v23, 0.0, (float)-(float)(v11[87] * 0.5) - 35.0);
cocos2d::CCPoint::operator+(v22, v18, v23);
v20(v17, v22);
(*(void (__fastcall **)(_DWORD, int))(**(_DWORD **)(a1 + 544) + 80))(*(_DWORD *)(a1 + 544), 1061997773);
(*(void (__fastcall **)(_DWORD, _DWORD))(**(_DWORD **)(a1 + 544) + 172))(*(_DWORD *)(a1 + 544), 0);
*(_DWORD *)(a1 + 500) = -1;
}
return v4;
}