//
// HardStreak::updateStroke from 0x1403bfb60 to 0x1403c0552 (2546 bytes)
//
// 13 xrefs:
// > GJBaseGameLayer::update @ 0x140341c1c
// > GJBaseGameLayer::update @ 0x140341c32
// > GJBaseGameLayer::update @ 0x140341ee2
// > GJBaseGameLayer::update @ 0x140341ef8
// > HardStreak::init @ 0x1403bfae8
// > MenuGameLayer::update @ 0x140470cf7
// > MenuGameLayer::resetPlayer @ 0x140471653
// > PlayerObject::createFadeOutDartStreak @ 0x1404f6b3c
// > PlayerObject::activateStreak @ 0x1404fe5ee
// > HardStreak::stopStroke @ 0x1403bfb26
// > MenuGameLayer::init @ 0x1404700d8
// > PlayerObject::createFadeOutDartStreak @ 0x1404f6b41
// > ??> @ 0x140923ffc
//
// 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:31:28 +0000
//
// Hidden C++ exception states: #wind=6
void __fastcall HardStreak::updateStroke(__int64 a1)
{
const struct cocos2d::CCPoint *v2; // rax
__int64 v3; // rbx
__int64 v4; // r12
__int64 v5; // r13
cocos2d::CCPoint *v6; // r14
const struct cocos2d::CCPoint *v7; // rbx
const struct cocos2d::CCPoint *v8; // rsi
cocos2d::CCPoint *v9; // rdi
const struct cocos2d::CCPoint *v10; // rax
__int64 v11; // rax
unsigned int *v12; // rsi
__int64 v13; // rax
unsigned __int64 v14; // rsi
unsigned __int64 v15; // r14
cocos2d::CCPoint *v16; // rdi
__int64 v17; // rax
__int64 v18; // rbx
__int64 v19; // rax
float *v20; // rax
cocos2d::CCPoint *v21; // rax
__int64 v22; // rax
__int64 v23; // rbx
__int64 v24; // rax
const struct cocos2d::CCPoint *v25; // r8
float *v26; // rax
__int64 v27; // r14
__int64 v28; // rsi
__int64 v29; // rdi
char *v30; // rbx
__int64 v31; // rax
unsigned int v32; // r12d
cocos2d::CCPoint *v33; // rdi
__int64 v34; // rbx
char *v35; // rcx
__int64 v36; // rdx
__int64 v37; // rsi
__int64 v38; // rbx
__int64 v39; // rdi
float *v40; // rax
__int64 v41; // rsi
cocos2d::CCPoint *v42; // rdi
__int64 v43; // rbx
int v44; // ecx
int v45; // eax
const struct cocos2d::CCPoint *v46; // rdx
__int64 *v47; // rdx
float v48; // xmm6_4
const struct cocos2d::CCPoint *v49; // r8
bool v50; // bl
int v51; // r13d
unsigned __int8 *v52; // rcx
float v53; // xmm0_4
int v54; // edi
__int64 v55; // rsi
bool Block; // [rsp+38h] [rbp-D0h]
void *Block_8[2]; // [rsp+40h] [rbp-C8h] BYREF
cocos2d::CCPoint *v58; // [rsp+50h] [rbp-B8h]
_BYTE v59[4]; // [rsp+58h] [rbp-B0h] BYREF
int v60; // [rsp+60h] [rbp-A8h] BYREF
_BYTE v61[4]; // [rsp+68h] [rbp-A0h] BYREF
__int64 v62; // [rsp+70h] [rbp-98h] BYREF
__int128 *v63; // [rsp+78h] [rbp-90h] BYREF
char v64[8]; // [rsp+80h] [rbp-88h] BYREF
__int16 v65; // [rsp+88h] [rbp-80h]
__int128 v66; // [rsp+98h] [rbp-70h] BYREF
char *v67; // [rsp+A8h] [rbp-60h]
int v68; // [rsp+B0h] [rbp-58h]
char v69[8]; // [rsp+B8h] [rbp-50h] BYREF
__int128 v70; // [rsp+C0h] [rbp-48h] BYREF
char *v71; // [rsp+D0h] [rbp-38h]
char v72[8]; // [rsp+D8h] [rbp-30h] BYREF
float v73[2]; // [rsp+E0h] [rbp-28h] BYREF
void **v74; // [rsp+E8h] [rbp-20h] BYREF
cocos2d::CCPoint *v75; // [rsp+F0h] [rbp-18h]
__int64 v76; // [rsp+F8h] [rbp-10h]
char v77[8]; // [rsp+100h] [rbp-8h] BYREF
char v78[8]; // [rsp+108h] [rbp+0h] BYREF
char v79[8]; // [rsp+110h] [rbp+8h] BYREF
char v80[8]; // [rsp+118h] [rbp+10h] BYREF
if ( !*(_BYTE *)(a1 + 442) )
return;
cocos2d::CCDrawNode::clear((cocos2d::CCDrawNode *)a1);
if ( !cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 416))
|| !(*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)(a1 + 320) + 32LL))(a1 + 320) )
{
return;
}
v68 = 2 - (*(_BYTE *)(a1 + 440) != 0);
v2 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 200LL))(a1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v72, v2);
*(_OWORD *)Block_8 = 0;
v58 = nullptr;
v3 = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 416)) + 1;
if ( v3 )
{
v4 = ((char *)Block_8[1] - (char *)Block_8[0]) >> 3;
v5 = 8 * v3;
v6 = (cocos2d::CCPoint *)sub_14003D460(8 * v3);
v74 = Block_8;
v75 = v6;
v76 = v3;
v8 = (const struct cocos2d::CCPoint *)Block_8[1];
v7 = (const struct cocos2d::CCPoint *)Block_8[0];
v9 = v6;
if ( Block_8[0] != Block_8[1] )
{
do
{
cocos2d::CCPoint::CCPoint(v9, v7);
v9 = (cocos2d::CCPoint *)((char *)v9 + 8);
v7 = (const struct cocos2d::CCPoint *)((char *)v7 + 8);
}
while ( v7 != v8 );
v7 = (const struct cocos2d::CCPoint *)Block_8[0];
}
if ( v7 )
{
v10 = v7;
if ( ((v58 - v7) & 0xFFFFFFFFFFFFFFF8uLL) >= 0x1000 )
{
v7 = *((const struct cocos2d::CCPoint **)v7 - 1);
if ( (unsigned __int64)(v10 - v7 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v7);
}
Block_8[0] = v6;
Block_8[1] = (char *)v6 + 8 * v4;
v58 = (cocos2d::CCPoint *)((char *)v6 + v5);
}
v11 = *(_QWORD *)(a1 + 416);
if ( v11 )
{
v12 = *(unsigned int **)(v11 + 56);
v13 = *v12;
if ( (_DWORD)v13 )
{
v14 = *((_QWORD *)v12 + 2);
v15 = v14 + 8 * (v13 - 1);
if ( v14 <= v15 )
{
while ( 1 )
{
if ( !*(_QWORD *)v14 )
goto LABEL_25;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v60, (const struct cocos2d::CCPoint *)(*(_QWORD *)v14 + 56LL));
cocos2d::CCPoint::operator-(&v60, v59, v72);
v16 = (cocos2d::CCPoint *)Block_8[1];
if ( Block_8[0] == Block_8[1] )
goto LABEL_21;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v63, (const struct cocos2d::CCPoint *)v59);
v18 = v17;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v62, (cocos2d::CCPoint *)((char *)v16 - 8));
cocos2d::CCPoint::operator-(v19, v64, v18);
if ( (float)((float)(v20[1] * v20[1]) + (float)(*v20 * *v20)) > 0.0099999998 )
break;
LABEL_24:
v14 += 8LL;
if ( v14 > v15 )
goto LABEL_25;
}
v16 = (cocos2d::CCPoint *)Block_8[1];
LABEL_21:
if ( v16 == v58 )
{
sub_1403C0830(Block_8, v16, v59);
}
else
{
cocos2d::CCPoint::CCPoint(v16, (const struct cocos2d::CCPoint *)v59);
Block_8[1] = (char *)Block_8[1] + 8;
}
goto LABEL_24;
}
}
}
LABEL_25:
cocos2d::CCPoint::operator-(a1 + 424, v69, v72);
v21 = (cocos2d::CCPoint *)Block_8[1];
if ( Block_8[0] == Block_8[1] )
goto LABEL_28;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v63, (const struct cocos2d::CCPoint *)v69);
v23 = v22;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v62, (const struct cocos2d::CCPoint *)((char *)Block_8[1] - 8));
cocos2d::CCPoint::operator-(v24, v64, v23);
if ( (float)((float)(v26[1] * v26[1]) + (float)(*v26 * *v26)) > 0.0099999998 )
{
v21 = (cocos2d::CCPoint *)Block_8[1];
LABEL_28:
if ( v21 == v58 )
{
sub_1403C0830(Block_8, v21, v69);
}
else
{
cocos2d::CCPoint::CCPoint(v21, (const struct cocos2d::CCPoint *)v69);
Block_8[1] = (char *)Block_8[1] + 8;
}
}
v27 = ((char *)Block_8[1] - (char *)Block_8[0]) >> 3;
if ( (int)v27 >= 2 )
{
if ( !*(_BYTE *)(a1 + 441) )
{
v28 = (int)v27 - 2;
v29 = (int)v27 - 1;
if ( cocos2d::ccpDistance(
(cocos2d *)((char *)Block_8[0] + 8 * v28),
(const struct cocos2d::CCPoint *)((char *)Block_8[0] + 8 * v29),
v25) > 10.0 )
{
v30 = (char *)Block_8[0] + 8 * v29;
cocos2d::CCPoint::operator-(v30, &v60, (char *)Block_8[0] + 8 * v28);
v31 = cocos2d::ccpNormalize(&v63, &v60);
cocos2d::CCPoint::operator*(v31, v61);
cocos2d::CCPoint::operator-((char *)Block_8[0] + 8 * v29, v59, v61);
cocos2d::CCPoint::operator=(v30, v59);
}
}
v32 = v27 - 1;
v70 = 0;
v71 = nullptr;
if ( (unsigned __int64)((int)v27 - 1) > 0x1FFFFFFFFFFFFFFFLL )
sub_14005A170();
v33 = (cocos2d::CCPoint *)sub_14003D460(8LL * (int)v32);
*(_QWORD *)&v70 = v33;
*((_QWORD *)&v70 + 1) = v33;
v71 = (char *)v33 + 8 * (int)v32;
v63 = &v70;
v34 = (int)v32;
do
{
cocos2d::CCPoint::CCPoint(v33);
v33 = (cocos2d::CCPoint *)((char *)v33 + 8);
--v34;
}
while ( v34 );
*((_QWORD *)&v70 + 1) = v33;
v35 = (char *)Block_8[0];
v36 = 0;
v37 = v32;
while ( 1 )
{
v38 = v36 + v70;
v39 = v36 + 8;
cocos2d::CCPoint::operator-(&v35[v36 + 8], &v60, &v35[v36]);
v40 = (float *)cocos2d::ccpNormalize(&v63, &v60);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v61, -v40[1], *v40);
cocos2d::CCPoint::operator=(v38, v61);
v36 = v39;
if ( !--v37 )
break;
v35 = (char *)Block_8[0];
}
v67 = nullptr;
v66 = 0;
v41 = (int)v27;
if ( (unsigned __int64)(int)v27 > 0x1FFFFFFFFFFFFFFFLL )
sub_14005A170();
v42 = (cocos2d::CCPoint *)sub_14003D460(8LL * (int)v27);
*(_QWORD *)&v66 = v42;
*((_QWORD *)&v66 + 1) = v42;
v67 = (char *)v42 + 8 * (int)v27;
v63 = &v66;
do
{
cocos2d::CCPoint::CCPoint(v42);
v42 = (cocos2d::CCPoint *)((char *)v42 + 8);
--v41;
}
while ( v41 );
*((_QWORD *)&v66 + 1) = v42;
v43 = 0;
do
{
v44 = 0;
if ( (_DWORD)v43 )
v44 = v43 - 1;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v59, (const struct cocos2d::CCPoint *)(v70 + 8LL * v44));
v45 = v27 - 2;
if ( (_DWORD)v43 != v32 )
v45 = v43;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v64, (const struct cocos2d::CCPoint *)(v70 + 8LL * v45));
cocos2d::CCPoint::operator+(v59, &v60, v64);
if ( cocos2d::ccpLength((cocos2d *)&v60, v46) >= 0.001 )
{
cocos2d::CCPoint::operator*(&v60, v61);
cocos2d::CCPoint::operator*(v61, &v62);
v47 = &v62;
}
else
{
v47 = (__int64 *)v59;
}
cocos2d::CCPoint::operator=(v66 + 8 * v43, v47);
v43 = (unsigned int)(v43 + 1);
}
while ( (int)v43 < (int)v27 );
cocos2d::CCPoint::operator-((char *)Block_8[0] + 8 * (int)v32, &v62, (char *)Block_8[0] + 8 * (int)v27 - 16);
cocos2d::ccpNormalize(v73, &v62);
v48 = (float)((float)(fabs(
(float)(v73[1] * *(float *)(v66 + 8LL * (int)v27 - 12))
+ (float)(v73[0] * *(float *)(v66 + 8LL * (int)v27 - 16)))
* 3.0)
* *(float *)(a1 + 432))
* *(float *)(a1 + 436);
v50 = v48 > cocos2d::ccpDistance(
(cocos2d *)((char *)Block_8[0] + 8 * (int)v27 - 16),
(const struct cocos2d::CCPoint *)((char *)Block_8[0] + 8 * (int)v32),
v49);
Block = v50;
v51 = 0;
do
{
if ( v51 )
v52 = (unsigned __int8 *)&unk_1407034C4;
else
v52 = (unsigned __int8 *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)(a1 + 320) + 8LL))(a1 + 320);
v65 = *(_WORD *)v52;
*(float *)&v74 = (float)(unsigned __int8)v65 / 255.0;
*((float *)&v74 + 1) = (float)HIBYTE(v65) / 255.0;
*(float *)&v75 = (float)v52[2] / 255.0;
v53 = (float)(*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)(a1 + 320) + 32LL))(a1 + 320) / 255.0;
if ( v51 )
v53 = v53 * 0.64999998;
*((float *)&v75 + 1) = v53;
v54 = 0;
v55 = 0;
do
{
if ( v50 && v54 == (_DWORD)v27 - 2 )
{
v55 += 8;
}
else
{
cocos2d::CCPoint::operator*(v55 + v66, &v60);
cocos2d::CCPoint::operator*(v55 + 8 + v66, v61);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v77);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v78);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v79);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v80);
cocos2d::CCPoint::operator-((char *)Block_8[0] + v55, &v62, &v60);
cocos2d::CCPoint::operator=(v77, &v62);
cocos2d::CCPoint::operator+((char *)Block_8[0] + v55, v64, &v60);
cocos2d::CCPoint::operator=(v78, v64);
cocos2d::CCPoint::operator+((char *)Block_8[0] + v55 + 8, v59, v61);
cocos2d::CCPoint::operator=(v79, v59);
cocos2d::CCPoint::operator-((char *)Block_8[0] + v55 + 8, &v63, v61);
cocos2d::CCPoint::operator=(v80, &v63);
HardStreak::appendQuad(a1, v77, &v74);
v55 += 8;
v50 = Block;
}
++v54;
}
while ( v54 < (int)v32 );
++v51;
}
while ( v51 < v68 );
sub_14003EA90(&v66);
sub_14003EA90(&v70);
}
sub_14003EA90(Block_8);
}