//
// sub_CFE62 from 0xcfe62 to 0xcfeb4 (82 bytes)
//
// 2 xrefs:
// > sub_CFBA4 @ 0xcfd9c
// > sub_D02AC @ 0xd03ca
//
// 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 11:41:58 +0000
//
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;
}