//
// canDrawLine from 0x67521c to 0x67533c (288 bytes)
//
// 8 xrefs:
// > processTrace @ 0x6820f0
// > processTrace @ 0x682158
// > processTrace @ 0x682b70
// > processTrace @ 0x682bcc
// > processTrace @ 0x682c90
// > processTrace @ 0x682e9c
// > processTrace @ 0x682f34
// > ??> @ 0xa45e0
//
// 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 canDrawLine(__int64 a1, unsigned int a2, char **a3)
{
unsigned __int64 DrawKey; // x19
char *v4; // x5
unsigned __int64 v5; // x1
_QWORD *v6; // x10
_QWORD *v7; // x8
unsigned __int64 v8; // x9
_QWORD *v9; // x0
__int64 v10; // x7
unsigned __int64 v11; // x6
_QWORD *v12; // x0
__int64 v13; // x0
char **v15; // [xsp+20h] [xbp+20h]
unsigned __int64 v17; // [xsp+28h] [xbp+28h]
DrawKey = makeDrawKey(a1, a2);
v4 = a3[1];
v5 = DrawKey % (unsigned __int64)v4;
v6 = *(_QWORD **)&(*a3)[8 * (DrawKey % (unsigned __int64)v4)];
if ( !v6 )
goto LABEL_13;
v7 = (_QWORD *)*v6;
v8 = *(_QWORD *)(*v6 + 8LL);
if ( !*v6 )
goto LABEL_10;
v9 = (_QWORD *)*v6;
v10 = 0;
v11 = *(_QWORD *)(*v6 + 8LL);
while ( DrawKey == v11 )
{
v9 = (_QWORD *)*v9;
++v10;
if ( !v9 )
goto LABEL_9;
LABEL_6:
v11 = v9[1];
if ( v5 != v11 % (unsigned __int64)v4 )
goto LABEL_9;
}
if ( v10 )
return 0;
v9 = (_QWORD *)*v9;
if ( v9 )
goto LABEL_6;
LABEL_9:
if ( v10 )
return 0;
LABEL_10:
while ( DrawKey != v8 )
{
v12 = (_QWORD *)*v7;
v6 = v7;
v7 = v12;
if ( v12 )
{
v8 = v12[1];
if ( v5 == v8 % (unsigned __int64)v4 )
continue;
}
goto LABEL_13;
}
if ( *v6 )
return 1;
LABEL_13:
v15 = a3;
v17 = DrawKey % (unsigned __int64)v4;
v13 = operator new(0x10u);
*(_QWORD *)v13 = 0;
*(_QWORD *)(v13 + 8) = DrawKey;
std::_Hashtable,std::__detail::_Identity,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits>::_M_insert_unique_node(
v15,
v17,
DrawKey,
(char *)v13);
return 1;
}