{"type": "func", "start": 5373185184, "end": 5373185498, "name": "SetupSequenceTriggerPopup::onAddChance", "pseudocode": "// \n// SetupSequenceTriggerPopup::onAddChance from 0x140444ca0 to 0x140444dda (314 bytes)\n// \n// 4 xrefs:\n// > SetupSequenceTriggerPopup::init @ 0x140443a10\n// > <???> @ 0x1406a23b4\n// > <???> @ 0x1406a23c4\n// > <???> @ 0x1406da4fc\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nvoid SetupSequenceTriggerPopup::onAddChance(SetupSequenceTriggerPopup *a1, cocos2d::CCObject *a2)\n{\n  int v3; // esi\n  float v4; // xmm0_4\n  CCMenuItemSpriteExtra *m_selectedButton; // rcx\n  int v6; // ebx\n  int v7; // eax\n  EffectGameObject *v8; // r8\n  EffectGameObject_vtbl *v9; // rcx\n  char *v10; // rdx\n  int v11; // ecx\n  EffectGameObject *m_gameObject; // rbp\n  __int64 v13; // rdx\n  int v14; // [rsp+40h] [rbp+8h] BYREF\n  int v15; // [rsp+50h] [rbp+18h] BYREF\n\n  v3 = (int)a1->getValue(a1, -1);\n  v4 = a1->getValue(a1, -2);\n  m_selectedButton = a1->m_selectedButton;\n  v6 = (int)v4;\n  if ( !m_selectedButton )\n  {\n    if ( v3 <= 0 || v6 <= 0 )\n      return;\n    m_gameObject = a1->m_gameObject;\n    v15 = v3;\n    v14 = (int)v4;\n    v13 = *(_QWORD *)&m_gameObject[1].m_uID;\n    if ( v13 == *(_QWORD *)&m_gameObject[1].m_nTag )\n    {\n      sub_14043F020(\n        (const void **)&m_gameObject[1].EnhancedGameObject::GameObject::CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable,\n        (_BYTE *)v13,\n        &v15,\n        &v14);\n    }\n    else\n    {\n      *(_DWORD *)v13 = v3;\n      *(_DWORD *)(v13 + 4) = v3;\n      *(_DWORD *)(v13 + 8) = v6;\n      *(_DWORD *)(v13 + 12) = 0;\n      *(_QWORD *)&m_gameObject[1].m_uID += 16LL;\n    }\n    m_gameObject[1].m_sInverse.b = NAN;\nLABEL_15:\n    SetupSequenceTriggerPopup::updateGroupIDButtons(a1);\n    return;\n  }\n  if ( !v6 )\n    return;\n  v7 = m_selectedButton->getTag(m_selectedButton);\n  v8 = a1->m_gameObject;\n  if ( v7 < 0 )\n    goto LABEL_15;\n  v9 = v8[1].EnhancedGameObject::GameObject::CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n  if ( v7 > (unsigned __int64)(((__int64)(*(_QWORD *)&v8[1].m_uID - (_QWORD)v9) >> 4) - 1)\n    || v9 == *(EffectGameObject_vtbl **)&v8[1].m_uID )\n  {\n    goto LABEL_15;\n  }\n  v10 = (char *)v9 + 16 * v7;\n  v11 = v6 + *((_DWORD *)v10 + 2);\n  if ( v11 < 1 )\n    v11 = 1;\n  *((_DWORD *)v10 + 2) = v11;\n  v8[1].m_sInverse.b = NAN;\n  SetupSequenceTriggerPopup::updateGroupIDButtons(a1);\n}", "assembly": "; \n; SetupSequenceTriggerPopup::onAddChance from 0x140444ca0 to 0x140444dda (314 bytes)\n; \n; 4 xrefs:\n; > SetupSequenceTriggerPopup::init @ 0x140443a10\n; > <???> @ 0x1406a23b4\n; > <???> @ 0x1406a23c4\n; > <???> @ 0x1406da4fc\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\npush    rbx                                                            ; +0x0, 0x140444ca0\npush    rsi                                                            ; +0x2, 0x140444ca2\npush    rdi                                                            ; +0x3, 0x140444ca3\nsub     rsp, 20h                                                       ; +0x4, 0x140444ca4\nmov     rax, [rcx]                                                     ; +0x8, 0x140444ca8\nmov     edx, 0FFFFFFFFh                                                ; +0xb, 0x140444cab\nmov     rdi, rcx                                                       ; +0x10, 0x140444cb0\ncall    qword ptr [rax+470h]                                           ; +0x13, 0x140444cb3\nmov     rax, [rdi]                                                     ; +0x19, 0x140444cb9\nmov     edx, 0FFFFFFFEh                                                ; +0x1c, 0x140444cbc\nmov     rcx, rdi                                                       ; +0x21, 0x140444cc1\ncvttss2si esi, xmm0                                                    ; +0x24, 0x140444cc4\ncall    qword ptr [rax+470h]                                           ; +0x28, 0x140444cc8\nmov     rcx, [rdi+3A8h]                                                ; +0x2e, 0x140444cce\ncvttss2si ebx, xmm0                                                    ; +0x35, 0x140444cd5\ntest    rcx, rcx                                                       ; +0x39, 0x140444cd9\njz      loc_140444D62                                                  ; +0x3c, 0x140444cdc\ntest    ebx, ebx                                                       ; +0x42, 0x140444ce2\njz      loc_140444DD2                                                  ; +0x44, 0x140444ce4\nmov     rax, [rcx]                                                     ; +0x4a, 0x140444cea\ncall    qword ptr [rax+38h]                                            ; +0x4d, 0x140444ced\nmov     r8, [rdi+290h]                                                 ; +0x50, 0x140444cf0\ntest    eax, eax                                                       ; +0x57, 0x140444cf7\njs      loc_140444DC3                                                  ; +0x59, 0x140444cf9\nmov     r9, [r8+748h]                                                  ; +0x5f, 0x140444cff\nmov     rcx, [r8+740h]                                                 ; +0x66, 0x140444d06\nmovsxd  rdx, eax                                                       ; +0x6d, 0x140444d0d\nmov     rax, r9                                                        ; +0x70, 0x140444d10\nsub     rax, rcx                                                       ; +0x73, 0x140444d13\nsar     rax, 4                                                         ; +0x76, 0x140444d16\ndec     rax                                                            ; +0x7a, 0x140444d1a\ncmp     rdx, rax                                                       ; +0x7d, 0x140444d1d\nja      loc_140444DC3                                                  ; +0x80, 0x140444d20\ncmp     rcx, r9                                                        ; +0x86, 0x140444d26\njz      loc_140444DC3                                                  ; +0x89, 0x140444d29\nshl     rdx, 4                                                         ; +0x8f, 0x140444d2f\nmov     eax, 1                                                         ; +0x93, 0x140444d33\nadd     rdx, rcx                                                       ; +0x98, 0x140444d38\nmov     ecx, [rdx+8]                                                   ; +0x9b, 0x140444d3b\nadd     ecx, ebx                                                       ; +0x9e, 0x140444d3e\ncmp     ecx, eax                                                       ; +0xa0, 0x140444d40\ncmovl   ecx, eax                                                       ; +0xa2, 0x140444d42\nmov     [rdx+8], ecx                                                   ; +0xa5, 0x140444d45\nmov     rcx, rdi                                                       ; +0xa8, 0x140444d48\nmov     dword ptr [r8+7E8h], 0FFFFFFFFh                                ; +0xab, 0x140444d4b\nadd     rsp, 20h                                                       ; +0xb6, 0x140444d56\npop     rdi                                                            ; +0xba, 0x140444d5a\npop     rsi                                                            ; +0xbb, 0x140444d5b\npop     rbx                                                            ; +0xbc, 0x140444d5c\njmp     SetupSequenceTriggerPopup__updateGroupIDButtons                ; +0xbd, 0x140444d5d\ntest    esi, esi                                                       ; +0xc2, 0x140444d62\njle     short loc_140444DD2                                            ; +0xc4, 0x140444d64\ntest    ebx, ebx                                                       ; +0xc6, 0x140444d66\njle     short loc_140444DD2                                            ; +0xc8, 0x140444d68\nmov     [rsp+38h+arg_8], rbp                                           ; +0xca, 0x140444d6a\nmov     rbp, [rdi+290h]                                                ; +0xcf, 0x140444d6f\nmov     [rsp+38h+arg_10], esi                                          ; +0xd6, 0x140444d76\nmov     [rsp+38h+arg_0], ebx                                           ; +0xda, 0x140444d7a\nlea     rcx, [rbp+740h]                                                ; +0xde, 0x140444d7e\nmov     rdx, [rcx+8]                                                   ; +0xe5, 0x140444d85\ncmp     rdx, [rcx+10h]                                                 ; +0xe9, 0x140444d89\njz      short loc_140444DA5                                            ; +0xed, 0x140444d8d\nmov     [rdx], esi                                                     ; +0xef, 0x140444d8f\nmov     [rdx+4], esi                                                   ; +0xf1, 0x140444d91\nmov     [rdx+8], ebx                                                   ; +0xf4, 0x140444d94\nmov     dword ptr [rdx+0Ch], 0                                         ; +0xf7, 0x140444d97\nadd     qword ptr [rcx+8], 10h                                         ; +0xfe, 0x140444d9e\njmp     short loc_140444DB4                                            ; +0x103, 0x140444da3\nlea     r9, [rsp+38h+arg_0]                                            ; +0x105, 0x140444da5\nlea     r8, [rsp+38h+arg_10]                                           ; +0x10a, 0x140444daa\ncall    sub_14043F020                                                  ; +0x10f, 0x140444daf\nmov     dword ptr [rbp+7E8h], 0FFFFFFFFh                               ; +0x114, 0x140444db4\nmov     rbp, [rsp+38h+arg_8]                                           ; +0x11e, 0x140444dbe\nmov     rcx, rdi                                                       ; +0x123, 0x140444dc3\nadd     rsp, 20h                                                       ; +0x126, 0x140444dc6\npop     rdi                                                            ; +0x12a, 0x140444dca\npop     rsi                                                            ; +0x12b, 0x140444dcb\npop     rbx                                                            ; +0x12c, 0x140444dcc\njmp     SetupSequenceTriggerPopup__updateGroupIDButtons                ; +0x12d, 0x140444dcd\nadd     rsp, 20h                                                       ; +0x132, 0x140444dd2\npop     rdi                                                            ; +0x136, 0x140444dd6\npop     rsi                                                            ; +0x137, 0x140444dd7\npop     rbx                                                            ; +0x138, 0x140444dd8\nretn                                                                   ; +0x139, 0x140444dd9", "xrefs": ["SetupSequenceTriggerPopup::init @ 0x140443a10", "<???> @ 0x1406a23b4", "<???> @ 0x1406a23c4", "<???> @ 0x1406da4fc"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}