//
// TutorialPopup::init from 0x6005f0 to 0x600828 (568 bytes)
//
// 2 xrefs:
// > TutorialPopup::create @ 0x600928
// > ??> @ 0x80700
//
// 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 TutorialPopup::init(__int64 a1, cocos2d::CCSprite **a2)
{
unsigned __int8 v4; // w0
unsigned int v5; // w22
cocos2d::CCDirector *v6; // x0
cocos2d::CCLayer *v7; // x0
const char *v8; // x1
float *v9; // x23
void (__fastcall *v10)(float *, cocos2d::CCPoint *); // x25
cocos2d::CCSprite *v11; // x0
CCMenuItemSpriteExtra *v12; // x0
__int64 v13; // x0
__int64 v14; // x25
void (__fastcall *v15)(__int64, __int64 *); // x26
__int64 v16; // x27
float v18; // [xsp+60h] [xbp+60h]
float v19; // [xsp+64h] [xbp+64h]
__int64 v20; // [xsp+68h] [xbp+68h] BYREF
cocos2d::CCPoint v21; // [xsp+70h] [xbp+70h] BYREF
cocos2d::SEL_MenuHandler v22; // 0:x2.16
v21.x = -1.034e-25;
v4 = cocos2d::CCLayerColor::initWithColor((cocos2d::CCLayerColor *)a1, (const cocos2d::_ccColor4B *)&v21);
v5 = v4;
if ( v4 )
{
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 984LL))(a1, 1);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1056LL))(a1, 1);
sub_D18EA8(a1 + 632, a2);
v6 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v6);
v7 = cocos2d::CCLayer::create();
*(_QWORD *)(a1 + 576) = v7;
(*(void (__fastcall **)(__int64, cocos2d::CCLayer *))(*(_QWORD *)a1 + 440LL))(a1, v7);
v9 = (float *)cocos2d::CCSprite::create(*a2, v8);
v10 = *(void (__fastcall **)(float *, cocos2d::CCPoint *))(*(_QWORD *)v9 + 184LL);
cocos2d::CCPoint::CCPoint(&v21, v18 * 0.5, (float)(v19 * 0.5) + 30.0);
v10(v9, &v21);
(*(void (__fastcall **)(_QWORD, float *, __int64))(**(_QWORD **)(a1 + 576) + 448LL))(*(_QWORD *)(a1 + 576), v9, 1);
v11 = cocos2d::CCSprite::createWithSpriteFrameName("NextBtn_001.png");
v22.ptr = (void (__cdecl *)(cocos2d::CCObject *))a1;
v22.adj = (size_t)TutorialPopup::closeTutorial;
v12 = CCMenuItemSpriteExtra::create(v11, nullptr, v22);
*(_QWORD *)(a1 + 664) = v12;
v13 = cocos2d::CCMenu::create((cocos2d::CCMenu *)v12, nullptr);
*(_QWORD *)(a1 + 544) = v13;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 576) + 448LL))(*(_QWORD *)(a1 + 576), v13, 10);
v14 = *(_QWORD *)(a1 + 544);
v15 = *(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v14 + 184LL);
v16 = (*(__int64 (__fastcall **)(float *))(*(_QWORD *)v9 + 192LL))(v9);
cocos2d::CCPoint::CCPoint(&v21, 0.0, -35.0 - (float)(v9[109] * 0.5));
cocos2d::CCPoint::operator+(&v20, v16, &v21);
v15(v14, &v20);
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(a1 + 664) + 160LL))(*(_QWORD *)(a1 + 664), 0.8);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 664) + 328LL))(*(_QWORD *)(a1 + 664), 0);
*(_DWORD *)(a1 + 624) = -1;
}
return v5;
}