//
// sub_100521468 from 0x100521468 to 0x1005215b0 (328 bytes)
//
// 1 xrefs:
// > sub_10051CF68 @ 0x10051d5b0
//
// 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
//
__int64 __fastcall sub_100521468(__int64 a1)
{
__int64 result; // x0
unsigned __int8 *v3; // x21
size_t v4; // x20
int v5; // w9
void *v6; // x0
__int64 v7; // x2
__int64 v8; // x4
int v9; // [xsp+Ch] [xbp-24h] BYREF
if ( !*(_DWORD *)(*(_QWORD *)(a1 + 128) + 1192LL) )
{
v7 = 356;
v8 = 3551;
LABEL_11:
sub_1005E0E48(20, 306, v7, "s3_srvr.c", v8);
*(_DWORD *)(a1 + 72) = 5;
return 0xFFFFFFFFLL;
}
result = (*(__int64 (__fastcall **)(__int64, __int64, __int64, __int64, __int64, int *))(*(_QWORD *)(a1 + 8) + 96LL))(
a1,
8720,
8721,
67,
514,
&v9);
if ( !v9 )
return result;
if ( !*(_DWORD *)(*(_QWORD *)(a1 + 128) + 456LL) )
{
v7 = 355;
v8 = 3571;
goto LABEL_11;
}
if ( result > 1 )
{
v3 = *(unsigned __int8 **)(a1 + 88);
v4 = *v3;
v5 = *(_DWORD *)(a1 + 96);
if ( (int)v4 + 2 <= v5 && (_DWORD)v4 + 2 + v3[v4 + 1] == v5 )
{
v6 = (void *)sub_100588710(*v3, "s3_srvr.c", 3601);
*(_QWORD *)(a1 + 632) = v6;
if ( v6 )
{
memcpy(v6, v3 + 1, v4);
*(_BYTE *)(a1 + 640) = v4;
return 1;
}
sub_1005E0E48(20, 306, 65, "s3_srvr.c", 3603);
}
}
*(_DWORD *)(a1 + 72) = 5;
return 0;
}