//
// sub_140044220 from 0x140044220 to 0x140044464 (580 bytes)
//
// 7 xrefs:
// > sub_140044220 @ 0x1400443ee
// > sub_140044220 @ 0x140044437
// > cocos2d::CCLightning::draw @ 0x140044841
// > cocos2d::CCLightning::draw @ 0x1400448c1
// > ??> @ 0x1406627c8
// > ??> @ 0x1406627d8
// > ??> @ 0x1406c45d8
//
// 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
//
struct cocos2d::CCPoint *__fastcall sub_140044220(
struct cocos2d::CCPoint *a1,
const struct cocos2d::CCPoint *a2,
const struct cocos2d::CCPoint *a3,
int a4,
int a5,
__int64 a6,
__int64 a7,
unsigned int *a8)
{
int v12; // r13d
_DWORD *v13; // rdi
__int64 v14; // rbx
unsigned __int64 v15; // r14
int v16; // ebp
float v17; // xmm0_4
int v18; // ebx
int v19; // eax
unsigned int *v20; // rsi
__int64 v21; // rdi
int v22; // ebx
int v23; // eax
cocos2d::CCPoint v25; // [rsp+40h] [rbp-38h] BYREF
cocos2d::CCPoint v26[6]; // [rsp+48h] [rbp-30h] BYREF
cocos2d::CCPoint v27; // [rsp+80h] [rbp+8h] BYREF
cocos2d::CCPoint::operator+(a2, &v27);
cocos2d::CCPoint::operator*(&v27, a1);
v12 = a5;
if ( a4 >= a5 )
{
v15 = 1103515245 * (1103515245 * a6 + 12345) + 12345;
v16 = a4 / 2;
v17 = ((double)((((unsigned __int64)(1103515245 * a6 + 12345) >> 16) & 0x7FFF) % 0x65) / 100.0 - 0.5) * (double)a4
+ a1->x;
a1->x = v17;
a1->y = ((double)(((v15 >> 16) & 0x7FFF) % 0x65) / 100.0 - 0.5) * (double)a4 + a1->y;
v18 = cocos2d::CCPoint::CCPoint(&v27, a1);
v19 = cocos2d::CCPoint::CCPoint(&v25, a2);
v20 = a8;
v21 = a7;
sub_140044220((unsigned int)v26, v19, v18, v16, v12, v15, a7, (__int64)a8);
v22 = cocos2d::CCPoint::CCPoint(&v27, a1);
v23 = cocos2d::CCPoint::CCPoint(v26, a3);
sub_140044220((unsigned int)&v25, v23, v22, v16, v12, v15, v21, (__int64)v20);
}
else
{
v13 = a8;
v14 = a7;
cocos2d::CCPoint::operator=(a7 + 8LL * *a8, a2);
cocos2d::CCPoint::operator=(v14 + 8LL * (unsigned int)(*v13 + 1), a3);
*v13 += 2;
}
return a1;
}