//
// BIO_gets from 0x7d0bd8 to 0x7d0cec (276 bytes)
//
// 18 xrefs:
// > OBJ_create_objects @ 0x81d038
// > PEM_read_bio @ 0x822664
// > PEM_read_bio @ 0x8227b4
// > PEM_read_bio @ 0x822914
// > PEM_read_bio @ 0x8229ec
// > TXT_DB_read @ 0x839090
// > TXT_DB_read @ 0x839194
// > a2i_ASN1_INTEGER @ 0x866d28
// > a2i_ASN1_INTEGER @ 0x866ec0
// > a2i_ASN1_STRING @ 0x86719c
// > a2i_ASN1_STRING @ 0x867300
// > sub_8791C0 @ 0x879378
// > OCSP_REQ_CTX_nbio @ 0x8b9528
// > sub_8C4CA8 @ 0x8c4d14
// > sub_8C4EEC @ 0x8c4f38
// > SMIME_crlf_copy @ 0x8c5ec0
// > sub_8D59A8 @ 0x8d59cc
// > ??> @ 0x5f74c
//
// 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 BIO_gets(_DWORD *a1, int a2, int a3)
{
int (*v4)(void); // r3
int (__fastcall *v5)(_DWORD *, int); // r5
int result; // r0
int v9; // r0
if ( !a1 || !*a1 || (v4 = *(int (**)(void))(*a1 + 20)) == nullptr )
{
ERR_put_error(32, 104, 121, "crypto/bio/bio_lib.c", 276);
return -2;
}
v5 = (int (__fastcall *)(_DWORD *, int))a1[1];
if ( !v5 )
{
if ( a1[3] )
return v4();
goto LABEL_11;
}
result = v5(a1, 5);
if ( result <= 0 )
return result;
if ( !a1[3] )
{
LABEL_11:
ERR_put_error(32, 104, 120, "crypto/bio/bio_lib.c", 286);
return -2;
}
v9 = (*(int (__fastcall **)(_DWORD *, int, int))(*a1 + 20))(a1, a2, a3);
return ((int (__fastcall *)(_DWORD *, int, int, int, _DWORD, int))v5)(a1, 133, a2, a3, 0, v9);
}