//
// StartPosLayer::addModeButtons from 0xb64d94 to 0xb64fd8 (580 bytes)
//
// 2 xrefs:
// > StartPosLayer::init @ 0xb680a0
// > ??> @ 0x94f48
//
// 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:14 +0000
//
__int64 __fastcall StartPosLayer::addModeButtons(StartPosLayer *this)
{
unsigned int v2; // w19
__int64 v3; // x0
unsigned int v4; // w24
cocos2d::CCDirector *v5; // x0
cocos2d::CCNode *v6; // x20
cocos2d::CCArray *v7; // x0
cocos2d::CCObject *v8; // x0
cocos2d::CCArray *v9; // x0
cocos2d::CCArray *v10; // x25
cocos2d::CCSprite *v11; // x0
cocos2d::CCObject *v12; // x21
__int64 v13; // x0
cocos2d::CCObject *v14; // x20
__int64 v16; // [xsp+78h] [xbp+78h] BYREF
__int64 v17; // [xsp+80h] [xbp+80h] BYREF
_BYTE v18[8]; // [xsp+88h] [xbp+88h] BYREF
__int64 v19[2]; // [xsp+90h] [xbp+90h] BYREF
void *v20; // [xsp+A0h] [xbp+A0h]
v2 = 0;
v3 = *(_QWORD *)(*((_QWORD *)this + 127) + 1840LL);
v4 = *(unsigned __int8 *)(v3 + 341);
*((_DWORD *)this + 256) = *(_DWORD *)(v3 + 328);
v5 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)v3);
cocos2d::CCDirector::getWinSize(&v16, v5);
v6 = *((cocos2d::CCNode **)this + 69);
cocos2d::CCPoint::CCPoint(
(cocos2d::CCPoint *)v18,
*(float *)&v16 * 0.5,
(float)((float)(*((float *)this + 184) * 0.5) + (float)(*((float *)&v16 + 1) * 0.5)) - 30.0);
v7 = (cocos2d::CCArray *)cocos2d::CCNode::convertToNodeSpace(&v17, v6, (const cocos2d::CCPoint *)v18);
v8 = (cocos2d::CCObject *)cocos2d::CCArray::create(v7);
*((_QWORD *)this + 129) = v8;
v9 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v8);
v10 = (cocos2d::CCArray *)cocos2d::CCArray::create(v9);
do
{
SelectSettingLayer::frameForItem(v4, v2, v19);
v11 = (cocos2d::CCSprite *)((char *)v19 + 1);
if ( (v19[0] & 1) != 0 )
v11 = (cocos2d::CCSprite *)v20;
v12 = (cocos2d::CCObject *)cocos2d::CCSprite::createWithSpriteFrameName(v11, (const char *)LOBYTE(v19[0]));
cocos2d::CCArray::addObject(*((cocos2d::CCArray **)this + 129), v12);
(*(void (__fastcall **)(cocos2d::CCObject *, float))(*(_QWORD *)v12 + 160LL))(v12, 0.9);
v13 = CCMenuItemSpriteExtra::create((__int64)v12, 0, (__int64)this, (__int64)StartPosLayer::onSelectMode, 0);
v14 = (cocos2d::CCObject *)v13;
if ( v4 == 1 && (v2 == 7 || v2 == 4) )
{
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v13 + 1056LL))(v13, 0);
(*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v12 + 912LL))(v12, 125);
}
(*(void (__fastcall **)(cocos2d::CCObject *, _QWORD))(*(_QWORD *)v14 + 72LL))(v14, v2);
(*(void (__fastcall **)(_QWORD, cocos2d::CCObject *))(**((_QWORD **)this + 69) + 456LL))(
*((_QWORD *)this + 69),
v14);
cocos2d::CCArray::addObject(v10, v14);
if ( (v19[0] & 1) != 0 )
operator delete(v20);
++v2;
}
while ( v2 != 8 );
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v18, (const cocos2d::CCPoint *)&v17);
GameToolbox::alignItemsHorisontally((__int64)v10, (__int64)v18, 0, 5.0);
StartPosLayer::onSelectMode(this, nullptr);
return _stack_chk_guard;
}