//
// GJSmartBlockPreview::addChance from 0x67083c to 0x67092c (240 bytes)
//
// 2 xrefs:
// > BrowseSmartKeyLayer::updateChanceValues @ 0x673e80
// > BrowseSmartKeyLayer::init @ 0x674e08
//
// 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 11:55:50 +0000
//
int __fastcall GJSmartBlockPreview::addChance(GJSmartBlockPreview *this, const char *a2, const char *a3)
{
int *v6; // r5
int v7; // r3
void (__fastcall *v9)(int *, _BYTE *); // r10
char *CString; // r1
char *v11; // r1
cocos2d::CCString *v12; // r0
_BYTE v13[8]; // [sp+0h] [bp-18h] BYREF
int v14[2]; // [sp+8h] [bp-10h] BYREF
char *v15; // [sp+10h] [bp-8h]
GJSmartBlockPreview::createInfoLabel((int)this, (int)a2, a3);
v6 = *((int **)this + 69);
v7 = *v6;
if ( !a3 )
return (*(int (__fastcall **)(_DWORD, _DWORD))(v7 + 172))(*((_DWORD *)this + 69), 0);
v9 = *(void (__fastcall **)(int *, _BYTE *))(v7 + 92);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v13, 45.0, -15.0);
v9(v6, v13);
v14[0] = 0;
v14[1] = 0;
v15 = nullptr;
if ( a2 )
{
v12 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat(
(cocos2d::CCString *)"%i (%.1f%%)",
a2,
(float)((float)((float)(int)a2 / (float)(int)a3) * 100.0));
CString = (char *)cocos2d::CCString::getCString(v12);
}
else
{
CString = "0";
}
std::string::assign(v14, CString);
if ( (v14[0] & 1) != 0 )
v11 = v15;
else
v11 = (char *)v14 + 1;
(*(void (__fastcall **)(_DWORD, char *, int))(**((_DWORD **)this + 69) + 464))(
*((_DWORD *)this + 69),
v11,
LOBYTE(v14[0]) << 31);
cocos2d::CCLabelBMFont::limitLabelWidth(*((cocos2d::CCLabelBMFont **)this + 69), 100.0, 0.8, 0.0);
(*(void (__fastcall **)(_DWORD, int))(**((_DWORD **)this + 69) + 172))(*((_DWORD *)this + 69), 1);
return std::string::~string((int)v14);
}