//
// GJBaseGameLayer::generatePickupAnimRandVal from 0x1001069d0 to 0x100106d26 (854 bytes)
//
// 1 xrefs:
// > GameObject::playDestroyObjectAnim @ 0x100249445
//
// 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:21:32 +0000
//
void __fastcall GJBaseGameLayer::generatePickupAnimRandVal(__int64 a1, __int64 a2, _DWORD *a3, _DWORD *a4)
{
float *v5; // r13
__int64 v6; // rax
int v7; // ebx
__int64 v8; // rdx
_QWORD *v9; // r13
_QWORD *v10; // rax
__int64 *v11; // rcx
int v12; // eax
int v13; // eax
float v14; // xmm1_4
_QWORD *v15; // r14
_QWORD *v16; // r12
_QWORD *v17; // rcx
__int64 v18; // rax
_QWORD *v19; // r14
__int64 *v20; // r12
__int64 v21; // rcx
__int64 v22; // r15
__int64 v23; // rax
_DWORD *v24; // r14
_QWORD *v25; // r15
_QWORD *v26; // rbx
__int64 v27; // r12
__int64 v28; // rax
_QWORD *v30; // [rsp+10h] [rbp-60h]
_DWORD *v31; // [rsp+18h] [rbp-58h]
__int64 v32; // [rsp+30h] [rbp-40h]
__int64 v33; // [rsp+38h] [rbp-38h]
float v34; // [rsp+40h] [rbp-30h]
__int64 *v35; // [rsp+40h] [rbp-30h]
v5 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2);
v6 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 192LL))(a2);
v7 = (int)*v5;
v8 = (unsigned int)(int)*(float *)(v6 + 4);
v9 = (_QWORD *)(a1 + 12120);
v10 = *(_QWORD **)(a1 + 12120);
v33 = (unsigned int)v7;
v32 = v8;
v31 = a4;
if ( v10 )
{
v11 = *(__int64 **)(a1 + 12120);
do
{
if ( *((_DWORD *)v11 + 7) <= v7 )
{
if ( *((_DWORD *)v11 + 7) >= v7 )
{
if ( *((_DWORD *)v11 + 8) > (int)v8 )
goto LABEL_4;
if ( *((_DWORD *)v11 + 8) >= (int)v8 )
goto LABEL_23;
}
++v11;
}
LABEL_4:
v11 = (__int64 *)*v11;
}
while ( v11 );
}
v12 = rand();
v34 = (float)((float)((float)v12 * 4.6566129e-10) + (float)((float)v12 * 4.6566129e-10)) + -1.0;
v13 = rand();
v8 = v32;
v14 = (float)v13 * 4.6566129e-10;
v10 = (_QWORD *)*v9;
v15 = (_QWORD *)(a1 + 12120);
v16 = (_QWORD *)(a1 + 12120);
if ( *v9 )
{
v17 = (_QWORD *)*v9;
while ( 1 )
{
v16 = v17;
if ( *((_DWORD *)v17 + 7) > v7 )
goto LABEL_12;
if ( *((_DWORD *)v17 + 7) < v7 )
{
LABEL_17:
v17 = (_QWORD *)v17[1];
if ( !v17 )
{
v15 = v16 + 1;
break;
}
}
else
{
if ( *((_DWORD *)v17 + 8) <= (int)v32 )
{
if ( *((_DWORD *)v17 + 8) >= (int)v32 )
goto LABEL_22;
goto LABEL_17;
}
LABEL_12:
v17 = (_QWORD *)*v17;
v15 = v16;
if ( !*v16 )
break;
}
}
}
v30 = v16;
v16 = operator new(0x30u);
*(_QWORD *)((char *)v16 + 28) = (unsigned int)v7 + (v32 << 32);
*(_QWORD *)((char *)v16 + 36) = 0;
*(_OWORD *)v16 = 0;
v16[2] = v30;
*v15 = v16;
v18 = **(_QWORD **)(a1 + 12112);
if ( v18 )
*(_QWORD *)(a1 + 12112) = v18;
sub_10001B680(*(__int64 **)(a1 + 12120), v16);
++*(_QWORD *)(a1 + 12128);
v10 = *(_QWORD **)(a1 + 12120);
v8 = v32;
LABEL_22:
*((float *)v16 + 9) = v34;
*((float *)v16 + 10) = v14;
v19 = (_QWORD *)(a1 + 12120);
v20 = (__int64 *)(a1 + 12120);
if ( !v10 )
{
LABEL_31:
v35 = v20;
v22 = v8;
v20 = (__int64 *)operator new(0x30u);
*(__int64 *)((char *)v20 + 28) = (unsigned int)v7 + (v22 << 32);
*(__int64 *)((char *)v20 + 36) = 0;
*(_OWORD *)v20 = 0;
v20[2] = (__int64)v35;
*v19 = v20;
v23 = **(_QWORD **)(a1 + 12112);
if ( v23 )
*(_QWORD *)(a1 + 12112) = v23;
sub_10001B680(*(__int64 **)(a1 + 12120), v20);
++*(_QWORD *)(a1 + 12128);
v10 = *(_QWORD **)(a1 + 12120);
v24 = v31;
v8 = v32;
goto LABEL_34;
}
LABEL_23:
v21 = (__int64)v10;
while ( 1 )
{
while ( 1 )
{
v20 = (__int64 *)v21;
if ( *(_DWORD *)(v21 + 28) <= v7 )
break;
LABEL_24:
v21 = *(_QWORD *)v21;
v19 = v20;
if ( !*v20 )
goto LABEL_31;
}
if ( *(_DWORD *)(v21 + 28) >= v7 )
break;
LABEL_29:
v21 = *(_QWORD *)(v21 + 8);
if ( !v21 )
{
v19 = v20 + 1;
goto LABEL_31;
}
}
if ( *(_DWORD *)(v21 + 32) > (int)v8 )
goto LABEL_24;
if ( *(_DWORD *)(v21 + 32) < (int)v8 )
goto LABEL_29;
v24 = v31;
LABEL_34:
*a3 = *((_DWORD *)v20 + 9);
v25 = (_QWORD *)(a1 + 12120);
LABEL_36:
if ( v10 )
{
do
{
v25 = v10;
if ( *((_DWORD *)v10 + 7) > v7 )
{
LABEL_35:
v10 = (_QWORD *)*v10;
v9 = v25;
goto LABEL_36;
}
if ( *((_DWORD *)v10 + 7) >= v7 )
{
if ( *((_DWORD *)v10 + 8) > (int)v8 )
goto LABEL_35;
if ( *((_DWORD *)v10 + 8) >= (int)v8 )
goto LABEL_46;
}
v10 = (_QWORD *)v10[1];
}
while ( v10 );
v9 = v25 + 1;
}
v26 = v25;
v27 = v8;
v25 = operator new(0x30u);
*(_QWORD *)((char *)v25 + 28) = (v27 << 32) | v33;
*(_QWORD *)((char *)v25 + 36) = 0;
*(_OWORD *)v25 = 0;
v25[2] = v26;
*v9 = v25;
v28 = **(_QWORD **)(a1 + 12112);
if ( v28 )
*(_QWORD *)(a1 + 12112) = v28;
sub_10001B680(*(__int64 **)(a1 + 12120), v25);
++*(_QWORD *)(a1 + 12128);
LABEL_46:
*v24 = *((_DWORD *)v25 + 10);
}