// // __divdi3 from 0xdcbbc to 0xdcd38 (380 bytes) // // 4 xrefs: // > j___divdi3 @ 0xe3578 // > @ 0x258c // > j___divdi3 @ 0xe3578 // > @ 0xe72c8 // // This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False! // // 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 11:42:06 +0000 // __int64 __fastcall _divdi3(__int64 a1, __int64 a2) { __int64 v2; // kr08_8 unsigned int v3; // r6 unsigned int v4; // r8 int v5; // r7 bool v6; // cc unsigned __int64 v7; // r4 __int64 v8; // r2 unsigned int v9; // r6 unsigned int v10; // r3 unsigned int v11; // r6 __int64 v12; // r0 bool v13; // cf unsigned __int64 v14; // r10 unsigned __int64 v15; // r0 __int64 v16; // r0 char v18; // [sp+4h] [bp-8h] v2 = a2; if ( a1 < 0 ) { v5 = -1; v3 = (unsigned __int64)-a1 >> 32; v4 = -(int)a1; } else { v3 = HIDWORD(a1); v4 = a1; v5 = 0; } if ( a2 < 0 ) { v5 = ~v5; v2 = -a2; } v6 = HIDWORD(v2) > v3; LODWORD(v7) = v4; if ( HIDWORD(v2) == v3 ) v6 = (unsigned int)v2 > v4; HIDWORD(v7) = v3; if ( v6 ) { v8 = 0; } else { if ( HIDWORD(v2) ) v9 = __clz(HIDWORD(v2)); else v9 = __clz(v2); if ( !HIDWORD(v2) ) v9 += 32; if ( HIDWORD(v7) ) v10 = __clz(HIDWORD(v7)); else v10 = __clz(v4); if ( !HIDWORD(v7) ) v10 += 32; v11 = v9 - v10; v18 = v11; v12 = v2 << v11; v13 = HIDWORD(v7) >= (unsigned __int64)(v2 << v11) >> 32; if ( HIDWORD(v7) == (unsigned __int64)(v2 << v11) >> 32 ) v13 = v4 >= (unsigned int)v12; if ( v13 ) { v7 = __PAIR64__(HIDWORD(v7), v4) - v12; v8 = 1LL << v11; } else { v8 = 0; } if ( v11 ) { v14 = (unsigned __int64)(v2 << v11) >> 1; do { v15 = 2 * v7; if ( v7 >= v14 ) v15 = 2 * (v7 - v14) + 1; --v11; v7 = v15; } while ( v11 ); v8 = v15 + v8 - (v15 >> v18 << v18); } } v16 = (unsigned int)v5; if ( v5 ) LODWORD(v16) = 1; return (unsigned int)v16 + (v8 ^ -v16); }
GD Web Decomp Icon

GD Web Decomp

Raw Source