//
// ParticleGameObject::applyParticleSettings from 0x100192330 to 0x100192605 (725 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::spawnParticleTrigger @ 0x100106964
// > ParticleGameObject::claimParticle @ 0x100192317
//
// 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:25:54 +0000
//
__int64 __fastcall ParticleGameObject::applyParticleSettings(__int64 a1, __int64 a2, double a3, __m128 a4, __m128 a5)
{
int v6; // eax
__int64 v7; // rax
__int64 result; // rax
__int64 v9; // rax
__int64 v10; // rdi
__m128 *v11; // rax
__int64 v12; // rax
__int64 v13; // rdi
unsigned __int16 *v14; // rax
int v15; // r15d
__m128 v16; // xmm1
unsigned __int8 v17; // al
int v18; // ecx
unsigned int v19; // eax
__m128 v20; // xmm2
signed __int32 v21; // [rsp+10h] [rbp-50h]
__m128 v22; // [rsp+30h] [rbp-30h] BYREF
unsigned __int16 v23; // [rsp+44h] [rbp-1Ch] BYREF
unsigned __int8 v24; // [rsp+46h] [rbp-1Ah]
v6 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 1560LL))(a2);
*(_BYTE *)(a1 + 820) = v6 != 2;
*(_BYTE *)(a1 + 1064) = v6 != 2;
if ( v6 == 2 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 136LL))(a1);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a2 + 128LL))(a2);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 152LL))(a1);
v7 = 144;
}
else
{
*(_QWORD *)&a3 = 1065353216;
v7 = 160;
}
(*(void (__fastcall **)(__int64, double))(*(_QWORD *)a2 + v7))(a2, a3);
if ( *(_BYTE *)(a1 + 1064) )
{
(*(void (__fastcall **)(__int64, double))(*(_QWORD *)a2 + 360LL))(a2, 0.0);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 368LL))(a1);
result = ParticleGameObject::updateParticleAngle(a1, a2);
if ( *(_BYTE *)(a1 + 809) != 1 )
goto LABEL_6;
LABEL_10:
v12 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 944LL))(a1);
v24 = *(_BYTE *)(v12 + 2);
v23 = *(_WORD *)v12;
v13 = *(_QWORD *)(a1 + 888);
if ( v13 )
v14 = (unsigned __int16 *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v13 + 944LL))(v13);
else
v14 = &v23;
v15 = *((unsigned __int8 *)v14 + 2);
v21 = *v14;
a4.f32[0] = (float)v24 / 255.0;
v22 = _mm_movelh_ps(
_mm_div_ps(_mm_cvtepi32_ps(_mm_cvtepu8_epi32(_mm_cvtsi32_si128(v23))), (__m128)xmmword_100A041D0),
_mm_insert_ps(
a4,
(__m128)*(unsigned int *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 1352LL))(a2) + 12),
16));
(*(void (__fastcall **)(__int64, __m128 *))(*(_QWORD *)a2 + 1360LL))(a2, &v22);
v16 = 0;
v16.f32[0] = (float)v15 / 255.0;
v22 = _mm_movelh_ps(
_mm_div_ps(_mm_cvtepi32_ps(_mm_cvtepu8_epi32(v21)), (__m128)xmmword_100A041D0),
_mm_insert_ps(
v16,
(__m128)*(unsigned int *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 1384LL))(a2) + 12),
16));
(*(void (__fastcall **)(__int64, __m128 *))(*(_QWORD *)a2 + 1392LL))(a2, &v22);
v17 = 1;
if ( *(_BYTE *)(a1 + 884) )
return (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a2 + 1280LL))(a2, v17);
goto LABEL_14;
}
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 368LL))(a1);
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a2 + 360LL))(a2);
if ( *(_BYTE *)(a1 + 809) == 1 )
goto LABEL_10;
LABEL_6:
if ( *(_BYTE *)(a1 + 1768) != 1 )
return result;
v9 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 944LL))(a1);
v22.i8[2] = *(_BYTE *)(v9 + 2);
v22.i16[0] = *(_WORD *)v9;
v10 = *(_QWORD *)(a1 + 888);
if ( v10 )
v11 = (__m128 *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v10 + 944LL))(v10);
else
v11 = &v22;
v18 = v11->u8[2];
a5.f32[0] = (float)v22.u8[2] / 255.0;
v19 = v11->u16[0];
*(__m128 *)(a2 + 708) = _mm_movelh_ps(
_mm_div_ps(
_mm_cvtepi32_ps(_mm_cvtepu8_epi32(_mm_cvtsi32_si128(v22.u16[0]))),
(__m128)xmmword_100A041D0),
_mm_blend_ps(a5, (__m128)xmmword_100A03610, 14));
v20 = 0;
v20.f32[0] = (float)v18 / 255.0;
*(__m128 *)(a2 + 724) = _mm_movelh_ps(
_mm_div_ps(
_mm_cvtepi32_ps(_mm_cvtepu8_epi32(_mm_cvtsi32_si128(v19))),
(__m128)xmmword_100A041D0),
_mm_blend_ps(v20, (__m128)xmmword_100A03610, 14));
v17 = 1;
if ( !*(_BYTE *)(a1 + 884) )
LABEL_14:
v17 = *(_BYTE *)(a1 + 885);
return (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a2 + 1280LL))(a2, v17);
}