//
// sub_BA4B40 from 0xba4b40 to 0xba4c54 (276 bytes)
//
// 1 xrefs:
// > sub_B94FB0 @ 0xb95054
//
// 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
//
char **__fastcall sub_BA4B40(__int64 a1)
{
__int64 v1; // x19
char **v2; // x21
char *v3; // x20
char **v4; // x0
char **i; // x2
char **v7; // x19
char **v8; // x21
void (*v9)(void *); // x1
char **v10; // x0
v1 = a1;
if ( a1 )
{
v2 = nullptr;
while ( 1 )
{
v3 = off_1231018(*(const char **)v1);
if ( !v3 )
break;
v4 = (char **)off_1231000(0x10u);
if ( !v4 )
{
v7 = v2;
off_1231008(v3);
goto LABEL_14;
}
v4[1] = nullptr;
*v4 = v3;
if ( v2 )
{
for ( i = v2; i[1]; i = (char **)i[1] )
;
i[1] = (char *)v4;
}
else
{
v2 = v4;
}
v1 = *(_QWORD *)(v1 + 8);
if ( !v1 )
return v2;
}
v7 = v2;
LABEL_14:
if ( v2 )
{
do
{
v8 = (char **)v7[1];
off_1231008(*v7);
v9 = off_1231008;
v10 = v7;
*v7 = nullptr;
v7 = v8;
v9(v10);
}
while ( v8 );
}
return nullptr;
}
else
{
return nullptr;
}
}