//
// sub_180083110 from 0x180083110 to 0x180083180 (112 bytes)
//
// 6 xrefs:
// > sub_180083B10 @ 0x180083b39
// > sub_180083B10 @ 0x180083b4b
// > sub_180083B10 @ 0x180083b83
// > sub_180083B10 @ 0x180083b94
// > sub_180088820 @ 0x180088861
// > sub_180088820 @ 0x180088959
//
// 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 11:22:03 +0000
//
void __fastcall sub_180083110(_QWORD *a1, __int64 a2)
{
__int64 v2; // rax
__int64 v3; // r9
__int64 v4; // rdx
__int64 v5; // r8
__int64 *v6; // rax
__int64 v7; // rcx
v2 = *(unsigned __int16 *)(a2 - 2);
v3 = a2 - 4 - *(unsigned __int16 *)(a2 - 4) - 48;
v4 = *(_QWORD *)(v3 + 32);
v5 = v4;
if ( (_WORD)v2 )
v5 = v2;
v6 = a1 + 1;
if ( v3 == *a1 )
{
v4 = *v6;
*(_QWORD *)(v3 + 32) = *v6;
}
*(_QWORD *)(v3 + 40) += v5;
if ( *(_QWORD *)(v3 + 40) == v4 )
{
v7 = *(_QWORD *)(v3 + 24);
if ( v7 )
{
*(_QWORD *)(*(_QWORD *)(v3 + 16) + 24LL) = v7;
*(_QWORD *)(*(_QWORD *)(v3 + 24) + 16LL) = *(_QWORD *)(v3 + 16);
off_1801ACF78(*(void **)(v3 + 8));
}
else
{
*(_QWORD *)(v3 + 40) = 0;
*(_QWORD *)(v3 + 32) = 0;
*v6 = 0;
}
}
}