//
// GauntletSprite::addLockedSprite from 0x1402fd2d0 to 0x1402fd61d (845 bytes)
//
// 2 xrefs:
// > GauntletSprite::toggleLockedSprite @ 0x1402fd6f8
// > ??> @ 0x14091e3bc
//
// 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:30:06 +0000
//
// Hidden C++ exception states: #wind=2
void __fastcall GauntletSprite::addLockedSprite(unsigned int *a1)
{
_QWORD *v2; // rdx
size_t v3; // r8
cocos2d::CCSprite *v4; // r14
void *v5; // r8
float v6; // xmm2_4
float *v7; // rbx
__int64 v8; // rdi
__int64 v9; // rax
__int64 v10; // rax
struct cocos2d::CCSprite *v11; // rsi
float *v12; // rbx
__int64 v13; // rdi
__int64 v14; // rax
__int64 v15; // rax
__int16 v16; // [rsp+30h] [rbp-88h] BYREF
char v17; // [rsp+32h] [rbp-86h]
_BYTE v18[12]; // [rsp+34h] [rbp-84h] BYREF
void *Block[2]; // [rsp+40h] [rbp-78h] BYREF
__m128i si128; // [rsp+50h] [rbp-68h]
_QWORD v21[4]; // [rsp+60h] [rbp-58h] BYREF
GauntletNode::frameForType(v21, a1[80]);
v2 = v21;
if ( v21[3] > 0xFu )
v2 = (_QWORD *)v21[0];
*(_OWORD *)Block = 0;
si128 = 0;
v3 = -1;
do
++v3;
while ( *((_BYTE *)v2 + v3) );
sub_14003D230(Block, v2, v3);
v4 = CCSpriteGrayscale::createWithSpriteFrameName((__int64)Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v5 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v5 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v5 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v5);
}
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
v16 = -256;
v17 = -1;
(**((void (__fastcall ***)(__int64, __int16 *))v4 + 40))((__int64)v4 + 320, &v16);
(*(void (__fastcall **)(unsigned int *, cocos2d::CCSprite *))(*(_QWORD *)a1 + 464LL))(a1, v4);
switch ( a1[80] )
{
case 1u:
v6 = 1.1;
break;
case 2u:
case 6u:
v6 = 0.89999998;
break;
case 4u:
v6 = 1.6;
break;
case 5u:
v6 = 1.3;
break;
case 7u:
v6 = 1.5;
break;
case 0xCu:
case 0x3Du:
v6 = 0.80000001;
break;
default:
v6 = 1.0;
break;
}
*((float *)v4 + 151) = v6 * 0.20999999;
*((float *)v4 + 152) = v6 * 0.72000003;
*((float *)v4 + 153) = v6 * 0.07;
v7 = (float *)(*(__int64 (__fastcall **)(unsigned int *))(*(_QWORD *)a1 + 320LL))(a1);
v8 = *(_QWORD *)v4;
v9 = (*(__int64 (__fastcall **)(unsigned int *))(*(_QWORD *)a1 + 320LL))(a1);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v18, *v7 * 0.5, *(float *)(v9 + 4) * 0.5);
(*(void (__fastcall **)(cocos2d::CCSprite *, __int64))(v8 + 184))(v4, v10);
v16 = -7711;
v17 = -31;
(**((void (__fastcall ***)(__int64, __int16 *))v4 + 40))((__int64)v4 + 320, &v16);
v11 = cocos2d::CCSprite::createWithSpriteFrameName("gauntletLock_001.png");
(*(void (__fastcall **)(cocos2d::CCSprite *, struct cocos2d::CCSprite *, __int64))(*(_QWORD *)v4 + 456LL))(v4, v11, 1);
v12 = (float *)(*(__int64 (__fastcall **)(cocos2d::CCSprite *))(*(_QWORD *)v4 + 320LL))(v4);
v13 = *(_QWORD *)v11;
v14 = (*(__int64 (__fastcall **)(cocos2d::CCSprite *))(*(_QWORD *)v4 + 320LL))(v4);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v18, *v12 * 0.5, *(float *)(v14 + 4) * 0.5);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(v13 + 184))(v11, v15);
sub_14003D310((__int64)v21);
}