{"type": "func", "start": 4301336864, "end": 4301337414, "name": "EditorUI::getRandomStartKey", "pseudocode": "// \n// EditorUI::getRandomStartKey from 0x100613120 to 0x100613346 (550 bytes)\n// \n// 2 xrefs:\n// > EditorUI::processSmartObjectsFromType @ 0x10004447f\n// > SetupSmartBlockLayer::onCreate @ 0x1004e6d60\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\nint __fastcall EditorUI::getRandomStartKey(int a1)\n{\n  int result; // eax\n  __m128 v2; // xmm0\n  bool v3; // cf\n  int v4; // eax\n\n  if ( a1 <= 1860 )\n  {\n    if ( a1 != 869 )\n    {\n      if ( a1 == 1431 )\n      {\n        qword_1009A35A0 = 214013 * qword_1009A35A0 + 2531011;\n        v2.f32[0] = (float)((float)(WORD1(qword_1009A35A0) & 0x7FFF) / 32767.0) * 3.0;\n        v2.f32[0] = _mm_round_ss(v2, v2, 9).f32[0];\n        result = 1431;\n        if ( (int)v2.f32[0] )\n          return ((int)v2.f32[0] == 1) ^ 0x599;\n      }\n      else if ( a1 == 1461 )\n      {\n        qword_1009A35A0 = 214013 * qword_1009A35A0 + 2531011;\n        v2.f32[0] = (float)((float)(WORD1(qword_1009A35A0) & 0x7FFF) / 32767.0) * 4.0;\n        v2.f32[0] = _mm_round_ss(v2, v2, 9).f32[0];\n        result = 1464;\n        if ( (unsigned int)(int)v2.f32[0] < 3 )\n          return (int)v2.f32[0] + 1461;\n      }\n      return result;\n    }\n    qword_1009A35A0 = 214013 * qword_1009A35A0 + 2531011;\n    v2.f32[0] = (float)((float)(WORD1(qword_1009A35A0) & 0x7FFF) / 32767.0)\n              + (float)((float)(WORD1(qword_1009A35A0) & 0x7FFF) / 32767.0);\n    v3 = (int)_mm_round_ss(v2, v2, 9).f32[0] == 0;\n    v4 = 870;\n    return v4 - v3;\n  }\n  switch ( a1 )\n  {\n    case 2838:\n      qword_1009A35A0 = 214013 * qword_1009A35A0 + 2531011;\n      v2.f32[0] = (float)((float)(WORD1(qword_1009A35A0) & 0x7FFF) / 32767.0)\n                + (float)((float)(WORD1(qword_1009A35A0) & 0x7FFF) / 32767.0);\n      return 2 * ((int)_mm_round_ss(v2, v2, 9).f32[0] != 0) + 2838;\n    case 2703:\n      qword_1009A35A0 = 214013 * qword_1009A35A0 + 2531011;\n      v2.f32[0] = (float)((float)(WORD1(qword_1009A35A0) & 0x7FFF) / 32767.0)\n                + (float)((float)(WORD1(qword_1009A35A0) & 0x7FFF) / 32767.0);\n      v3 = (int)_mm_round_ss(v2, v2, 9).f32[0] == 0;\n      v4 = 2704;\n      return v4 - v3;\n    case 1861:\n      qword_1009A35A0 = 214013 * qword_1009A35A0 + 2531011;\n      v2.f32[0] = (float)((float)(WORD1(qword_1009A35A0) & 0x7FFF) / 32767.0) * 4.0;\n      v2.f32[0] = _mm_round_ss(v2, v2, 9).f32[0];\n      result = 1864;\n      if ( (unsigned int)(int)v2.f32[0] < 3 )\n        return (int)v2.f32[0] + 1861;\n      break;\n  }\n  return result;\n}", "assembly": "; \n; EditorUI::getRandomStartKey from 0x100613120 to 0x100613346 (550 bytes)\n; \n; 2 xrefs:\n; > EditorUI::processSmartObjectsFromType @ 0x10004447f\n; > SetupSmartBlockLayer::onCreate @ 0x1004e6d60\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, 0x100613120\nmov     rbp, rsp                                                       ; +0x1, 0x100613121\ncmp     edi, 744h                                                      ; +0x4, 0x100613124\njg      short loc_1006131A1                                            ; +0xa, 0x10061312a\ncmp     edi, 365h                                                      ; +0xc, 0x10061312c\njz      loc_100613216                                                  ; +0x12, 0x100613132\ncmp     edi, 597h                                                      ; +0x18, 0x100613138\njz      loc_1006132A7                                                  ; +0x1e, 0x10061313e\ncmp     edi, 5B5h                                                      ; +0x24, 0x100613144\njnz     loc_100613344                                                  ; +0x2a, 0x10061314a\nimul    rax, cs:qword_1009A35A0, 343FDh                                ; +0x30, 0x100613150\nadd     rax, 269EC3h                                                   ; +0x3b, 0x10061315b\nmov     cs:qword_1009A35A0, rax                                        ; +0x41, 0x100613161\nshr     eax, 10h                                                       ; +0x48, 0x100613168\nand     eax, 7FFFh                                                     ; +0x4b, 0x10061316b\ncvtsi2ss xmm0, eax                                                     ; +0x50, 0x100613170\ndivss   xmm0, cs:dword_100816868                                       ; +0x54, 0x100613174\nmulss   xmm0, cs:dword_10081505C                                       ; +0x5c, 0x10061317c\nroundss xmm0, xmm0, 9                                                  ; +0x64, 0x100613184\ncvttss2si eax, xmm0                                                    ; +0x6a, 0x10061318a\nlea     ecx, [rax+5B5h]                                                ; +0x6e, 0x10061318e\ncmp     eax, 3                                                         ; +0x74, 0x100613194\nmov     eax, 5B8h                                                      ; +0x77, 0x100613197\ncmovb   eax, ecx                                                       ; +0x7c, 0x10061319c\npop     rbp                                                            ; +0x7f, 0x10061319f\nretn                                                                   ; +0x80, 0x1006131a0\ncmp     edi, 0B16h                                                     ; +0x81, 0x1006131a1\njz      loc_10061325D                                                  ; +0x87, 0x1006131a7\ncmp     edi, 0A8Fh                                                     ; +0x8d, 0x1006131ad\njz      loc_1006132FF                                                  ; +0x93, 0x1006131b3\ncmp     edi, 745h                                                      ; +0x99, 0x1006131b9\njnz     loc_100613344                                                  ; +0x9f, 0x1006131bf\nimul    rax, cs:qword_1009A35A0, 343FDh                                ; +0xa5, 0x1006131c5\nadd     rax, 269EC3h                                                   ; +0xb0, 0x1006131d0\nmov     cs:qword_1009A35A0, rax                                        ; +0xb6, 0x1006131d6\nshr     eax, 10h                                                       ; +0xbd, 0x1006131dd\nand     eax, 7FFFh                                                     ; +0xc0, 0x1006131e0\ncvtsi2ss xmm0, eax                                                     ; +0xc5, 0x1006131e5\ndivss   xmm0, cs:dword_100816868                                       ; +0xc9, 0x1006131e9\nmulss   xmm0, cs:dword_10081505C                                       ; +0xd1, 0x1006131f1\nroundss xmm0, xmm0, 9                                                  ; +0xd9, 0x1006131f9\ncvttss2si eax, xmm0                                                    ; +0xdf, 0x1006131ff\nlea     ecx, [rax+745h]                                                ; +0xe3, 0x100613203\ncmp     eax, 3                                                         ; +0xe9, 0x100613209\nmov     eax, 748h                                                      ; +0xec, 0x10061320c\ncmovb   eax, ecx                                                       ; +0xf1, 0x100613211\npop     rbp                                                            ; +0xf4, 0x100613214\nretn                                                                   ; +0xf5, 0x100613215\nimul    rax, cs:qword_1009A35A0, 343FDh                                ; +0xf6, 0x100613216\nadd     rax, 269EC3h                                                   ; +0x101, 0x100613221\nmov     cs:qword_1009A35A0, rax                                        ; +0x107, 0x100613227\nshr     eax, 10h                                                       ; +0x10e, 0x10061322e\nand     eax, 7FFFh                                                     ; +0x111, 0x100613231\ncvtsi2ss xmm0, eax                                                     ; +0x116, 0x100613236\ndivss   xmm0, cs:dword_100816868                                       ; +0x11a, 0x10061323a\naddss   xmm0, xmm0                                                     ; +0x122, 0x100613242\nroundss xmm0, xmm0, 9                                                  ; +0x126, 0x100613246\ncvttss2si eax, xmm0                                                    ; +0x12c, 0x10061324c\ncmp     eax, 1                                                         ; +0x130, 0x100613250\nmov     eax, 366h                                                      ; +0x133, 0x100613253\njmp     loc_100613341                                                  ; +0x138, 0x100613258\nimul    rax, cs:qword_1009A35A0, 343FDh                                ; +0x13d, 0x10061325d\nadd     rax, 269EC3h                                                   ; +0x148, 0x100613268\nmov     cs:qword_1009A35A0, rax                                        ; +0x14e, 0x10061326e\nshr     eax, 10h                                                       ; +0x155, 0x100613275\nand     eax, 7FFFh                                                     ; +0x158, 0x100613278\ncvtsi2ss xmm0, eax                                                     ; +0x15d, 0x10061327d\ndivss   xmm0, cs:dword_100816868                                       ; +0x161, 0x100613281\naddss   xmm0, xmm0                                                     ; +0x169, 0x100613289\nroundss xmm0, xmm0, 9                                                  ; +0x16d, 0x10061328d\ncvttss2si eax, xmm0                                                    ; +0x173, 0x100613293\nxor     ecx, ecx                                                       ; +0x177, 0x100613297\ntest    eax, eax                                                       ; +0x179, 0x100613299\nsetnz   cl                                                             ; +0x17b, 0x10061329b\nlea     eax, ds:0B16h[rcx*2]                                           ; +0x17e, 0x10061329e\npop     rbp                                                            ; +0x185, 0x1006132a5\nretn                                                                   ; +0x186, 0x1006132a6\nimul    rax, cs:qword_1009A35A0, 343FDh                                ; +0x187, 0x1006132a7\nadd     rax, 269EC3h                                                   ; +0x192, 0x1006132b2\nmov     cs:qword_1009A35A0, rax                                        ; +0x198, 0x1006132b8\nshr     eax, 10h                                                       ; +0x19f, 0x1006132bf\nand     eax, 7FFFh                                                     ; +0x1a2, 0x1006132c2\ncvtsi2ss xmm0, eax                                                     ; +0x1a7, 0x1006132c7\ndivss   xmm0, cs:dword_100816868                                       ; +0x1ab, 0x1006132cb\nmulss   xmm0, cs:flt_100815320                                         ; +0x1b3, 0x1006132d3\nroundss xmm0, xmm0, 9                                                  ; +0x1bb, 0x1006132db\ncvttss2si eax, xmm0                                                    ; +0x1c1, 0x1006132e1\nxor     ecx, ecx                                                       ; +0x1c5, 0x1006132e5\ncmp     eax, 1                                                         ; +0x1c7, 0x1006132e7\nsetz    cl                                                             ; +0x1ca, 0x1006132ea\nxor     ecx, 599h                                                      ; +0x1cd, 0x1006132ed\ntest    eax, eax                                                       ; +0x1d3, 0x1006132f3\nmov     eax, 597h                                                      ; +0x1d5, 0x1006132f5\ncmovnz  eax, ecx                                                       ; +0x1da, 0x1006132fa\npop     rbp                                                            ; +0x1dd, 0x1006132fd\nretn                                                                   ; +0x1de, 0x1006132fe\nimul    rax, cs:qword_1009A35A0, 343FDh                                ; +0x1df, 0x1006132ff\nadd     rax, 269EC3h                                                   ; +0x1ea, 0x10061330a\nmov     cs:qword_1009A35A0, rax                                        ; +0x1f0, 0x100613310\nshr     eax, 10h                                                       ; +0x1f7, 0x100613317\nand     eax, 7FFFh                                                     ; +0x1fa, 0x10061331a\ncvtsi2ss xmm0, eax                                                     ; +0x1ff, 0x10061331f\ndivss   xmm0, cs:dword_100816868                                       ; +0x203, 0x100613323\naddss   xmm0, xmm0                                                     ; +0x20b, 0x10061332b\nroundss xmm0, xmm0, 9                                                  ; +0x20f, 0x10061332f\ncvttss2si eax, xmm0                                                    ; +0x215, 0x100613335\ncmp     eax, 1                                                         ; +0x219, 0x100613339\nmov     eax, 0A90h                                                     ; +0x21c, 0x10061333c\nsbb     eax, 0                                                         ; +0x221, 0x100613341\npop     rbp                                                            ; +0x224, 0x100613344\nretn                                                                   ; +0x225, 0x100613345", "xrefs": ["EditorUI::processSmartObjectsFromType @ 0x10004447f", "SetupSmartBlockLayer::onCreate @ 0x1004e6d60"], "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"}