//
// sub_18001CAB0 from 0x18001cab0 to 0x18001cbd3 (291 bytes)
//
// 2 xrefs:
// > sub_180018CF0 @ 0x180018d40
// > ??> @ 0x1801f735c
//
// 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:52:52 +0000
//
__int64 __fastcall sub_18001CAB0(__int64 a1, __int64 a2, unsigned int a3, int a4)
{
int v6; // ebx
__int64 *v7; // rsi
__int64 v8; // rcx
__int64 result; // rax
unsigned int v10; // eax
char v11; // di
char v12; // di
char v13; // bl
__int64 v14; // [rsp+30h] [rbp+8h] BYREF
if ( a4 == 256 )
{
sub_18001BC50(a1);
*(_DWORD *)(a1 + 3068) = a3;
*(_DWORD *)(a1 + 3084) = a3;
v6 = 0;
v7 = (__int64 *)(a1 + 17472);
do
{
v8 = *v7;
v14 = 0;
if ( v8 )
{
result = (*(__int64 (__fastcall **)(__int64, _QWORD, __int64 *))(*(_QWORD *)v8 + 288LL))(v8, 0, &v14);
if ( (_DWORD)result )
return result;
if ( v14 )
sub_1800992C0(v14);
}
++v6;
++v7;
}
while ( v6 < 50 );
return 0;
}
else if ( a4 == 2 )
{
v10 = *(_DWORD *)(a1 + 2136);
v11 = 0;
if ( a3 != v10 )
{
if ( a3 < v10 )
{
sub_18001BC50(a1);
v10 = *(_DWORD *)(a1 + 2136);
v11 = 1;
}
if ( v10 < a3 )
{
do
{
LOBYTE(a2) = 1;
sub_18001CDC0(a1, a2);
}
while ( *(_DWORD *)(a1 + 2136) < a3 );
}
if ( v11 )
{
v12 = *(_BYTE *)(a1 + 3048);
v13 = *(_BYTE *)(a1 + 3049);
sub_1800D5B30(a1);
*(_BYTE *)(a1 + 3048) = v12;
*(_BYTE *)(a1 + 3049) = v13;
}
}
return 0;
}
else
{
return 19;
}
}