//
// sub_1004B1F70 from 0x1004b1f70 to 0x1004b2027 (183 bytes)
//
// 247 xrefs:
// > ??> @ 0x1008af488
// > ??> @ 0x1008afc80
// > ??> @ 0x1008b2720
// > ??> @ 0x1008b2f18
// > ??> @ 0x1008b5200
// > ??> @ 0x1008b5990
// > ??> @ 0x1008b61b0
// > ??> @ 0x1008b8ab0
// > ??> @ 0x1008b9228
// > ??> @ 0x1008c27c0
// > ??> @ 0x1008d9a30
// > ??> @ 0x1008da2b0
// > ??> @ 0x1008db1a0
// > ??> @ 0x1008db980
// > ??> @ 0x1008dcd28
// > ??> @ 0x1008de1d0
// > ??> @ 0x1008de970
// > ??> @ 0x1008df040
// > ??> @ 0x1008df740
// > ??> @ 0x1008dfed0
// > ??> @ 0x1008e05c0
// > ??> @ 0x1008e18f8
// > ??> @ 0x1008e20c8
// > ??> @ 0x1008e2d48
// > ??> @ 0x1008ec3b0
// > ??> @ 0x1008ecae8
// > ??> @ 0x1008ed258
// > ??> @ 0x1008ed908
// > ??> @ 0x1008ee158
// > ??> @ 0x1008ee968
// > ??> @ 0x1008f16d0
// > ??> @ 0x1008f1d90
// > ??> @ 0x1008f24c0
// > ??> @ 0x1008f2be8
// > ??> @ 0x1008f34d0
// > ??> @ 0x1008f42f8
// > ??> @ 0x1008f6478
// > ??> @ 0x1008f6bf0
// > ??> @ 0x1008f7720
// > ??> @ 0x1008f8528
// > ??> @ 0x1008f8ca0
// > ??> @ 0x1008f93c8
// > ??> @ 0x1008f9a88
// > ??> @ 0x1008fa278
// > ??> @ 0x1008fa968
// > ??> @ 0x1008fb098
// > ??> @ 0x1008fb800
// > ??> @ 0x1008fbf60
// > ??> @ 0x1008fc668
// > ??> @ 0x1008fce88
// > ??> @ 0x1008fd600
// > ??> @ 0x1008fdd78
// > ??> @ 0x1008fe570
// > ??> @ 0x1008fed98
// > ??> @ 0x1008ff588
// > ??> @ 0x1008ffe48
// > ??> @ 0x100900620
// > ??> @ 0x100900d90
// > ??> @ 0x1009014c0
// > ??> @ 0x100901c18
// > ??> @ 0x100902758
// > ??> @ 0x100902f68
// > ??> @ 0x100903760
// > ??> @ 0x100903ec0
// > ??> @ 0x1009049d0
// > ??> @ 0x100905768
// > ??> @ 0x100905f60
// > ??> @ 0x100906758
// > ??> @ 0x100907798
// > ??> @ 0x1009082b0
// > ??> @ 0x100908ab0
// > ??> @ 0x100909228
// > ??> @ 0x10090a820
// > ??> @ 0x10090af28
// > ??> @ 0x10090b660
// > ??> @ 0x10090c830
// > ??> @ 0x10090d3d8
// > ??> @ 0x10090db58
// > ??> @ 0x10090e398
// > ??> @ 0x10090eb90
// > ??> @ 0x100910520
// > ??> @ 0x100910d08
// > ??> @ 0x100911428
// > ??> @ 0x100911c50
// > ??> @ 0x1009128f8
// > ??> @ 0x100913088
// > ??> @ 0x100914348
// > ??> @ 0x100915be8
// > ??> @ 0x100916388
// > ??> @ 0x100916af0
// > ??> @ 0x1009171e0
// > ??> @ 0x1009179b0
// > ??> @ 0x100918128
// > ??> @ 0x100918850
// > ??> @ 0x100919060
// > ??> @ 0x100919710
// > ??> @ 0x100919dd0
// > ??> @ 0x10091a5b8
// > ??> @ 0x10091ad78
// > ??> @ 0x10091b648
// > ??> @ 0x10091cfa0
// > ??> @ 0x10091d6b0
// > ??> @ 0x10091e978
// > ??> @ 0x10091f5a0
// > ??> @ 0x100920d38
// > ??> @ 0x100921530
// > ??> @ 0x100921d28
// > ??> @ 0x1009224d8
// > ??> @ 0x100923268
// > ??> @ 0x1009241b8
// > ??> @ 0x100924d08
// > ??> @ 0x100925460
// > ??> @ 0x100925c58
// > ??> @ 0x100926450
// > ??> @ 0x100927190
// > ??> @ 0x100928930
// > ??> @ 0x1009290e8
// > ??> @ 0x10092d988
// > ??> @ 0x10092e9e8
// > ??> @ 0x10092fbb0
// > ??> @ 0x100930350
// > ??> @ 0x100930ad8
// > ??> @ 0x1009315e0
// > ??> @ 0x100932aa0
// > ??> @ 0x100934b58
// > ??> @ 0x100936c20
// > ??> @ 0x100938808
// > ??> @ 0x100938ff0
// > ??> @ 0x1009396c8
// > ??> @ 0x100939f38
// > ??> @ 0x10093a638
// > ??> @ 0x10093adb8
// > ??> @ 0x100942bf8
// > ??> @ 0x100943408
// > ??> @ 0x1009445d0
// > ??> @ 0x100944d30
// > ??> @ 0x100945530
// > ??> @ 0x100947290
// > ??> @ 0x100947af0
// > ??> @ 0x100948bd0
// > ??> @ 0x1009497d8
// > ??> @ 0x100949e60
// > ??> @ 0x10094abe0
// > ??> @ 0x10094b478
// > ??> @ 0x10094bc70
// > ??> @ 0x10094c488
// > ??> @ 0x10094cd00
// > ??> @ 0x10094d598
// > ??> @ 0x10094dd90
// > ??> @ 0x10094e4d0
// > ??> @ 0x10094f520
// > ??> @ 0x100950060
// > ??> @ 0x1009507a8
// > ??> @ 0x100950e70
// > ??> @ 0x100951cf0
// > ??> @ 0x1009524e8
// > ??> @ 0x100952ce0
// > ??> @ 0x1009534d8
// > ??> @ 0x100953cd8
// > ??> @ 0x100954510
// > ??> @ 0x100954d10
// > ??> @ 0x100955478
// > ??> @ 0x100955bf0
// > ??> @ 0x100956888
// > ??> @ 0x100956fb8
// > ??> @ 0x1009576d0
// > ??> @ 0x100957d88
// > ??> @ 0x100958648
// > ??> @ 0x100959388
// > ??> @ 0x10095a3d8
// > ??> @ 0x10095ab78
// > ??> @ 0x10095b368
// > ??> @ 0x10095bb60
// > ??> @ 0x10095c2e8
// > ??> @ 0x10095ca28
// > ??> @ 0x10095d1b8
// > ??> @ 0x10095db08
// > ??> @ 0x10095e7d8
// > ??> @ 0x100960380
// > ??> @ 0x100963400
// > ??> @ 0x100963ac8
// > ??> @ 0x1009648c0
// > ??> @ 0x100966520
// > ??> @ 0x100966d00
// > ??> @ 0x100967510
// > ??> @ 0x100967d08
// > ??> @ 0x100968500
// > ??> @ 0x100968cf8
// > ??> @ 0x1009694f0
// > ??> @ 0x100969cf0
// > ??> @ 0x10096a520
// > ??> @ 0x10096ad20
// > ??> @ 0x10096b550
// > ??> @ 0x10096bd48
// > ??> @ 0x10096c540
// > ??> @ 0x10096cd38
// > ??> @ 0x10096d530
// > ??> @ 0x10096dd28
// > ??> @ 0x10096e520
// > ??> @ 0x10096ed18
// > ??> @ 0x10096f510
// > ??> @ 0x10096fd08
// > ??> @ 0x100971318
// > ??> @ 0x100973238
// > ??> @ 0x100973900
// > ??> @ 0x100974010
// > ??> @ 0x1009762c0
// > ??> @ 0x100977890
// > ??> @ 0x100978088
// > ??> @ 0x100978818
// > ??> @ 0x100978f90
// > ??> @ 0x10097b440
// > ??> @ 0x10097c8f0
// > ??> @ 0x10097dad8
// > ??> @ 0x10097e218
// > ??> @ 0x10097f9f8
// > ??> @ 0x1009804d8
// > ??> @ 0x100980d08
// > ??> @ 0x1009814a0
// > ??> @ 0x1009830a8
// > ??> @ 0x1009837d8
// > ??> @ 0x100984a48
// > ??> @ 0x100985140
// > ??> @ 0x100986650
// > ??> @ 0x100987270
// > ??> @ 0x1009879e8
// > ??> @ 0x1009881e0
// > ??> @ 0x100988a08
// > ??> @ 0x100989200
// > ??> @ 0x10098a0f0
// > ??> @ 0x10098aff8
// > ??> @ 0x10098bb78
// > ??> @ 0x10098c698
// > ??> @ 0x10098cd88
// > ??> @ 0x10098d898
// > ??> @ 0x10098e090
// > ??> @ 0x10098ed48
// > ??> @ 0x10098f470
// > ??> @ 0x10098fb20
// > ??> @ 0x100990218
// > ??> @ 0x100990918
// > ??> @ 0x100992b88
// > ??> @ 0x1009933c0
// > ??> @ 0x100994478
// > ??> @ 0x100994cd0
// > ??> @ 0x100995398
// > ??> @ 0x100995a58
//
// 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_1004B1F70(_BYTE *a1, int a2)
{
__int64 result; // rax
const void **v3; // r12
unsigned __int64 v4; // r13
result = (unsigned int)(int)((double)(a2 * (unsigned __int8)a1[9]) / 255.0);
a1[8] = result;
if ( a1[16] == 1 )
{
result = *((_QWORD *)a1 - 25);
if ( result )
{
result = *(_QWORD *)(result + 56);
if ( *(_DWORD *)result )
{
v3 = *(const void ***)(result + 16);
v4 = (unsigned __int64)&v3[*(unsigned int *)result - 1];
do
{
if ( !*v3 )
break;
result = (__int64)__dynamic_cast(
*v3,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCObject,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCRGBAProtocol,
-2);
if ( result )
result = (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)result + 104LL))(
result,
(unsigned __int8)a1[8]);
++v3;
}
while ( (unsigned __int64)v3 <= v4 );
}
}
}
return result;
}