//
// sub_100603A54 from 0x100603a54 to 0x100603c3c (488 bytes)
//
// 2 xrefs:
// > sub_1006012E4 @ 0x100601478
// > sub_1006012E4 @ 0x100601508
//
// 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
//
void **__fastcall sub_100603A54(__int64 *a1, __int64 a2)
{
void **v4; // x19
int v5; // w22
int v6; // w24
__int64 v7; // x23
int v9; // [xsp+8h] [xbp-48h] BYREF
__int64 v10; // [xsp+10h] [xbp-40h]
int v11; // [xsp+1Ch] [xbp-34h] BYREF
v4 = (void **)sub_1005DE4A4();
sub_100588190(9, 11, (__int64)"x509_lu.c", 493);
v5 = sub_100603940(*(int **)(*a1 + 8), 1, a2, &v11);
if ( (v5 & 0x80000000) == 0 )
goto LABEL_8;
sub_100588190(10, 11, (__int64)"x509_lu.c", 501);
if ( !(unsigned int)sub_100603330(a1, 1, a2, (__int64)&v9) )
{
LABEL_15:
sub_1005DE314(v4);
return nullptr;
}
if ( v9 == 2 )
{
sub_1005F4000(v10);
}
else if ( v9 == 1 )
{
sub_1005F3CA0(v10);
}
sub_100588190(9, 11, (__int64)"x509_lu.c", 507);
v5 = sub_100603940(*(int **)(*a1 + 8), 1, a2, &v11);
if ( v5 < 0 )
{
sub_100588190(10, 11, (__int64)"x509_lu.c", 510);
goto LABEL_15;
}
LABEL_8:
if ( v11 <= 0 )
{
LABEL_12:
sub_100588190(10, 11, (__int64)"x509_lu.c", 526);
}
else
{
v6 = 0;
while ( 1 )
{
v7 = *(_QWORD *)(sub_1005DEA60(*(_QWORD *)(*a1 + 8), v5 + v6) + 8);
sub_100588508((_DWORD *)(v7 + 28), 1, 3, (__int64)"x509_lu.c", 518);
if ( !(unsigned int)sub_1005DE80C(v4, v7) )
break;
if ( ++v6 >= v11 )
goto LABEL_12;
}
sub_100588190(10, 11, (__int64)"x509_lu.c", 520);
sub_1005F3CA0(v7);
sub_1005DE9D0(v4, (void (*)(void))sub_1005F3CA0);
return nullptr;
}
return v4;
}