//
// cocos2d::CCSpriteBatchNode::initWithTexture from 0x100155790 to 0x1001558ae (286 bytes)
//
// 6 xrefs:
// > cocos2d::CCSpriteBatchNode::createWithTexture @ 0x100155703
// > cocos2d::CCSpriteBatchNode::create @ 0x100155945
// > cocos2d::CCSpriteBatchNode::initWithFile @ 0x1001559ac
// > cocos2d::CCSpriteBatchNode::init @ 0x100155a3f
// > cocos2d::CCTMXLayer::initWithTilesetInfo @ 0x100243aae
// > cocos2d::CCLabelBMFont::initWithString @ 0x1006aa1b3
//
// 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 12:25:04 +0000
//
char __fastcall cocos2d::CCSpriteBatchNode::initWithTexture(__int64 a1, __int64 a2, unsigned int a3)
{
void *v4; // r15
unsigned int v5; // r14d
__int64 v6; // rax
char hasPremultipliedAlpha; // al
int v8; // ecx
void *v9; // r15
void *v10; // r15
__int64 v11; // rax
__int64 v12; // rax
*(_QWORD *)(a1 + 336) = 0x30300000001LL;
v4 = operator new(0x70u);
cocos2d::CCTextureAtlas::CCTextureAtlas(v4);
*(_QWORD *)(a1 + 328) = v4;
v5 = 29;
if ( a3 )
v5 = a3;
cocos2d::CCTextureAtlas::initWithTexture(v4, a2, v5);
v6 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 328) + 96LL))(*(_QWORD *)(a1 + 328));
hasPremultipliedAlpha = cocos2d::CCTexture2D::hasPremultipliedAlpha(v6);
v8 = 770;
if ( hasPremultipliedAlpha )
v8 = 1;
*(_DWORD *)(a1 + 336) = v8;
*(_DWORD *)(a1 + 340) = 771;
v9 = operator new(0x40u);
sub_1007FE7B0(v9);
*(_QWORD *)(a1 + 208) = v9;
sub_1007FE870(v9, v5);
v10 = operator new(0x40u);
sub_1007FE7B0(v10);
*(_QWORD *)(a1 + 344) = v10;
sub_1007FE870(v10, v5);
*(_WORD *)(a1 + 352) = 0;
v11 = cocos2d::CCShaderCache::sharedShaderCache(v10);
v12 = cocos2d::CCShaderCache::programForKey(v11, "ShaderPositionTextureColor");
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 664LL))(a1, v12);
return 1;
}