{"type": "func", "start": 4298651088, "end": 4298651307, "name": "GameManager::loadMiddlegroundAsync", "pseudocode": "// \n// GameManager::loadMiddlegroundAsync from 0x1003835d0 to 0x1003836ab (219 bytes)\n// \n// 1 xrefs:\n// > GJBaseGameLayer::swapMiddleground @ 0x100114af1\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 __fastcall GameManager::loadMiddlegroundAsync(GameManager *a1, int a2)\n{\n  char v2; // al\n  int v3; // eax\n  int v4; // ebx\n  cocos2d::CCTextureCache *v5; // r15\n  cocos2d::CCString *v6; // rax\n  const char *CString; // rax\n  cocos2d::CCTextureCache *v8; // r15\n  cocos2d::CCString *v9; // rax\n  const char *v10; // rax\n  char v11; // [rsp+0h] [rbp-20h]\n  char v12; // [rsp+0h] [rbp-20h]\n\n  v11 = v2;\n  v3 = 3;\n  if ( a2 < 3 )\n    v3 = a2;\n  v4 = 1;\n  if ( v3 >= 2 )\n    v4 = v3;\n  if ( !a1->m_loadingG1 && v4 != a1->m_loadedMG )\n  {\n    a1->m_loadingG1 = 1;\n    *(_WORD *)&a1->m_finishedLoadingMG1 = 0;\n    v5 = cocos2d::CCTextureCache::sharedTextureCache();\n    v6 = (cocos2d::CCString *)sub_1007AB580(\"fg_%02d_001.png\", v11);\n    CString = cocos2d::CCString::getCString(v6);\n    cocos2d::CCTextureCache::addImageAsync(\n      v5,\n      CString,\n      a1,\n      (cocos2d::SEL_MenuHandler)(unsigned __int64)GameManager::finishedLoadingMGAsync1,\n      v4,\n      kCCTexture2DPixelFormat_RGBA8888);\n    v8 = cocos2d::CCTextureCache::sharedTextureCache();\n    v9 = (cocos2d::CCString *)sub_1007AB580(\"fg_%02d_2_001.png\", v12);\n    v10 = cocos2d::CCString::getCString(v9);\n    cocos2d::CCTextureCache::addImageAsync(\n      v8,\n      v10,\n      a1,\n      (cocos2d::SEL_MenuHandler)(unsigned __int64)GameManager::finishedLoadingMGAsync2,\n      v4,\n      kCCTexture2DPixelFormat_RGBA8888);\n  }\n}", "assembly": "; \n; GameManager::loadMiddlegroundAsync from 0x1003835d0 to 0x1003836ab (219 bytes)\n; \n; 1 xrefs:\n; > GJBaseGameLayer::swapMiddleground @ 0x100114af1\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    rbp                                                            ; +0x0, 0x1003835d0\nmov     rbp, rsp                                                       ; +0x1, 0x1003835d1\npush    r15                                                            ; +0x4, 0x1003835d4\npush    r14                                                            ; +0x6, 0x1003835d6\npush    rbx                                                            ; +0x8, 0x1003835d8\npush    rax; char                                                      ; +0x9, 0x1003835d9\ncmp     esi, 3                                                         ; +0xa, 0x1003835da\nmov     eax, 3                                                         ; +0xd, 0x1003835dd\ncmovl   eax, esi                                                       ; +0x12, 0x1003835e2\ncmp     eax, 2                                                         ; +0x15, 0x1003835e5\nmov     ebx, 1                                                         ; +0x18, 0x1003835e8\ncmovge  ebx, eax                                                       ; +0x1d, 0x1003835ed\ncmp     byte ptr [rdi+3B6h], 0                                         ; +0x20, 0x1003835f0\njnz     loc_1003836A0                                                  ; +0x27, 0x1003835f7\ncmp     ebx, [rdi+3A8h]                                                ; +0x2d, 0x1003835fd\njz      loc_1003836A0                                                  ; +0x33, 0x100383603\nmov     byte ptr [rdi+3B6h], 1                                         ; +0x39, 0x100383609\nmov     word ptr [rdi+3B9h], 0                                         ; +0x40, 0x100383610\nmov     r14, rdi                                                       ; +0x49, 0x100383619\ncall    cocos2d__CCTextureCache__sharedTextureCache                    ; +0x4c, 0x10038361c\nmov     r15, rax                                                       ; +0x51, 0x100383621\nlea     rdi, aFg02d001Png; \"fg_%02d_001.png\"                           ; +0x54, 0x100383624\nmov     esi, ebx                                                       ; +0x5b, 0x10038362b\nxor     eax, eax                                                       ; +0x5d, 0x10038362d\ncall    sub_1007AB580                                                  ; +0x5f, 0x10038362f\nmov     rdi, rax                                                       ; +0x64, 0x100383634\ncall    cocos2d__CCString__getCString                                  ; +0x67, 0x100383637\nmov     dword ptr [rsp+20h+var_20], 0; char                            ; +0x6c, 0x10038363c\nlea     rcx, GameManager__finishedLoadingMGAsync1                      ; +0x73, 0x100383643\nmov     rdi, r15                                                       ; +0x7a, 0x10038364a\nmov     rsi, rax                                                       ; +0x7d, 0x10038364d\nmov     rdx, r14                                                       ; +0x80, 0x100383650\nxor     r8d, r8d                                                       ; +0x83, 0x100383653\nmov     r9d, ebx                                                       ; +0x86, 0x100383656\ncall    cocos2d__CCTextureCache__addImageAsync                         ; +0x89, 0x100383659\ncall    cocos2d__CCTextureCache__sharedTextureCache                    ; +0x8e, 0x10038365e\nmov     r15, rax                                                       ; +0x93, 0x100383663\nlea     rdi, aFg02d2001Png; \"fg_%02d_2_001.png\"                        ; +0x96, 0x100383666\nmov     esi, ebx                                                       ; +0x9d, 0x10038366d\nxor     eax, eax                                                       ; +0x9f, 0x10038366f\ncall    sub_1007AB580                                                  ; +0xa1, 0x100383671\nmov     rdi, rax                                                       ; +0xa6, 0x100383676\ncall    cocos2d__CCString__getCString                                  ; +0xa9, 0x100383679\nmov     dword ptr [rsp+20h+var_20], 0                                  ; +0xae, 0x10038367e\nlea     rcx, GameManager__finishedLoadingMGAsync2                      ; +0xb5, 0x100383685\nmov     rdi, r15                                                       ; +0xbc, 0x10038368c\nmov     rsi, rax                                                       ; +0xbf, 0x10038368f\nmov     rdx, r14                                                       ; +0xc2, 0x100383692\nxor     r8d, r8d                                                       ; +0xc5, 0x100383695\nmov     r9d, ebx                                                       ; +0xc8, 0x100383698\ncall    cocos2d__CCTextureCache__addImageAsync                         ; +0xcb, 0x10038369b\nadd     rsp, 8                                                         ; +0xd0, 0x1003836a0\npop     rbx                                                            ; +0xd4, 0x1003836a4\npop     r14                                                            ; +0xd5, 0x1003836a5\npop     r15                                                            ; +0xd7, 0x1003836a7\npop     rbp                                                            ; +0xd9, 0x1003836a9\nretn                                                                   ; +0xda, 0x1003836aa", "xrefs": ["GJBaseGameLayer::swapMiddleground @ 0x100114af1"], "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"}