//
// sub_F77C10 from 0xf77c10 to 0xf780a0 (1168 bytes)
//
// 4 xrefs:
// > std::__ndk1::moneypunct_byname::init @ 0xf617ec
// > std::__ndk1::moneypunct_byname::init @ 0xf61808
// > std::__ndk1::moneypunct_byname::init @ 0xf61cc0
// > std::__ndk1::moneypunct_byname::init @ 0xf61cdc
//
// 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:44 +0000
//
__int64 __fastcall sub_F77C10(__int64 result, __int64 *a2, char a3, char a4, char a5, char a6)
{
__int64 v6; // x19
unsigned __int64 v7; // x9
__int64 v8; // x9
_BOOL4 v9; // w9
unsigned __int64 v10; // x10
__int64 v11; // x12
bool v12; // zf
__int64 v13; // x13
unsigned __int8 *v14; // x10
char *v15; // x11
__int16 v16; // w13
char v17; // w14
__int64 v18; // x12
char v19; // w11
char v20; // w13
char v21; // w14
char v22; // w15
char v23; // w16
__int64 v24; // x13
__int64 v25; // x14
unsigned __int8 *v26; // x12
unsigned __int8 v27; // w14
unsigned __int8 v28; // t1
unsigned __int8 *v29; // x17
unsigned __int8 *v30; // x16
unsigned __int8 *v31; // x15
unsigned int v32; // t1
__int16 v33; // w10
__int16 v34; // w10
__int16 v35; // w10
__int16 v36; // w10
unsigned __int64 v37; // x9
__int64 v38; // x9
__int64 v39; // x10
__int64 v40; // x9
v6 = result;
if ( (a3 & 1) != 0 )
{
v7 = *(unsigned __int8 *)a2;
if ( (v7 & 1) != 0 )
v8 = a2[1];
else
v8 = v7 >> 1;
v9 = v8 == 4;
}
else
{
v9 = 0;
}
if ( a4 == 1 )
{
switch ( a6 )
{
case 0:
*(_DWORD *)result = 67109379;
if ( !a5 || a5 == 2 )
return result;
if ( a5 != 1 )
goto LABEL_73;
if ( !v9 )
return std::string::insert(a2, 0, 1, 32);
return result;
case 1:
*(_BYTE *)result = 3;
*(_BYTE *)(result + 3) = 4;
if ( a5 == 2 )
goto LABEL_75;
if ( a5 == 1 )
goto LABEL_76;
if ( a5 )
goto LABEL_73;
goto LABEL_37;
case 2:
*(_BYTE *)result = 2;
*(_BYTE *)(result + 3) = 3;
if ( a5 == 2 )
{
v33 = 260;
goto LABEL_85;
}
if ( a5 == 1 )
{
v34 = 1024;
goto LABEL_89;
}
if ( a5 )
goto LABEL_73;
*(_WORD *)(result + 1) = 1024;
return result;
case 3:
*(_BYTE *)result = 3;
*(_BYTE *)(result + 3) = 4;
if ( a5 == 2 )
{
LABEL_75:
v33 = 513;
goto LABEL_85;
}
if ( a5 == 1 )
{
LABEL_76:
v34 = 2;
goto LABEL_89;
}
if ( a5 )
goto LABEL_73;
LABEL_37:
*(_WORD *)(result + 1) = 2;
return result;
case 4:
*(_BYTE *)result = 2;
*(_BYTE *)(result + 3) = 4;
if ( a5 == 2 )
{
v34 = 768;
LABEL_89:
*(_WORD *)(result + 1) = v34;
if ( !v9 )
result = (__int64)std::string::push_back(a2, 32);
}
else if ( a5 == 1 )
{
v33 = 259;
LABEL_85:
*(_WORD *)(result + 1) = v33;
if ( v9 )
{
v37 = *(unsigned __int8 *)a2;
if ( (v37 & 1) != 0 )
{
v39 = a2[2];
v40 = a2[1] - 1;
a2[1] = v40;
*(_BYTE *)(v39 + v40) = 0;
}
else
{
v38 = (v37 >> 1) - 1;
*(_BYTE *)a2 = 2 * v38;
*((_BYTE *)a2 + v38 + 1) = 0;
}
}
}
else
{
if ( a5 )
goto LABEL_73;
*(_WORD *)(result + 1) = 3;
}
break;
default:
goto LABEL_73;
}
}
else if ( a4 )
{
LABEL_73:
*(_DWORD *)v6 = 67109634;
}
else
{
if ( v9 )
{
v10 = *(unsigned __int8 *)a2;
v11 = a2[1];
v12 = (v10 & 1) == 0;
v13 = v10 >> 1;
if ( (v10 & 1) != 0 )
v14 = (unsigned __int8 *)a2[2];
else
v14 = (unsigned __int8 *)a2 + 1;
if ( v12 )
v11 = v13;
if ( v11 != 3 )
{
v15 = (char *)&v14[v11];
if ( v11 == 4 )
{
v16 = *(_WORD *)v14;
v17 = v14[3];
*(v15 - 1) = v14[2];
*(_WORD *)(v15 - 3) = v16;
*v14 = v17;
}
else
{
v18 = v11 - 3;
if ( v18 == 3 )
{
v19 = *v14;
v20 = v14[1];
v21 = v14[4];
v22 = v14[2];
v23 = v14[5];
*v14 = v14[3];
v14[3] = v19;
v14[1] = v21;
v14[4] = v20;
v14[2] = v23;
v14[5] = v22;
}
else
{
v24 = 3;
do
{
v25 = v24;
v24 = v18;
v18 = v25 % v18;
}
while ( v18 );
if ( v24 )
{
v26 = &v14[v24];
do
{
v28 = *--v26;
v27 = v28;
v29 = v26 + 3;
v30 = v26;
do
{
v31 = v29;
v32 = *v29;
v29 += 3;
result = v32;
if ( v15 - (char *)v31 <= 3 )
v29 = &v14[3 - (v15 - (char *)v31)];
*v30 = result;
v30 = v31;
}
while ( v29 != v26 );
*v31 = v27;
}
while ( v26 != v14 );
}
}
}
}
}
switch ( a6 )
{
case 0:
*(_DWORD *)v6 = 33555459;
if ( !a5 || a5 == 2 )
return result;
if ( a5 != 1 )
goto LABEL_73;
if ( !v9 )
return std::string::insert(a2, 0, 1, 32);
return result;
case 1:
*(_BYTE *)v6 = 3;
*(_BYTE *)(v6 + 3) = 2;
if ( a5 == 2 )
{
v35 = 1025;
goto LABEL_97;
}
if ( a5 == 1 )
{
v36 = 4;
goto LABEL_94;
}
if ( a5 )
goto LABEL_73;
*(_WORD *)(v6 + 1) = 4;
return result;
case 2:
*(_BYTE *)v6 = 4;
*(_BYTE *)(v6 + 3) = 3;
if ( a5 == 2 )
goto LABEL_77;
if ( a5 == 1 )
{
if ( !v9 )
result = std::string::insert(a2, 0, 1, 32);
}
else if ( a5 )
{
goto LABEL_73;
}
goto LABEL_83;
case 3:
*(_BYTE *)v6 = 4;
*(_BYTE *)(v6 + 3) = 2;
if ( a5 == 2 )
{
v36 = 3;
goto LABEL_94;
}
if ( a5 == 1 )
{
v35 = 769;
goto LABEL_97;
}
if ( a5 )
goto LABEL_73;
*(_WORD *)(v6 + 1) = 768;
return result;
case 4:
*(_BYTE *)v6 = 4;
*(_BYTE *)(v6 + 3) = 3;
if ( a5 == 2 )
{
LABEL_77:
v35 = 258;
LABEL_97:
*(_WORD *)(v6 + 1) = v35;
if ( v9 )
return (__int64)std::string::erase((char *)a2, 0, 1u);
return result;
}
if ( a5 != 1 )
{
if ( a5 )
goto LABEL_73;
LABEL_83:
*(_WORD *)(v6 + 1) = 512;
return result;
}
v36 = 512;
LABEL_94:
*(_WORD *)(v6 + 1) = v36;
if ( v9 )
return result;
break;
default:
goto LABEL_73;
}
return std::string::insert(a2, 0, 1, 32);
}
return result;
}