//
// EmoteSprite::fitToHeight from 0x1009045b0 to 0x100904702 (338 bytes)
//
// 20 xrefs:
// > EditLevelLayer::init @ 0x1001dd7d4
// > GJThreadCell::loadFromThread @ 0x100232da2
// > GJNotificationCell::loadFromNotification @ 0x1002345e5
// > sub_10029AA90 @ 0x10029b22d
// > MultilineBitmapFont::initWithFont @ 0x10047c453
// > ShareCommentLayer::init @ 0x1006b2308
// > EditorSoundConfigCell::loadFromConfig @ 0x1008f2298
// > sub_1008F3770 @ 0x1008f3db0
// > SoundPackDescPopup::init @ 0x1008fa926
// > sub_1008FABC0 @ 0x1008fac7b
// > EmotePickerPopup::addCell @ 0x100903489
// > sub_1009055C0 @ 0x100905974
// > ThreadViewPopup::init @ 0x10092e243
// > ThreadViewPopup::layoutTitleRow @ 0x10092ea77
// > NewThreadPopup::init @ 0x100945637
// > sub_100945920 @ 0x1009459d8
// > sub_10094C500 @ 0x10094cc74
// > ThreadDescPopup::buildUI @ 0x100952d4b
// > sub_1009531B0 @ 0x100953268
// > sub_1009543D0 @ 0x1009547d8
//
// 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:38:04 +0000
//
__int64 __fastcall EmoteSprite::fitToHeight(_QWORD *a1, float a2, float a3)
{
__int64 result; // rax
float v4; // xmm2_4
float v5; // xmm0_4
__int64 v6; // rax
__int64 v7; // rax
__m128 v8; // xmm0
unsigned __int64 *v9; // r14
float v10; // xmm1_4
double v11; // [rsp+0h] [rbp-50h] BYREF
unsigned __int64 v12; // [rsp+8h] [rbp-48h] BYREF
__m128 v13; // [rsp+10h] [rbp-40h]
float v14; // [rsp+2Ch] [rbp-24h]
v14 = a3;
v13.f32[0] = a2;
result = (*(__int64 (__fastcall **)(_QWORD *))(*a1 + 328LL))(a1);
v4 = *(float *)(result + 4);
if ( v4 > 0.0 )
{
v5 = v13.f32[0] / v4;
if ( v14 > 0.0 )
{
v13.f32[0] = v13.f32[0] * v14;
v6 = *a1;
v14 = v5;
if ( v5 > (float)(v13.f32[0] / *(float *)(*(__int64 (__fastcall **)(_QWORD *))(v6 + 328))(a1)) )
v5 = v13.f32[0] / *(float *)(*(__int64 (__fastcall **)(_QWORD *))(*a1 + 328LL))(a1);
}
(*(void (__fastcall **)(_QWORD *, float))(*a1 + 160LL))(a1, v5 * *(float *)(a1[75] + 12LL));
v7 = a1[75];
v8 = (__m128)*(unsigned int *)(v7 + 16);
if ( *(_BYTE *)(v7 + 40) )
v8 = _mm_xor_ps(v8, (__m128)xmmword_100A035F0);
v13 = v8;
v9 = (unsigned __int64 *)(*(__int64 (__fastcall **)(_QWORD *))(*a1 + 192LL))(a1);
v13.f32[0] = (*(float (__fastcall **)(_QWORD *))(*a1 + 168LL))(a1) * v8.f32[0];
v14 = *(float *)(a1[75] + 20LL);
v10 = v14 * (*(float (__fastcall **)(_QWORD *))(*a1 + 168LL))(a1);
sub_100278250((float *)&v12, v13.f32[0], v10);
sub_100278350(&v11, v9, &v12);
return (*(__int64 (__fastcall **)(_QWORD *, double *))(*a1 + 184LL))(a1, &v11);
}
return result;
}