//
// ScrollableContentLayer::mountRowSlot from 0x6e4fb0 to 0x6e519c (492 bytes)
//
// 3 xrefs:
// > ScrollableContentLayer::remountVirtualRow @ 0x6e53f0
// > ScrollableContentLayer::updateVirtualRows @ 0x6e5610
// > ??> @ 0x558b8
//
// 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 12:51:42 +0000
//
__int64 __fastcall ScrollableContentLayer::mountRowSlot(ScrollableContentLayer *this, signed int a2)
{
int v2; // w24
float *v5; // x1
__int64 v6; // x22
void (__fastcall *v7)(__int64, char **); // x25
__int64 **v8; // x25
float v9; // s1
void (__fastcall *v10)(__int64, char **); // x24
__int64 OwnedMenu; // x24
__int64 v12; // x19
int v13; // w0
bool v14; // cc
__int64 v15; // x0
int v16; // w0
__int64 *v17; // x1
__int64 v18; // x0
float v20; // [xsp+50h] [xbp+50h]
char *v21; // [xsp+60h] [xbp+60h] BYREF
v2 = a2 + 1;
v5 = (float *)(*((_QWORD *)this + 77) + 4LL * (a2 + 1));
v20 = *v5 - *(v5 - 1);
v6 = cocos2d::CCNode::create(_stack_chk_guard);
v7 = *(void (__fastcall **)(__int64, char **))(*(_QWORD *)v6 + 320LL);
cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v21, *((float *)this + 106), v20);
v7(v6, &v21);
v8 = (__int64 **)((char *)this + 648);
v9 = *(float *)(*((_QWORD *)this + 77) + 4LL * v2);
v10 = *(void (__fastcall **)(__int64, char **))(*(_QWORD *)v6 + 184LL);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v21, 0.0, -v9);
v10(v6, &v21);
OwnedMenu = ScrollableContentLayer::createOwnedMenu(this);
(*(void (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v6 + 464LL))(v6, OwnedMenu, 10);
(*(void (__fastcall **)(_QWORD, __int64))(**((_QWORD **)this + 52) + 456LL))(*((_QWORD *)this + 52), v6);
v12 = *((_QWORD *)this + 81);
if ( v12 )
{
v13 = *(_DWORD *)(v12 + 32);
v14 = v13 < a2;
if ( v13 <= a2 )
goto LABEL_5;
while ( 1 )
{
v15 = *(_QWORD *)v12;
if ( !*(_QWORD *)v12 )
break;
while ( 1 )
{
v12 = v15;
v16 = *(_DWORD *)(v15 + 32);
v14 = v16 < a2;
if ( v16 > a2 )
break;
LABEL_5:
if ( !v14 )
goto LABEL_13;
v15 = *(_QWORD *)(v12 + 8);
if ( !v15 )
{
v21 = (char *)v12;
v8 = (__int64 **)(v12 + 8);
goto LABEL_10;
}
}
}
v21 = (char *)v12;
v8 = (__int64 **)v12;
}
else
{
v21 = (char *)this + 648;
}
LABEL_10:
v12 = operator new(0x38u);
*(_DWORD *)(v12 + 32) = a2;
v17 = (__int64 *)v12;
*(_QWORD *)(v12 + 40) = 0;
*(_QWORD *)(v12 + 48) = 0;
*(_QWORD *)(v12 + 16) = v21;
*(_QWORD *)v12 = 0;
*(_QWORD *)(v12 + 8) = 0;
*v8 = (__int64 *)v12;
v18 = **((_QWORD **)this + 80);
if ( v18 )
{
*((_QWORD *)this + 80) = v18;
v17 = *v8;
}
std::__tree_balance_after_insert *>(*((__int64 **)this + 81), v17);
++*((_QWORD *)this + 82);
LABEL_13:
*(_QWORD *)(v12 + 40) = v6;
*(_QWORD *)(v12 + 48) = OwnedMenu;
(*(void (__fastcall **)(_QWORD, _QWORD, __int64, __int64))(**((_QWORD **)this + 74) + 16LL))(
*((_QWORD *)this + 74),
(unsigned int)a2,
v6,
OwnedMenu);
return _stack_chk_guard;
}