//
// std::__ndk1::numpunct_byname::__init from 0xf748d0 to 0xf74aa0 (464 bytes)
//
// 5 xrefs:
// > sub_F6A1A8 @ 0xf6a79c
// > sub_F6B1B0 @ 0xf6ba20
// > std::__ndk1::numpunct_byname::numpunct_byname @ 0xf74890
// > std::__ndk1::numpunct_byname::numpunct_byname @ 0xf74af0
// > ??> @ 0xaf840
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 13:13:41 +0000
//
__int64 __fastcall std::numpunct_byname::__init(__int64 a1, char *a2)
{
__int64 result; // x0
__int64 v5; // x22
struct lconv *v6; // x21
void *exception; // x19
size_t v8; // x0
_QWORD *v9; // x0
__int64 v10[3]; // [xsp+8h] [xbp-58h] BYREF
__int128 v11; // [xsp+20h] [xbp-40h] BYREF
__int64 v12; // [xsp+30h] [xbp-30h]
__int64 v13; // [xsp+38h] [xbp-28h]
v13 = *(_QWORD *)(_ReadStatusReg(TPIDR_EL0) + 40);
result = strcmp(a2, "C");
if ( (_DWORD)result )
{
if ( !newlocale() )
{
exception = _cxa_allocate_exception(0x10u);
memset(v10, 0, sizeof(v10));
v8 = strlen(a2);
std::string::__init(v10, a2, v8);
v9 = std::string::insert(v10, 0, "numpunct_byname::numpunct_byname failed to construct for ");
v12 = v9[2];
v11 = *(_OWORD *)v9;
v9[1] = 0;
v9[2] = 0;
*v9 = 0;
std::runtime_error::runtime_error(exception, &v11);
_cxa_throw(
exception,
(struct type_info *)&`typeinfo for'std::runtime_error,
(void (*)(void *))std::overflow_error::~overflow_error);
}
v5 = uselocale();
v6 = localeconv();
if ( v5 )
uselocale();
if ( *v6->decimal_point )
*(_DWORD *)(a1 + 16) = *(unsigned __int8 *)v6->decimal_point;
if ( *v6->thousands_sep )
*(_DWORD *)(a1 + 20) = *(unsigned __int8 *)v6->thousands_sep;
std::string::assign((__int64 *)(a1 + 24), v6->grouping);
result = freelocale();
}
_ReadStatusReg(TPIDR_EL0);
return result;
}