//
// BUF_reverse from 0x7d8f28 to 0x7d8f84 (92 bytes)
//
// 7 xrefs:
// > tls_construct_client_verify @ 0x7a2d78
// > tls_process_cert_verify @ 0x7ac180
// > sub_8009C0 @ 0x800a78
// > sub_8009C0 @ 0x800a88
// > sub_8009C0 @ 0x800a9c
// > sub_8009C0 @ 0x800c1c
// > ??> @ 0x5d15c
//
// 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
//
char *__fastcall BUF_reverse(char *result, char *a2, unsigned int a3)
{
char *v3; // r2
char v4; // t1
unsigned int v5; // r1
unsigned int v6; // r2
char *v7; // r1
char *v8; // r3
char v9; // r2
if ( a2 )
{
if ( a3 )
{
result += a3;
v3 = &a2[a3];
do
{
v4 = *a2++;
*--result = v4;
}
while ( a2 != v3 );
}
}
else
{
v5 = a3 - 1;
v6 = a3 >> 1;
v7 = &result[v5];
if ( v6 )
{
v8 = &result[v6];
do
{
v9 = *v7;
*v7-- = *result;
*result++ = v9;
}
while ( result != v8 );
}
}
return result;
}