//
// sub_975C98 from 0x975c98 to 0x975f16 (638 bytes)
//
// 4 xrefs:
// > std::__ndk1::moneypunct_byname::init @ 0x967dcc
// > std::__ndk1::moneypunct_byname::init @ 0x967de6
// > std::__ndk1::moneypunct_byname::init @ 0x96814c
// > std::__ndk1::moneypunct_byname::init @ 0x968166
//
// 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:57 +0000
//
void __fastcall sub_975C98(int a1, int *a2, int a3, int a4, int a5, int a6)
{
int v8; // r6
unsigned int v9; // r1
int v10; // r0
unsigned __int64 v11; // kr00_8
unsigned int v12; // r2
int v13; // r3
int v14; // r2
char v15; // r12
__int16 v16; // r3
int v17; // r0
__int16 v18; // r0
__int16 v19; // r0
__int16 v20; // r0
__int16 v21; // r0
unsigned int v22; // r0
int v23; // r0
int v24; // r0
v8 = 0;
if ( a3 == 1 )
{
v9 = *(unsigned __int8 *)a2;
v10 = a2[1];
if ( (v9 & 1) == 0 )
v10 = v9 >> 1;
if ( v10 == 4 )
v8 = 1;
}
if ( a4 == 1 )
{
switch ( a6 )
{
case 0:
v17 = 67109379;
LABEL_26:
*(_DWORD *)a1 = v17;
if ( !a5 || a5 == 2 )
return;
if ( a5 != 1 )
goto LABEL_50;
LABEL_71:
if ( !v8 )
std::string::insert(a2, 0, 1, 32);
return;
case 1:
case 3:
*(_BYTE *)a1 = 3;
*(_BYTE *)(a1 + 3) = 4;
if ( a5 == 2 )
{
v20 = 513;
goto LABEL_61;
}
if ( a5 == 1 )
{
v19 = 2;
goto LABEL_65;
}
if ( a5 )
goto LABEL_50;
*(_WORD *)(a1 + 1) = 2;
return;
case 2:
*(_BYTE *)a1 = 2;
*(_BYTE *)(a1 + 3) = 3;
if ( a5 == 2 )
{
v20 = 260;
goto LABEL_61;
}
if ( a5 == 1 )
{
v19 = 1024;
goto LABEL_65;
}
if ( a5 )
goto LABEL_50;
*(_WORD *)(a1 + 1) = 1024;
return;
case 4:
*(_BYTE *)a1 = 2;
*(_BYTE *)(a1 + 3) = 4;
if ( a5 == 2 )
{
v19 = 768;
LABEL_65:
*(_WORD *)(a1 + 1) = v19;
if ( !v8 )
std::string::push_back(a2, 32);
}
else if ( a5 == 1 )
{
v20 = 259;
LABEL_61:
*(_WORD *)(a1 + 1) = v20;
if ( v8 )
{
v22 = *(unsigned __int8 *)a2;
if ( (v22 & 1) != 0 )
{
v24 = a2[1] - 1;
a2[1] = v24;
*(_BYTE *)(a2[2] + v24) = 0;
}
else
{
v23 = (v22 >> 1) - 1;
*(_BYTE *)a2 = 2 * v23;
*((_BYTE *)a2 + v23 + 1) = 0;
}
}
}
else
{
if ( a5 )
goto LABEL_50;
*(_WORD *)(a1 + 1) = 3;
}
break;
default:
goto LABEL_50;
}
}
else if ( a4 )
{
LABEL_50:
*(_DWORD *)a1 = 67109634;
}
else
{
if ( v8 == 1 )
{
v11 = *(_QWORD *)(a2 + 1);
v12 = *(unsigned __int8 *)a2;
v13 = v12 & 1;
if ( (v12 & 1) == 0 )
v11 = __PAIR64__((unsigned int)a2 + 1, v12 >> 1);
if ( (_DWORD)v11 != 3 )
{
v14 = HIDWORD(v11) + v11;
if ( (_DWORD)v11 == 4 )
{
v15 = *(_BYTE *)(HIDWORD(v11) + 3);
v16 = *(_WORD *)HIDWORD(v11);
*(_BYTE *)(v14 - 1) = *(_BYTE *)(HIDWORD(v11) + 2);
*(_WORD *)(v14 - 3) = v16;
*(_BYTE *)HIDWORD(v11) = v15;
}
else
{
std::__rotate_gcd>(HIDWORD(v11), HIDWORD(v11) + 3, v14, v13);
}
}
}
switch ( a6 )
{
case 0:
v17 = 33555459;
goto LABEL_26;
case 1:
*(_BYTE *)a1 = 3;
*(_BYTE *)(a1 + 3) = 2;
if ( a5 == 2 )
{
v21 = 1025;
goto LABEL_74;
}
if ( a5 == 1 )
{
v18 = 4;
goto LABEL_70;
}
if ( a5 )
goto LABEL_50;
*(_WORD *)(a1 + 1) = 4;
return;
case 2:
*(_BYTE *)a1 = 4;
*(_BYTE *)(a1 + 3) = 3;
if ( a5 == 2 )
goto LABEL_54;
if ( a5 != 1 )
goto LABEL_44;
if ( !v8 )
std::string::insert(a2, 0, 1, 32);
goto LABEL_59;
case 3:
*(_BYTE *)a1 = 4;
*(_BYTE *)(a1 + 3) = 2;
if ( a5 == 2 )
{
v18 = 3;
goto LABEL_70;
}
if ( a5 == 1 )
{
v21 = 769;
goto LABEL_74;
}
if ( a5 )
goto LABEL_50;
*(_WORD *)(a1 + 1) = 768;
return;
case 4:
*(_BYTE *)a1 = 4;
*(_BYTE *)(a1 + 3) = 3;
if ( a5 == 2 )
{
LABEL_54:
v21 = 258;
LABEL_74:
*(_WORD *)(a1 + 1) = v21;
if ( v8 )
std::string::erase((unsigned __int8 *)a2, 0, 1u);
}
else
{
if ( a5 == 1 )
{
v18 = 512;
LABEL_70:
*(_WORD *)(a1 + 1) = v18;
goto LABEL_71;
}
LABEL_44:
if ( a5 )
goto LABEL_50;
LABEL_59:
*(_WORD *)(a1 + 1) = 512;
}
break;
default:
goto LABEL_50;
}
}
}