//
// sub_100603240 from 0x100603240 to 0x100603330 (240 bytes)
//
// 3 xrefs:
// > sub_1005834D0 @ 0x100583ca0
// > sub_1005FEC08 @ 0x1005fec34
// > sub_1005FEC08 @ 0x1005fec68
//
// 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
//
_QWORD *__fastcall sub_100603240(__int64 a1, __int64 a2)
{
unsigned int *v4; // x22
int v5; // w23
_QWORD *v6; // x20
_BYTE *v7; // x0
unsigned int (__fastcall *v8)(_BYTE *); // x8
__int64 v9; // x8
void (__fastcall *v10)(_QWORD *); // x8
v4 = *(unsigned int **)(a1 + 16);
if ( (int)sub_1005DEA4C(v4) <= 0 )
{
LABEL_5:
v7 = sub_100588710(32, (__int64)"x509_lu.c", 69);
v6 = v7;
if ( v7 )
{
*(_DWORD *)v7 = 0;
*((_DWORD *)v7 + 1) = 0;
*((_QWORD *)v7 + 1) = a2;
*((_QWORD *)v7 + 2) = 0;
*((_QWORD *)v7 + 3) = 0;
v8 = *(unsigned int (__fastcall **)(_BYTE *))(a2 + 8);
if ( !v8 || v8(v7) )
{
v6[3] = a1;
if ( (unsigned int)sub_1005DE80C(*(void ***)(a1 + 16), (__int64)v6) )
return v6;
v9 = v6[1];
if ( v9 )
{
v10 = *(void (__fastcall **)(_QWORD *))(v9 + 16);
if ( v10 )
v10(v6);
}
}
sub_100588C44(v6);
}
return nullptr;
}
v5 = 0;
while ( 1 )
{
v6 = (_QWORD *)sub_1005DEA60((__int64)v4, v5);
if ( v6[1] == a2 )
return v6;
if ( ++v5 >= (int)sub_1005DEA4C(v4) )
goto LABEL_5;
}
}