//
// StartPosLayer::addModeButtons from 0x10025d3f0 to 0x10025d643 (595 bytes)
//
// 1 xrefs:
// > StartPosLayer::init @ 0x10025c7e7
//
// This function is hookable on this platform (idp: pc, 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 12:27:29 +0000
//
__int64 __fastcall StartPosLayer::addModeButtons(__int64 a1, __int64 a2)
{
__int64 v3; // rax
unsigned int v4; // r14d
__int64 v5; // rax
__int64 v6; // r15
__int64 v7; // rax
__int64 v8; // rdi
unsigned int i; // r13d
char *v10; // rdi
__int64 v11; // r15
__int64 v12; // r12
unsigned int v13; // r14d
int v14; // r13d
__int64 v15; // rbx
__int64 result; // rax
__int64 v17; // rcx
_QWORD *v18; // rdi
_WORD *v19; // rsi
_QWORD *v20; // rax
_BYTE v21[8]; // [rsp+8h] [rbp-58h] BYREF
float v22[2]; // [rsp+10h] [rbp-50h] BYREF
__int64 v23; // [rsp+18h] [rbp-48h]
_WORD v24[8]; // [rsp+20h] [rbp-40h] BYREF
void *__p; // [rsp+30h] [rbp-30h]
v3 = *(_QWORD *)(*(_QWORD *)(a1 + 1016) + 1840LL);
v4 = *(unsigned __int8 *)(v3 + 341);
*(_DWORD *)(a1 + 1024) = *(_DWORD *)(v3 + 328);
v5 = cocos2d::CCDirector::sharedDirector(a1, a2);
cocos2d::CCDirector::getWinSize(v22, v5);
v6 = *(_QWORD *)(a1 + 552);
sub_100278250(v24, v22[0] * 0.5, (float)((float)(0.5 * *(float *)(a1 + 736)) + (float)(v22[1] * 0.5)) + -30.0);
cocos2d::CCNode::convertToNodeSpace(v21, v6, v24);
v7 = sub_1007FE900(v21);
*(_QWORD *)(a1 + 1032) = v7;
v8 = v7;
cocos2d::CCObject::retain(v7);
v23 = sub_1007FE900(v8);
for ( i = 0; i != 8; ++i )
{
SelectSettingLayer::frameForItem((__int64)v24, v4, i);
v10 = (char *)v24 + 1;
if ( (v24[0] & 1) != 0 )
v10 = (char *)__p;
v11 = cocos2d::CCSprite::createWithSpriteFrameName(v10);
sub_1007FEBF0(*(_QWORD *)(a1 + 1032), v11);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v11 + 160LL))(v11, 0.89999998);
v12 = CCMenuItemSpriteExtra::create(v11, 0, a1, StartPosLayer::onSelectMode, 0);
if ( v4 && (i == 7 || i == 4) )
{
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v12 + 1056LL))(v12, 0);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v11 + 912LL))(v11, 125);
}
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v12 + 72LL))(v12, i);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v12);
sub_1007FEBF0(v23, v12);
if ( (v24[0] & 1) != 0 )
operator delete(__p);
}
sub_1002782D0(v24, v21);
v13 = 0;
GameToolbox::alignItemsHorisontally(v23, v24, 0, 5.0);
v14 = *(_DWORD *)(a1 + 1024);
v15 = *(_QWORD *)(a1 + 1032);
result = sub_1007FEF90(v15);
if ( (_DWORD)result )
{
do
{
v20 = (_QWORD *)sub_1007FEFE0(v15, v13);
if ( v14 == v13 )
{
v17 = *v20;
v18 = v20;
v19 = &unk_100A06A06;
}
else
{
memset(v24, 125, 3);
v17 = *v20;
v18 = v20;
v19 = v24;
}
(*(void (__fastcall **)(_QWORD *, _WORD *))(v17 + 960))(v18, v19);
++v13;
result = sub_1007FEF90(v15);
}
while ( v13 < (unsigned int)result );
}
return result;
}