//
// SSL_select_next_proto from 0x9ad000 to 0x9ad0e0 (224 bytes)
//
// 1 xrefs:
// > ??> @ 0x758cc
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:06:54 +0000
//
int __fastcall SSL_select_next_proto(_DWORD *a1, _BYTE *a2, int a3, unsigned int a4, _BYTE *a5, unsigned int a6)
{
unsigned int v6; // r8
size_t v7; // r9
size_t v8; // r6
unsigned int v9; // r5
int v10; // r4
_BYTE *v11; // r2
int result; // r0
if ( a4 )
{
v6 = 0;
while ( !a6 )
{
v7 = *(unsigned __int8 *)(a3 + v6);
LABEL_12:
v6 += v7 + 1;
if ( a4 <= v6 )
goto LABEL_13;
}
v8 = *(unsigned __int8 *)(a3 + v6);
v7 = v8;
v9 = 0;
while ( 1 )
{
v10 = (unsigned __int8)a5[v9];
if ( v10 == v8 && !memcmp((const void *)(a3 + v6 + 1), &a5[v9 + 1], v8) )
break;
v9 += v10 + 1;
if ( a6 <= v9 )
goto LABEL_12;
}
v11 = (_BYTE *)(a3 + v6);
result = 1;
}
else
{
LABEL_13:
result = 2;
v11 = a5;
}
*a1 = v11 + 1;
*a2 = *v11;
return result;
}