//
// sub_1006A1AC8 from 0x1006a1ac8 to 0x1006a1d08 (576 bytes)
//
// 1 xrefs:
// > sub_1006773BC @ 0x1006781b8
//
// 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:40 +0000
//
__int64 __fastcall sub_1006A1AC8(__int64 *a1, char *a2)
{
__int64 v3; // x19
unsigned __int8 v5; // w8
const char *v6; // x20
int v7; // t1
int v9; // t1
unsigned __int8 v10; // w8
const char *v11; // x21
size_t v12; // x0
const char *v13; // x21
__uint32_t v14; // w0
__int64 v15; // x8
int v16; // t1
size_t v17; // x21
void *v18; // x0
__int64 v19; // [xsp+18h] [xbp-48h] BYREF
v3 = *a1;
v19 = 0;
if ( sub_10069A1C4("CSeq:", a2, 5) )
{
if ( sscanf(a2 + 4, ": %ld", &v19) == 1 )
{
*(_QWORD *)(*(_QWORD *)(v3 + 536) + 144LL) = v19;
*(_QWORD *)(v3 + 35632) = v19;
return 0;
}
else
{
sub_10067889C(v3, "Unable to read the CSeq header: [%s]", a2);
return 85;
}
}
if ( !sub_10069A1C4("Session:", a2, 8) )
return 0;
v7 = (unsigned __int8)a2[8];
v6 = a2 + 8;
v5 = v7;
if ( !v7 )
goto LABEL_18;
while ( (char)v5 < 0 ? __maskrune(v5, 0x4000u) : _DefaultRuneLocale.__runetype[v5] & 0x4000 )
{
v9 = *(unsigned __int8 *)++v6;
v5 = v9;
if ( !v9 )
goto LABEL_18;
}
v10 = *v6;
if ( !*v6 )
{
LABEL_18:
sub_10067889C(v3, "Got a blank Session ID");
return 0;
}
v11 = *(const char **)(v3 + 1672);
if ( v11 )
{
v12 = strlen(*(const char **)(v3 + 1672));
if ( !strncmp(v6, v11, v12) )
return 0;
sub_10067889C(v3, "Got RTSP Session ID Line [%s], but wanted ID [%s]", v6, v11);
return 86;
}
v13 = v6;
do
{
if ( (char)v10 < 0 )
v14 = __maskrune(v10, 0x500u);
else
v14 = _DefaultRuneLocale.__runetype[v10] & 0x500;
if ( v14 )
goto LABEL_30;
if ( (unsigned int)*(unsigned __int8 *)v13 - 43 > 0x34 )
break;
v15 = (unsigned __int8)(*v13 - 43);
if ( ((1LL << v15) & 0x1000000000000DLL) != 0 )
goto LABEL_30;
if ( v15 != 49 || v13[1] != 36 )
break;
++v13;
LABEL_30:
v16 = *(unsigned __int8 *)++v13;
v10 = v16;
}
while ( v16 );
v17 = v13 - v6;
v18 = off_1009E5FD0(v17 + 1);
*(_QWORD *)(v3 + 1672) = v18;
if ( !v18 )
return 27;
memcpy(v18, v6, v17);
*(_BYTE *)(*(_QWORD *)(v3 + 1672) + v17) = 0;
return 0;
}