//
// sub_1800500F0 from 0x1800500f0 to 0x18005019f (175 bytes)
//
// 2 xrefs:
// > sub_18004A3A0 @ 0x18004a629
// > ??> @ 0x1801f88f8
//
// 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
//
__int64 __fastcall sub_1800500F0(int *a1)
{
__int64 v1; // rdi
int v2; // ebx
__m128 v3; // xmm0
int v4; // ecx
__int64 result; // rax
int v6; // r10d
int v7; // ecx
int v8; // edx
__int64 v9; // r8
int v10; // eax
v1 = (unsigned int)*a1;
v2 = a1[1];
v3 = (__m128)COERCE_UNSIGNED_INT((float)v2);
v3.m128_f32[0] = powf(v3.m128_f32[0], 1.0 / (float)*a1);
v4 = (int)v3.m128_f32[0];
if ( (int)v3.m128_f32[0] != 0x80000000 && (float)v4 != v3.m128_f32[0] )
v3.m128_f32[0] = (float)(v4 - (_mm_movemask_ps(_mm_unpacklo_ps(v3, v3)) & 1));
for ( result = (unsigned int)(int)v3.m128_f32[0]; ; result = (unsigned int)(v6 + v10) )
{
v6 = result;
v7 = 1;
v8 = 1;
if ( (int)v1 > 0 )
{
v9 = v1;
do
{
v7 *= (_DWORD)result;
v8 *= (_DWORD)result + 1;
--v9;
}
while ( v9 );
}
if ( v7 <= v2 && v8 > v2 )
break;
v10 = -1;
if ( v7 <= v2 )
v10 = 1;
}
return result;
}