//
// ScrollableContentLayer::restoreScrollOffset from 0x140081000 to 0x1400810c6 (198 bytes)
//
// 4 xrefs:
// > DeathHistogram::restoreScroll @ 0x14011495a
// > EditorSoundsLayer::showTab @ 0x14019e505
// > KeybindingsLayer::showTab @ 0x1403d7bd1
// > ??> @ 0x140912068
//
// 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:25:55 +0000
//
char __fastcall ScrollableContentLayer::restoreScrollOffset(__int64 a1, size_t *a2)
{
int *v4; // rsi
size_t v5; // rdx
size_t v6; // r8
size_t v7; // rcx
__int64 i; // r9
__int64 v9; // rax
__int64 v10; // rax
__int64 v11; // rcx
__int64 v13[3]; // [rsp+20h] [rbp-18h] BYREF
v4 = sub_140080E00();
v5 = (size_t)a2;
if ( a2[3] > 0xF )
v5 = *a2;
v6 = a2[2];
v7 = 0;
for ( i = 0xCBF29CE484222325uLL; v7 < v6; i = 0x100000001B3LL * (v9 ^ i) )
v9 = *(unsigned __int8 *)(v5 + v7++);
v10 = sub_140067710(v4, v13, a2, i)[1];
if ( !v10 || v10 == *((_QWORD *)v4 + 1) )
return 0;
*(_DWORD *)(a1 + 436) = *(_DWORD *)(v10 + 48);
*(_DWORD *)(a1 + 476) = 0;
ScrollableContentLayer::clampOffset(a1);
ScrollableContentLayer::applyContentPosition(v11);
return 1;
}