// // sub_180047910 from 0x180047910 to 0x180047e3c (1324 bytes) // // 2 xrefs: // > sub_1800447A0 @ 0x1800448e0 // > @ 0x1801f828c // // 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 10:53:14 +0000 // __int64 __fastcall sub_180047910(__int64 a1, unsigned int **a2, unsigned __int64 a3, unsigned __int64 a4) { unsigned int *v4; // r11 unsigned __int64 v7; // r13 unsigned __int64 v8; // r9 unsigned int *v9; // rax unsigned int *v10; // r15 unsigned int v11; // edx unsigned int v12; // r8d unsigned int v13; // ecx unsigned int v14; // esi unsigned int v15; // esi unsigned int v16; // esi unsigned __int64 v17; // r10 unsigned __int64 v18; // rdi unsigned __int64 v19; // r14 int v20; // r14d int v21; // r8d __int64 v22; // rax unsigned __int64 v23; // rcx unsigned __int64 v24; // r10 __int64 v25; // rcx __int64 v26; // r10 unsigned __int64 v27; // r8 int v28; // edx unsigned __int64 *v29; // rax unsigned __int64 v30; // rcx __int64 v31; // rcx __int64 v32; // rdx unsigned __int64 v33; // rax unsigned __int64 v34; // rbp unsigned __int64 v35; // r9 unsigned __int64 v36; // r8 int v37; // r12d __int64 v38; // rdi int v39; // eax unsigned int *v40; // rcx unsigned int v41; // ecx unsigned int *v43; // r8 unsigned __int64 v44; // rcx unsigned int (__fastcall *v45)(unsigned int **, unsigned __int64 *, _QWORD); // rax unsigned int v46; // eax unsigned __int64 v47; // rcx unsigned int v48; // eax unsigned __int64 v49; // [rsp+20h] [rbp-68h] BYREF unsigned __int64 v50; // [rsp+28h] [rbp-60h] BYREF unsigned __int64 v51; // [rsp+38h] [rbp-50h] unsigned __int64 v53; // [rsp+A0h] [rbp+18h] BYREF unsigned __int64 v54; // [rsp+A8h] [rbp+20h] v54 = a4; v4 = a2[1]; v7 = *((_QWORD *)v4 + 856); if ( v4[118] ) v8 = *((_QWORD *)v4 + 66); else v8 = 0; v9 = *a2; v10 = v4 + 168; v11 = v4[124]; v12 = v4[127]; if ( !v4[119] ) v10 = nullptr; v13 = v9[1]; v14 = v9[3]; if ( !v13 ) v13 = v4[129]; if ( !v14 ) v14 = v4[130]; if ( v12 ) { v15 = ((v4[126] + v12) >> 1) + 1; } else { if ( v11 == v4[125] && v11 ) v16 = v11 * v13 * v14; else v16 = (v13 * v14) << 12; v15 = (v16 >> 3) + 64; } v17 = v54; v18 = v54; v50 = *((_QWORD *)v4 + 856); if ( v8 ) v18 = v8; v51 = 0; v49 = a3; v19 = 0; if ( v10 ) { v20 = *v10; v53 = 0; v21 = v20 - 1; if ( v20 - 1 >= 0 ) { v22 = *((_QWORD *)v10 + 1) + 24LL * v21; do { v23 = *(_QWORD *)v22; if ( *(_QWORD *)v22 != -1 && *(_DWORD *)(v22 + 16) && (!v8 || v23 < v8) && v23 <= v54 ) break; v22 -= 24; --v21; } while ( v21 >= 0 ); } v24 = v7; if ( v21 < 0 ) { v27 = v53; } else { v25 = *((_QWORD *)v10 + 1); v26 = *(_QWORD *)(v25 + 24LL * v21 + 8); v27 = *(_QWORD *)(v25 + 24LL * v21); v24 = v7 + v26; } v28 = 0; if ( v20 > 0 ) { v29 = *((unsigned __int64 **)v10 + 1); do { v30 = *v29; if ( *v29 != -1 && *((_DWORD *)v29 + 4) && (!v8 || v30 < v8) && v30 > v54 ) break; ++v28; v29 += 3; } while ( v28 < v20 ); } if ( v28 >= v20 ) { v33 = v18; } else { v31 = *((_QWORD *)v10 + 1); v32 = 3LL * v28; v33 = *(_QWORD *)(v31 + 8 * v32); a3 = v7 + *(_QWORD *)(v31 + 8 * v32 + 8); } if ( a3 < v24 ) { v19 = v51; } else { v50 = v24; v19 = v27; v49 = a3; v18 = v33; } v17 = v54; } *((_QWORD *)v4 + 857) = v17; v34 = v18 + 1; if ( v18 != v19 ) v34 = v18; if ( v19 >= v34 ) { LABEL_60: **a2 = 6; return 0; } v35 = v50; v36 = v49; v37 = 1; LABEL_50: if ( v35 > v36 ) goto LABEL_60; v38 = v35 + (unsigned int)(int)((double)((int)v17 - (int)v19) / (double)((int)v34 - (int)v19) * (double)((int)v36 - (int)v35)) - (unsigned __int64)v15; if ( v38 >= (__int64)v36 ) v38 = v36 - 1; if ( v38 < (__int64)v35 ) v38 = v35; if ( (*((unsigned int (__fastcall **)(unsigned int **, __int64, _QWORD))a2[1] + 1))(a2, v38, *((_QWORD *)a2[1] + 13)) ) goto LABEL_60; *((_QWORD *)a2[1] + 58) = 0; a2[1][1026] = 0; v39 = sub_1800419B0(*((_QWORD *)a2[1] + 15)); v40 = *a2; if ( !v39 ) { *v40 = 8; return 0; } *v40 = 2; a2[1][1716] = 0; v41 = **a2; while ( 2 ) { switch ( v41 ) { case 0u: if ( !(unsigned int)sub_180044980(a1, (__int64)a2) ) goto LABEL_60; goto LABEL_66; case 1u: if ( !(unsigned int)sub_180045B60(a1, (__int64)a2) ) goto LABEL_60; goto LABEL_69; case 2u: if ( (unsigned int)sub_180044B90(a1, (__int64)a2) ) goto LABEL_66; goto LABEL_69; case 3u: if ( !(unsigned int)sub_180044E10(a1, a2, &v53, 1) ) goto LABEL_60; if ( (_DWORD)v53 ) goto LABEL_69; LABEL_66: v41 = **a2; if ( v41 > 7 ) goto LABEL_60; continue; case 4u: case 7u: LABEL_69: v43 = a2[1]; if ( v43[1028] ) { v44 = *((_QWORD *)v43 + 533); if ( *((_QWORD *)v43 + 58) && (v44 + v43[1060] < v34 || v37) ) { if ( v44 < v19 ) goto LABEL_60; v45 = *((unsigned int (__fastcall **)(unsigned int **, unsigned __int64 *, _QWORD))v43 + 2); if ( v54 >= v44 ) { v19 = v44 + v43[1060]; if ( !v45 || v45(a2, &v50, *((_QWORD *)v43 + 13)) || !sub_180041B90(*((_QWORD *)a2[1] + 15)) ) goto LABEL_60; v48 = sub_180041A40(*((_DWORD **)a2[1] + 15)); v36 = v49; v35 = v50 - (v48 >> 3); v50 = v35; v47 = v35; } else { v34 = v44 + v43[1060]; if ( !v45 || v45(a2, &v49, *((_QWORD *)v43 + 13)) || !sub_180041B90(*((_QWORD *)a2[1] + 15)) ) goto LABEL_60; v46 = sub_180041A40(*((_DWORD **)a2[1] + 15)); v35 = v50; v36 = v49 - (v46 >> 3); v49 = v36; v47 = v36; } v37 = 0; v15 = 2 * (v47 - v38) / 3 + 16; } else { v35 = v50; if ( v38 == v50 ) goto LABEL_60; v36 = v49; if ( v15 ) v15 *= 2; else v15 = 16; } if ( v19 >= v34 ) goto LABEL_60; LODWORD(v17) = v54; goto LABEL_50; } return 1; default: goto LABEL_60; } } }