//
// sub_1800D9CD0 from 0x1800d9cd0 to 0x1800d9d69 (153 bytes)
//
// 2 xrefs:
// > ??> @ 0x18016ce80
// > ??> @ 0x1801ff180
//
// 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_1800D9CD0(__int64 a1, __int64 a2, unsigned __int8 a3, unsigned __int8 a4)
{
_QWORD *v4; // rbx
_QWORD *v5; // rsi
_QWORD *v9; // rdi
__int64 result; // rax
v4 = *(_QWORD **)(a1 + 40);
v5 = (_QWORD *)(a1 + 40);
if ( v4 == (_QWORD *)(a1 + 40) )
return 0;
while ( 1 )
{
v9 = v4 - 1;
if ( !v4 )
v9 = nullptr;
if ( (*(unsigned __int8 (__fastcall **)(_QWORD *))*v9)(v9) == a3 )
{
result = (*(__int64 (__fastcall **)(_QWORD *, __int64, _QWORD, _QWORD))(*v9 + 88LL))(v9, a2, a3, a4);
if ( (_DWORD)result )
break;
}
v4 = (_QWORD *)*v4;
if ( v4 == v5 )
return 0;
}
return result;
}