//
// Java_org_cocos2dx_lib_Cocos2dxBitmap_nativeInitBitmapDC from 0xd7e098 to 0xd7e244 (428 bytes)
//
// 1 xrefs:
// > ??> @ 0xb1070
//
// This function is hookable on this platform (idp: arm, 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 13:08:08 +0000
//
_DWORD *__fastcall Java_org_cocos2dx_lib_Cocos2dxBitmap_nativeInitBitmapDC(
__int64 a1,
__int64 a2,
int a3,
int a4,
__int64 a5)
{
int v9; // w22
unsigned __int8 v10; // w0
_DWORD *result; // x0
__int64 v12; // x2
__int64 v13; // x9
unsigned int v14; // w8
int v15; // w3
__int64 v16; // x7
uint32x4_t *v17; // x1
unsigned int v18; // w0
int v19; // w1
unsigned __int64 v20; // t2
unsigned __int64 v21; // t2
unsigned __int64 v22; // t2
v9 = 4 * a3 * a4;
v10 = atomic_load((unsigned __int8 *)&byte_1560828);
if ( (v10 & 1) == 0 && _cxa_guard_acquire((__guard *)&byte_1560828) )
{
dword_1560830 = 0;
dword_1560834 = 0;
qword_1560838 = 0;
_cxa_guard_release((__guard *)&byte_1560828);
__cxa_atexit((void (*)(void *))cocos2d::BitmapDC::~BitmapDC, &dword_1560830, &unk_1548000);
}
dword_1560830 = a3;
dword_1560834 = a4;
qword_1560838 = operator new[](v9);
result = (_DWORD *)(*(__int64 (__fastcall **)(__int64, __int64, _QWORD, _QWORD, __int64))(*(_QWORD *)a1 + 1600LL))(
a1,
a5,
0,
(unsigned int)v9,
qword_1560838);
v12 = qword_1560838;
if ( a4 > 0 )
{
v13 = (unsigned int)(a3 - 1);
v14 = ((unsigned int)(a3 - 4) >> 2) + 1;
v15 = 0;
v16 = 4 * v14;
while ( a3 <= 0 )
{
LABEL_14:
if ( ++v15 == a4 )
return result;
}
if ( (unsigned int)v13 <= 2 )
{
result = (_DWORD *)v12;
v19 = 0;
}
else
{
v17 = (uint32x4_t *)v12;
v18 = 0;
do
{
++v18;
*v17 = vorrq_s8(vshlq_n_s32(*v17, 8u), vshrq_n_u32(*v17, 0x18u));
++v17;
}
while ( v14 > v18 );
result = (_DWORD *)(v12 + 4 * v16);
if ( a3 == (_DWORD)v16 )
{
LABEL_13:
v12 += 4 * (v13 + 1);
goto LABEL_14;
}
v19 = 4 * v14;
}
HIDWORD(v20) = *result;
LODWORD(v20) = *result;
*result = v20 >> 24;
if ( a3 > v19 + 1 )
{
HIDWORD(v21) = result[1];
LODWORD(v21) = HIDWORD(v21);
result[1] = v21 >> 24;
if ( a3 > v19 + 2 )
{
HIDWORD(v22) = result[2];
LODWORD(v22) = HIDWORD(v22);
result[2] = v22 >> 24;
}
}
goto LABEL_13;
}
return result;
}