// // randRangeWeighted from 0x5893d4 to 0x5894e0 (268 bytes) // // 1 xrefs: // > @ 0x6a638 // // This function is hookable on this platform! // // Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings // __int64 __fastcall randRangeWeighted(float a1, float a2) { int v2; // w1 unsigned int v3; // w19 float v4; // s8 int v5; // w0 float v6; // s9 int v7; // w0 float v8; // s0 float v9; // s1 float v10; // s4 float v11; // s0 __int64 result; // x0 float v13; // s3 int v14; // w0 v2 = 0; v3 = (int)a1; v4 = (float)(int)a1; v5 = (int)a1; if ( a2 < v4 ) { v14 = rand(); v9 = a2; v8 = a1; if ( a2 < v4 ) return v3; v6 = 1.0 / 0.0; v10 = (float)v14 * 4.6566e-10; } else { do v2 += v5++; while ( (float)v5 <= a2 ); v6 = 1.0 / (float)v2; v7 = rand(); v8 = a1; v9 = a2; v10 = (float)v7 * 4.6566e-10; } v11 = v9 + v8; LODWORD(result) = v3; v13 = (float)((float)(v11 - v4) * v6) + 0.0; if ( v13 < v10 ) { while ( 1 ) { LODWORD(result) = result + 1; if ( v9 < (float)(int)result ) break; v13 = v13 + (float)((float)(v11 - (float)(int)result) * v6); if ( v13 >= v10 ) return (unsigned int)result; } return v3; } return (unsigned int)result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source