//
// sub_10001B894 from 0x10001b894 to 0x10001b970 (220 bytes)
//
// 1 xrefs:
// > sub_10001B650 @ 0x10001b6c8
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// 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 10:57:20 +0000
//
unsigned __int64 __fastcall sub_10001B894(unsigned __int64 result, size_t __n)
{
unsigned __int64 v2; // x19
unsigned __int64 v3; // x20
int8x8_t v4; // x21
uint8x8_t v5; // d0
__int64 v6; // x8
v2 = result;
if ( __n == 1 )
{
v3 = 2;
}
else
{
v3 = __n;
if ( (__n & (__n - 1)) != 0 )
{
result = std::__next_prime(__n);
v3 = result;
}
}
v4 = *(int8x8_t *)(v2 + 8);
if ( v3 > *(_QWORD *)&v4 )
return sub_10001B970(v2, v3);
if ( v3 < *(_QWORD *)&v4 )
{
result = vcvtps_u32_f32((float)*(unsigned __int64 *)(v2 + 24) / *(float *)(v2 + 32));
if ( *(_QWORD *)&v4 < 3u || (v5 = (uint8x8_t)vcnt_s8(v4), v5.i16[0] = vaddlv_u8(v5), v5.u32[0] > 1uLL) )
{
result = std::__next_prime(result);
}
else
{
v6 = 1LL << -(char)__clz(result - 1);
if ( result >= 2 )
result = v6;
}
if ( v3 <= result )
v3 = result;
if ( v3 < *(_QWORD *)&v4 )
return sub_10001B970(v2, v3);
}
return result;
}