//
// UI_add_info_string from 0x83a738 to 0x83a8f8 (448 bytes)
//
// 1 xrefs:
// > ??> @ 0x668ec
//
// 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 UI_add_info_string(int a1, int a2)
{
_DWORD *v4; // r0
int v5; // r4
int *v6; // r0
int v7; // r0
int v8; // r5
int v10; // r5
if ( !a2 )
{
ERR_put_error(40, 109, 67, (int)"crypto/ui/ui_lib.c", 99);
return -1;
}
v4 = CRYPTO_malloc(&dword_20, (int)"crypto/ui/ui_lib.c", 103);
v5 = (int)v4;
if ( !v4 )
return -1;
v4[1] = a2;
v4[3] = 0;
v6 = *(int **)(a1 + 4);
*(_DWORD *)(v5 + 28) = 0;
*(_DWORD *)(v5 + 8) = 0;
*(_DWORD *)v5 = 4;
if ( !v6 )
{
v6 = OPENSSL_sk_new_null();
*(_DWORD *)(a1 + 4) = v6;
if ( !v6 )
{
if ( (*(_DWORD *)(v5 + 28) & 1) != 0 )
{
CRYPTO_free(*(void **)(v5 + 4), (int)"crypto/ui/ui_lib.c", 56);
if ( *(_DWORD *)v5 == 3 )
{
CRYPTO_free(*(void **)(v5 + 16), (int)"crypto/ui/ui_lib.c", 59);
CRYPTO_free(*(void **)(v5 + 20), (int)"crypto/ui/ui_lib.c", 60);
CRYPTO_free(*(void **)(v5 + 24), (int)"crypto/ui/ui_lib.c", 61);
}
}
CRYPTO_free((void *)v5, (int)"crypto/ui/ui_lib.c", 67);
return -1;
}
}
*(_DWORD *)(v5 + 16) = 0;
*(_DWORD *)(v5 + 20) = 0;
*(_DWORD *)(v5 + 24) = 0;
v7 = OPENSSL_sk_push(v6, v5);
v8 = v7;
if ( v7 > 0 )
return v8;
v10 = v7 - 1;
if ( (*(_DWORD *)(v5 + 28) & 1) != 0 )
{
CRYPTO_free(*(void **)(v5 + 4), (int)"crypto/ui/ui_lib.c", 56);
if ( *(_DWORD *)v5 == 3 )
{
CRYPTO_free(*(void **)(v5 + 16), (int)"crypto/ui/ui_lib.c", 59);
CRYPTO_free(*(void **)(v5 + 20), (int)"crypto/ui/ui_lib.c", 60);
CRYPTO_free(*(void **)(v5 + 24), (int)"crypto/ui/ui_lib.c", 61);
}
}
CRYPTO_free((void *)v5, (int)"crypto/ui/ui_lib.c", 67);
return v10;
}