//
// sub_1005BF448 from 0x1005bf448 to 0x1005bf574 (300 bytes)
//
// 4 xrefs:
// > sub_1005C1C08 @ 0x1005c1c44
// > sub_1005C1C08 @ 0x1005c1c78
// > sub_1005C22CC @ 0x1005c23b0
// > sub_1005C22CC @ 0x1005c23e0
//
// 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_1005BF448(__int64 a1, void **a2)
{
__int64 v4; // x0
__int64 v5; // x20
_BYTE *v6; // x3
int v7; // w22
__int64 v8; // x2
__int64 v9; // x4
if ( !a1 )
{
v8 = 67;
v9 = 1296;
LABEL_7:
sub_1005E0E48(16, 151, v8, "ec_asn1.c", v9);
return 0;
}
v4 = sub_1005C5B5C(*(_QWORD *)(a1 + 8), *(_QWORD *)(a1 + 16), *(unsigned int *)(a1 + 36), 0, 0, 0);
v5 = v4;
if ( !a2 || !v4 )
return v5;
v6 = *a2;
if ( *a2 )
{
v7 = 0;
goto LABEL_10;
}
v6 = sub_100588710(v4, (__int64)"ec_asn1.c", 1308);
*a2 = v6;
if ( !v6 )
{
v8 = 65;
v9 = 1309;
goto LABEL_7;
}
v7 = 1;
LABEL_10:
if ( sub_1005C5B5C(*(_QWORD *)(a1 + 8), *(_QWORD *)(a1 + 16), *(unsigned int *)(a1 + 36), v6, v5, 0) )
{
if ( !v7 )
*a2 = (char *)*a2 + v5;
}
else
{
sub_1005E0E48(16, 151, 16, "ec_asn1.c", 1316);
if ( v7 )
{
sub_100588C44(*a2);
v5 = 0;
*a2 = nullptr;
}
else
{
return 0;
}
}
return v5;
}