//
// X509_check_host from 0xe045bc to 0xe046a0 (228 bytes)
//
// 2 xrefs:
// > sub_DEA4B4 @ 0xdea540
// > ??> @ 0x45228
//
// 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 X509_check_host(__int64 a1, const char *a2, unsigned __int64 a3, int a4, _QWORD *a5)
{
unsigned __int64 v7; // x19
size_t v9; // x0
int v10; // w3
unsigned __int64 v11; // x2
unsigned __int64 v13; // x21
v7 = a3;
if ( a2 )
{
if ( !a3 )
{
v9 = strlen(a2);
v7 = v9;
v10 = a4;
if ( v9 > 1 )
{
v11 = v9 - 1;
goto LABEL_5;
}
return sub_E02CA8(a1, a2, v7, v10, 2, a5);
}
if ( a3 <= 1 )
{
if ( !memchr(a2, 0, 1u) )
{
v7 = 1;
v10 = a4;
return sub_E02CA8(a1, a2, v7, v10, 2, a5);
}
}
else
{
v13 = a3 - 1;
if ( !memchr(a2, 0, a3 - 1) )
{
v11 = v13;
v10 = a4;
LABEL_5:
if ( !a2[v11] )
v7 = v11;
return sub_E02CA8(a1, a2, v7, v10, 2, a5);
}
}
}
return 4294967294LL;
}