//
// sub_14006A340 from 0x14006a340 to 0x14006a3f2 (178 bytes)
//
// 12 xrefs:
// > sub_140067D30 @ 0x140067ebd
// > sub_1402A4E90 @ 0x1402a500a
// > sub_140356E00 @ 0x140356f7a
// > sub_1403572D0 @ 0x140357449
// > sub_140357780 @ 0x1403578fc
// > sub_14038D160 @ 0x14038d2f2
// > sub_14038D600 @ 0x14038d7b1
// > sub_140502650 @ 0x1405027e6
// > sub_1405029F0 @ 0x140502b72
// > sub_14051BC90 @ 0x14051be29
// > sub_14054E0F0 @ 0x14054e28a
// > ??> @ 0x140911318
//
// 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
//
__int64 __fastcall sub_14006A340(float *a1)
{
__int64 v1; // rdx
bool v3; // sf
unsigned __int64 v4; // rdx
unsigned __int64 v5; // rbx
float v6; // xmm0_4
float v7; // xmm0_4
unsigned __int64 v8; // rcx
unsigned __int64 v9; // rax
unsigned __int64 v10; // rcx
v1 = *((_QWORD *)a1 + 2);
v3 = v1 + 1 < 0;
v4 = v1 + 1;
v5 = *((_QWORD *)a1 + 7);
if ( v3 )
v6 = (float)(int)(v4 & 1 | (v4 >> 1)) + (float)(int)(v4 & 1 | (v4 >> 1));
else
v6 = (float)(int)v4;
v7 = ceilf(v6 / *a1);
v8 = 0;
if ( v7 >= 9.223372e18 )
{
v7 = v7 - 9.223372e18;
if ( v7 < 9.223372e18 )
v8 = 0x8000000000000000uLL;
}
v9 = v8 + (unsigned int)(int)v7;
v10 = 8;
if ( v9 > 8 )
v10 = v9;
if ( v5 < v10 )
{
if ( v5 >= 0x200 || (v5 *= 8LL, v5 < v10) )
v5 = v10;
}
return sub_14003F310(a1, v5);
}