//
// sub_1800D5620 from 0x1800d5620 to 0x1800d56de (190 bytes)
//
// 2 xrefs:
// > sub_1800D52C0 @ 0x1800d5350
// > ??> @ 0x1801ba7e8
//
// 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
//
char *__fastcall sub_1800D5620(_DWORD *a1)
{
char *result; // rax
__int64 v3; // r9
unsigned __int8 *v4; // rdx
__int64 v5; // r8
char v6; // cl
bool v7; // cc
unsigned __int8 *i; // rcx
char v9; // dl
bool v10; // cc
result = sub_1800D5590((__int64)(a1 + 48));
if ( result )
{
v3 = 0;
v4 = (unsigned __int8 *)(result + 162);
v5 = 0;
while ( 1 )
{
v6 = *(v4 - 1);
if ( v6 == 3 )
{
if ( *v4 >> 4 >= a1[12] )
return nullptr;
}
else if ( v6 == 2 )
{
v7 = (int)*v4 < a1[8];
goto LABEL_7;
}
if ( v6 != 1 )
goto LABEL_8;
v7 = (int)*v4 < a1[4];
LABEL_7:
if ( !v7 )
return nullptr;
LABEL_8:
++v5;
v4 += 4;
if ( v5 > 14 )
{
for ( i = (unsigned __int8 *)(result + 222); ; i += 4 )
{
v9 = *(i - 1);
switch ( v9 )
{
case 3:
if ( *i >> 4 >= a1[12] )
return nullptr;
break;
case 2:
v10 = (int)*i < a1[8];
LABEL_14:
if ( !v10 )
return nullptr;
break;
case 1:
v10 = (int)*i < a1[4];
goto LABEL_14;
}
if ( ++v3 > 5 )
return result;
}
}
}
}
return result;
}