//
// sub_745114 from 0x745114 to 0x7451a6 (146 bytes)
//
// 2 xrefs:
// > ThreadViewPopup::markShareLinks @ 0x74f732
// > ThreadViewPopup::markShareLinks @ 0x74f740
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:58:41 +0000
//
int __fastcall sub_745114(unsigned __int8 *a1, unsigned int a2, _DWORD *a3)
{
unsigned int v3; // r3
unsigned int v4; // r5
int i; // r6
int v6; // r4
int v7; // r7
unsigned int v8; // r4
_DWORD *v9; // r9
unsigned __int8 *v10; // r4
unsigned __int8 v11; // r4
v3 = 0;
v4 = 0;
for ( i = 0; v3 < a2; ++i )
{
v6 = *a1;
v7 = v6 & 1;
v8 = (v6 & 1) != 0 ? *((_DWORD *)a1 + 1) : v6 >> 1;
if ( v3 >= v8 )
break;
if ( v4 < -1431655765 * ((a3[1] - *a3) >> 2) )
{
v9 = (_DWORD *)(*a3 + 12 * v4);
if ( v3 == *v9 )
{
++v4;
v3 += v9[1];
continue;
}
}
if ( v7 )
v10 = *((unsigned __int8 **)a1 + 2);
else
v10 = a1 + 1;
v11 = v10[v3];
if ( (v11 & 0x80) == 0 )
goto LABEL_21;
if ( (v11 & 0xE0) == 0xC0 )
{
v3 += 2;
continue;
}
if ( (v11 & 0xF0) == 0xE0 )
{
v3 += 3;
continue;
}
if ( (v11 & 0xF8) == 0xF0 )
v3 += 4;
else
LABEL_21:
++v3;
}
return i;
}