{"type": "func", "start": 4144712, "end": 4144898, "name": "EmoteSprite::defForName", "pseudocode": "// \n// EmoteSprite::defForName from 0x3f3e48 to 0x3f3f02 (186 bytes)\n// \n// 3 xrefs:\n// > EmoteSprite::parseTokens @ 0x3f4002\n// > EmoteSprite::createWithName @ 0x3f4466\n// > EmotePickerPopup::onBuildWindowContent @ 0x779832\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:16 +0000\n// \n\nint __fastcall EmoteSprite::defForName(int a1, int a2, int a3, int a4)\n{\n  unsigned int v5; // r1\n  char *v6; // r2\n  unsigned int i; // r3\n  char *v8; // r2\n  int v9; // r1\n  int *v10; // r2\n  int *v11; // r0\n  int v12; // r5\n  char *v14; // r2\n  int v15; // [sp+0h] [bp-10h] BYREF\n  unsigned int v16; // [sp+4h] [bp-Ch]\n  char *v17; // [sp+8h] [bp-8h]\n  int v18; // [sp+Ch] [bp-4h]\n\n  v18 = a4;\n  sub_3F3CB4();\n  v15 = 0;\n  v16 = 0;\n  v17 = nullptr;\n  if ( (*(_BYTE *)a1 & 1) != 0 )\n  {\n    std::string::__init(&v15, *(const void **)(a1 + 8), *(_DWORD *)(a1 + 4));\n  }\n  else\n  {\n    v5 = *(_DWORD *)(a1 + 4);\n    v6 = *(char **)(a1 + 8);\n    v15 = *(_DWORD *)a1;\n    v16 = v5;\n    v17 = v6;\n  }\n  for ( i = 0; ; ++i )\n  {\n    v9 = v15 & 1;\n    if ( !v9 )\n      break;\n    if ( i >= v16 )\n      goto LABEL_18;\n    v8 = v17;\nLABEL_7:\n    if ( (unsigned __int8)v8[i] > 0x40u )\n    {\n      v10 = v9 ? (int *)v17 : (int *)((char *)&v15 + 1);\n      if ( *((unsigned __int8 *)v10 + i) <= 0x5Au )\n      {\n        if ( v9 )\n          v14 = v17;\n        else\n          v14 = (char *)&v15 + 1;\n        v14[i] += 32;\n      }\n    }\n  }\n  if ( i < (unsigned __int8)v15 >> 1 )\n  {\n    v8 = (char *)&v15 + 1;\n    goto LABEL_7;\n  }\nLABEL_18:\n  v11 = std::__tree<std::__value_type<std::string,EmoteDef const*>,std::__map_value_compare<std::string,std::__value_type<std::string,EmoteDef const*>,std::less<std::string>,true>,std::allocator<std::__value_type<std::string,EmoteDef const*>>>::find<std::string>(\n          (int)&dword_D2B53C,\n          (unsigned __int8 *)&v15);\n  if ( v11 == &dword_D2B540 )\n    v12 = 0;\n  else\n    v12 = v11[7];\n  std::string::~string((int)&v15);\n  return v12;\n}", "assembly": "; \n; EmoteSprite::defForName from 0x3f3e48 to 0x3f3f02 (186 bytes)\n; \n; 3 xrefs:\n; > EmoteSprite::parseTokens @ 0x3f4002\n; > EmoteSprite::createWithName @ 0x3f4466\n; > EmotePickerPopup::onBuildWindowContent @ 0x779832\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:16 +0000\n; \nPUSH            {R0-R6,LR}                                             ; +0x0, 0x3f3e48\nMOV             R5, R0                                                 ; +0x2, 0x3f3e4a\nLDR             R6, =(__stack_chk_guard_ptr - 0x3F3E54)                ; +0x4, 0x3f3e4c\nMOV             R4, SP                                                 ; +0x6, 0x3f3e4e\nADD             R6, PC; __stack_chk_guard_ptr                          ; +0x8, 0x3f3e50\nLDR             R6, [R6]; __stack_chk_guard                            ; +0xa, 0x3f3e52\nLDR             R3, [R6]                                               ; +0xc, 0x3f3e54\nSTR             R3, [SP,#0x10+var_4]                                   ; +0xe, 0x3f3e56\nBL              sub_3F3CB4                                             ; +0x10, 0x3f3e58\nMOVS            R3, #0                                                 ; +0x14, 0x3f3e5c\nSTR             R3, [SP,#0x10+var_10]                                  ; +0x16, 0x3f3e5e\nSTR             R3, [SP,#0x10+var_C]                                   ; +0x18, 0x3f3e60\nSTR             R3, [SP,#0x10+var_8]                                   ; +0x1a, 0x3f3e62\nLDRB            R3, [R5]                                               ; +0x1c, 0x3f3e64\nTST.W           R3, #1                                                 ; +0x1e, 0x3f3e66\nBNE             loc_3F3E78                                             ; +0x22, 0x3f3e6a\nLDM.W           R5, {R0-R2}                                            ; +0x24, 0x3f3e6c\nSTMEA.W         SP, {R0-R2}                                            ; +0x28, 0x3f3e70\nMOVS            R3, #0                                                 ; +0x2c, 0x3f3e74\nB               loc_3F3E94                                             ; +0x2e, 0x3f3e76\nMOV             R0, SP                                                 ; +0x30, 0x3f3e78\nLDR             R1, [R5,#8]                                            ; +0x32, 0x3f3e7a\nLDR             R2, [R5,#4]                                            ; +0x34, 0x3f3e7c\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x36, 0x3f3e7e\nB               loc_3F3E74                                             ; +0x3a, 0x3f3e82\nLDR             R2, [SP,#0x10+var_C]                                   ; +0x3c, 0x3f3e84\nCMP             R3, R2                                                 ; +0x3e, 0x3f3e86\nBCS             loc_3F3EBE                                             ; +0x40, 0x3f3e88\nLDR             R2, [SP,#0x10+var_8]                                   ; +0x42, 0x3f3e8a\nLDRB            R2, [R2,R3]                                            ; +0x44, 0x3f3e8c\nCMP             R2, #0x40 ; '@'                                        ; +0x46, 0x3f3e8e\nBHI             loc_3F3EA0                                             ; +0x48, 0x3f3e90\nADDS            R3, #1                                                 ; +0x4a, 0x3f3e92\nLDRB.W          R2, [SP,#0x10+var_10]                                  ; +0x4c, 0x3f3e94\nANDS.W          R1, R2, #1                                             ; +0x50, 0x3f3e98\nBEQ             loc_3F3EB2                                             ; +0x54, 0x3f3e9c\nB               loc_3F3E84                                             ; +0x56, 0x3f3e9e\nCBZ             R1, loc_3F3EA6                                         ; +0x58, 0x3f3ea0\nLDR             R2, [SP,#0x10+var_8]                                   ; +0x5a, 0x3f3ea2\nB               loc_3F3EAA                                             ; +0x5c, 0x3f3ea4\nADD.W           R2, SP, #0x10+var_10+1                                 ; +0x5e, 0x3f3ea6\nLDRB            R2, [R2,R3]                                            ; +0x62, 0x3f3eaa\nCMP             R2, #0x5A ; 'Z'                                        ; +0x64, 0x3f3eac\nBLS             loc_3F3EEC                                             ; +0x66, 0x3f3eae\nB               loc_3F3E92                                             ; +0x68, 0x3f3eb0\nCMP.W           R3, R2,LSR#1                                           ; +0x6a, 0x3f3eb2\nBCS             loc_3F3EBE                                             ; +0x6e, 0x3f3eb6\nADD.W           R2, SP, #0x10+var_10+1                                 ; +0x70, 0x3f3eb8\nB               loc_3F3E8C                                             ; +0x74, 0x3f3ebc\nLDR             R5, =(dword_D2B530 - 0x3F3EC6)                         ; +0x76, 0x3f3ebe\nMOV             R1, R4                                                 ; +0x78, 0x3f3ec0\nADD             R5, PC; dword_D2B530                                   ; +0x7a, 0x3f3ec2\nADD.W           R0, R5, #(dword_D2B53C - 0xD2B530)                     ; +0x7c, 0x3f3ec4\nADDS            R5, #(dword_D2B540 - 0xD2B530)                         ; +0x80, 0x3f3ec8\nBL              _ZNSt6__ndk16__treeINS_12__value_typeINS_12basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEEPK8EmoteDefEENS_19__map_value_compareIS7_SB_NS_4lessIS7_EELb1EEENS5_ISB_EEE4findIS7_EENS_15__tree_iteratorISB_PNS_11__tree_nodeISB_PvEEiEERKT_; std::__tree<std::__value_type<std::string,EmoteDef const*>,std::__map_value_compare<std::string,std::__value_type<std::string,EmoteDef const*>,std::less<std::string>,true>,std::allocator<std::__value_type<std::string,EmoteDef const*>>>::find<std::string>(std::string const&) ; +0x82, 0x3f3eca\nCMP             R0, R5                                                 ; +0x86, 0x3f3ece\nIT NE                                                                  ; +0x88, 0x3f3ed0\nLDRNE           R5, [R0,#0x1C]                                         ; +0x8a, 0x3f3ed2\nMOV             R0, R4                                                 ; +0x8c, 0x3f3ed4\nIT EQ                                                                  ; +0x8e, 0x3f3ed6\nMOVEQ           R5, #0                                                 ; +0x90, 0x3f3ed8\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x92, 0x3f3eda\nLDR             R2, [SP,#0x10+var_4]                                   ; +0x96, 0x3f3ede\nLDR             R3, [R6]                                               ; +0x98, 0x3f3ee0\nMOV             R0, R5                                                 ; +0x9a, 0x3f3ee2\nCMP             R2, R3                                                 ; +0x9c, 0x3f3ee4\nBEQ             loc_3F3EFE                                             ; +0x9e, 0x3f3ee6\nBLX             __stack_chk_fail                                       ; +0xa0, 0x3f3ee8\nCBZ             R1, loc_3F3EF8                                         ; +0xa4, 0x3f3eec\nLDR             R2, [SP,#0x10+var_8]                                   ; +0xa6, 0x3f3eee\nLDRB            R1, [R2,R3]                                            ; +0xa8, 0x3f3ef0\nADDS            R1, #0x20 ; ' '                                        ; +0xaa, 0x3f3ef2\nSTRB            R1, [R2,R3]                                            ; +0xac, 0x3f3ef4\nB               loc_3F3E92                                             ; +0xae, 0x3f3ef6\nADD.W           R2, SP, #0x10+var_10+1                                 ; +0xb0, 0x3f3ef8\nB               loc_3F3EF0                                             ; +0xb4, 0x3f3efc\nADD             SP, SP, #0x10                                          ; +0xb6, 0x3f3efe\nPOP             {R4-R6,PC}                                             ; +0xb8, 0x3f3f00", "xrefs": ["EmoteSprite::parseTokens @ 0x3f4002", "EmoteSprite::createWithName @ 0x3f4466", "EmotePickerPopup::onBuildWindowContent @ 0x779832"], "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"}