//
// SSL_select_next_proto from 0x7983fc to 0x7984dc (224 bytes)
//
// 1 xrefs:
// > ??> @ 0x5be4c
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
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;
}