//
// EmoteSprite::fitToHeight from 0x1004dc63c to 0x1004dc780 (324 bytes)
//
// 20 xrefs:
// > EditLevelLayer::init @ 0x10010f5e4
// > GJThreadCell::loadFromThread @ 0x10012ff70
// > GJNotificationCell::loadFromNotification @ 0x1001311ec
// > ShareCommentLayer::init @ 0x10026d2c0
// > sub_1002D0568 @ 0x1002d0c3c
// > sub_10037C930 @ 0x10037cfac
// > EditorSoundConfigCell::loadFromConfig @ 0x1004ce770
// > sub_1004CF9C0 @ 0x1004d00a0
// > sub_1004D4894 @ 0x1004d4f10
// > sub_1004D5188 @ 0x1004d5234
// > EmotePickerPopup::addCell @ 0x1004db7c4
// > EmoteSprite::attachToLabel @ 0x1004dd17c
// > ThreadViewPopup::init @ 0x1004f8948
// > ThreadViewPopup::layoutTitleRow @ 0x1004f90cc
// > sub_100508F28 @ 0x10050a028
// > sub_10050A328 @ 0x10050a3d4
// > InvitesPopup::buildRows @ 0x10050f1a4
// > ThreadDescPopup::buildUI @ 0x1005133d8
// > sub_100513850 @ 0x1005138fc
// > sub_100514348 @ 0x1005146fc
//
// 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 11:06:34 +0000
//
__int64 __fastcall EmoteSprite::fitToHeight(_QWORD *a1, float a2, float a3)
{
__int64 result; // x0
float v7; // s0
float v8; // s10
float v9; // s8
__int64 v10; // x8
float v11; // s8
float32x2_t *v12; // x20
float v13; // s8
float v14; // s9
float v15; // s0
double v16; // d0
float32x2_t v17; // [xsp+0h] [xbp-40h] BYREF
float32x2_t v18; // [xsp+8h] [xbp-38h] BYREF
result = (*(__int64 (__fastcall **)(_QWORD *))(*a1 + 328LL))(a1);
v7 = *(float *)(result + 4);
if ( v7 > 0.0 )
{
v8 = a2 / v7;
if ( a3 > 0.0 )
{
v9 = a2 * a3;
if ( v8 > (float)(v9 / *(float *)(*(__int64 (__fastcall **)(_QWORD *))(*a1 + 328LL))(a1)) )
v8 = v9 / *(float *)(*(__int64 (__fastcall **)(_QWORD *))(*a1 + 328LL))(a1);
}
(*(void (__fastcall **)(_QWORD *, float))(*a1 + 160LL))(a1, v8 * *(float *)(a1[75] + 12LL));
v10 = a1[75];
if ( *(_BYTE *)(v10 + 40) )
v11 = -*(float *)(v10 + 16);
else
v11 = *(float *)(v10 + 16);
v12 = (float32x2_t *)(*(__int64 (__fastcall **)(_QWORD *))(*a1 + 192LL))(a1);
v13 = v11 * (*(float (__fastcall **)(_QWORD *))(*a1 + 168LL))(a1);
v14 = *(float *)(a1[75] + 20LL);
v15 = (*(float (__fastcall **)(_QWORD *))(*a1 + 168LL))(a1);
sub_1000262BC((float *)&v17, v13, v14 * v15);
*(float32x2_t *)&v16 = sub_100026318(v12, &v17, &v18);
return (*(__int64 (__fastcall **)(_QWORD *, float32x2_t *, double))(*a1 + 184LL))(a1, &v18, v16);
}
return result;
}