//
// sub_CFE62 from 0xcfe62 to 0xcfeb4 (82 bytes)
//
// 2 xrefs:
// > sub_CFBA4 @ 0xcfd9c
// > sub_D02AC @ 0xd03ca
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
int __fastcall sub_CFE62(signed int a1, int a2)
{
int result; // r0
int v5; // r6
int v6; // r1
int v7; // r3
bool v8; // cc
int v9; // r1
for ( result = a1 >> ((sub_CFB94(a1) - 1) * (a2 - 1) / a2); ; result += v9 )
{
v5 = 0;
v6 = 1;
v7 = 1;
while ( v5 < a2 )
{
v7 *= result + 1;
++v5;
v6 *= result;
}
if ( v6 <= a1 && v7 > a1 )
break;
v8 = v6 <= a1;
v9 = 1;
if ( !v8 )
v9 = -1;
}
return result;
}