//
// sub_1800D7B40 from 0x1800d7b40 to 0x1800d7b85 (69 bytes)
//
// 3 xrefs:
// > sub_1800E4740 @ 0x1800e4776
// > sub_1800FD770 @ 0x1800fd7c6
// > sub_1800FE610 @ 0x1800fea53
//
// 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:12 +0000
//
__int64 __fastcall sub_1800D7B40(__int64 a1, int a2, _DWORD *a3)
{
_QWORD *v3; // rcx
_QWORD *v4; // rax
if ( a3 )
{
v3 = (_QWORD *)(a1 + 384);
if ( a2 >= 0 )
{
v4 = (_QWORD *)*v3;
if ( (_QWORD *)*v3 != v3 )
{
if ( a2 <= 0 )
{
LABEL_7:
if ( v4 )
{
*a3 = *((_DWORD *)v4 + 36);
return 0;
}
}
else
{
while ( 1 )
{
v4 = (_QWORD *)*v4;
if ( v4 == v3 )
break;
if ( --a2 <= 0 )
goto LABEL_7;
}
}
}
}
}
return 31;
}