//
// sub_CD2674 from 0xcd2674 to 0xcd2804 (400 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall sub_CD2674(unsigned __int64 *a1, __int64 a2, __int64 a3)
{
_QWORD *v6; // x0
__int64 v7; // x2
__int64 v8; // x0
__int64 result; // x0
char v10; // [xsp+48h] [xbp+48h] BYREF
a1[1] = 0;
sub_CD14C0(&v10, a1, 1);
if ( !v10 )
return a1[1];
v6 = *(_QWORD **)((char *)a1 + *(_QWORD *)(*a1 - 24) + 232);
v7 = v6[3] - v6[2];
if ( !v7 )
{
v7 = (*(__int64 (__fastcall **)(_QWORD *))(*v6 + 56LL))(v6);
if ( v7 > 0 )
goto LABEL_4;
goto LABEL_7;
}
if ( v7 <= 0 )
{
LABEL_7:
if ( v7 == -1 )
{
sub_CCE830((__int64)a1 + *(_QWORD *)(*a1 - 24), *(_DWORD *)((char *)a1 + *(_QWORD *)(*a1 - 24) + 32) | 2);
return a1[1];
}
return a1[1];
}
LABEL_4:
if ( v7 > a3 )
v7 = a3;
v8 = *(unsigned __int64 *)((char *)a1 + *(_QWORD *)(*a1 - 24) + 232);
result = (*(__int64 (__fastcall **)(__int64, __int64, __int64))(*(_QWORD *)v8 + 64LL))(v8, a2, v7);
a1[1] = result;
return result;
}