//
// std::__ndk1::moneypunct_byname::init from 0x968894 to 0x968b6c (728 bytes)
//
// 4 xrefs:
// > sub_968830 @ 0x968858
// > sub_968B94 @ 0x968bc6
// > sub_96D650 @ 0x96d9b0
// > sub_96DDD0 @ 0x96e106
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:05:44 +0000
//
int __fastcall std::moneypunct_byname::init(_DWORD *a1, char *a2)
{
int v4; // r0
int v5; // r8
int v6; // r5
int v7; // r6
int v8; // r0
int v9; // r0
int v10; // r5
int v11; // r4
int v12; // r0
int v13; // r5
int v14; // r4
int v15; // r5
int v16; // r4
void *exception; // r8
size_t v19; // r0
_DWORD *v20; // r0
int v21; // r5
int v22; // r6
int v23; // [sp+Ch] [bp-1BCh] BYREF
int v24; // [sp+10h] [bp-1B8h] BYREF
int v25; // [sp+14h] [bp-1B4h]
int v26[4]; // [sp+18h] [bp-1B0h] BYREF
_DWORD v27[101]; // [sp+28h] [bp-1A0h] BYREF
v4 = sub_992EBC(8127, a2);
v5 = v4;
if ( !v4 )
{
exception = _cxa_allocate_exception(8u);
memset(v26, 0, 12);
v19 = strlen(a2);
std::string::__init(v26, a2, v19);
v20 = std::string::insert(v26, 0, "moneypunct_byname failed to construct for ");
v21 = v20[1];
v22 = v20[2];
v27[0] = *v20;
v27[1] = v21;
v27[2] = v22;
*v20 = 0;
v20[1] = 0;
v20[2] = 0;
std::runtime_error::runtime_error(exception, v27);
_cxa_throw(
exception,
(struct type_info *)&`typeinfo for'std::runtime_error,
(void (*)(void *))std::runtime_error::~runtime_error);
}
v6 = sub_992F18(v4);
v7 = sub_992EB0();
if ( v6 )
sub_992F18(v6);
v8 = **(unsigned __int8 **)(v7 + 20);
if ( !**(_BYTE **)(v7 + 20) )
v8 = -1;
a1[2] = v8;
v9 = **(unsigned __int8 **)(v7 + 24);
if ( !**(_BYTE **)(v7 + 24) )
v9 = -1;
a1[3] = v9;
std::string::assign(a1 + 4, *(char **)(v7 + 28));
v24 = 0;
v25 = 0;
v23 = *(_DWORD *)(v7 + 12);
v10 = sub_992F18(v5);
v11 = sub_9935B8(v27, &v23, 100, &v24);
if ( v10 )
sub_992F18(v10);
if ( v11 == -1 )
std::__throw_runtime_error("locale not supported");
std::wstring::assign(a1 + 7, v27, &v27[v11]);
v12 = *(unsigned __int8 *)(v7 + 40);
if ( v12 == 255 )
v12 = 0;
a1[16] = v12;
if ( *(_BYTE *)(v7 + 52) )
{
v24 = 0;
v25 = 0;
v23 = *(_DWORD *)(v7 + 32);
v13 = sub_992F18(v5);
v14 = sub_9935B8(v27, &v23, 100, &v24);
if ( v13 )
sub_992F18(v13);
if ( v14 == -1 )
std::__throw_runtime_error("locale not supported");
std::wstring::assign(a1 + 10, v27, &v27[v14]);
}
else
{
std::wstring::assign(a1 + 10, "(");
}
if ( *(_BYTE *)(v7 + 53) )
{
v24 = 0;
v25 = 0;
v23 = *(_DWORD *)(v7 + 36);
v15 = sub_992F18(v5);
v16 = sub_9935B8(v27, &v23, 100, &v24);
if ( v15 )
sub_992F18(v15);
if ( v16 == -1 )
std::__throw_runtime_error("locale not supported");
std::wstring::assign(a1 + 13, v27, &v27[v16]);
}
else
{
std::wstring::assign(a1 + 13, "(");
}
std::wstring::basic_string(v26, a1 + 7);
sub_975F18(
a1 + 17,
v26,
1,
(unsigned __int8)*(_WORD *)(v7 + 48),
HIBYTE(*(unsigned __int16 *)(v7 + 48)),
*(unsigned __int8 *)(v7 + 52));
sub_975F18(
a1 + 18,
a1 + 7,
1,
(unsigned __int8)*(_WORD *)(v7 + 50),
HIBYTE(*(unsigned __int16 *)(v7 + 50)),
*(unsigned __int8 *)(v7 + 53));
std::wstring::~wstring(v26);
sub_992EA4(v5);
return _stack_chk_guard - v27[100];
}