//
// sub_1006F528C from 0x1006f528c to 0x1006f54bc (560 bytes)
//
// 1 xrefs:
// > ??> @ 0x1009e7db8
//
// 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:42 +0000
//
_QWORD *__fastcall sub_1006F528C(unsigned __int8 *a1, int a2, __int64 a3)
{
__int64 *v6; // x20
__int64 *v7; // x19
__int64 *v8; // x8
int v9; // w24
int v10; // w0
int v11; // w8
int v12; // w0
int v13; // w8
__int64 v14; // x2
_QWORD *v15; // x21
_QWORD *v17; // x0
_QWORD v18[3]; // [xsp+0h] [xbp-70h] BYREF
_QWORD v19[3]; // [xsp+18h] [xbp-58h] BYREF
void *v20; // [xsp+30h] [xbp-40h]
__int64 *v21; // [xsp+38h] [xbp-38h]
v20 = nullptr;
v21 = nullptr;
sub_1006D0E90(v19);
sub_1006D0E90(v18);
if ( *(_QWORD *)(a3 + 24) && *(_QWORD *)(a3 + 32) && *(_QWORD *)(a3 + 40) )
{
v6 = (__int64 *)sub_1006D0E9C();
if ( v6 )
{
v7 = (__int64 *)sub_1006D1C30();
if ( v7 )
{
while ( 1 )
{
v8 = *(__int64 **)(a3 + 64);
if ( v8 && *(_QWORD *)(a3 + 72) )
{
v20 = *(void **)(a3 + 72);
v21 = v8;
v9 = 1;
*(_OWORD *)(a3 + 64) = 0u;
}
else
{
if ( !(unsigned int)sub_1006F51A8(a3) )
goto LABEL_30;
v9 = 0;
}
v10 = sub_1006D0D88(*(_QWORD *)(a3 + 32));
v11 = v10 + 7;
if ( v10 + 7 < 0 )
v11 = v10 + 14;
if ( a2 > v11 >> 3 )
{
v12 = sub_1006D0D88(*(_QWORD *)(a3 + 32));
v13 = v12 + 7;
if ( v12 + 7 < 0 )
v13 = v12 + 14;
a2 = v13 >> 3;
}
if ( !sub_1006D1318(a1, a2, (__int64)v19)
|| !sub_1006D3430((__int64)v18, *(__int64 **)(a3 + 56), (__int64 *)v20, *(_QWORD *)(a3 + 32), v7)
|| !(unsigned int)sub_1006CE958((__int64)v6, (__int64)v18, (__int64)v19)
|| (int)sub_1006D15C8((__int64)v6, *(_QWORD *)(a3 + 32)) >= 1
&& !(unsigned int)sub_1006CED10((__int64)v6, (__int64)v6, *(_QWORD *)(a3 + 32))
|| !sub_1006D3430((__int64)v6, v6, v21, *(_QWORD *)(a3 + 32), v7) )
{
goto LABEL_30;
}
if ( *((_DWORD *)v20 + 2) && *((_DWORD *)v6 + 2) )
{
v17 = sub_1006F51B4();
v15 = v17;
if ( !v17 )
goto LABEL_30;
*v17 = v20;
v17[1] = v6;
goto LABEL_32;
}
v14 = 110;
if ( v9 )
goto LABEL_31;
}
}
}
else
{
v6 = nullptr;
}
v7 = nullptr;
LABEL_30:
v14 = 3;
goto LABEL_31;
}
v6 = nullptr;
v7 = nullptr;
v14 = 101;
LABEL_31:
sub_100706FB0(10, 112, v14, "dsa_ossl.c", 209);
sub_1006D0E38(v20);
sub_1006D0E38(v6);
v15 = nullptr;
LABEL_32:
if ( v7 )
sub_1006D1C94((void **)v7);
sub_1006D0DC4((__int64)v19);
sub_1006D0DC4((__int64)v18);
if ( v21 )
sub_1006D0DC4((__int64)v21);
return v15;
}