//
// sub_1800F2E00 from 0x1800f2e00 to 0x1800f2ebc (188 bytes)
//
// 2 xrefs:
// > sub_1800F2C00 @ 0x1800f2d75
// > ??> @ 0x1802006e0
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 10:54:22 +0000
//
__int64 __fastcall sub_1800F2E00(__int64 a1, __int64 *a2)
{
int v4; // r9d
__int64 v5; // r8
_QWORD **v6; // rdx
__int64 *v7; // rcx
__int64 v8; // rax
int v9; // eax
v4 = 0;
if ( *((int *)a2 + 8) > 0 )
{
v5 = 0;
do
{
++v4;
v6 = (_QWORD **)(v5 + a2[5]);
v5 += 24;
*v6[1] = *v6;
(*v6)[1] = v6[1];
v6[1] = v6;
*v6 = v6;
}
while ( v4 < *((_DWORD *)a2 + 8) );
}
v7 = *(__int64 **)(a1 + 8);
if ( a2 == v7 )
{
v8 = *a2;
if ( (__int64 *)*a2 == v7 )
v8 = 0;
*(_QWORD *)(a1 + 8) = v8;
}
*(_QWORD *)a2[1] = *a2;
*(_QWORD *)(*a2 + 8) = a2[1];
v9 = *((_DWORD *)a2 + 8);
a2[1] = (__int64)a2;
*a2 = (__int64)a2;
*(_DWORD *)(a1 + 16) -= v9;
sub_1800B6AA0(*((_QWORD *)off_1801AED20 + 52), (_DWORD *)a2[3]);
return 0;
}