//
// sub_BB99D0 from 0xbb99d0 to 0xbb9b40 (368 bytes)
//
// 1 xrefs:
// > sub_BBACA4 @ 0xbbacb4
//
// 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
//
__int64 __fastcall sub_BB99D0(__int64 a1, __int64 a2, int a3)
{
unsigned int v6; // w0
__int64 v8; // x0
__int64 file; // x0
int v10; // w24
__int64 v11; // x0
__int64 v12; // x0
int v13; // w20
_BYTE v14[64]; // [xsp+58h] [xbp+58h] BYREF
if ( a1 )
{
if ( byte_124784C )
{
LABEL_3:
v6 = sub_BABA88(a3);
RAND_bytes(a2, v6);
return 0;
}
if ( (unsigned int)RAND_status(a1) )
{
byte_124784C = 1;
goto LABEL_3;
}
v8 = *(_QWORD *)(a1 + 1928);
if ( v8 )
{
file = RAND_load_file(v8, 1024);
v10 = file;
if ( (unsigned int)RAND_status(file) )
{
if ( !v10 )
goto LABEL_3;
return 1;
}
}
else
{
v10 = 0;
}
do
{
if ( !(unsigned int)RAND_bytes(v14, 64) )
break;
v11 = RAND_add(v14, 64, 32.0);
}
while ( !(unsigned int)RAND_status(v11) );
*(_BYTE *)(a1 + 2824) = 0;
RAND_file_name(a1 + 2824, 0x4000);
if ( !*(_BYTE *)(a1 + 2824) || (v12 = RAND_load_file(a1 + 2824, 1024), v13 = v12, !(unsigned int)RAND_status(v12)) )
{
sub_B7B528(a1, "libcurl is now using a weak random seed!\n");
return 1;
}
if ( !(v13 + v10) )
goto LABEL_3;
return 1;
}
if ( (unsigned int)RAND_status(0) )
goto LABEL_3;
return 1;
}