//
// sub_CD22E from 0xcd22e to 0xcd2b4 (134 bytes)
//
// 2 xrefs:
// > sub_CA3B8 @ 0xca56e
// > sub_CD2B4 @ 0xcd3aa
//
// 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:56 +0000
//
int __fastcall sub_CD22E(int *a1)
{
__int64 v1; // r4
float v2; // s0
int result; // r0
int v4; // r6
int v5; // r1
int v6; // r3
bool v7; // cc
int v8; // r1
v1 = *(_QWORD *)a1;
v2 = pow((float)a1[1], (float)(1.0 / (float)*a1));
for ( result = (int)floorf(v2); ; result += v8 )
{
v4 = 0;
v5 = 1;
v6 = 1;
while ( v4 < (int)v1 )
{
v6 *= result + 1;
++v4;
v5 *= result;
}
if ( v5 <= SHIDWORD(v1) && v6 > SHIDWORD(v1) )
break;
v7 = v5 <= SHIDWORD(v1);
v8 = 1;
if ( !v7 )
v8 = -1;
}
return result;
}