//
// Java_org_cocos2dx_lib_Cocos2dxBitmap_nativeInitBitmapDC from 0xb0dbcc to 0xb0dd78 (428 bytes)
//
// 1 xrefs:
// > ??> @ 0x85548
//
// 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
//
_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
__int64 v11; // x0
__int64 v12; // x5
_DWORD *result; // x0
__int64 v14; // x2
__int64 v15; // x9
unsigned int v16; // w8
int v17; // w3
__int64 v18; // x7
uint32x4_t *v19; // x1
unsigned int v20; // w0
int v21; // w1
unsigned __int64 v22; // t2
unsigned __int64 v23; // t2
unsigned __int64 v24; // t2
v9 = 4 * a3 * a4;
v10 = atomic_load((unsigned __int8 *)&byte_1245880);
if ( (v10 & 1) == 0 && _cxa_guard_acquire((__guard *)&byte_1245880) )
{
dword_1245888 = 0;
dword_124588C = 0;
qword_1245890 = 0;
_cxa_guard_release((__guard *)&byte_1245880);
__cxa_atexit((void (*)(void *))cocos2d::BitmapDC::~BitmapDC, &dword_1245888, &unk_122F000);
}
dword_1245888 = a3;
dword_124588C = a4;
v11 = operator new[](v9);
v12 = *a1;
qword_1245890 = v11;
result = (_DWORD *)(*(__int64 (__fastcall **)(__int64 *, __int64, _QWORD, _QWORD))(v12 + 1600))(
a1,
a5,
0,
(unsigned int)v9);
v14 = qword_1245890;
if ( a4 > 0 )
{
v15 = (unsigned int)(a3 - 1);
v16 = ((unsigned int)(a3 - 4) >> 2) + 1;
v17 = 0;
v18 = 4 * v16;
while ( a3 <= 0 )
{
LABEL_14:
if ( ++v17 == a4 )
return result;
}
if ( (unsigned int)v15 <= 2 )
{
result = (_DWORD *)v14;
v21 = 0;
}
else
{
v19 = (uint32x4_t *)v14;
v20 = 0;
do
{
++v20;
*v19 = vorrq_s8(vshlq_n_s32(*v19, 8u), vshrq_n_u32(*v19, 0x18u));
++v19;
}
while ( v16 > v20 );
result = (_DWORD *)(v14 + 4 * v18);
if ( a3 == (_DWORD)v18 )
{
LABEL_13:
v14 += 4 * (v15 + 1);
goto LABEL_14;
}
v21 = 4 * v16;
}
HIDWORD(v22) = *result;
LODWORD(v22) = *result;
*result = v22 >> 24;
if ( a3 > v21 + 1 )
{
HIDWORD(v23) = result[1];
LODWORD(v23) = HIDWORD(v23);
result[1] = v23 >> 24;
if ( a3 > v21 + 2 )
{
HIDWORD(v24) = result[2];
LODWORD(v24) = HIDWORD(v24);
result[2] = v24 >> 24;
}
}
goto LABEL_13;
}
return result;
}