//
// sub_1406679A0 from 0x1406679a0 to 0x140667ae6 (326 bytes)
//
// 2 xrefs:
// > sub_1406661A0 @ 0x1406664c8
// > ??> @ 0x140931e50
//
// 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:35:51 +0000
//
// Hidden C++ exception states: #wind=2
__int64 *__fastcall sub_1406679A0(__int64 *a1, int a2, int a3, int a4)
{
__int64 v5; // rbp
unsigned __int64 v7; // rsi
unsigned __int64 v8; // r15
__int64 v9; // r8
__int64 v10; // rbx
__int64 v11; // r8
__int64 v12; // rbx
v5 = a2;
v7 = 0;
*a1 = 0;
a1[1] = 0;
a1[2] = 0;
a1[3] = 0;
a1[4] = 0;
a1[5] = 0;
sub_140668E10(a1, a3 + 1);
sub_140668E10(a1 + 3, a4 + 1);
v8 = 0;
v9 = *a1;
if ( (a1[1] - *a1) / 24 )
{
v10 = 0;
do
{
sub_140668F10(v10 + v9, v5);
++v8;
v10 += 24;
v9 = *a1;
}
while ( v8 < (a1[1] - *a1) / 24 );
}
v11 = a1[3];
if ( (a1[4] - v11) / 24 )
{
v12 = 0;
do
{
sub_140668F10(v12 + v11, v5);
++v7;
v12 += 24;
v11 = a1[3];
}
while ( v7 < (a1[4] - v11) / 24 );
}
return a1;
}