//
// sub_140122F00 from 0x140122f00 to 0x140123000 (256 bytes)
//
// 5 xrefs:
// > sub_140122D60 @ 0x140122ea6
// > sub_1403CBAC0 @ 0x1403cbcf4
// > ??> @ 0x140897dec
// > ??> @ 0x140897dfc
// > ??> @ 0x14091673c
//
// 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:57 +0000
//
__int64 __fastcall sub_140122F00(_QWORD *a1, __int64 a2, __int64 a3, __int64 a4)
{
_QWORD *v4; // rbx
_QWORD *i; // rdi
_QWORD *v10; // r8
v4 = (_QWORD *)*a1;
if ( *a1 )
{
for ( i = (_QWORD *)a1[1]; v4 != i; v4 += 9 )
{
sub_14003D310((__int64)(v4 + 5));
sub_14003D310((__int64)(v4 + 1));
}
v10 = (_QWORD *)*a1;
if ( (unsigned __int64)(72 * ((a1[2] - *a1) / 72LL)) >= 0x1000 )
{
if ( (unsigned __int64)v10 - *(v10 - 1) - 8 > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
v10 = (_QWORD *)*(v10 - 1);
}
j_j_free(v10);
}
*a1 = a2;
a1[1] = a2 + 72 * a3;
a1[2] = a2 + 72 * a4;
return 9 * a4;
}