{"type": "func", "start": 4142690, "end": 4142774, "name": "EmoteSprite::charIndexForByte", "pseudocode": "// \n// EmoteSprite::charIndexForByte from 0x3f3662 to 0x3f36b6 (84 bytes)\n// \n// 4 xrefs:\n// > MultilineBitmapFont::initWithFont @ 0x3d64d8\n// > MultilineBitmapFont::initWithFont @ 0x3d6602\n// > MultilineBitmapFont::initWithFont @ 0x3d6610\n// > EmoteSprite::attachToLabel @ 0x3f455c\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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 11:47:15 +0000\n// \n\nint __fastcall EmoteSprite::charIndexForByte(unsigned __int8 *a1, int a2)\n{\n  int v2; // r3\n  int v3; // r2\n  int v4; // r4\n  int v5; // r4\n  int v6; // r5\n  int v7; // r2\n  unsigned __int8 *v8; // r7\n  unsigned __int8 v9; // r7\n  int v10; // r3\n\n  v2 = *a1;\n  if ( (v2 & 1) != 0 )\n    v3 = *((_DWORD *)a1 + 1);\n  else\n    v3 = v2 >> 1;\n  if ( a2 < v3 )\n  {\n    v5 = a2;\n  }\n  else\n  {\n    if ( (v2 & 1) != 0 )\n      v4 = *((_DWORD *)a1 + 1);\n    else\n      v4 = v2 >> 1;\n    v5 = v4 - 1;\n  }\n  v6 = 0;\n  v7 = 0;\n  while ( v6 <= v5 )\n  {\n    if ( (v2 & 1) != 0 )\n      v8 = *((unsigned __int8 **)a1 + 2);\n    else\n      v8 = a1 + 1;\n    v9 = v8[v6++];\n    if ( (v9 & 0xC0) != 0x80 )\n      ++v7;\n  }\n  if ( (v2 & 1) != 0 )\n    v10 = *((_DWORD *)a1 + 1);\n  else\n    v10 = v2 >> 1;\n  if ( a2 >= v10 )\n    return v7;\n  else\n    return v7 - 1;\n}", "assembly": "; \n; EmoteSprite::charIndexForByte from 0x3f3662 to 0x3f36b6 (84 bytes)\n; \n; 4 xrefs:\n; > MultilineBitmapFont::initWithFont @ 0x3d64d8\n; > MultilineBitmapFont::initWithFont @ 0x3d6602\n; > MultilineBitmapFont::initWithFont @ 0x3d6610\n; > EmoteSprite::attachToLabel @ 0x3f455c\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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 11:47:15 +0000\n; \nPUSH            {R4-R7,LR}                                             ; +0x0, 0x3f3662\nLDRB            R3, [R0]                                               ; +0x2, 0x3f3664\nANDS.W          R6, R3, #1                                             ; +0x4, 0x3f3666\nITE EQ                                                                 ; +0x8, 0x3f366a\nASREQ           R2, R3, #1                                             ; +0xa, 0x3f366c\nLDRNE           R2, [R0,#4]                                            ; +0xc, 0x3f366e\nCMP             R1, R2                                                 ; +0xe, 0x3f3670\nBLT             loc_3F3680                                             ; +0x10, 0x3f3672\nCBZ             R6, loc_3F367A                                         ; +0x12, 0x3f3674\nLDR             R4, [R0,#4]                                            ; +0x14, 0x3f3676\nB               loc_3F367C                                             ; +0x16, 0x3f3678\nASRS            R4, R3, #1                                             ; +0x18, 0x3f367a\nSUBS            R4, #1                                                 ; +0x1a, 0x3f367c\nB               loc_3F3682                                             ; +0x1c, 0x3f367e\nMOV             R4, R1                                                 ; +0x1e, 0x3f3680\nMOVS            R5, #0                                                 ; +0x20, 0x3f3682\nMOV             R2, R5                                                 ; +0x22, 0x3f3684\nCMP             R5, R4                                                 ; +0x24, 0x3f3686\nBGT             loc_3F36A2                                             ; +0x26, 0x3f3688\nCBZ             R6, loc_3F3690                                         ; +0x28, 0x3f368a\nLDR             R7, [R0,#8]                                            ; +0x2a, 0x3f368c\nB               loc_3F3692                                             ; +0x2c, 0x3f368e\nADDS            R7, R0, #1                                             ; +0x2e, 0x3f3690\nLDRB            R7, [R7,R5]                                            ; +0x30, 0x3f3692\nADDS            R5, #1                                                 ; +0x32, 0x3f3694\nAND.W           R7, R7, #0xC0                                          ; +0x34, 0x3f3696\nCMP             R7, #0x80                                              ; +0x38, 0x3f369a\nIT NE                                                                  ; +0x3a, 0x3f369c\nADDNE           R2, #1                                                 ; +0x3c, 0x3f369e\nB               loc_3F3686                                             ; +0x3e, 0x3f36a0\nCBZ             R6, loc_3F36A8                                         ; +0x40, 0x3f36a2\nLDR             R3, [R0,#4]                                            ; +0x42, 0x3f36a4\nB               loc_3F36AA                                             ; +0x44, 0x3f36a6\nASRS            R3, R3, #1                                             ; +0x46, 0x3f36a8\nCMP             R1, R3                                                 ; +0x48, 0x3f36aa\nITE LT                                                                 ; +0x4a, 0x3f36ac\nADDLT.W         R0, R2, #0xFFFFFFFF                                    ; +0x4c, 0x3f36ae\nMOVGE           R0, R2                                                 ; +0x50, 0x3f36b2\nPOP             {R4-R7,PC}                                             ; +0x52, 0x3f36b4", "xrefs": ["MultilineBitmapFont::initWithFont @ 0x3d64d8", "MultilineBitmapFont::initWithFont @ 0x3d6602", "MultilineBitmapFont::initWithFont @ 0x3d6610", "EmoteSprite::attachToLabel @ 0x3f455c"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "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"}