//
// sub_100574390 from 0x100574390 to 0x100574538 (424 bytes)
//
// 1 xrefs:
// > sub_100574538 @ 0x10057465c
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void **__fastcall sub_100574390(__int64 a1, __int16 a2)
{
_DWORD *v3; // x28
_QWORD *v4; // x26
void **v5; // x19
__int16 v6; // w23
int v7; // w8
__int64 i; // x24
size_t v9; // x22
void *v10; // x21
char *v11; // x0
char *v12; // x0
void **v13; // x21
if ( a1 )
{
v3 = **(_DWORD ***)(a1 + 24);
if ( v3 )
{
v4 = nullptr;
v5 = nullptr;
v6 = HIBYTE(a2) | (unsigned __int16)(a2 << 8);
v7 = *(_DWORD *)(a1 + 16);
for ( i = 8; ; i += 8 )
{
if ( v7 == 30 )
v9 = 28;
else
v9 = 16;
v10 = off_10085DED0(1u, 0x30u);
if ( !v10 )
{
LABEL_23:
if ( v5 )
{
do
{
off_10085DEB8(v5[4]);
off_10085DEB8(v5[3]);
v13 = (void **)v5[5];
off_10085DEB8(v5);
v5 = v13;
}
while ( v13 );
}
return nullptr;
}
v11 = off_10085DEC8(*(const char **)a1);
*((_QWORD *)v10 + 3) = v11;
if ( !v11 )
{
((void (__fastcall *)(void *))off_10085DEB8)(v10);
goto LABEL_23;
}
v12 = (char *)off_10085DED0(1u, v9);
*((_QWORD *)v10 + 4) = v12;
if ( !v12 )
{
off_10085DEB8(*((void **)v10 + 3));
((void (__fastcall *)(void *))off_10085DEB8)(v10);
goto LABEL_23;
}
if ( !v5 )
v5 = (void **)v10;
if ( v4 )
v4[5] = v10;
v7 = *(_DWORD *)(a1 + 16);
*((_DWORD *)v10 + 1) = v7;
*((_DWORD *)v10 + 2) = 1;
*((_DWORD *)v10 + 4) = v9;
if ( v7 == 30 )
break;
if ( v7 == 2 )
{
*((_DWORD *)v12 + 1) = *v3;
goto LABEL_18;
}
LABEL_19:
v3 = *(_DWORD **)(*(_QWORD *)(a1 + 24) + i);
v4 = v10;
if ( !v3 )
return v5;
}
*(_OWORD *)(v12 + 8) = *(_OWORD *)v3;
LABEL_18:
v7 = *(_DWORD *)(a1 + 16);
v12[1] = v7;
*((_WORD *)v12 + 1) = v6;
goto LABEL_19;
}
}
return nullptr;
}