//
// sub_1800D7E40 from 0x1800d7e40 to 0x1800d7eba (122 bytes)
//
// 3 xrefs:
// > sub_1800D7C40 @ 0x1800d7c61
// > sub_1800D7D40 @ 0x1800d7d58
// > sub_1800D98B0 @ 0x1800d98d3
//
// 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_1800D7E40(_QWORD *a1, int a2)
{
_QWORD *v3; // rax
__int64 v4; // r8
_QWORD *v5; // rcx
_QWORD *v6; // rax
__int64 *v7; // rax
v3 = (_QWORD *)a1[41];
if ( v3 == a1 + 41 )
{
LABEL_4:
v5 = a1 + 81;
v6 = (_QWORD *)*v5;
if ( (_QWORD *)*v5 == v5 )
{
LABEL_7:
v7 = (__int64 *)a1[48];
if ( v7 == a1 + 48 )
{
return 0;
}
else
{
while ( *((_DWORD *)v7 + 36) != a2 )
{
v7 = (__int64 *)*v7;
if ( v7 == a1 + 48 )
return 0;
}
return v7[32];
}
}
else
{
while ( *((_DWORD *)v6 + 48) != a2 )
{
v6 = (_QWORD *)*v6;
if ( v6 == v5 )
goto LABEL_7;
}
return v6[34];
}
}
else
{
while ( 1 )
{
v4 = v3[2];
if ( *(_DWORD *)(v4 + 20) == a2 )
return *(_QWORD *)(v4 + 120);
v3 = (_QWORD *)*v3;
if ( v3 == a1 + 41 )
goto LABEL_4;
}
}
}