//
// sub_1000987F0 from 0x1000987f0 to 0x100098902 (274 bytes)
//
// 0 xrefs:
//
// 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_1000987F0(__int64 a1, const char *a2)
{
_QWORD **v3; // r13
_QWORD *i; // r15
__int64 v5; // r12
__int64 v6; // rax
_QWORD *v7; // rcx
__int64 v8; // rcx
void *v9; // rdi
FILE *v10; // rax
FILE *v11; // r14
v3 = (_QWORD **)(a1 + 48);
for ( i = *(_QWORD **)(a1 + 48); i; i = *v3 )
{
v6 = i[9];
*(_QWORD *)(a1 + 48) = v6;
v7 = *(_QWORD **)(a1 + 56);
if ( v7 != i )
{
v8 = i[8];
if ( !v8 )
goto LABEL_7;
LABEL_6:
*(_QWORD *)(v8 + 72) = v6;
goto LABEL_7;
}
*(_QWORD *)(a1 + 56) = v7[8];
v8 = i[8];
if ( v8 )
goto LABEL_6;
LABEL_7:
if ( v6 )
*(_QWORD *)(v6 + 64) = v8;
i[2] = 0;
v5 = i[10];
(*(void (__fastcall **)(_QWORD *))(*i + 128LL))(i);
(*(void (__fastcall **)(__int64, _QWORD *))(*(_QWORD *)v5 + 32LL))(v5, i);
}
*(_OWORD *)v3 = 0;
*(_DWORD *)(a1 + 92) = 0;
*(_OWORD *)(a1 + 104) = 0;
v9 = *(void **)(a1 + 120);
if ( v9 )
operator delete[](v9);
*(_QWORD *)(a1 + 120) = 0;
v10 = fopen(a2, "rb");
if ( v10 )
{
v11 = v10;
sub_100098910(a1, v10);
fclose(v11);
return *(unsigned int *)(a1 + 92);
}
else
{
*(_DWORD *)(a1 + 92) = 3;
*(_QWORD *)(a1 + 104) = a2;
*(_QWORD *)(a1 + 112) = 0;
return 3;
}
}