//
// sub_1800CC0A0 from 0x1800cc0a0 to 0x1800cc15a (186 bytes)
//
// 4 xrefs:
// > sub_1800CAC90 @ 0x1800cae39
// > sub_1800CBEE0 @ 0x1800cbf36
// > sub_1800CC0A0 @ 0x1800cc0fd
// > ??> @ 0x1801fe5ec
//
// 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:07 +0000
//
__int64 __fastcall sub_1800CC0A0(__int64 a1, char a2)
{
int v2; // r9d
_QWORD *v3; // rdi
_QWORD *v4; // rbx
char v5; // r8
unsigned int v7; // r9d
__int64 v8; // rdx
_QWORD *v9; // rsi
_QWORD *i; // rbx
__int64 v11; // rdi
unsigned __int8 v13; // [rsp+38h] [rbp+10h] BYREF
v2 = *(_DWORD *)(a1 + 72);
v3 = (_QWORD *)(a1 + 400);
v4 = *(_QWORD **)(a1 + 400);
v5 = 1;
if ( (v2 & 1) == 0 )
v5 = a2;
v7 = v2 | 0x10;
if ( !v5 )
v7 = *(_DWORD *)(a1 + 72) & 0xFFFFFFEF;
for ( *(_DWORD *)(a1 + 72) = v7; v4 != v3; v4 = (_QWORD *)*v4 )
{
v8 = *(_DWORD *)(a1 + 72) >> 4;
LOBYTE(v8) = (*(_DWORD *)(a1 + 72) & 0x10) != 0;
sub_1800CC0A0(v4[2], v8);
}
v9 = (_QWORD *)(a1 + 424);
for ( i = (_QWORD *)*v9; i != v9; i = (_QWORD *)*i )
{
v11 = i[2];
(*(void (__fastcall **)(__int64, unsigned __int8 *))(*(_QWORD *)v11 + 24LL))(v11, &v13);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v11 + 16LL))(v11, v13);
}
return 0;
}