//
// sub_1008DC6D0 from 0x1008dc6d0 to 0x1008dc953 (643 bytes)
//
// 1 xrefs:
// > DropdownListPopup::init @ 0x1008dab51
//
// 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:37:44 +0000
//
__int64 __fastcall sub_1008DC6D0(void **a1, __int64 a2, __int64 a3, unsigned __int64 a4)
{
__int64 v5; // r15
void **v6; // rbx
__int64 v7; // rax
void **v8; // r12
void **v9; // r13
void *v10; // rdi
void **v11; // r12
__int64 v12; // r13
__int64 v13; // r12
__int64 v14; // rax
void **v15; // rbx
__int64 result; // rax
char *v17; // r13
unsigned __int64 v18; // rax
__int64 v19; // r13
char *v20; // r12
unsigned __int64 v21; // [rsp+8h] [rbp-38h]
v5 = a2;
v6 = (void **)*a1;
v7 = (__int64)a1[2];
if ( 0x6DB6DB6DB6DB6DB7LL * ((v7 - (__int64)*a1) >> 3) < a4 )
{
if ( !v6 )
goto LABEL_29;
v21 = a4;
v8 = a1;
v9 = (void **)a1[1];
v10 = *a1;
if ( v9 == v6 )
goto LABEL_28;
while ( 1 )
{
if ( (*(_BYTE *)(v9 - 3) & 1) != 0 )
{
operator delete(*(v9 - 1));
if ( (*(_BYTE *)(v9 - 6) & 1) != 0 )
LABEL_10:
operator delete(*(v9 - 4));
}
else if ( (*(_BYTE *)(v9 - 6) & 1) != 0 )
{
goto LABEL_10;
}
v9 -= 7;
if ( v9 == v6 )
{
v10 = *v8;
LABEL_28:
v8[1] = v6;
operator delete(v10);
*(_OWORD *)v8 = 0;
v8[2] = nullptr;
v7 = 0;
a4 = v21;
a1 = v8;
LABEL_29:
if ( a4 > 0x492492492492492LL )
goto LABEL_37;
v18 = 0x6DB6DB6DB6DB6DB7LL * (v7 >> 3);
if ( 2 * v18 > a4 )
a4 = 2 * v18;
if ( v18 >= 0x249249249249249LL )
a4 = 0x492492492492492LL;
if ( a4 > 0x492492492492492LL )
LABEL_37:
sub_1008DC450();
v15 = a1;
v19 = 56 * a4;
v20 = (char *)operator new(56 * a4);
*a1 = v20;
a1[1] = v20;
a1[2] = &v20[v19];
result = sub_1008DC970(a1, a2, a3, v20);
LABEL_36:
v15[1] = (void *)result;
return result;
}
}
}
v11 = (void **)a1[1];
if ( 0x6DB6DB6DB6DB6DB7LL * (v11 - v6) < a4 )
{
v12 = a2 + (_BYTE *)a1[1] - (_BYTE *)v6;
if ( v11 != v6 )
{
v13 = 0;
do
{
LODWORD(v6[v13]) = *(_DWORD *)(a2 + v13 * 8);
std::string::operator=((std::string *)&v6[v13 + 1], (const std::string *)(a2 + v13 * 8 + 8));
std::string::operator=((std::string *)&v6[v13 + 4], (const std::string *)(a2 + v13 * 8 + 32));
v14 = a2 + v13 * 8 + 56;
v13 += 7;
}
while ( v14 != v12 );
v11 = (void **)a1[1];
}
v15 = a1;
result = sub_1008DC970(a1, v12, a3, v11);
goto LABEL_36;
}
v17 = (char *)*a1;
if ( a2 != a3 )
{
do
{
*(_DWORD *)v6 = *(_DWORD *)v5;
std::string::operator=((std::string *)(v6 + 1), (const std::string *)(v5 + 8));
std::string::operator=((std::string *)(v6 + 4), (const std::string *)(v5 + 32));
v6 += 7;
v17 += 56;
v5 += 56;
}
while ( v5 != a3 );
v11 = (void **)a1[1];
}
while ( v11 != v6 )
{
if ( (*(_BYTE *)(v11 - 3) & 1) != 0 )
operator delete(*(v11 - 1));
if ( (*(_BYTE *)(v11 - 6) & 1) != 0 )
operator delete(*(v11 - 4));
v11 -= 7;
}
a1[1] = v17;
return (__int64)a1;
}