//
// ButtonSprite::setString from 0x1000682fc to 0x1000686cc (976 bytes)
//
// 30 xrefs:
// > CustomizeObjectLayer::init @ 0x100056a50
// > CustomizeObjectLayer::init @ 0x100056c20
// > CustomizeObjectLayer::updateCustomColorLabels @ 0x1000583b8
// > CustomizeObjectLayer::textChanged @ 0x100059438
// > ButtonSprite::init_1 @ 0x100068294
// > ButtonSprite::updateBGImage @ 0x100068784
// > sub_10046B7C4 @ 0x10046b818
// > EditorUI::setIDPopupClosed @ 0x10047679c
// > EditorUI::setIDPopupClosed @ 0x100476840
// > EditorUI::onResetSpecialFilter @ 0x100476bbc
// > EditorUI::onResetSpecialFilter @ 0x100476be4
// > sub_1004E0B74 @ 0x1004e0bb8
// > sub_1004FA25C @ 0x1004fa4b4
// > sub_100505178 @ 0x1005051b0
// > sub_100505178 @ 0x100505290
// > sub_1005054E4 @ 0x10050559c
// > sub_100505614 @ 0x100505668
// > sub_100505798 @ 0x100505988
// > LevelPickerPopup::textChanged @ 0x1005062ac
// > sub_10050EB50 @ 0x10050eb90
// > sub_100523640 @ 0x100523678
// > sub_100541E6C @ 0x100541ea4
// > sub_100542A8C @ 0x100543cd4
// > sub_100542A8C @ 0x100543cfc
// > sub_100542A8C @ 0x100543d24
// > sub_100542A8C @ 0x100543d60
// > sub_100544244 @ 0x1005442a0
// > sub_100544244 @ 0x1005442b0
// > sub_100544244 @ 0x1005442c0
// > sub_100544244 @ 0x1005442d0
//
// This function is hookable on this platform (idp: arm, 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 10:57:57 +0000
//
__int64 __fastcall ButtonSprite::setString(__int64 result, const std::string::value_type *a2)
{
__int64 v2; // x29
__int64 v3; // x30
__int64 v4; // d8
__int64 v5; // d9
__int64 v7; // x19
__n128 v8; // q0
float v9; // s8
__int64 v10; // x20
float *v11; // x0
__int64 v12; // x20
float v13; // s8
float v14; // s8
float v15; // s9
float v16; // s8
__int64 v17; // x0
float v18; // s1
__int64 v19; // x20
float v20; // s8
__int64 v21; // x0
__int64 v22; // x20
float v23; // s8
__int64 v24; // x0
__int64 v25; // x20
float v26; // s8
__int64 v27; // x0
const void *v28; // x0
__int64 v29; // x20
__int64 v30; // x0
float v31; // s8
__int64 v32; // x0
__int64 v33; // x20
float v34; // s0
float v35; // [xsp+8h] [xbp-38h] BYREF
__int64 v36; // [xsp+10h] [xbp-30h]
__int64 v37; // [xsp+18h] [xbp-28h]
__int64 v38; // [xsp+30h] [xbp-10h]
__int64 v39; // [xsp+38h] [xbp-8h]
if ( *(_DWORD *)(result + 596) == 1 )
{
v36 = v5;
v37 = v4;
v38 = v2;
v39 = v3;
v7 = result;
(*(void (__fastcall **)(_QWORD, float))(**(_QWORD **)(result + 624) + 160LL))(*(_QWORD *)(result + 624), 1.0);
(*(void (__fastcall **)(_QWORD, const std::string::value_type *))(**(_QWORD **)(v7 + 624) + 928LL))(
*(_QWORD *)(v7 + 624),
a2);
std::string::assign((std::string *)(v7 + 672), a2);
v8.n128_u32[0] = *(_DWORD *)(v7 + 600);
if ( v8.n128_f32[0] > 0.0 )
{
v8.n128_u32[0] = *(_DWORD *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v7 + 624) + 328LL))(*(_QWORD *)(v7 + 624));
v9 = *(float *)(v7 + 600);
if ( v8.n128_f32[0] > v9 )
{
v10 = *(_QWORD *)(v7 + 624);
v11 = (float *)(*(__int64 (__fastcall **)(__int64, float))(*(_QWORD *)v10 + 328LL))(v10, v8.n128_f32[0]);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v10 + 160LL))(v10, v9 / *v11);
}
}
v12 = *(_QWORD *)(v7 + 624);
if ( (*(float (__fastcall **)(__int64, __n128))(*(_QWORD *)v12 + 168LL))(v12, v8) <= *(float *)(v7 + 608) )
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(v7 + 624) + 168LL))(*(_QWORD *)(v7 + 624));
(*(void (__fastcall **)(__int64))(*(_QWORD *)v12 + 160LL))(v12);
if ( *(_BYTE *)(v7 + 620) == 1 )
{
v13 = *(float *)(v7 + 600);
}
else
{
v14 = *(float *)(v7 + 604);
v15 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v7 + 624) + 328LL))(*(_QWORD *)(v7 + 624));
if ( v14 >= (float)(v15
* (*(float (__fastcall **)(_QWORD))(**(_QWORD **)(v7 + 624) + 168LL))(*(_QWORD *)(v7 + 624))) )
{
v13 = *(float *)(v7 + 604);
}
else
{
v16 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v7 + 624) + 328LL))(*(_QWORD *)(v7 + 624));
v13 = v16 * (*(float (__fastcall **)(_QWORD))(**(_QWORD **)(v7 + 624) + 168LL))(*(_QWORD *)(v7 + 624));
}
}
v17 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v7 + 624) + 328LL))(*(_QWORD *)(v7 + 624));
v18 = *(float *)(v7 + 612);
if ( v18 == 0.0 )
v18 = *(float *)(v17 + 4) + 4.0;
v19 = *(_QWORD *)(v7 + 648);
sub_1000262C4(&v35, v13 + 16.0, v18);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v19 + 320LL))(v19, &v35);
v20 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v7 + 648) + 328LL))(*(_QWORD *)(v7 + 648));
v21 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(v7 + 648) + 328LL))(*(_QWORD *)(v7 + 648));
sub_1000262C4(&v35, v20, *(float *)(v21 + 4));
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v7 + 320LL))(v7, &v35);
v22 = *(_QWORD *)(v7 + 624);
v23 = (float)(*(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 328LL))(v7) * 0.5)
+ *(float *)(v7 + 656);
v24 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 328LL))(v7);
sub_1000262BC(&v35, v23, (float)(*(float *)(v24 + 4) * 0.5) + *(float *)(v7 + 660));
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v22 + 184LL))(v22, &v35);
v25 = *(_QWORD *)(v7 + 648);
v26 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 328LL))(v7) * 0.5;
v27 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 328LL))(v7);
sub_1000262BC(&v35, v26, *(float *)(v27 + 4) * 0.5);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v25 + 184LL))(v25, &v35);
if ( (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 512LL))(v7) )
{
v28 = (const void *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 512LL))(v7);
if ( v28 )
{
if ( __dynamic_cast(
v28,
(const struct __class_type_info *)&`typeinfo for'cocos2d::CCNode,
(const struct __class_type_info *)&`typeinfo for'CCMenuItemSpriteExtra,
0) )
{
v29 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 512LL))(v7);
v30 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 328LL))(v7);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v29 + 320LL))(v29, v30);
v31 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 328LL))(v7) * 0.5;
v32 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v7 + 328LL))(v7);
sub_1000262BC(&v35, v31, *(float *)(v32 + 4) * 0.5);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v7 + 184LL))(v7, &v35);
}
}
}
v33 = *(_QWORD *)(v7 + 624);
v34 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v33 + 168LL))(v33);
return (*(__int64 (__fastcall **)(__int64, float))(*(_QWORD *)v33 + 160LL))(v33, v34 * *(float *)(v7 + 616));
}
return result;
}