//
// DrawGridLayer::create from 0x14040a080 to 0x14040a391 (785 bytes)
//
// 2 xrefs:
// > LevelEditorLayer::init @ 0x1403ee67c
// > ??> @ 0x140925cb8
//
// This function is hookable on this platform (idp: pc, 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 11:31:59 +0000
//
// Hidden C++ exception states: #wind=7
unsigned __int64 *__fastcall DrawGridLayer::create(unsigned __int64 a1, unsigned __int64 a2)
{
unsigned __int64 *v4; // rdi
_QWORD *v5; // rax
__int64 v6; // rcx
cocos2d::CCObject *v7; // rax
__int64 v8; // rcx
cocos2d::CCObject *v9; // rax
__int64 v10; // rcx
cocos2d::CCObject *v11; // rax
cocos2d::CCPoint *v12; // r14
cocos2d::CCPoint *v13; // rsi
__int64 v14; // rbx
__int64 v15; // rbp
cocos2d::CCPoint *v16; // r14
cocos2d::CCPoint *v17; // rsi
__int64 v18; // rbp
cocos2d::CCPoint *v19; // rbp
cocos2d::CCPoint *v20; // rsi
v4 = (unsigned __int64 *)operator new(0x280u);
cocos2d::CCLayer::CCLayer((cocos2d::CCLayer *)v4);
*v4 = (unsigned __int64)&DrawGridLayer::`vftable';
v4[40] = (unsigned __int64)&DrawGridLayer::`vftable';
v4[41] = (unsigned __int64)&DrawGridLayer::`vftable';
v4[42] = (unsigned __int64)&DrawGridLayer::`vftable';
v4[43] = (unsigned __int64)&DrawGridLayer::`vftable';
v4[44] = (unsigned __int64)&DrawGridLayer::`vftable';
*((_DWORD *)v4 + 108) = 0;
v4[55] = 0;
v4[56] = 0;
v5 = operator new(0x20u);
*v5 = v5;
v5[1] = v5;
v4[55] = (unsigned __int64)v5;
v4[57] = 0;
v4[58] = 0;
v4[59] = 0;
v4[60] = 7;
v4[61] = 8;
*((_DWORD *)v4 + 108) = 1065353216;
sub_14003F200((__int64)(v4 + 57), 0x10u, v4[55]);
*((_DWORD *)v4 + 124) = -1082130432;
v4[63] = 0;
*((_DWORD *)v4 + 128) = 0;
*((_BYTE *)v4 + 516) = 0;
*((_OWORD *)v4 + 33) = 0;
v4[68] = 0;
v4[69] = 15;
*((_BYTE *)v4 + 528) = 0;
v4[70] = 0;
v4[71] = 0;
v4[72] = 0;
v4[73] = 0;
v4[74] = 0;
v4[75] = 0;
*((_DWORD *)v4 + 152) = 0;
*((_WORD *)v4 + 316) = 0;
*((_DWORD *)v4 + 159) = 1106247680;
if ( cocos2d::CCLayer::init((cocos2d::CCLayer *)v4) )
{
v4[70] = a1;
v4[65] = a2;
v4[71] = 0;
v7 = (cocos2d::CCObject *)cocos2d::CCArray::create(v6);
v4[72] = (unsigned __int64)v7;
cocos2d::CCObject::retain(v7);
v9 = (cocos2d::CCObject *)cocos2d::CCArray::create(v8);
v4[73] = (unsigned __int64)v9;
cocos2d::CCObject::retain(v9);
v11 = (cocos2d::CCObject *)cocos2d::CCArray::create(v10);
v4[74] = (unsigned __int64)v11;
cocos2d::CCObject::retain(v11);
*((_DWORD *)v4 + 153) = 1132144891;
*((_DWORD *)v4 + 154) = 1134283329;
*((_DWORD *)v4 + 155) = 1136768455;
*((_DWORD *)v4 + 156) = 1139408901;
*((_DWORD *)v4 + 157) = 1141899267;
*((_DWORD *)v4 + 152) = 1134283329;
v12 = (cocos2d::CCPoint *)operator new(0x2580u);
v13 = v12;
v14 = 1200;
v15 = 1200;
do
{
cocos2d::CCPoint::CCPoint(v13);
v13 = (cocos2d::CCPoint *)((char *)v13 + 8);
--v15;
}
while ( v15 );
v4[51] = (unsigned __int64)v12;
memset(v12, 0, 0x2580u);
v16 = (cocos2d::CCPoint *)operator new(0x2580u);
v17 = v16;
v18 = 1200;
do
{
cocos2d::CCPoint::CCPoint(v17);
v17 = (cocos2d::CCPoint *)((char *)v17 + 8);
--v18;
}
while ( v18 );
v4[52] = (unsigned __int64)v16;
memset(v16, 0, 0x2580u);
v19 = (cocos2d::CCPoint *)operator new(0x2580u);
v20 = v19;
do
{
cocos2d::CCPoint::CCPoint(v20);
v20 = (cocos2d::CCPoint *)((char *)v20 + 8);
--v14;
}
while ( v14 );
v4[53] = (unsigned __int64)v19;
memset(v19, 0, 0x2580u);
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v4);
return v4;
}
else
{
(*(void (__fastcall **)(unsigned __int64 *, __int64))(*v4 + 8))(v4, 1);
return nullptr;
}
}