//
// OPENSSL_asc2uni from 0x825f8c to 0x826028 (156 bytes)
//
// 3 xrefs:
// > PKCS12_key_gen_asc @ 0x824684
// > OPENSSL_utf82uni @ 0x826158
// > ??> @ 0x6570c
//
// 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
//
_BYTE *__fastcall OPENSSL_asc2uni(const char *a1, size_t a2, _DWORD *a3, _DWORD *a4)
{
char *v7; // r8
_BYTE *result; // r0
int v9; // r12
char *v10; // lr
char v11; // r4
char *v12; // r3
if ( a2 == -1 )
a2 = strlen(a1);
v7 = (char *)(2 * (a2 + 1));
result = CRYPTO_malloc(v7, (int)"crypto/pkcs12/p12_utl.c", 25);
if ( result )
{
if ( (int)(v7 - 2) > 0 )
{
v9 = 0;
do
{
result[v9] = 0;
v10 = &result[v9];
v11 = a1[v9 >> 1];
v9 += 2;
v10[1] = v11;
}
while ( (int)(v7 - 2) > v9 );
}
v12 = &v7[(_DWORD)result];
*(v12 - 2) = 0;
*(v12 - 1) = 0;
if ( a4 )
*a4 = v7;
if ( a3 )
*a3 = result;
}
return result;
}