//
// std::__ndk1::to_wstring from 0x97dce8 to 0x97ddd8 (240 bytes)
//
// 0 xrefs:
//
// 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:06:04 +0000
//
int __fastcall std::to_wstring(long double a1)
{
int *v1; // r8
char v2; // r1
unsigned int v3; // r6
int *v4; // r0
signed int v5; // r0
int v6; // r1
void *v7; // r2
int v9; // [sp+8h] [bp-24h] BYREF
int v10; // [sp+Ch] [bp-20h] BYREF
void *v11; // [sp+10h] [bp-1Ch]
int v12; // [sp+14h] [bp-18h]
v1 = (int *)LODWORD(a1);
v11 = operator new(0x60u);
v9 = 25;
v10 = 20;
sub_998BA0(v11, 0, 20);
*((_DWORD *)v11 + 20) = 0;
std::wstring::resize((unsigned __int8 *)&v9, 0x17u);
v2 = v9;
v3 = v10;
if ( (v9 & 1) == 0 )
v3 = (unsigned __int8)v9 >> 1;
while ( 1 )
{
v4 = (int *)v11;
if ( (v2 & 1) == 0 )
v4 = &v10;
v5 = sub_993C1C(v4, v3 + 1, "%");
if ( v5 >= 0 )
break;
v3 = (2 * v3) | 1;
LABEL_9:
std::wstring::resize((unsigned __int8 *)&v9, v3);
v2 = v9;
}
if ( v5 > v3 )
{
v3 = v5;
goto LABEL_9;
}
std::wstring::resize((unsigned __int8 *)&v9, v5);
v6 = v10;
v7 = v11;
*v1 = v9;
v1[1] = v6;
v1[2] = (int)v7;
return _stack_chk_guard - v12;
}