//
// sub_1800825F0 from 0x1800825f0 to 0x180082663 (115 bytes)
//
// 4 xrefs:
// > sub_1800828E0 @ 0x1800828f2
// > sub_180083F30 @ 0x180083fad
// > sub_1800840C0 @ 0x18008413d
// > ??> @ 0x1801bf2b0
//
// 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 11:22:03 +0000
//
__int64 *__fastcall sub_1800825F0(__int64 *a1, int a2)
{
__int64 v2; // rax
__int64 *v4; // rax
__int64 v5; // r8
__int64 *v6; // rdx
__int64 v8; // [rsp+30h] [rbp+8h] BYREF
v2 = a1[1];
if ( (unsigned __int64)(v2 + 64) <= 0x8000 )
{
v5 = *a1;
a1[1] = v2 + 64;
v6 = (__int64 *)(v2 + v5 + 48);
}
else
{
v4 = sub_180082500((__int64)a1, 0x40u, &v8);
v5 = v8;
v6 = v4;
}
*v6 = v5 | (a2 - 1);
v6[1] = 0;
v6[2] = 0;
v6[3] = 0;
v6[4] = 0;
v6[5] = 0;
v6[6] = 0;
v6[7] = 0;
return v6;
}