//
// sub_100666474 from 0x100666474 to 0x100666510 (156 bytes)
//
// 1 xrefs:
// > sub_100644CC4 @ 0x100644f04
//
// 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:01 +0000
//
__int64 __fastcall sub_100666474(__int64 a1, __int64 a2, _QWORD *a3)
{
__int64 v3; // x10
_QWORD *v4; // x8
__int64 result; // x0
__int64 v6; // x9
_QWORD *v7; // x8
v3 = *(_QWORD *)(a2 + 32);
v4 = *(_QWORD **)(a1 + 256);
if ( (v3 & 2) == 0 || (result = v4[29], v6 = 2, !result) )
{
if ( (v3 & 1) != 0 )
{
result = v4[22];
v6 = 1;
if ( !result )
{
result = v4[15];
if ( !result )
{
LABEL_12:
sub_100706FB0(20, 183, 68, "ssl_lib.c", 2587);
return 0;
}
v6 = 0;
}
}
else
{
if ( (v3 & 0x40) == 0 )
goto LABEL_12;
result = v4[50];
v6 = 5;
if ( !result )
goto LABEL_12;
}
}
if ( a3 )
{
v7 = &v4[7 * v6];
*a3 = v7[16];
return v7[15];
}
return result;
}