//
// __aeabi_uidiv from 0x8e06c0 to 0x8e0768 (168 bytes)
//
// 150 xrefs:
// > SFXBrowser::onPage @ 0x5844f6
// > std::__detail::_Mod::__calc @ 0x59e8f0
// > std::uniform_int_distribution::operator @ 0x59e938
// > std::uniform_int_distribution::operator @ 0x59e952
// > cocos2d::CCScheduler::scheduleSelector @ 0x5ae706
// > cocos2d::CCScheduler::priorityIn @ 0x5aecaa
// > cocos2d::CCScheduler::appendIn @ 0x5aef18
// > cocos2d::CCActionManager::addAction @ 0x5b98fe
// > cocos2d::CCShuffleTiles::getDelta @ 0x5bb886
// > cocos2d::CCDictionary::setObjectUnSafe @ 0x5c021a
// > cocos2d::CCDictionary::setObjectUnSafe @ 0x5c069a
// > cocos2d::CCLabelAtlas::updateAtlasValues @ 0x5caf7e
// > cocos2d::CCBMFontConfiguration::parseKerningEntry @ 0x5cc36a
// > cocos2d::CCBMFontConfiguration::parseConfigFile @ 0x5cc7c4
// > cocos2d::CCImage::_initWithPngData @ 0x5e1c1a
// > cocos2d::CCGLProgram::updateUniformLocation @ 0x5e4472
// > cocos2d::CCTMXTilesetInfo::rectForGID @ 0x5f8c5a
// > cocos2d::CCTileMapAtlas::updateAtlasValueAt @ 0x5fa258
// > png_zalloc @ 0x64cfe0
// > sub_64FEB4 @ 0x64ffe0
// > png_malloc_array @ 0x65206c
// > png_realloc_array @ 0x6520d8
// > png_read_push_finish_row @ 0x652666
// > png_read_push_finish_row @ 0x65268a
// > sub_654424 @ 0x6546a4
// > png_handle_sPLT @ 0x65d55c
// > png_combine_row @ 0x65eaa6
// > png_read_finish_row @ 0x65f3ec
// > png_read_finish_row @ 0x65f410
// > png_read_start_row @ 0x65f490
// > png_set_filter_heuristics_fixed @ 0x662cbc
// > png_set_filter_heuristics_fixed @ 0x662cfe
// > png_set_filter_heuristics_fixed @ 0x662d40
// > png_set_filter_heuristics_fixed @ 0x662d82
// > png_set_filter_heuristics_fixed @ 0x662dc4
// > png_write_finish_row @ 0x665da4
// > png_write_finish_row @ 0x665dbe
// > png_do_write_interlace @ 0x665ec8
// > png_do_write_interlace @ 0x665f62
// > sub_668C64 @ 0x668daa
// > sub_69F640 @ 0x69f658
// > sub_69F764 @ 0x69f77c
// > sub_69F87C @ 0x69f918
// > sub_69F87C @ 0x69f96c
// > _TIFFMultiply32 @ 0x69fe10
// > sub_6A2E4C @ 0x6a2ec8
// > sub_6AAEA4 @ 0x6aaf60
// > TIFFReadDirectory @ 0x6b175c
// > sub_6B2FE0 @ 0x6b34a8
// > sub_6E911C @ 0x6e9164
// > sub_6EA1E8 @ 0x6ea230
// > sub_6ED9A4 @ 0x6eda90
// > sub_6ED9A4 @ 0x6edab0
// > TIFFReadEncodedStrip @ 0x6ededc
// > TIFFReadEncodedStrip @ 0x6edf08
// > TIFFReadEncodedTile @ 0x6eec40
// > sub_6EF8AC @ 0x6efa0c
// > sub_6EFA34 @ 0x6efb1c
// > sub_6EFA34 @ 0x6efb98
// > sub_6EFA34 @ 0x6efc5c
// > TIFFComputeStrip @ 0x6efff8
// > TIFFNumberOfStrips @ 0x6f0110
// > TIFFVStripSize64 @ 0x6f0320
// > TIFFVStripSize64 @ 0x6f0368
// > TIFFScanlineSize64 @ 0x6f0b2c
// > TIFFComputeTile @ 0x6f22f8
// > TIFFComputeTile @ 0x6f2340
// > TIFFComputeTile @ 0x6f2388
// > TIFFComputeTile @ 0x6f23dc
// > TIFFComputeTile @ 0x6f23f4
// > TIFFComputeTile @ 0x6f2410
// > TIFFComputeTile @ 0x6f2438
// > TIFFComputeTile @ 0x6f244c
// > TIFFComputeTile @ 0x6f2468
// > TIFFNumberOfTiles @ 0x6f2724
// > TIFFNumberOfTiles @ 0x6f276c
// > TIFFNumberOfTiles @ 0x6f27cc
// > TIFFVTileSize64 @ 0x6f2c00
// > TIFFVTileSize64 @ 0x6f2c48
// > TIFFWriteScanline @ 0x6f349c
// > TIFFWriteScanline @ 0x6f34bc
// > TIFFWriteScanline @ 0x6f358c
// > TIFFWriteEncodedStrip @ 0x6f3910
// > TIFFWriteEncodedStrip @ 0x6f3b38
// > TIFFWriteRawStrip @ 0x6f3dc0
// > TIFFWriteEncodedTile @ 0x6f418c
// > TIFFWriteEncodedTile @ 0x6f4208
// > TIFFWriteEncodedTile @ 0x6f42b0
// > TIFFSetupStrips @ 0x6f4638
// > sub_700E04 @ 0x700e8e
// > sub_700ED4 @ 0x700f28
// > sub_72E7B8 @ 0x72ec48
// > sub_72E7B8 @ 0x72ec7a
// > sub_72E7B8 @ 0x72ee3a
// > sub_72E7B8 @ 0x72ee84
// > sub_72E7B8 @ 0x72efd8
// > sub_72E7B8 @ 0x72f004
// > sub_735270 @ 0x7358e8
// > sub_735270 @ 0x735a0a
// > sub_753514 @ 0x7536e2
// > sub_754588 @ 0x754748
// > sub_754C30 @ 0x754df0
// > sub_76AEE0 @ 0x76b0a6
// > sub_76BF44 @ 0x76c0fc
// > sub_76C5CC @ 0x76c784
// > ssl3_write_bytes @ 0x789428
// > ssl3_write_bytes @ 0x789440
// > n_ssl3_mac @ 0x78aa38
// > n_ssl3_mac @ 0x78aa84
// > ssl3_cbc_digest_record @ 0x78d4b0
// > ssl3_cbc_digest_record @ 0x78d4dc
// > ssl3_cbc_digest_record @ 0x78d4ec
// > ssl3_cbc_digest_record @ 0x78d5ac
// > ssl3_cbc_digest_record @ 0x78d5d8
// > ssl3_cbc_digest_record @ 0x78d5e8
// > ssl3_cbc_digest_record @ 0x78d778
// > ssl3_cbc_digest_record @ 0x78dd9c
// > tls_fips_digest_extra @ 0x78dfcc
// > tls_fips_digest_extra @ 0x78dfdc
// > ec_wNAF_mul @ 0x7ec388
// > ec_wNAF_mul @ 0x7ec414
// > sub_80B57C @ 0x80b5f8
// > OPENSSL_LH_insert @ 0x80c42c
// > OPENSSL_LH_delete @ 0x80c790
// > sub_80E7B4 @ 0x80e7f4
// > sub_80E9E8 @ 0x80ea28
// > sub_80EAF0 @ 0x80eb28
// > sub_80EAF0 @ 0x80eb80
// > CRYPTO_secure_malloc_init @ 0x80ed50
// > CRYPTO_secure_malloc @ 0x80f2d8
// > CRYPTO_secure_malloc @ 0x80f368
// > CRYPTO_secure_malloc @ 0x80f3e8
// > CRYPTO_secure_malloc @ 0x80f48c
// > CRYPTO_secure_malloc @ 0x80f568
// > CRYPTO_secure_free @ 0x80f960
// > CRYPTO_secure_free @ 0x80f9b8
// > CRYPTO_secure_free @ 0x80fa9c
// > CRYPTO_secure_free @ 0x80fbf4
// > CRYPTO_secure_free @ 0x80fce8
// > CRYPTO_secure_free @ 0x80fd74
// > CRYPTO_secure_actual_size @ 0x81003c
// > CRYPTO_secure_actual_size @ 0x810094
// > BN_mod_exp_mont_word @ 0x86df6c
// > BN_mod_exp_mont_word @ 0x86dfd0
// > cms_RecipientInfo_pwri_crypt @ 0x8764b8
// > cms_RecipientInfo_pwri_crypt @ 0x876514
// > dsa_builtin_paramgen2 @ 0x881238
// > __aeabi_uidivmod @ 0x8e0774
// > ??> @ 0x3b2ac
// > ??> @ 0x6bcec
//
// 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
//
// Alternative name is '__udivsi3'
unsigned int __fastcall _aeabi_uidiv(unsigned int result, unsigned int a2)
{
char v2; // r2
unsigned int v3; // r1
unsigned int v4; // r3
int v5; // r2
bool v6; // zf
if ( a2 != 1 )
{
if ( a2 )
{
if ( result <= a2 )
{
return result == a2;
}
else if ( (a2 & (a2 - 1)) != 0 )
{
v2 = __clz(a2) - __clz(result);
v3 = a2 << v2;
v4 = 1 << v2;
v5 = 0;
while ( 1 )
{
if ( result >= v3 )
{
result -= v3;
v5 |= v4;
}
if ( result >= v3 >> 1 )
{
result -= v3 >> 1;
v5 |= v4 >> 1;
}
if ( result >= v3 >> 2 )
{
result -= v3 >> 2;
v5 |= v4 >> 2;
}
if ( result >= v3 >> 3 )
{
result -= v3 >> 3;
v5 |= v4 >> 3;
}
v6 = result == 0;
if ( result )
{
v4 >>= 4;
v6 = v4 == 0;
}
if ( v6 )
break;
v3 >>= 4;
}
return v5;
}
else
{
result >>= 31 - __clz(a2);
}
}
else
{
if ( result )
result = -1;
return _aeabi_idiv0(result);
}
}
return result;
}