//
// SSL_select_next_proto from 0xfbf320 to 0xfbf420 (256 bytes)
//
// 1 xrefs:
// > ??> @ 0xafe58
//
// 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 13:15:20 +0000
//
__int64 __fastcall SSL_select_next_proto(
_QWORD *a1,
_BYTE *a2,
__int64 a3,
unsigned int a4,
_BYTE *a5,
unsigned int a6)
{
unsigned int v12; // w26
_BYTE *v13; // x28
unsigned int v14; // w20
int v15; // w22
int v16; // w19
__int64 result; // x0
v12 = 0;
if ( a4 )
{
while ( !a6 )
{
v15 = *(unsigned __int8 *)(a3 + v12);
LABEL_10:
v12 += v15 + 1;
if ( a4 <= v12 )
goto LABEL_11;
}
v13 = (_BYTE *)(a3 + v12);
v14 = 0;
v15 = (unsigned __int8)*v13;
while ( 1 )
{
v16 = (unsigned __int8)a5[v14];
if ( v16 == v15 && !memcmp((const void *)(a3 + v12 + 1), &a5[v14 + 1], (unsigned __int8)v15) )
break;
v14 += v16 + 1;
if ( a6 <= v14 )
goto LABEL_10;
}
result = 1;
}
else
{
LABEL_11:
v13 = a5;
result = 2;
}
*a1 = v13 + 1;
*a2 = *v13;
return result;
}