{"type": "func", "start": 6442549568, "end": 6442549702, "name": "cocos2d::extension::CCHttpClient::availableThreadCount", "pseudocode": "// \n// cocos2d::extension::CCHttpClient::availableThreadCount from 0x180018140 to 0x1800181c6 (134 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x180032408\n// > <???> @ 0x18004ca04\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 12:15:42 +0000\n// \n\n__int64 __fastcall cocos2d::extension::CCHttpClient::availableThreadCount(cocos2d::extension::CCHttpClient *this)\n{\n  __int64 v1; // rbx\n  struct _Mtx_internal_imp_t *v2; // rdi\n  unsigned __int64 v3; // rdx\n  unsigned __int64 v4; // rax\n  __int64 v5; // rbx\n\n  v1 = *((_QWORD *)this + 7);\n  v2 = (struct _Mtx_internal_imp_t *)(v1 + 64);\n  if ( Mtx_lock((_Mtx_t)(v1 + 64)) )\n  {\n    std::_Throw_Cpp_error(5);\n    __debugbreak();\n  }\n  if ( *(_DWORD *)(v1 + 140) == 0x7FFFFFFF )\n  {\n    *(_DWORD *)(v1 + 140) = 2147483646;\n    std::_Throw_Cpp_error(6);\n    __debugbreak();\n  }\n  v3 = *(_QWORD *)(v1 + 224) + *(_QWORD *)(v1 + 56);\n  v4 = (__int64)(*(_QWORD *)(v1 + 8) - *(_QWORD *)v1) >> 4;\n  v5 = v4 - v3;\n  if ( v4 <= v3 )\n    v5 = 0;\n  Mtx_unlock(v2);\n  return v5;\n}", "assembly": "; \n; cocos2d::extension::CCHttpClient::availableThreadCount from 0x180018140 to 0x1800181c6 (134 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x180032408\n; > <???> @ 0x18004ca04\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 12:15:42 +0000\n; \nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x180018140\npush    rdi                                                            ; +0x5, 0x180018145\nsub     rsp, 20h                                                       ; +0x6, 0x180018146\nmov     rbx, [rcx+38h]                                                 ; +0xa, 0x18001814a\nlea     rdi, [rbx+40h]                                                 ; +0xe, 0x18001814e\nmov     rcx, rdi; _Mtx_t                                               ; +0x12, 0x180018152\ncall    cs:_Mtx_lock                                                   ; +0x15, 0x180018155\ntest    eax, eax                                                       ; +0x1b, 0x18001815b\njz      short loc_18001816B                                            ; +0x1d, 0x18001815d\nmov     ecx, 5                                                         ; +0x1f, 0x18001815f\ncall    cs:?_Throw_Cpp_error@std@@YAXH@Z; std::_Throw_Cpp_error(int)   ; +0x24, 0x180018164\nint     3; Trap to Debugger                                            ; +0x2a, 0x18001816a\ncmp     dword ptr [rdi+4Ch], 7FFFFFFFh                                 ; +0x2b, 0x18001816b\njnz     short loc_180018187                                            ; +0x32, 0x180018172\nmov     ecx, 6                                                         ; +0x34, 0x180018174\nmov     dword ptr [rdi+4Ch], 7FFFFFFEh                                 ; +0x39, 0x180018179\ncall    cs:?_Throw_Cpp_error@std@@YAXH@Z; std::_Throw_Cpp_error(int)   ; +0x40, 0x180018180\nint     3; Trap to Debugger                                            ; +0x46, 0x180018186\nmov     rcx, [rbx+0E0h]                                                ; +0x47, 0x180018187\nmov     rax, [rbx+8]                                                   ; +0x4e, 0x18001818e\nsub     rax, [rbx]                                                     ; +0x52, 0x180018192\nmov     rdx, [rbx+38h]                                                 ; +0x55, 0x180018195\nadd     rdx, rcx                                                       ; +0x59, 0x180018199\nsar     rax, 4                                                         ; +0x5c, 0x18001819c\nxor     ecx, ecx                                                       ; +0x60, 0x1800181a0\nmov     rbx, rax                                                       ; +0x62, 0x1800181a2\nsub     rbx, rdx                                                       ; +0x65, 0x1800181a5\ncmp     rax, rdx                                                       ; +0x68, 0x1800181a8\ncmovbe  rbx, rcx                                                       ; +0x6b, 0x1800181ab\nmov     rcx, rdi; _Mtx_t                                               ; +0x6f, 0x1800181af\ncall    cs:_Mtx_unlock                                                 ; +0x72, 0x1800181b2\nmov     rax, rbx                                                       ; +0x78, 0x1800181b8\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x7b, 0x1800181bb\nadd     rsp, 20h                                                       ; +0x80, 0x1800181c0\npop     rdi                                                            ; +0x84, 0x1800181c4\nretn                                                                   ; +0x85, 0x1800181c5", "xrefs": ["<???> @ 0x180032408", "<???> @ 0x18004ca04"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}