//
// UI_new_method from 0x83b2dc to 0x83b3c8 (236 bytes)
//
// 2 xrefs:
// > UI_new @ 0x83b3d4
// > ??> @ 0x669bc
//
// 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
//
_DWORD *__fastcall UI_new_method(int a1)
{
_DWORD *v2; // r4
pthread_rwlock_t *v3; // r5
int v4; // r5
_DWORD *result; // r0
v2 = CRYPTO_zalloc(&dword_18, (int)"crypto/ui/ui_lib.c", 27);
if ( v2 )
{
v3 = CRYPTO_THREAD_lock_new();
v2[5] = v3;
if ( v3 )
{
if ( a1 )
*v2 = a1;
else
*v2 = UI_get_default_method();
v4 = CRYPTO_new_ex_data(0xBu, (int)v2, v2 + 3);
result = v2;
if ( !v4 )
{
CRYPTO_free(v2, (int)"crypto/ui/ui_lib.c", 47);
return nullptr;
}
}
else
{
ERR_put_error(40, 104, 65, (int)"crypto/ui/ui_lib.c", 36);
CRYPTO_free(v2, (int)"crypto/ui/ui_lib.c", 37);
return nullptr;
}
}
else
{
ERR_put_error(40, 104, 65, (int)"crypto/ui/ui_lib.c", 30);
return nullptr;
}
return result;
}