//
// ScrollableContentLayer::getOrCreateSectionMenu from 0x3f5bf0 to 0x3f5cda (234 bytes)
//
// 1 xrefs:
// > ScrollableContentLayer::sectionAddChild @ 0x3f5d36
//
// 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:47:17 +0000
//
int __fastcall ScrollableContentLayer::getOrCreateSectionMenu(ScrollableContentLayer *this, int a2)
{
char *v2; // r4
char *v5; // r6
char *i; // r3
char *v7; // r2
cocos2d::CCNode *Section; // r9
int OwnedMenu; // r0
char *v11; // r3
int v12; // r8
int v13; // r2
char *v14; // r2
_DWORD *v15; // r6
_DWORD *v16; // r0
int v17; // r3
int v18; // r3
_DWORD v19[2]; // [sp+0h] [bp-8h] BYREF
v19[0] = this;
v19[1] = a2;
v2 = (char *)this + 432;
v5 = (char *)this + 432;
for ( i = *((char **)this + 108); i; i = v7 )
{
if ( *((_DWORD *)i + 4) >= a2 )
{
v7 = *(char **)i;
}
else
{
v7 = *((char **)i + 1);
i = v5;
}
v5 = i;
}
if ( v5 != v2 && a2 >= *((_DWORD *)v5 + 4) )
return *((_DWORD *)v5 + 5);
Section = ScrollableContentLayer::getOrCreateSection(this, a2);
OwnedMenu = ScrollableContentLayer::createOwnedMenu(this);
v11 = *((char **)this + 108);
v12 = OwnedMenu;
if ( v11 )
{
while ( 1 )
{
v13 = *((_DWORD *)v11 + 4);
if ( a2 >= v13 )
{
if ( v13 >= a2 )
{
v19[0] = v11;
v2 = (char *)v19;
goto LABEL_20;
}
v14 = *((char **)v11 + 1);
if ( !v14 )
{
v19[0] = v11;
v2 = v11 + 4;
goto LABEL_20;
}
}
else
{
v14 = *(char **)v11;
if ( !*(_DWORD *)v11 )
{
v19[0] = v11;
v2 = v11;
goto LABEL_20;
}
}
v11 = v14;
}
}
v19[0] = v2;
LABEL_20:
v15 = *(_DWORD **)v2;
if ( !*(_DWORD *)v2 )
{
v16 = (_DWORD *)operator new(0x18u);
v16[5] = 0;
v15 = v16;
*v16 = 0;
v16[1] = 0;
v17 = v19[0];
v16[4] = a2;
v16[2] = v17;
*(_DWORD *)v2 = v16;
v18 = **((_DWORD **)this + 107);
if ( v18 )
*((_DWORD *)this + 107) = v18;
std::__tree_balance_after_insert *>(*((_DWORD **)this + 108), *(_DWORD **)v2);
++*((_DWORD *)this + 109);
}
v15[5] = v12;
(*(void (__fastcall **)(cocos2d::CCNode *, int, int))(*(_DWORD *)Section + 232))(Section, v12, 10);
return v12;
}