//
// sub_981638 from 0x981638 to 0x9816e0 (168 bytes)
//
// 1 xrefs:
// > sub_9813BC @ 0x981480
//
// 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 12:06:08 +0000
//
int __fastcall sub_981638(_DWORD *a1, void *lpsrc)
{
int v3; // r5
_DWORD *v4; // r0
_DWORD *v5; // r6
int v6; // r1
const void *v7; // r0
bool v8; // zf
_DWORD *v9; // r0
const void *v10; // r0
void *v11; // r0
if ( !lpsrc )
return 0;
while ( 1 )
{
v3 = 0;
v4 = _dynamic_cast(
lpsrc,
(const struct __class_type_info *)&`typeinfo for'__cxxabiv1::__shim_type_info,
(const struct __class_type_info *)&`typeinfo for'__cxxabiv1::__pointer_type_info,
0);
v5 = v4;
if ( !v4 )
break;
v6 = a1[2];
if ( (v4[2] & ~v6) != 0 )
return 0;
v7 = (const void *)a1[3];
if ( v7 == (const void *)v5[3] )
return 1;
v8 = (a1[2] & 1) == 0;
v3 = 0;
if ( (v6 & 1) != 0 )
v8 = v7 == nullptr;
if ( v8 )
return v3;
v9 = _dynamic_cast(
v7,
(const struct __class_type_info *)&`typeinfo for'__cxxabiv1::__shim_type_info,
(const struct __class_type_info *)&`typeinfo for'__cxxabiv1::__pointer_type_info,
0);
if ( !v9 )
{
v10 = (const void *)a1[3];
if ( !v10 )
return 0;
v3 = 0;
v11 = _dynamic_cast(
v10,
(const struct __class_type_info *)&`typeinfo for'__cxxabiv1::__shim_type_info,
(const struct __class_type_info *)&`typeinfo for'__cxxabiv1::__pointer_to_member_type_info,
0);
if ( v11 )
return sub_9816F8((int)v11, (void *)v5[3]);
return v3;
}
lpsrc = (void *)v5[3];
a1 = v9;
if ( !lpsrc )
return 0;
}
return v3;
}