// // sub_18004D180 from 0x18004d180 to 0x18004d3e6 (614 bytes) // // 2 xrefs: // > @ 0x180166de0 // > @ 0x1801f8730 // // 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:16 +0000 // int *__fastcall sub_18004D180(__int64 a1, __int64 a2, int *a3) { int *v5; // rax __int64 v6; // r12 int *v7; // rdi int v8; // eax int v9; // eax int v11; // eax int v12; // r14d int v13; // eax int v14; // ecx int *v15; // rsi int v16; // r15d unsigned int v17; // eax unsigned int v18; // edx int v19; // eax int v20; // ebx int v21; // ecx unsigned int v22; // edx unsigned int v23; // r8d int v24; // eax int v25; // ecx int v26; // ebx int *v27; // rsi int v28; // eax int *i; // rbx int v30; // eax int v31; // eax v5 = (int *)sub_180033C30(a1, 1, 3208); v6 = *(_QWORD *)(a2 + 32); v7 = v5; if ( !v5 ) return nullptr; memset(v5, 0, 0xC88u); v8 = sub_180048210(a3, 1u); if ( v8 < 0 ) goto LABEL_5; if ( v8 ) { v9 = sub_180048210(a3, 4u) + 1; *v7 = v9; if ( v9 <= 0 ) goto LABEL_5; } else { *v7 = 1; } v11 = sub_180048210(a3, 1u); if ( v11 < 0 ) goto LABEL_5; v12 = 0; if ( v11 ) { v13 = sub_180048210(a3, 8u) + 1; v7[289] = v13; if ( v13 > 0 ) { v14 = *(_DWORD *)(a2 + 4); v15 = v7 + 546; v16 = 0; while ( 1 ) { v17 = v14 - 1; v18 = 0; if ( !v14 ) v17 = 0; for ( ; v17; v17 >>= 1 ) ++v18; v19 = sub_180048210(a3, v18); *(v15 - 256) = v19; v20 = v19; v21 = *(_DWORD *)(a2 + 4); v22 = 0; v23 = v21 - 1; if ( !v21 ) v23 = 0; for ( ; v23; v23 >>= 1 ) ++v22; v24 = sub_180048210(a3, v22); *v15 = v24; if ( v20 < 0 ) break; if ( v24 < 0 ) break; if ( v20 == v24 ) break; v14 = *(_DWORD *)(a2 + 4); if ( v20 >= v14 || v24 >= v14 ) break; ++v16; ++v15; if ( v16 >= v7[289] ) goto LABEL_26; } } goto LABEL_5; } LABEL_26: if ( (unsigned int)sub_180048210(a3, 2u) ) { LABEL_5: memset(v7, 0, 0xC88u); sub_180033C90(a1, (__int64)v7); return nullptr; } v25 = *v7; if ( *v7 > 1 ) { v26 = 0; if ( *(int *)(a2 + 4) > 0 ) { v27 = v7 + 1; do { v28 = sub_180048210(a3, 4u); *v27 = v28; v25 = *v7; if ( v28 >= *v7 || v28 < 0 ) goto LABEL_5; ++v26; ++v27; } while ( v26 < *(_DWORD *)(a2 + 4) ); } } if ( v25 > 0 ) { for ( i = v7 + 273; ; ++i ) { sub_180048210(a3, 8u); v30 = sub_180048210(a3, 8u); *(i - 16) = v30; if ( v30 >= *(_DWORD *)(v6 + 16) ) break; if ( v30 < 0 ) break; v31 = sub_180048210(a3, 8u); *i = v31; if ( v31 >= *(_DWORD *)(v6 + 20) || v31 < 0 ) break; if ( ++v12 >= *v7 ) return v7; } goto LABEL_5; } return v7; }