//
// StartPosLayer::onSelectSpeed from 0x10025e280 to 0x10025e36d (237 bytes)
//
// 1 xrefs:
// > StartPosLayer::addSpeedButtons @ 0x10025d855
//
// 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:27:29 +0000
//
__int64 __fastcall StartPosLayer::onSelectSpeed(__int64 a1, __int64 a2)
{
__int64 v2; // rax
unsigned int v3; // eax
int v4; // r13d
__int64 v5; // rbx
__int64 result; // rax
unsigned int v7; // r14d
__int64 v8; // rcx
_QWORD *v9; // rdi
_DWORD *v10; // rsi
_QWORD *v11; // rax
_DWORD v12[11]; // [rsp+0h] [rbp-2Ch] BYREF
v12[0] = HIDWORD(v2);
if ( a2 )
{
v3 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2);
*(_DWORD *)(a1 + 1028) = v3;
*(_DWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 1016) + 1840LL) + 332LL) = v3;
v4 = 1;
if ( v3 > 4 )
goto LABEL_4;
goto LABEL_3;
}
v3 = *(_DWORD *)(a1 + 1028);
v4 = 1;
if ( v3 <= 4 )
LABEL_3:
v4 = dword_100A06AF0[v3];
LABEL_4:
v5 = *(_QWORD *)(a1 + 1040);
result = sub_1007FEF90(v5);
if ( (_DWORD)result )
{
v7 = 0;
do
{
v11 = (_QWORD *)sub_1007FEFE0(v5, v7);
if ( v4 == v7 )
{
v8 = *v11;
v9 = v11;
v10 = &unk_100A06A06;
}
else
{
memset(v12, 125, 3);
v8 = *v11;
v9 = v11;
v10 = v12;
}
(*(void (__fastcall **)(_QWORD *, _DWORD *))(v8 + 960))(v9, v10);
++v7;
result = sub_1007FEF90(v5);
}
while ( v7 < (unsigned int)result );
}
return result;
}