{"type": "func", "start": 4720656, "end": 4720780, "name": "GJBaseGameLayer::controlEventLink", "pseudocode": "// \n// GJBaseGameLayer::controlEventLink from 0x480810 to 0x48088c (124 bytes)\n// \n// 2 xrefs:\n// > GJBaseGameLayer::controlTriggersWithControlID @ 0x495c9a\n// > GJBaseGameLayer::controlTriggersInGroup @ 0x495f62\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 GJBaseGameLayer::controlEventLink(GJBaseGameLayer *a1, int a2, int a3, GJActionCommand a4)\n{\n  std::_rb_tree_base *p_m_header; // r5\n  std::_rb_tree_base *m_left; // r4\n  unsigned int v9; // r11\n  int i; // r2\n  std::_rb_tree_base *v11; // r1\n  int v12; // r1\n  int v14; // [sp+4h] [bp-8h]\n\n  p_m_header = &a1->m_gameState.m_unkMapPairGJGameEventIntVectorEventTriggerInstance.m_header;\n  m_left = a1->m_gameState.m_unkMapPairGJGameEventIntVectorEventTriggerInstance.m_header.m_left;\nLABEL_2:\n  if ( m_left != p_m_header )\n  {\n    v9 = 0;\n    for ( i = 28; ; i = v14 )\n    {\n      while ( 1 )\n      {\n        v11 = m_left[1].m_left;\n        if ( v9 >= -1227133513 * (((char *)m_left[1].m_right - (char *)v11) >> 2) )\n        {\n          m_left = (std::_rb_tree_base *)sub_761FA8(m_left);\n          goto LABEL_2;\n        }\n        v12 = (int)v11 + i * v9;\n        if ( a3 == -1 ? *(_DWORD *)(v12 + 4) == a2 : *(_DWORD *)(v12 + 8) == a3 )\n          break;\nLABEL_16:\n        ++v9;\n      }\n      if ( a4 )\n      {\n        if ( a4 == Pause )\n        {\n          *(_BYTE *)(v12 + 12) = 1;\n        }\n        else if ( a4 == Resume )\n        {\n          *(_BYTE *)(v12 + 12) = 0;\n        }\n        goto LABEL_16;\n      }\n      v14 = i;\n      std::vector<EventTriggerInstance>::_M_erase((int)&m_left[1].m_left, v12);\n    }\n  }\n}", "assembly": "; \n; GJBaseGameLayer::controlEventLink from 0x480810 to 0x48088c (124 bytes)\n; \n; 2 xrefs:\n; > GJBaseGameLayer::controlTriggersWithControlID @ 0x495c9a\n; > GJBaseGameLayer::controlTriggersInGroup @ 0x495f62\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.W          {R0-R2,R4-R11,LR}                                      ; +0x0, 0x480810\nADDW            R5, R0, #0x464                                         ; +0x4, 0x480814\nLDR.W           R4, [R0,#0x46C]                                        ; +0x8, 0x480818\nMOV             R8, R1                                                 ; +0xc, 0x48081c\nMOV             R7, R2                                                 ; +0xe, 0x48081e\nMOV             R6, R3                                                 ; +0x10, 0x480820\nMOV.W           R9, #0                                                 ; +0x12, 0x480822\nCMP             R4, R5                                                 ; +0x16, 0x480826\nBEQ             loc_480886                                             ; +0x18, 0x480828\nADD.W           R10, R4, #0x18                                         ; +0x1a, 0x48082a\nMOV.W           R11, #0                                                ; +0x1e, 0x48082e\nMOVS            R2, #0x1C                                              ; +0x22, 0x480832\nLDR             R1, [R4,#0x18]                                         ; +0x24, 0x480834\nLDR             R0, [R4,#0x1C]                                         ; +0x26, 0x480836\nLDR             R3, =0xB6DB6DB7                                        ; +0x28, 0x480838\nSUBS            R0, R0, R1                                             ; +0x2a, 0x48083a\nASRS            R0, R0, #2                                             ; +0x2c, 0x48083c\nMULS            R0, R3                                                 ; +0x2e, 0x48083e\nCMP             R11, R0                                                ; +0x30, 0x480840\nBCS             loc_48087C                                             ; +0x32, 0x480842\nADDS            R3, R7, #1                                             ; +0x34, 0x480844\nMLA             R1, R2, R11, R1                                        ; +0x36, 0x480846\nBEQ             loc_480852                                             ; +0x3a, 0x48084a\nLDR             R0, [R1,#8]                                            ; +0x3c, 0x48084c\nCMP             R0, R7                                                 ; +0x3e, 0x48084e\nB               loc_480856                                             ; +0x40, 0x480850\nLDR             R0, [R1,#4]                                            ; +0x42, 0x480852\nCMP             R0, R8                                                 ; +0x44, 0x480854\nBNE             loc_480876                                             ; +0x46, 0x480856\nCBNZ            R6, loc_480866                                         ; +0x48, 0x480858\nMOV             R0, R10                                                ; +0x4a, 0x48085a\nSTR             R2, [SP,#0xC+var_8]                                    ; +0x4c, 0x48085c\nBL              _ZNSt6vectorI20EventTriggerInstanceSaIS0_EE8_M_eraseEN9__gnu_cxx17__normal_iteratorIPS0_S2_EE; std::vector<EventTriggerInstance>::_M_erase(__gnu_cxx::__normal_iterator<EventTriggerInstance*,std::vector<EventTriggerInstance>>) ; +0x4e, 0x48085e\nLDR             R2, [SP,#0xC+var_8]                                    ; +0x52, 0x480862\nB               loc_480834                                             ; +0x54, 0x480864\nCMP             R6, #1                                                 ; +0x56, 0x480866\nBNE             loc_48086E                                             ; +0x58, 0x480868\nSTRB            R6, [R1,#0xC]                                          ; +0x5a, 0x48086a\nB               loc_480876                                             ; +0x5c, 0x48086c\nCMP             R6, #2                                                 ; +0x5e, 0x48086e\nIT EQ                                                                  ; +0x60, 0x480870\nSTRBEQ.W        R9, [R1,#0xC]                                          ; +0x62, 0x480872\nADD.W           R11, R11, #1                                           ; +0x66, 0x480876\nB               loc_480834                                             ; +0x6a, 0x48087a\nMOV             R0, R4                                                 ; +0x6c, 0x48087c\nBL              sub_761FA8                                             ; +0x6e, 0x48087e\nMOV             R4, R0                                                 ; +0x72, 0x480882\nB               loc_480826                                             ; +0x74, 0x480884\nADD             SP, SP, #0xC                                           ; +0x76, 0x480886\nPOP.W           {R4-R11,PC}                                            ; +0x78, 0x480888", "xrefs": ["GJBaseGameLayer::controlTriggersWithControlID @ 0x495c9a", "GJBaseGameLayer::controlTriggersInGroup @ 0x495f62"], "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"}