{"type": "func", "start": 743428, "end": 743572, "name": "sub_B5804", "pseudocode": "// \n// sub_B5804 from 0xb5804 to 0xb5894 (144 bytes)\n// \n// 3 xrefs:\n// > sub_B5764 @ 0xb5794\n// > sub_B57D4 @ 0xb57f0\n// > sub_B5954 @ 0xb5984\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\n__int64 __fastcall sub_B5804(__int64 a1, unsigned int a2)\n{\n  __int64 result; // x0\n  __int64 v5; // x8\n  void *v6; // x8\n  void *dest; // [xsp+8h] [xbp-18h] BYREF\n\n  if ( *(_DWORD *)(a1 + 8) > (signed int)a2 )\n    return 28;\n  dest = nullptr;\n  if ( a2 )\n  {\n    result = sub_B5894(a2, &dest);\n    if ( (_DWORD)result )\n      return result;\n    v5 = *(int *)(a1 + 8);\n    if ( (_DWORD)v5 )\n      memcpy(dest, *(const void **)a1, 4 * v5);\n  }\n  if ( *(int *)(a1 + 12) >= 1 )\n    sub_65158(*(_QWORD *)a1);\n  v6 = dest;\n  *(_DWORD *)(a1 + 12) = a2;\n  *(_QWORD *)a1 = v6;\n  return 0;\n}", "assembly": "; \n; sub_B5804 from 0xb5804 to 0xb5894 (144 bytes)\n; \n; 3 xrefs:\n; > sub_B5764 @ 0xb5794\n; > sub_B57D4 @ 0xb57f0\n; > sub_B5954 @ 0xb5984\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\nSUB             SP, SP, #0x30                                          ; +0x0, 0xb5804\nSTP             X20, X19, [SP,#0x20+var_10]                            ; +0x4, 0xb5808\nSTP             X29, X30, [SP,#0x20+var_s0]                            ; +0x8, 0xb580c\nLDR             W8, [X0,#8]                                            ; +0xc, 0xb5810\nADD             X29, SP, #0x20                                         ; +0x10, 0xb5814\nCMP             W8, W1                                                 ; +0x14, 0xb5818\nB.LE            loc_B5828                                              ; +0x18, 0xb581c\nMOV             W0, #0x1C                                              ; +0x1c, 0xb5820\nB               loc_B5884                                              ; +0x20, 0xb5824\nMOV             X19, X0                                                ; +0x24, 0xb5828\nMOV             W20, W1                                                ; +0x28, 0xb582c\nSTR             XZR, [SP,#0x20+dest]                                   ; +0x2c, 0xb5830\nCBZ             W1, loc_B5860                                          ; +0x30, 0xb5834\nADD             X1, SP, #0x20+dest                                     ; +0x34, 0xb5838\nMOV             W0, W20                                                ; +0x38, 0xb583c\nBL              sub_B5894                                              ; +0x3c, 0xb5840\nCBNZ            W0, loc_B5884                                          ; +0x40, 0xb5844\nLDRSW           X8, [X19,#8]                                           ; +0x44, 0xb5848\nCBZ             W8, loc_B5860                                          ; +0x48, 0xb584c\nLDR             X0, [SP,#0x20+dest]; dest                              ; +0x4c, 0xb5850\nLDR             X1, [X19]; src                                         ; +0x50, 0xb5854\nLSL             X2, X8, #2; n                                          ; +0x54, 0xb5858\nBL              .memcpy                                                ; +0x58, 0xb585c\nLDR             W8, [X19,#0xC]                                         ; +0x5c, 0xb5860\nCMP             W8, #1                                                 ; +0x60, 0xb5864\nB.LT            loc_B5874                                              ; +0x64, 0xb5868\nLDR             X0, [X19]                                              ; +0x68, 0xb586c\nBL              sub_65158                                              ; +0x6c, 0xb5870\nLDR             X8, [SP,#0x20+dest]                                    ; +0x70, 0xb5874\nMOV             W0, WZR                                                ; +0x74, 0xb5878\nSTR             W20, [X19,#0xC]                                        ; +0x78, 0xb587c\nSTR             X8, [X19]                                              ; +0x7c, 0xb5880\nLDP             X29, X30, [SP,#0x20+var_s0]                            ; +0x80, 0xb5884\nLDP             X20, X19, [SP,#0x20+var_10]                            ; +0x84, 0xb5888\nADD             SP, SP, #0x30 ; '0'                                    ; +0x88, 0xb588c\nRET                                                                    ; +0x8c, 0xb5890", "xrefs": ["sub_B5764 @ 0xb5794", "sub_B57D4 @ 0xb57f0", "sub_B5954 @ 0xb5984"], "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"}