//
// UI_new_method from 0xde3240 to 0xde332c (236 bytes)
//
// 2 xrefs:
// > UI_new @ 0xde3330
// > ??> @ 0x45ea0
//
// 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
//
_QWORD *__fastcall UI_new_method(__int64 a1)
{
_QWORD *v2; // x19
pthread_rwlock_t *v3; // x0
void *v5; // x0
void *v6; // x0
v2 = CRYPTO_zalloc(&dword_30, (__int64)"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();
if ( !(unsigned int)CRYPTO_new_ex_data(0xBu, (__int64)v2, v2 + 3) )
{
v5 = v2;
v2 = nullptr;
CRYPTO_free(v5, (__int64)"crypto/ui/ui_lib.c", 47);
}
}
else
{
ERR_put_error(40, 104, 65, (__int64)"crypto/ui/ui_lib.c", 36);
v6 = v2;
v2 = nullptr;
CRYPTO_free(v6, (__int64)"crypto/ui/ui_lib.c", 37);
}
}
else
{
ERR_put_error(40, 104, 65, (__int64)"crypto/ui/ui_lib.c", 30);
}
return v2;
}