//
// sub_1006E54CC from 0x1006e54cc to 0x1006e55b0 (228 bytes)
//
// 2 xrefs:
// > sub_1006E7C84 @ 0x1006e7cf4
// > sub_1006E8434 @ 0x1006e8a60
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:12:35 +0000
//
__int64 __fastcall sub_1006E54CC(__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_100706FB0(16, 152, v9, "ec_asn1.c", v10);
return 0;
}
v7 = *(void **)(v5 + 16);
if ( !v7 )
{
v7 = sub_1006DD9A0(v6);
*(_QWORD *)(v5 + 16) = v7;
if ( !v7 )
{
v9 = 65;
v10 = 1277;
goto LABEL_10;
}
v6 = *(__int64 **)(v5 + 8);
}
if ( !(unsigned int)sub_1006EBD5C(v6, v7) )
{
v9 = 16;
v10 = 1281;
goto LABEL_10;
}
v8 = (_BYTE *)*a2;
*(_DWORD *)(v5 + 36) = *(_BYTE *)*a2 & 0xFE;
*a2 = &v8[a3];
return v5;
}