//
// DialogLayer::displayDialogObject from 0x140175110 to 0x14017545f (847 bytes)
//
// 3 xrefs:
// > DialogLayer::init @ 0x140175067
// > DialogLayer::displayNextObject @ 0x1401750df
// > ??> @ 0x140918434
//
// 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:27:32 +0000
//
// Hidden C++ exception states: #wind=3
__m128 __fastcall DialogLayer::displayDialogObject(__int64 a1, __int64 a2)
{
__int64 v4; // rcx
__int64 v5; // rax
__int128 *v6; // rdx
int v7; // eax
int v8; // edx
cocos2d::CCString *v9; // rax
const char *CString; // rax
struct cocos2d::CCSprite *v11; // rax
__int64 *v12; // rdi
__int64 v13; // rbx
__int64 v14; // rax
float v15; // xmm7_4
_QWORD *v16; // rdx
size_t v17; // r8
const struct cocos2d::CCPoint *v18; // rax
__int64 *v19; // rdi
__int64 v20; // rbx
__int64 v21; // rax
__int64 v22; // rcx
__int64 *v23; // rdi
__int64 v24; // rbx
__int64 v25; // rax
__m128 result; // xmm0
__int128 *v27; // [rsp+40h] [rbp-39h] BYREF
_BYTE v28[8]; // [rsp+48h] [rbp-31h] BYREF
__int128 v29; // [rsp+50h] [rbp-29h] BYREF
__int64 v30; // [rsp+60h] [rbp-19h]
unsigned __int64 v31; // [rsp+68h] [rbp-11h]
_QWORD v32[4]; // [rsp+70h] [rbp-9h] BYREF
if ( a2 )
{
*(_BYTE *)(a1 + 616) = 1;
*(_BYTE *)(a1 + 617) = *(_BYTE *)(a2 + 132);
cocos2d::CCNode::stopAllActions(*(cocos2d::CCNode **)(a1 + 608));
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)(*(_QWORD *)(a1 + 608) + 320LL) + 40LL))(
*(_QWORD *)(a1 + 608) + 320LL,
0);
v4 = *(_QWORD *)(a1 + 584);
if ( v4 )
{
(*(void (__fastcall **)(__int64))(*(_QWORD *)v4 + 528LL))(v4);
*(_QWORD *)(a1 + 584) = 0;
}
v5 = *(_QWORD *)(a1 + 576);
if ( v5 )
{
*(_QWORD *)(v5 + 712) = 0;
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 576) + 528LL))(*(_QWORD *)(a1 + 576));
*(_QWORD *)(a1 + 576) = 0;
}
sub_14003F4F0((__int64)&v29, a2 + 88);
v6 = &v29;
if ( v31 > 0xF )
v6 = (__int128 *)v29;
(**(void (__fastcall ***)(__int64, __int128 *))(*(_QWORD *)(a1 + 568) + 360LL))(*(_QWORD *)(a1 + 568) + 360LL, v6);
sub_14003D310((__int64)&v29);
LOWORD(v27) = *(_WORD *)(a2 + 124);
BYTE2(v27) = *(_BYTE *)(a2 + 126);
(**(void (__fastcall ***)(__int64, __int128 **))(*(_QWORD *)(a1 + 568) + 368LL))(
*(_QWORD *)(a1 + 568) + 368LL,
&v27);
v7 = *(_DWORD *)(a2 + 120);
if ( v7 > 0 )
{
v8 = 56;
if ( v7 < 56 )
v8 = *(_DWORD *)(a2 + 120);
v9 = cocos2d::CCString::createWithFormat("dialogIcon_%03d.png", v8);
CString = cocos2d::CCString::getCString(v9);
v11 = cocos2d::CCSprite::create(CString);
*(_QWORD *)(a1 + 584) = v11;
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSprite *, __int64))(**(_QWORD **)(a1 + 560) + 456LL))(
*(_QWORD *)(a1 + 560),
v11,
2);
v12 = *(__int64 **)(a1 + 584);
v13 = *v12;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v27, -143.0, 0.0);
(*(void (__fastcall **)(__int64 *, __int64))(v13 + 184))(v12, v14);
}
v15 = *(float *)(a2 + 128);
v27 = &v29;
sub_14003F4F0((__int64)v32, a2 + 56);
v16 = v32;
if ( v32[3] > 0xFu )
v16 = (_QWORD *)v32[0];
v29 = 0;
v30 = 0;
v31 = 0;
v17 = -1;
do
++v17;
while ( *((_BYTE *)v16 + v17) );
sub_14003D230(&v29, v16, v17);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, 0.0, 1.0);
*(_QWORD *)(a1 + 576) = TextArea::create((__int64)&v29, "chatFont.fnt", 1.0, 242.0 / v15, v18, 1101004800, 0, 0);
sub_14003D310((__int64)v32);
v19 = *(__int64 **)(a1 + 576);
v20 = *v19;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, 0.0, 0.5);
(*(void (__fastcall **)(__int64 *, __int64))(v20 + 288))(v19, v21);
(*(void (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 576) + 160LL))(*(_QWORD *)(a1 + 576));
v22 = a1 + 544;
if ( !a1 )
v22 = 0;
*(_QWORD *)(*(_QWORD *)(a1 + 576) + 712LL) = v22;
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 560) + 456LL))(
*(_QWORD *)(a1 + 560),
*(_QWORD *)(a1 + 576),
3);
v23 = *(__int64 **)(a1 + 576);
v24 = *v23;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v28, -92.0, 0.0);
(*(void (__fastcall **)(__int64 *, __int64))(v24 + 184))(v23, v25);
return TextArea::fadeInCharacters(*(_QWORD *)(a1 + 576), 0.2, 0.02, 0, 0);
}
return result;
}