//
// sub_1401112C0 from 0x1401112c0 to 0x1401113fc (316 bytes)
//
// 5 xrefs:
// > DeathHistogram::setSurvival @ 0x140112adf
// > DeathHistogram::setSurvival @ 0x140112da9
// > ??> @ 0x1408968ac
// > ??> @ 0x1408968bc
// > ??> @ 0x140915df4
//
// 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:26:49 +0000
//
unsigned __int64 __fastcall sub_1401112C0(__int64 *a1, float a2, float *a3, float a4)
{
__int64 v4; // r9
unsigned __int64 v6; // rsi
unsigned __int64 result; // rax
__int64 v10; // r8
__int64 v11; // rdi
float v12; // xmm1_4
__int64 v13; // rcx
float *v14; // rax
char v15; // dl
bool v16; // al
__int64 v17; // rcx
v4 = *a1;
v6 = 0;
result = (unsigned __int64)((unsigned __int128)((a1[1] - *a1) * (__int128)0x2AAAAAAAAAAAAAABLL) >> 64) >> 63;
if ( (a1[1] - *a1) / 24 )
{
v10 = *a1;
v11 = 0;
do
{
v12 = *(float *)(v11 + v4 + 8);
v13 = v11 + v4;
v14 = (float *)(v11 + v4 + 12);
if ( a2 > (float)(v12 - a4) )
{
if ( (float)(a4 + *v14) > a2 )
{
v15 = 1;
goto LABEL_8;
}
v4 = v10;
}
v15 = 0;
LABEL_8:
v16 = a3[1] > v12 && *v14 > *a3 && a3[3] > *(float *)(v13 + 16) && *(float *)(v13 + 20) > a3[2];
if ( v15 || v16 )
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(v11 + v4) + 336LL))(
*(_QWORD *)(v11 + v4),
0,
v10);
v4 = *a1;
++v6;
v17 = a1[1] - *a1;
v11 += 24;
v10 = *a1;
result = (unsigned __int64)((unsigned __int128)(v17 * (__int128)0x2AAAAAAAAAAAAAABLL) >> 64) >> 63;
}
while ( v6 < v17 / 24 );
}
return result;
}