//
// cocos2d::CCLabelBMFont::limitLabelWidth from 0x1006ace70 to 0x1006acf44 (212 bytes)
//
// 306 xrefs:
// > EditorUI::updateGroupIDLabel @ 0x10000acac
// > LevelEditorLayer::updateObjectLabel @ 0x1000bcc2a
// > EditLevelLayer::init @ 0x1001dddad
// > EditLevelLayer::setupLevelInfo @ 0x1001def1c
// > EditLevelLayer::setIDPopupClosed @ 0x1001e1176
// > sub_1001E1180 @ 0x1001e11ed
// > RewardUnlockLayer::playLabelEffect @ 0x100202bb0
// > MessagesProfilePage::init @ 0x100211eb6
// > SetupTriggerPopup::updateEaseLabel @ 0x10022436b
// > SetupTriggerPopup::updateCustomEaseLabel @ 0x10022537b
// > LevelListCell::loadFromList @ 0x10022b62f
// > LevelListCell::loadFromList @ 0x10022b8dd
// > LevelListCell::loadFromList @ 0x10022bfc7
// > LevelListCell::loadFromList @ 0x10022c182
// > LevelListCell::loadFromList @ 0x10022c41e
// > ArtistCell::loadFromObject @ 0x10022cf45
// > URLCell::loadFromObject @ 0x10022d27d
// > CommentCell::loadFromComment @ 0x10022d6ee
// > CommentCell::loadFromComment @ 0x10022e4dc
// > CommentCell::loadFromComment @ 0x10022eda8
// > GJScoreCell::loadFromScore @ 0x10022faf9
// > GJScoreCell::loadFromScore @ 0x10022fb88
// > GJScoreCell::loadFromScore @ 0x100230030
// > GJScoreCell::loadFromScore @ 0x1002301ca
// > GJScoreCell::loadFromScore @ 0x1002303f3
// > GJScoreCell::loadFromScore @ 0x1002305c6
// > GJScoreCell::loadFromScore @ 0x100230791
// > GJScoreCell::loadFromScore @ 0x100230965
// > GJScoreCell::loadFromScore @ 0x100230b56
// > GJLevelScoreCell::loadFromScore @ 0x10023107c
// > GJLevelScoreCell::loadFromScore @ 0x1002311f1
// > GJLevelScoreCell::loadFromScore @ 0x100231447
// > GJLevelScoreCell::loadFromScore @ 0x1002314c8
// > GJLevelScoreCell::loadFromScore @ 0x100231725
// > GJLocalLevelScoreCell::loadFromScore @ 0x1002319e3
// > GJMessageCell::loadFromMessage @ 0x10023224e
// > GJMessageCell::loadFromMessage @ 0x100232559
// > GJThreadCell::loadFromThread @ 0x100232e6b
// > GJThreadCell::loadFromThread @ 0x10023372b
// > GJNotificationCell::loadFromNotification @ 0x10023466f
// > SmartTemplateCell::loadFromObject @ 0x100234f8d
// > LevelCell::loadCustomLevelCell @ 0x1002374fa
// > LevelCell::loadCustomLevelCell @ 0x1002376d3
// > LevelCell::loadCustomLevelCell @ 0x10023852d
// > LevelCell::loadCustomLevelCell @ 0x100238613
// > LevelCell::loadCustomLevelCell @ 0x1002389ee
// > LevelCell::loadCustomLevelCell @ 0x1002396e2
// > LevelCell::loadCustomLevelCell @ 0x100239855
// > LevelCell::loadCustomLevelCell @ 0x100239a04
// > LevelCell::loadCustomLevelCell @ 0x100239d50
// > GJCompactUserCell::buildUserRow @ 0x10023f663
// > ShareLevelSettingsLayer::init @ 0x10026f9a3
// > EditorPauseLayer::customSetup @ 0x10027dad5
// > GJAccountSettingsLayer::createToggleButton @ 0x10028bf29
// > sub_10029BA90 @ 0x10029bb28
// > sub_10029BD30 @ 0x10029be63
// > LevelInfoLayer::init @ 0x1002aa406
// > LevelInfoLayer::init @ 0x1002aa685
// > LevelInfoLayer::init @ 0x1002abf3e
// > LevelInfoLayer::setupPlatformerStats @ 0x1002ade8c
// > LevelInfoLayer::setupPlatformerStats @ 0x1002adf79
// > LevelInfoLayer::setIDPopupClosed @ 0x1002af576
// > sub_1002AF580 @ 0x1002af5f3
// > LevelInfoLayer::updateLabelValues @ 0x1002afc4e
// > LevelInfoLayer::updateLabelValues @ 0x1002afc6d
// > LevelInfoLayer::updateLabelValues @ 0x1002afc8c
// > LevelInfoLayer::updateLabelValues @ 0x1002afcab
// > LevelInfoLayer::updateLabelValues @ 0x1002afcca
// > ColorChannelSprite::updateCopyLabel @ 0x1002c3856
// > TopArtistsLayer::setupPageInfo @ 0x1002fc275
// > TopArtistsLayer::updateLevelsLabel @ 0x1002fc38d
// > CommunityCreditsPage::init @ 0x10030b53f
// > CommunityCreditsPage::init @ 0x10030b968
// > CommunityCreditsPage::init @ 0x10030bab6
// > CommunityCreditsPage::init @ 0x10030bc09
// > LevelListLayer::init @ 0x100347ad5
// > LevelListLayer::init @ 0x100347b61
// > ItemInfoPopup::init @ 0x10035bc9e
// > ItemInfoPopup::init @ 0x10035bda2
// > MenuLayer::init @ 0x10037beb0
// > MenuLayer::updateUserProfileButton @ 0x10037c8d8
// > GauntletLayer::setupGauntlet @ 0x10037e857
// > SecretLayer4::init @ 0x10039a63b
// > sub_10039B120 @ 0x10039b167
// > SecretLayer4::onSubmit @ 0x10039b81d
// > SecretLayer4::onSubmit @ 0x10039b86f
// > SecretLayer4::onSubmit @ 0x10039b94c
// > SecretLayer4::onSubmit @ 0x10039b991
// > SecretLayer4::onSubmit @ 0x10039baed
// > SecretLayer4::onSubmit @ 0x10039bbb5
// > SecretLayer4::onSubmit @ 0x10039bbfa
// > SecretLayer4::onSubmit @ 0x10039bd25
// > SecretLayer4::onSubmit @ 0x10039bd77
// > SecretLayer4::onSubmit @ 0x10039beb4
// > SecretLayer4::onSubmit @ 0x10039bfa6
// > SecretLayer4::onSubmit @ 0x10039c08e
// > WorldLevelPage::init @ 0x1003aedba
// > DialogLayer::init @ 0x1003b0aca
// > PauseLayer::onChangeStartpos @ 0x1003c1c76
// > PauseLayer::createToggleButton @ 0x1003c24f9
// > PauseLayer::setupPlatformerLabels @ 0x1003c2e65
// > PauseLayer::setupPlatformerLabels @ 0x1003c2f29
// > LevelLeaderboard::init @ 0x1003c73a6
// > GJSmartBlockPreview::addCount @ 0x100416180
// > GJSmartBlockPreview::addChance @ 0x100416306
// > SFXBrowser::setupList @ 0x100430c2b
// > sub_100431460 @ 0x100431d6b
// > sub_100431E80 @ 0x100432353
// > CreateParticlePopup::createParticleSlider @ 0x100468383
// > SecretLayer5::init @ 0x10046edd6
// > SecretLayer5::updateMessageLabel @ 0x10046fa87
// > LevelBrowserLayer::updatePageLabel @ 0x1004828ca
// > LevelBrowserLayer::updatePageLabel @ 0x100482930
// > LevelBrowserLayer::setupPageInfo @ 0x100486ed9
// > LevelBrowserLayer::updateLevelsLabel @ 0x100487047
// > NumberInputLayer::updateNumberState @ 0x100489fc3
// > FLAlertLayer::init @ 0x100494539
// > SecretLayer2::init @ 0x10049672b
// > SecretLayer2::updateMessageLabel @ 0x100497067
// > SecretLayer2::onSubmit @ 0x1004977ce
// > SecretLayer2::onSubmit @ 0x100497813
// > SecretLayer2::onSubmit @ 0x10049784f
// > SecretLayer2::onSubmit @ 0x10049798c
// > SecretLayer2::onSubmit @ 0x100497b5b
// > SecretLayer2::onSubmit @ 0x100497c7f
// > SecretLayer2::onSubmit @ 0x100497cd1
// > SecretLayer2::onSubmit @ 0x100497e83
// > SecretLayer2::onSubmit @ 0x100497fbe
// > SecretLayer2::onSubmit @ 0x1004980bb
// > SecretLayer2::onSubmit @ 0x1004981a1
// > SecretLayer2::onSubmit @ 0x100498287
// > SecretLayer2::onSubmit @ 0x10049836d
// > SetupReverbPopup::updateReverbLabel @ 0x1004b14bc
// > SetupCameraRotatePopup::updateEasingLabel @ 0x1004b708f
// > EndLevelLayer::customSetup @ 0x1004b9642
// > EndLevelLayer::customSetup @ 0x1004b9724
// > EndLevelLayer::customSetup @ 0x1004b9ab5
// > EndLevelLayer::playCurrencyEffect @ 0x1004bbc2b
// > EndLevelLayer::playDiamondEffect @ 0x1004bbf8b
// > SetupSmartTemplateLayer::init @ 0x1004e2bc1
// > GameToolbox::createToggleButton @ 0x1004eb7c5
// > RetryLevelLayer::customSetup @ 0x1004f771a
// > sub_1005070C0 @ 0x10050736e
// > GJRateEditorSoundLayer::init @ 0x100509183
// > SetupMGTrigger::updateEasingLabel @ 0x10050b61f
// > ColorSelectLiveOverlay::createToggleButton @ 0x1005971ca
// > GauntletNode::generateNode @ 0x1005a1dd9
// > SetupItemEditTriggerPopup::updateOpButton @ 0x1005ac067
// > SetupItemEditTriggerPopup::updateFormulaLabel @ 0x1005ac9a8
// > SetupItemCompareTriggerPopup::updateFormulaLabel @ 0x1005af13f
// > KeybindCapturePopup::init @ 0x1005b3ef6
// > KeybindCapturePopup::updateConflictLabel @ 0x1005b54a4
// > KeybindCapturePopup::updateConflictLabel @ 0x1005b55f2
// > sub_1005BD820 @ 0x1005bdad6
// > EditorUI::updateDpadStepLabel @ 0x10063b29e
// > GJListLayer::init @ 0x1006a44a0
// > CustomSFXWidget::updateSFXInfo @ 0x1006b7b80
// > CustomSFXWidget::updateSFXInfo @ 0x1006b7ce7
// > CustomSFXWidget::updateSFXInfo @ 0x1006b7d5f
// > CustomSFXWidget::updateSFXInfo @ 0x1006b7dd6
// > CustomSFXWidget::deleteSFX @ 0x1006b81f5
// > CustomSFXWidget::downloadSFXFailed @ 0x1006b8899
// > CustomSFXWidget::updateError @ 0x1006b8941
// > sub_1006B8950 @ 0x1006b89f3
// > sub_1006C4830 @ 0x1006c5540
// > SetupGradientPopup::updateBlendingLabel @ 0x1006c5bd5
// > SetupGradientPopup::onBlending @ 0x1006c5cf9
// > SecretLayer::init @ 0x1006d1f9c
// > SecretLayer::updateMessageLabel @ 0x1006d23c7
// > SecretLayer::onSubmit @ 0x1006d2b73
// > SecretLayer::onSubmit @ 0x1006d2ce4
// > SecretLayer::onSubmit @ 0x1006d2de7
// > SecretLayer::onSubmit @ 0x1006d2ec4
// > SecretLayer::onSubmit @ 0x1006d30e3
// > SongInfoLayer::init @ 0x1006d80c3
// > SongInfoLayer::init @ 0x1006d815c
// > SongInfoLayer::init @ 0x1006d8811
// > SongInfoLayer::init @ 0x1006d8b38
// > CustomSongWidget::updateSongInfo @ 0x1006fa34e
// > CustomSongWidget::updateSongInfo @ 0x1006fa36d
// > CustomSongWidget::updateSongInfo @ 0x1006fa3db
// > CustomSongWidget::updateSongInfo @ 0x1006fa3fa
// > CustomSongWidget::updateSongInfo @ 0x1006fa422
// > CustomSongWidget::updateSongInfo @ 0x1006fa544
// > CustomSongWidget::updateSongInfo @ 0x1006fa5a8
// > CustomSongWidget::updateSongInfo @ 0x1006fa689
// > CustomSongWidget::deleteSong @ 0x1006fafa9
// > CustomSongWidget::updateMultiAssetInfo @ 0x1006fc757
// > CustomSongWidget::loadSongInfoFailed @ 0x1006fcdc0
// > CustomSongWidget::updateError @ 0x1006fcf27
// > CustomSongWidget::downloadSongFinished @ 0x1006fd19c
// > CustomSongWidget::downloadSongFailed @ 0x1006fd547
// > CustomSongWidget::processNextMultiAsset @ 0x1006fd906
// > CustomSongWidget::processNextMultiAsset @ 0x1006fd92d
// > FriendsProfilePage::init @ 0x100734cd4
// > SetupCameraOffsetTrigger::updateEasingLabel @ 0x1007427af
// > ColorSelectPopup::init @ 0x100804ee4
// > FRequestProfilePage::init @ 0x10086f115
// > sub_100871860 @ 0x10087193e
// > VideoOptionsLayer::init @ 0x100880eb7
// > VideoOptionsLayer::createToggleButton @ 0x100881251
// > VideoOptionsLayer::onTextureQualityPrev @ 0x10088136c
// > VideoOptionsLayer::onTextureQualityNext @ 0x1008813ed
// > VideoOptionsLayer::updateTextureQuality @ 0x100881723
// > VideoOptionsLayer::updateResolution @ 0x1008817e0
// > InfoLayer::init @ 0x1008919cb
// > InfoLayer::init @ 0x100891baf
// > sub_100893570 @ 0x100893655
// > ProfilePage::init @ 0x10089ded2
// > ProfilePage::loadPageFromUserInfo @ 0x10089f567
// > ProfilePage::loadPageFromUserInfo @ 0x10089fcc1
// > ProfilePage::loadPageFromUserInfo @ 0x1008a0dfc
// > ProfilePage::loadPageFromUserInfo @ 0x1008a19c3
// > sub_1008B4B80 @ 0x1008b4c52
// > sub_1008B4B80 @ 0x1008b4cf7
// > sub_1008C8B30 @ 0x1008c9355
// > DeathTrackerPopup::init @ 0x1008cad18
// > sub_1008CDF10 @ 0x1008cf445
// > Dropdown::init @ 0x1008d9d91
// > sub_1008DA020 @ 0x1008da0b4
// > Dropdown::refreshValueLabel @ 0x1008da137
// > Dropdown::onRowSelected @ 0x1008da838
// > sub_1008DB580 @ 0x1008db77b
// > sub_1008DCDF0 @ 0x1008dcf8f
// > EditorSFXActionConfigLayer::refreshRows @ 0x1008e01a1
// > sub_1008EF050 @ 0x1008ef812
// > EditorSoundConfigCell::loadFromConfig @ 0x1008f24d0
// > EditorSoundConfigCell::loadFromConfig @ 0x1008f26ff
// > EditorSoundConfigCell::loadFromConfig @ 0x1008f2af6
// > EditorSoundConfigCell::loadFromConfig @ 0x1008f2d0c
// > EditorSoundConfigCell::loadFromConfig @ 0x1008f2f0e
// > EditorSoundConfigCell::loadFromConfig @ 0x1008f304b
// > sub_1008F3270 @ 0x1008f333e
// > sub_1008F3270 @ 0x1008f342f
// > sub_1008F3770 @ 0x1008f3919
// > sub_1008F3770 @ 0x1008f3a67
// > sub_1008F5C20 @ 0x1008f5e14
// > sub_1008FB260 @ 0x1008fb46e
// > sub_1008FB260 @ 0x1008fb526
// > sub_1008FB260 @ 0x1008fb730
// > EditorSoundsLayer::buildContentForTab @ 0x1008fe57e
// > IDNameBrowserPopup::init @ 0x100909c8b
// > IDNameBrowserPopup::init @ 0x100909d52
// > sub_10090A970 @ 0x10090a9fe
// > sub_10090AA30 @ 0x10090aa9d
// > IDNameBrowserPopup::mountVirtualRow @ 0x10090bda8
// > IDNameBrowserPopup::mountVirtualRow @ 0x10090be9c
// > sub_1009147B0 @ 0x10091488e
// > sub_1009147B0 @ 0x1009148e4
// > sub_10092AC30 @ 0x10092acca
// > ThreadViewPopup::init @ 0x10092daed
// > ThreadViewPopup::layoutTitleRow @ 0x10092ec2f
// > sub_10092EDD0 @ 0x10092ee44
// > ThreadViewPopup::buildMemberButton @ 0x10092f445
// > sub_10092FFD0 @ 0x100930495
// > ThreadViewPopup::threadSearchFinished @ 0x1009320f8
// > sub_100934410 @ 0x1009344c0
// > sub_100934410 @ 0x10093460c
// > ThreadViewPopup::threadMessagesFinished @ 0x100934d90
// > ThreadViewPopup::mountVirtualRow @ 0x1009385f3
// > ThreadViewPopup::mountVirtualRow @ 0x100938a69
// > NewThreadPopup::init @ 0x100944763
// > NewThreadPopup::applyMode @ 0x100946c71
// > sub_1009472D0 @ 0x100947514
// > ThreadOptionsPopup::init @ 0x100949764
// > sub_10094C500 @ 0x10094ce44
// > sub_10094C500 @ 0x10094d0c3
// > sub_10094C500 @ 0x10094d23f
// > sub_10094C500 @ 0x10094d2e5
// > sub_1009543D0 @ 0x1009546ac
// > sub_1009543D0 @ 0x1009548b6
// > MusicChangelogPopup::buildContent @ 0x10095813b
// > MusicChangelogPopup::buildContent @ 0x100958231
// > NewsPopup::rebuildPage @ 0x1009594f7
// > NewsPopup::rebuildPage @ 0x1009598a8
// > sub_10095C520 @ 0x10095c675
// > sub_1009645C0 @ 0x10096469e
// > sub_100964B50 @ 0x100964ea6
// > sub_100964B50 @ 0x10096528f
// > sub_100969480 @ 0x1009696b6
// > sub_100969480 @ 0x10096a8c3
// > sub_10096F160 @ 0x10096f304
// > SFXChangelogPopup::buildContent @ 0x10097118c
// > SFXFolderPickerPopup::rebuildList @ 0x10097348b
// > SFXFolderPickerPopup::updateShareHint @ 0x1009738a6
// > sub_100975720 @ 0x100975887
// > sub_100975720 @ 0x1009758e3
// > sub_10097E2F0 @ 0x10097ee3b
// > sub_10097E2F0 @ 0x10097f0c5
// > sub_100980B10 @ 0x100980b8c
// > NotificationsPage::init @ 0x10098b38a
// > sub_10098E530 @ 0x10098e6f1
// > sub_1009948B0 @ 0x100994a5a
// > sub_100995AA0 @ 0x100995b61
// > sub_100998310 @ 0x100999a02
// > sub_100998310 @ 0x100999b8f
// > sub_100998310 @ 0x100999cdf
// > sub_100998310 @ 0x100999e2f
// > sub_100998310 @ 0x10099a5ba
// > AccountReviewPopup::buildReportedRows @ 0x10099c878
// > AccountReviewPopup::buildReportedRows @ 0x10099d457
// > AccountReviewPopup::buildFilterRows @ 0x10099ee28
// > sub_10099F240 @ 0x10099fe50
// > sub_10099F240 @ 0x1009a06b0
// > sub_1009A0F70 @ 0x1009a13f8
// > sub_1009A4C50 @ 0x1009a50fe
//
// 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 12:35:22 +0000
//
__int64 __fastcall cocos2d::CCLabelBMFont::limitLabelWidth(__int64 a1, float a2, __m128 a3, __m128 a4)
{
float *v5; // rax
__m128 v6; // xmm0
__m128 v7; // xmm1
__m128 v8; // xmm4
__m128 v9; // xmm2
__m128 v10; // xmm2
__m128 v11; // xmm3
__m128 v12; // xmm3
__m128 v13; // xmm0
__m128 v14; // xmm4
__m128 v15; // xmm4
__m128 v16; // xmm2
float v21; // [rsp+24h] [rbp-Ch]
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)a1 + 160LL))(a1, 1.0);
v5 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 328LL))(a1);
v6 = (__m128)*(unsigned int *)v5;
v21 = *v5;
*(double *)v6.i64 = (*(double (__fastcall **)(__int64))(*(_QWORD *)a1 + 168LL))(a1);
v7 = (__m128)LODWORD(a2);
v7.f32[0] = a2 / v21;
v8.f32[0] = a2;
v9 = _mm_cmplt_ss((__m128)LODWORD(a2), (__m128)LODWORD(v21));
v10 = _mm_or_ps(_mm_andnot_ps(v9, v6), _mm_and_ps(v7, v9));
v7.i32[0] = 0;
v11 = _mm_cmplt_ss((__m128)0LL, v8);
v12 = _mm_or_ps(_mm_andnot_ps(v11, v6), _mm_and_ps(v10, v11));
v13 = v12;
v13.f32[0] = fminf(v12.f32[0], a3.f32[0]);
v14 = _mm_cmpneq_ss(a3, v7);
v15 = _mm_or_ps(_mm_and_ps(v14, v13), _mm_andnot_ps(v14, v12));
v13.i32[1] = v15.i32[1];
v13.f32[0] = fmaxf(v15.f32[0], a4.f32[0]);
v16 = _mm_cmpneq_ss(a4, v7);
return (*(__int64 (__fastcall **)(__int64, double))(*(_QWORD *)a1 + 160LL))(
a1,
COERCE_DOUBLE(v16.i64[0] & v13.i64[0] | _mm_andnot_ps(v16, v15).u64[0]));
}