//
// sub_180115250 from 0x180115250 to 0x1801152ce (126 bytes)
//
// 1 xrefs:
// > sub_180114120 @ 0x1801142e4
//
// 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_180115250(__int64 a1, int *a2)
{
int v3; // eax
int v5; // edx
int *v6; // r8
int v7; // eax
__int64 v8; // r10
__int64 v9; // rax
int v10; // edx
__int64 v11; // rcx
int v12; // eax
if ( *(_DWORD *)(a1 + 36) )
{
v3 = *(_DWORD *)(a1 + 8);
if ( !v3 )
return 28;
v5 = *a2;
v6 = (int *)(*(_QWORD *)a1 + 4LL * (v5 & (v3 - 1)));
v7 = *v6;
if ( *v6 != -1 )
{
v8 = *(_QWORD *)(a1 + 16);
while ( 1 )
{
v9 = 2LL * v7;
if ( *(_DWORD *)(v8 + 8 * v9) == v5 )
break;
v6 = (int *)(v8 + 4 + 8 * v9);
v7 = *v6;
if ( *v6 == -1 )
return 0;
}
v10 = *v6;
v11 = 2LL * *v6;
v12 = *(_DWORD *)(v8 + 16LL * *v6 + 4);
*(_QWORD *)(v8 + 8 * v11 + 8) = 0;
*v6 = v12;
*(_DWORD *)(v8 + 8 * v11 + 4) = *(_DWORD *)(a1 + 32);
--*(_DWORD *)(a1 + 36);
*(_DWORD *)(a1 + 32) = v10;
}
}
return 0;
}