//
// sub_8B565C from 0x8b565c to 0x8b5700 (164 bytes)
//
// 1 xrefs:
// > ??> @ 0xa3a3fc
//
// 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 sub_8B565C(int a1, int a2, int a3)
{
int data; // r7
int v7; // r0
bool v8; // zf
int v10; // r5
int init; // r0
bool v12; // cc
if ( !a2 )
return 0;
data = BIO_get_data(a1);
v7 = BIO_next(a1);
v8 = data == 0;
if ( data )
v8 = v7 == 0;
if ( v8 )
return 0;
v10 = BIO_read(v7, a2, a3);
init = BIO_get_init(a1);
v12 = init <= 0;
if ( init )
v12 = v10 <= 0;
if ( !v12 && EVP_DigestUpdate(data) <= 0 )
return -1;
BIO_clear_flags(a1, 15);
BIO_copy_next_retry(a1);
return v10;
}