//
// sub_1800DF630 from 0x1800df630 to 0x1800df6e2 (178 bytes)
//
// 5 xrefs:
// > ??> @ 0x18016d180
// > ??> @ 0x18016d370
// > ??> @ 0x18016d508
// > ??> @ 0x18016d6d8
// > ??> @ 0x1801ff804
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall sub_1800DF630(__int64 a1, int a2, __int64 **a3)
{
__int64 result; // rax
int v7; // edx
__int64 *v8; // r8
__int64 *v9; // rcx
int v10; // [rsp+30h] [rbp+8h] BYREF
result = (*(__int64 (__fastcall **)(__int64, int *))(*(_QWORD *)a1 + 232LL))(a1, &v10);
if ( (_DWORD)result )
return result;
if ( a2 < 0 || a2 >= v10 || !a3 )
return 31;
v7 = 0;
v8 = *(__int64 **)(a1 + 248);
v9 = **(__int64 ***)(a1 + 240);
if ( v9 == v8 )
return 0;
while ( 1 )
{
if ( *(_QWORD *)(a1 + 168) && *((unsigned __int16 *)v9 + 26) != *(_DWORD *)(a1 + 192) )
goto LABEL_10;
if ( v7 >= a2 )
break;
++v7;
LABEL_10:
v9 = (__int64 *)*v9;
if ( v9 == v8 )
return 0;
}
*a3 = v9;
return 0;
}