//
// ScrollableContentLayer::updateVirtualRows from 0x140082bf0 to 0x140082f1e (814 bytes)
//
// 4 xrefs:
// > ScrollableContentLayer::applyContentPosition @ 0x1400812f4
// > ??> @ 0x14088b48c
// > ??> @ 0x14088b4fc
// > ??> @ 0x14091229c
//
// 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 11:25:56 +0000
//
void __fastcall ScrollableContentLayer::updateVirtualRows(__int64 a1)
{
__int64 v2; // r10
__int64 v3; // rcx
int v4; // r11d
float v5; // xmm0_4
float v6; // xmm1_4
unsigned __int64 v7; // rdx
__int64 v8; // r12
float v9; // xmm1_4
__int64 v10; // r12
unsigned __int64 v11; // rcx
__int64 v12; // r15
int *v13; // rbx
__int64 v14; // rdx
int v15; // r15d
_DWORD *v16; // rax
int *v17; // rcx
int *v18; // r14
int *v19; // rdi
int v20; // ebx
int v21; // edi
__int64 **v22; // rbx
__int64 **v23; // rcx
__int64 *v24; // rax
__int64 v25; // rcx
__int64 **v26; // rax
int v27; // ebx
__int64 *v28; // rax
__int64 *v29; // rdx
__int64 *i; // rcx
if ( !*(_QWORD *)(a1 + 576) )
return;
if ( *(_BYTE *)(a1 + 648) )
return;
v2 = *(_QWORD *)(a1 + 600);
v3 = *(_QWORD *)(a1 + 608);
v4 = ((v3 - v2) >> 2) - 1;
if ( v4 <= 0 )
return;
v5 = *(float *)(a1 + 584);
if ( *(_BYTE *)(a1 + 568) )
v6 = *(float *)(a1 + 424);
else
v6 = *(float *)(a1 + 428);
v7 = (v3 - (v2 + 4)) >> 2;
v8 = v2 + 4;
v9 = (float)(v6 + *(float *)(a1 + 436)) + v5;
while ( (__int64)v7 > 0 )
{
if ( *(float *)(v8 + 4 * (v7 >> 1)) <= (float)(*(float *)(a1 + 436) - v5) )
{
v8 += 4 * (v7 >> 1) + 4;
v7 += -1LL - (v7 >> 1);
}
else
{
v7 >>= 1;
}
}
v10 = (v8 - (v2 + 4)) >> 2;
v11 = (v3 - v2 - 4) >> 2;
v12 = v2;
while ( (__int64)v11 > 0 )
{
if ( v9 <= *(float *)(v12 + 4 * (v11 >> 1)) )
{
v11 >>= 1;
}
else
{
v12 += 4 * (v11 >> 1) + 4;
v11 += -1LL - (v11 >> 1);
}
}
v13 = (int *)(a1 + 640);
v14 = *(unsigned int *)(a1 + 640);
v15 = ((v12 - v2) >> 2) - 1;
if ( (int)v10 > v4 - 1 )
LODWORD(v10) = v4 - 1;
v16 = (_DWORD *)(a1 + 644);
if ( v15 < (int)v10 )
v15 = v10;
if ( (_DWORD)v10 == (_DWORD)v14 )
{
if ( v15 == *v16 )
return;
v17 = (int *)(a1 + 640);
}
else
{
v17 = (int *)(a1 + 640);
}
v18 = (int *)(a1 + 644);
*(_BYTE *)(a1 + 648) = 1;
if ( (int)v14 >= 0 )
{
v19 = (int *)(a1 + 640);
if ( v15 < (int)v14 )
{
LABEL_29:
ScrollableContentLayer::unmountAllRows(a1);
v13 = v19;
goto LABEL_30;
}
v19 = v17;
if ( (int)v10 > *v16 )
{
v18 = (int *)(a1 + 644);
goto LABEL_29;
}
}
LABEL_30:
v20 = *v13;
if ( v20 >= 0 )
{
if ( v20 < (int)v10 )
{
do
ScrollableContentLayer::unmountRowSlot(a1, (unsigned int)v20++);
while ( v20 < (int)v10 );
v18 = (int *)(a1 + 644);
}
v21 = *v18;
if ( *v18 > v15 )
{
do
{
v22 = *(__int64 ***)(a1 + 624);
v23 = v22;
v24 = v22[1];
if ( !*((_BYTE *)v24 + 25) )
{
do
{
if ( *((_DWORD *)v24 + 8) >= v21 )
v22 = (__int64 **)v24;
else
v24 += 2;
v24 = (__int64 *)*v24;
}
while ( !*((_BYTE *)v24 + 25) );
v23 = *(__int64 ***)(a1 + 624);
}
if ( !*((_BYTE *)v22 + 25) && v21 >= *((_DWORD *)v22 + 8) && v22 != v23 )
{
if ( *(__int64 **)(a1 + 560) == v22[6] )
*(_QWORD *)(a1 + 560) = 0;
v25 = *(_QWORD *)(a1 + 576);
if ( v25 )
(*(void (__fastcall **)(__int64, _QWORD, __int64 *))(*(_QWORD *)v25 + 24LL))(v25, (unsigned int)v21, v22[5]);
LOBYTE(v14) = 1;
(*(void (__fastcall **)(__int64 *, __int64))(*v22[5] + 520))(v22[5], v14);
v26 = sub_14006A9D0((_QWORD *)(a1 + 624), v22);
j_j_free(v26);
}
--v21;
}
while ( v21 > v15 );
v18 = (int *)(a1 + 644);
}
}
v27 = v10;
if ( (int)v10 <= v15 )
{
do
{
v28 = *(__int64 **)(a1 + 624);
v29 = v28;
for ( i = (__int64 *)v28[1]; !*((_BYTE *)i + 25); i = (__int64 *)*i )
{
if ( *((_DWORD *)i + 8) >= v27 )
v29 = i;
else
i += 2;
}
if ( *((_BYTE *)v29 + 25) || v27 < *((_DWORD *)v29 + 8) || v29 == v28 )
ScrollableContentLayer::mountRowSlot(a1, (unsigned int)v27);
++v27;
}
while ( v27 <= v15 );
v18 = (int *)(a1 + 644);
}
*v18 = v15;
*(_DWORD *)(a1 + 640) = v10;
*(_BYTE *)(a1 + 648) = 0;
}