//
// sub_10095AE40 from 0x10095ae40 to 0x10095af99 (345 bytes)
//
// 2 xrefs:
// > NewsPopup::newsImageDownloaded @ 0x10095b23e
// > NewsPopup::newsImageFailed @ 0x10095b2fc
//
// 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:43 +0000
//
char __fastcall sub_10095AE40(__int64 a1, int a2, __int64 a3)
{
__int64 v3; // rax
__int64 v4; // rcx
__int64 v5; // r12
int v6; // r13d
const void *v8; // r15
__int64 v9; // r13
size_t v10; // rbx
const void **i; // r12
char *v13; // rdi
unsigned int v14; // eax
size_t v15; // rbx
const void **j; // r12
char *v17; // rdi
unsigned int v18; // eax
if ( a2 < 0 )
return 0;
v3 = *(_QWORD *)(a1 + 680);
if ( (int)(-858993459 * ((unsigned __int64)(*(_QWORD *)(a1 + 688) - v3) >> 4)) <= a2 )
return 0;
v4 = 80LL * (unsigned int)a2;
v5 = *(_QWORD *)(v3 + v4 + 56);
v6 = -1431655765 * ((*(_QWORD *)(v3 + v4 + 64) - v5) >> 5);
if ( v6 <= 0 )
return 0;
v8 = (const void *)(a3 + 1);
v9 = v6 & 0x7FFFFFFF;
if ( (*(_BYTE *)a3 & 1) != 0 )
{
v10 = *(_QWORD *)(a3 + 8);
for ( i = (const void **)(v5 + 48); ; i += 12 )
{
v14 = *((unsigned __int8 *)i - 16);
if ( (v14 & 1) != 0 )
{
if ( *(i - 1) != (const void *)v10 )
goto LABEL_9;
}
else if ( v14 >> 1 != v10 )
{
goto LABEL_9;
}
if ( (v14 & 1) != 0 )
v13 = (char *)*i;
else
v13 = (char *)i - 15;
if ( !memcmp(v13, *(const void **)(a3 + 16), v10) )
return 1;
LABEL_9:
if ( !--v9 )
return 0;
}
}
v15 = *(_BYTE *)a3 >> 1;
for ( j = (const void **)(v5 + 48); ; j += 12 )
{
v18 = *((unsigned __int8 *)j - 16);
if ( (v18 & 1) == 0 )
break;
if ( *(j - 1) == (const void *)v15 )
goto LABEL_24;
LABEL_19:
if ( !--v9 )
return 0;
}
if ( v18 >> 1 != v15 )
goto LABEL_19;
LABEL_24:
if ( (v18 & 1) != 0 )
v17 = (char *)*j;
else
v17 = (char *)j - 15;
if ( memcmp(v17, v8, v15) )
goto LABEL_19;
return 1;
}