//
// ThreadViewPopup::scrollToUnreadLine from 0xc66068 to 0xc66180 (280 bytes)
//
// 2 xrefs:
// > ThreadViewPopup::threadMessagesFinished @ 0xc8a68c
// > ??> @ 0x4b148
//
// 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 13:05:25 +0000
//
__int64 __fastcall ThreadViewPopup::scrollToUnreadLine(__int64 this)
{
__int64 v1; // x6
_DWORD *v2; // x5
__int64 v3; // x4
__int64 v4; // x2
_DWORD *v5; // x1
int v6; // t1
float v7; // s2
float v8; // s1
float v9; // s0
float v10; // s0
_BOOL4 v11; // w1
ThreadViewPopup *v12; // x19
if ( *(__int64 *)(this + 960) > 0 )
{
v1 = *(_QWORD *)(this + 824);
if ( v1 )
{
v2 = *(_DWORD **)(this + 696);
v3 = 0x6DB6DB6DB6DB6DB7LL * ((__int64)(*(_QWORD *)(this + 704) - (_QWORD)v2) >> 3);
if ( v3 )
{
v4 = 0;
v5 = v2 + 14;
if ( *v2 == 2 )
{
LABEL_9:
v7 = *(float *)(this + 844);
v8 = *(float *)(v1 + 432) - v7;
v9 = -*((float *)v2 + 2);
if ( v8 <= 0.0 )
v8 = 0.0;
if ( (float)(v9 - v8) < 24.0 )
{
v10 = v9 - (float)(v7 * 0.3);
if ( v8 >= v10 )
v11 = v10 > 0.0;
else
v11 = v8 > 0.0;
if ( v11 )
{
if ( v8 < v10 )
v10 = v8;
}
else
{
v10 = 0.0;
}
v12 = (ThreadViewPopup *)this;
ScrollableContentLayer::scrollTo(*(ScrollableContentLayer **)(this + 824), v10);
return ThreadViewPopup::setUnseenBelow(v12, 1u);
}
}
else
{
while ( 1 )
{
++v4;
v2 = v5;
if ( v4 == v3 )
break;
v6 = *v5;
v5 += 14;
if ( v6 == 2 )
goto LABEL_9;
}
}
}
}
}
return this;
}