//
// sub_100663EA8 from 0x100663ea8 to 0x100664018 (368 bytes)
//
// 1 xrefs:
// > sub_100659D30 @ 0x10065a118
//
// 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:11:00 +0000
//
__int64 __fastcall sub_100663EA8(_QWORD *a1, unsigned __int8 *a2, int a3, int *a4)
{
unsigned __int8 v6; // w24
__int64 v7; // x23
int v8; // w8
__int64 v9; // x2
__int64 v10; // x4
__int64 v12; // x21
__int64 v13; // x8
__int64 v14; // x22
unsigned __int64 v15; // x23
__int64 v16; // x8
if ( a3 != 5 )
{
v9 = 353;
v10 = 397;
LABEL_7:
sub_100706FB0(20, 311, v9, "d1_srtp.c", v10);
v8 = 50;
goto LABEL_8;
}
if ( (a2[1] | (*a2 << 8)) != 2 )
{
v9 = 353;
v10 = 405;
goto LABEL_7;
}
v6 = a2[2];
v7 = a2[3];
if ( a2[4] )
{
sub_100706FB0(20, 311, 352, "d1_srtp.c", 413);
v8 = 47;
LABEL_8:
*a4 = v8;
return 1;
}
if ( !a1 || (v12 = a1[81]) == 0 && ((v13 = a1[46]) == 0 || (v12 = *(_QWORD *)(v13 + 728)) == 0) )
{
v9 = 359;
v10 = 423;
goto LABEL_7;
}
if ( (int)sub_100704BB4(v12) <= 0 )
{
LABEL_17:
v9 = 353;
v10 = 443;
goto LABEL_7;
}
v14 = 0;
v15 = v7 & 0xFFFFFFFFFFFF00FFLL | ((unsigned __int64)v6 << 8);
while ( 1 )
{
v16 = sub_100704BC8(v12, v14);
if ( *(_QWORD *)(v16 + 8) == v15 )
break;
v14 = (unsigned int)(v14 + 1);
if ( (int)v14 >= (int)sub_100704BB4(v12) )
goto LABEL_17;
}
a1[82] = v16;
*a4 = 0;
return 0;
}