//
// sub_10062E664 from 0x10062e664 to 0x10062e768 (260 bytes)
//
// 2 xrefs:
// > sub_10062D184 @ 0x10062d1b8
// > sub_10062D49C @ 0x10062d4d0
//
// 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_10062E664(unsigned __int8 *a1, unsigned __int64 a2)
{
_QWORD *v4; // x19
unsigned __int64 v5; // x20
unsigned __int64 v6; // x1
unsigned __int8 *v7; // x0
int v8; // w8
int v9; // t1
__int64 v10; // x22
unsigned __int8 *v11; // x0
int v12; // w8
int v13; // t1
__int64 v14; // x20
v4 = sub_1005CF04C();
if ( v4 )
{
v5 = a2 >> 1;
v6 = v5;
v7 = a1;
if ( v5 )
{
v6 = v5;
v7 = a1;
if ( !*a1 )
{
v6 = v5;
v7 = a1;
do
{
v9 = *++v7;
v8 = v9;
--v6;
}
while ( v6 && !v8 );
}
}
if ( v6 )
{
v10 = sub_1005AB1B0(v7, v6, 0);
}
else
{
v10 = (__int64)sub_1005AAD34();
sub_1005AB128(v10, 0);
}
v4[1] = v10;
v11 = &a1[v5];
if ( v5 && !*v11 )
{
do
{
v13 = *++v11;
v12 = v13;
--v5;
}
while ( v5 && !v12 );
}
if ( v5 )
{
v14 = sub_1005AB1B0(v11, v5, 0);
}
else
{
v14 = (__int64)sub_1005AAD34();
sub_1005AB128(v14, 0);
}
*v4 = v14;
}
else
{
sub_100624720(137, 118, (__int64)"gost_sign.c", 326);
return nullptr;
}
return v4;
}