//
// sub_1001E80F0 from 0x1001e80f0 to 0x1001e82e8 (504 bytes)
//
// 1 xrefs:
// > cocos2d::CCKeyboardDispatcher::dispatchKeyboardMSG @ 0x1001e6538
//
// 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:26:30 +0000
//
__int64 __fastcall sub_1001E80F0(__int64 a1, __int64 *a2, __int64 *a3)
{
unsigned __int64 v3; // r9
unsigned __int64 v4; // r8
unsigned __int64 v5; // r11
__int64 v6; // rbx
__int64 *v7; // rax
__int64 *v8; // r10
unsigned __int64 v9; // rax
unsigned __int64 v10; // rax
__int64 v11; // r14
unsigned __int64 v12; // rax
v3 = a2[1];
v4 = a3[1];
v5 = (0x101010101010101LL
* ((((v3 - ((v3 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v3 - ((v3 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)
+ ((((v3 - ((v3 >> 1) & 0x5555555555555555LL)) & 0x3333333333333333LL)
+ (((v3 - ((v3 >> 1) & 0x5555555555555555LL)) >> 2) & 0x3333333333333333LL)) >> 4))
& 0xF0F0F0F0F0F0F0FLL)) >> 56;
if ( v5 > 1 )
{
if ( v4 >= v3 )
{
if ( (v3 | v4) >> 32 )
v4 %= v3;
else
v4 = (unsigned int)v4 % (unsigned int)v3;
}
}
else
{
v4 &= v3 - 1;
}
v6 = *a2;
v7 = *(__int64 **)(*a2 + 8 * v4);
do
{
v8 = v7;
v7 = (__int64 *)*v7;
}
while ( v7 != a3 );
if ( v8 != a2 + 2 )
{
v9 = v8[1];
if ( (unsigned int)v5 > 1 )
{
if ( v9 >= v3 )
{
if ( !((v3 | v9) >> 32) )
{
if ( (unsigned int)v9 % (unsigned int)v3 == v4 )
goto LABEL_26;
goto LABEL_17;
}
v9 %= v3;
}
if ( v9 == v4 )
goto LABEL_26;
}
else if ( ((v3 - 1) & v9) == v4 )
{
goto LABEL_26;
}
}
LABEL_17:
if ( !*a3 )
goto LABEL_25;
v10 = *(_QWORD *)(*a3 + 8);
if ( (unsigned int)v5 <= 1 )
{
if ( ((v3 - 1) & v10) == v4 )
goto LABEL_26;
LABEL_25:
*(_QWORD *)(v6 + 8 * v4) = 0;
goto LABEL_26;
}
if ( v10 < v3 )
{
LABEL_24:
if ( v10 == v4 )
goto LABEL_26;
goto LABEL_25;
}
if ( (v3 | v10) >> 32 )
{
v10 %= v3;
goto LABEL_24;
}
if ( (unsigned int)v10 % (unsigned int)v3 != v4 )
goto LABEL_25;
LABEL_26:
v11 = *a3;
if ( *a3 )
{
v12 = *(_QWORD *)(v11 + 8);
if ( (unsigned int)v5 <= 1 )
{
v12 &= v3 - 1;
if ( v12 == v4 )
goto LABEL_36;
goto LABEL_35;
}
if ( v12 >= v3 )
{
if ( !((v3 | v12) >> 32) )
{
v12 = (unsigned int)v12 % (unsigned int)v3;
if ( v12 == v4 )
goto LABEL_36;
goto LABEL_35;
}
v12 %= v3;
}
if ( v12 != v4 )
{
LABEL_35:
*(_QWORD *)(v6 + 8 * v12) = v8;
v11 = *a3;
}
}
else
{
v11 = 0;
}
LABEL_36:
*v8 = v11;
*a3 = 0;
--a2[3];
*(_QWORD *)a1 = a3;
*(_QWORD *)(a1 + 8) = a2;
*(_BYTE *)(a1 + 16) = 1;
*(_DWORD *)(a1 + 17) = 0;
*(_DWORD *)(a1 + 20) = 0;
return a1;
}