//
// sub_1005BF364 from 0x1005bf364 to 0x1005bf448 (228 bytes)
//
// 2 xrefs:
// > sub_1005C1B1C @ 0x1005c1b8c
// > sub_1005C22CC @ 0x1005c28f8
//
// 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_1005BF364(__int64 *a1, _QWORD *a2, __int64 a3)
{
__int64 v5; // x19
__int64 *v6; // x0
void *v7; // x1
_BYTE *v8; // x8
__int64 v9; // x2
__int64 v10; // x4
if ( !a1 || (v5 = *a1) == 0 || (v6 = *(__int64 **)(v5 + 8)) == nullptr )
{
v9 = 67;
v10 = 1271;
LABEL_10:
sub_1005E0E48(16, 152, v9, "ec_asn1.c", v10);
return 0;
}
v7 = *(void **)(v5 + 16);
if ( !v7 )
{
v7 = sub_1005B7838(v6);
*(_QWORD *)(v5 + 16) = v7;
if ( !v7 )
{
v9 = 65;
v10 = 1277;
goto LABEL_10;
}
v6 = *(__int64 **)(v5 + 8);
}
if ( !(unsigned int)sub_1005C5BF4(v6, v7) )
{
v9 = 16;
v10 = 1281;
goto LABEL_10;
}
v8 = (_BYTE *)*a2;
*(_DWORD *)(v5 + 36) = *(_BYTE *)*a2 & 0xFE;
*a2 = &v8[a3];
return v5;
}