//
// sub_1800DBB90 from 0x1800dbb90 to 0x1800dbc93 (259 bytes)
//
// 5 xrefs:
// > sub_1800DAEB0 @ 0x1800daf1c
// > sub_1800DB010 @ 0x1800db10e
// > ??> @ 0x18018c9dc
// > ??> @ 0x18018c9f0
// > ??> @ 0x1801ff42c
//
// 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:13 +0000
//
__int64 __fastcall sub_1800DBB90(__int64 a1, int a2)
{
_OWORD *v5; // rsi
__int64 v6; // rdx
int v7; // eax
__int64 v8; // rdx
_OWORD *v9; // rcx
__int64 v10; // r8
__int128 v11; // xmm0
char v12; // [rsp+30h] [rbp-18h]
if ( a2 < *(_DWORD *)(a1 + 8) )
return 28;
v5 = nullptr;
if ( a2 )
{
v6 = (unsigned int)(16 * a2);
if ( (unsigned int)(v6 - 1) > 0x3FFFFFFE )
return 38;
v12 = 1;
v5 = sub_1800B6530(
*((_QWORD *)off_1801AED20 + 52),
v6,
"C:\\buildagent1\\work\\570ad728b1678096\\core_api\\src\\fmod_memory.h",
243,
0,
0,
v12);
if ( !v5 )
return 38;
v7 = *(_DWORD *)(a1 + 8);
if ( v7 )
{
v8 = *(int *)(a1 + 8);
if ( v7 > 0 )
{
v9 = v5;
v10 = *(_QWORD *)a1 - (_QWORD)v5;
do
{
v11 = *(_OWORD *)((char *)v9++ + v10);
*(v9 - 1) = v11;
--v8;
}
while ( v8 );
}
}
}
if ( *(int *)(a1 + 12) > 0 )
{
if ( *(_QWORD *)a1 )
sub_1800B6AA0(*((_QWORD *)off_1801AED20 + 52), *(_DWORD **)a1);
}
*(_QWORD *)a1 = v5;
*(_DWORD *)(a1 + 12) = a2;
return 0;
}