//
// sub_1800879E0 from 0x1800879e0 to 0x180087aa1 (193 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801ae330
// > ??> @ 0x1801fa26c
//
// 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_1800879E0(_QWORD *a1, __int64 a2, __int64 a3, __int64 a4)
{
__int64 v4; // rbx
_QWORD *v5; // rax
__int64 v6; // rdx
int v7; // ecx
int v8; // eax
__int64 v9; // rcx
__int64 result; // rax
__int64 v11; // r8
__int64 v12; // [rsp+30h] [rbp+8h] BYREF
v4 = *a1;
LOBYTE(a4) = 1;
v5 = (_QWORD *)(*a1 + 608LL);
v5[2] = 0;
v5[1] = v5;
*v5 = v5;
v6 = *(_QWORD *)(v4 + 168);
v7 = *(_DWORD *)(v6 + 74136);
v8 = v7 + 1;
if ( v7 == 0x7FFFFFFF )
v8 = 0;
*(_DWORD *)(v6 + 74136) = v8;
*(_DWORD *)(v4 + 632) = v7;
v9 = *(_QWORD *)(v4 + 168);
*(_QWORD *)(v4 + 568) = 0;
*(_DWORD *)(v4 + 576) = 0;
*(_QWORD *)(v4 + 552) = 0;
*(_QWORD *)(v4 + 560) = 0;
*(_QWORD *)(v4 + 584) = 0;
*(_DWORD *)(v4 + 600) = 0;
*(_DWORD *)(v4 + 636) = 1065353216;
result = sub_1800FCF40(v9, &v12, 16, a4);
if ( !(_DWORD)result )
{
LOBYTE(v11) = 1;
*(_BYTE *)v12 = 8;
*(_QWORD *)(v12 + 8) = v4;
return sub_1800FD370(*(_QWORD *)(v4 + 168), v12, v11);
}
return result;
}