//
// sub_14006A6B0 from 0x14006a6b0 to 0x14006a74c (156 bytes)
//
// 54 xrefs:
// > sub_14005E900 @ 0x14005ea2e
// > sub_14005E900 @ 0x14005ea75
// > sub_14005E900 @ 0x14005eabc
// > sub_140065D60 @ 0x140065ff9
// > sub_1400660E0 @ 0x140066263
// > sub_140067F60 @ 0x1400680dc
// > sub_140068190 @ 0x140068305
// > sub_1400688D0 @ 0x140068a8b
// > sub_140068B70 @ 0x140068d0f
// > sub_140069360 @ 0x14006950c
// > sub_14018C8D0 @ 0x14018ca4d
// > sub_14018CB00 @ 0x14018cc7c
// > sub_1402749A0 @ 0x140274b1c
// > sub_1403533B0 @ 0x140353543
// > sub_1403536C0 @ 0x14035387b
// > sub_140358050 @ 0x1403581cc
// > sub_140358280 @ 0x140358400
// > sub_1403584B0 @ 0x14035862c
// > sub_140358760 @ 0x1403588dd
// > sub_140358A00 @ 0x140358b79
// > sub_14035E6C0 @ 0x14035e836
// > GJEffectManager::getLoadedMoveOffset @ 0x14036b0de
// > GJEffectManager::saveToState @ 0x14036e8d9
// > GJEffectManager::saveToState @ 0x14036e9d2
// > GJEffectManager::saveToState @ 0x14036ea59
// > GJEffectManager::saveToState @ 0x14036eb4b
// > GJEffectManager::saveToState @ 0x14036eb92
// > GJEffectManager::loadFromState @ 0x14036ed81
// > GJEffectManager::loadFromState @ 0x14036eeec
// > GJEffectManager::loadFromState @ 0x14036ef73
// > GJEffectManager::loadFromState @ 0x14036f162
// > sub_14036F290 @ 0x14036f428
// > sub_14036F4D0 @ 0x14036f6be
// > sub_1403704E0 @ 0x14037065c
// > sub_140370710 @ 0x1403708b7
// > sub_140370960 @ 0x140370ae5
// > sub_140370B90 @ 0x140370d15
// > sub_140371C00 @ 0x140371d8d
// > sub_140371E40 @ 0x140371fbc
// > sub_140372070 @ 0x1403721ec
// > sub_140372CF0 @ 0x140372e9c
// > sub_140373130 @ 0x14037330c
// > sub_140373340 @ 0x1403734dc
// > sub_140514770 @ 0x140514d4f
// > sub_140514770 @ 0x140515176
// > sub_140514770 @ 0x1405151bd
// > sub_140514770 @ 0x140515439
// > sub_140514770 @ 0x140515569
// > sub_14051C820 @ 0x14051c9cc
// > sub_14051CA00 @ 0x14051cbdc
// > sub_14051CC10 @ 0x14051cdfc
// > sub_14054E8F0 @ 0x14054ea84
// > sub_14054EB30 @ 0x14054ecbd
// > ??> @ 0x140911348
//
// This function is hookable on this platform (idp: pc, 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 11:25:47 +0000
//
unsigned __int64 __fastcall sub_14006A6B0(__int64 a1, __int64 a2)
{
unsigned __int64 v2; // rbx
float v3; // xmm0_4
float v4; // xmm0_4
unsigned __int64 v5; // rax
unsigned __int64 v6; // rcx
unsigned __int64 result; // rax
v2 = *(_QWORD *)(a1 + 56);
if ( a2 < 0 )
v3 = (float)(a2 & 1 | (unsigned int)((unsigned __int64)a2 >> 1))
+ (float)(a2 & 1 | (unsigned int)((unsigned __int64)a2 >> 1));
else
v3 = (float)(int)a2;
v4 = ceilf(v3 / *(float *)a1);
v5 = 0;
if ( v4 >= 9.223372e18 )
{
v4 = v4 - 9.223372e18;
if ( v4 < 9.223372e18 )
v5 = 0x8000000000000000uLL;
}
v6 = v5 + (unsigned int)(int)v4;
result = 8;
if ( v6 > 8 )
result = v6;
if ( v2 >= result )
return v2;
if ( v2 < 0x200 && 8 * v2 >= result )
return 8 * v2;
return result;
}