{"type": "func", "start": 367004, "end": 367336, "name": "sub_5999C", "pseudocode": "// \n// sub_5999C from 0x5999c to 0x59ae8 (332 bytes)\n// \n// 2 xrefs:\n// > sub_597E0 @ 0x59828\n// > sub_5C1A8 @ 0x5c1ac\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_5999C(__int64 a1, float *a2, char a3)\n{\n  __int64 v3; // x8\n  __int64 v4; // x9\n  float v6; // s0\n  float v7; // s1\n  float v8; // s0\n  float v9; // s1\n  float v10; // s1\n  float v11; // s0\n  float v12; // s0\n  float v13; // s0\n  float v14; // s0\n  float v15; // s0\n  __int64 v16; // x8\n  float v17; // s1\n\n  if ( !a2 )\n    return 31;\n  v3 = *(_QWORD *)(a1 + 472);\n  if ( !v3 )\n    return 30;\n  v4 = *(_QWORD *)(a1 + 32);\n  if ( !v4 )\n    return 30;\n  if ( (*(_DWORD *)(a1 + 72) & 0x800002) != 0 )\n  {\n    *a2 = 0.0;\n    return 0;\n  }\n  if ( (*(_BYTE *)(v3 + 56) & 0x10) != 0 )\n  {\n    v8 = *(float *)(a1 + 240);\n    v9 = 1.0;\n    if ( v8 >= 1.0 )\n    {\n      v12 = (float)(*(float *)(a1 + 164) * *(float *)(a1 + 120))\n          - (float)(*(float *)(a1 + 192) * (float)(*(float *)(a1 + 164) * *(float *)(a1 + 120)));\n      v13 = v12 - (float)(*(float *)(a1 + 208) * v12);\n      if ( (a3 & 1) != 0 )\n        v9 = *(float *)(a1 + 536);\n      v11 = (float)(v13 * v9) * (float)(*(float *)(v4 + 496) * *(float *)(v4 + 492));\n      goto LABEL_20;\n    }\n    v10 = 1.0;\n    if ( (a3 & 1) != 0 )\n      v10 = *(float *)(a1 + 536);\n    v7 = (float)((float)((float)(1.0 - v8) + (float)(*(float *)(a1 + 164) * v8))\n               * (float)((float)((float)((float)(1.0 - v8) + (float)(*(float *)(a1 + 120) * v8))\n                               * (float)((float)(1.0 - v8) + (float)((float)(1.0 - *(float *)(a1 + 192)) * v8)))\n                       * (float)((float)(1.0 - v8) + (float)((float)(1.0 - *(float *)(a1 + 208)) * v8))))\n       * v10;\n    v6 = *(float *)(v4 + 492) * (float)((float)(1.0 - v8) + (float)(*(float *)(v4 + 496) * v8));\n  }\n  else\n  {\n    v6 = *(float *)(v4 + 492);\n    if ( (a3 & 1) != 0 )\n      v7 = *(float *)(a1 + 536);\n    else\n      v7 = 1.0;\n  }\n  v11 = v7 * v6;\nLABEL_20:\n  *a2 = v11;\n  v14 = v11 * *(float *)(a1 + 88);\n  *a2 = v14;\n  v15 = *(float *)(a1 + 92) + v14;\n  *a2 = v15;\n  v16 = *(_QWORD *)(v3 + 40);\n  if ( v16 )\n  {\n    v17 = *(float *)(v16 + 316);\n    if ( v17 != 0.0 )\n    {\n      v15 = v17 * v15;\n      *a2 = v15;\n    }\n  }\n  *a2 = fabsf(v15);\n  return 0;\n}", "assembly": "; \n; sub_5999C from 0x5999c to 0x59ae8 (332 bytes)\n; \n; 2 xrefs:\n; > sub_597E0 @ 0x59828\n; > sub_5C1A8 @ 0x5c1ac\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\nCBZ             X1, loc_599D4                                          ; +0x0, 0x5999c\nLDR             X8, [X0,#0x1D8]                                        ; +0x4, 0x599a0\nCBZ             X8, loc_599D0                                          ; +0x8, 0x599a4\nLDR             X9, [X0,#0x20]                                         ; +0xc, 0x599a8\nCBZ             X9, loc_599D0                                          ; +0x10, 0x599ac\nLDR             W10, [X0,#0x48]                                        ; +0x14, 0x599b0\nMOV             W11, #0x800002                                         ; +0x18, 0x599b4\nTST             W10, W11                                               ; +0x20, 0x599bc\nB.EQ            loc_599D8                                              ; +0x24, 0x599c0\nMOV             W0, WZR                                                ; +0x28, 0x599c4\nSTR             WZR, [X1]                                              ; +0x2c, 0x599c8\nRET                                                                    ; +0x30, 0x599cc\nB               loc_5C4EC                                              ; +0x34, 0x599d0\nB               loc_5C4E4                                              ; +0x38, 0x599d4\nLDRB            W10, [X8,#0x38]                                        ; +0x3c, 0x599d8\nTBNZ            W10, #4, loc_599F0                                     ; +0x40, 0x599dc\nLDR             S0, [X9,#0x1EC]                                        ; +0x44, 0x599e0\nTBZ             W2, #0, loc_59A5C                                      ; +0x48, 0x599e4\nLDR             S1, [X0,#0x218]                                        ; +0x4c, 0x599e8\nB               loc_59A60                                              ; +0x50, 0x599ec\nLDR             S0, [X0,#0xF0]                                         ; +0x54, 0x599f0\nFMOV            S1, #1.0                                               ; +0x58, 0x599f4\nFCMP            S0, S1                                                 ; +0x5c, 0x599f8\nB.GE            loc_59A68                                              ; +0x60, 0x599fc\nLDR             S5, [X0,#0xC0]                                         ; +0x64, 0x59a00\nLDR             S3, [X0,#0x78]                                         ; +0x68, 0x59a04\nLDR             S6, [X0,#0xD0]                                         ; +0x6c, 0x59a08\nFMOV            S1, #1.0                                               ; +0x70, 0x59a0c\nLDR             S4, [X0,#0xA4]                                         ; +0x74, 0x59a10\nFSUB            S2, S1, S0                                             ; +0x78, 0x59a14\nFSUB            S5, S1, S5                                             ; +0x7c, 0x59a18\nFMADD           S3, S3, S0, S2                                         ; +0x80, 0x59a1c\nFSUB            S6, S1, S6                                             ; +0x84, 0x59a20\nFMADD           S5, S5, S0, S2                                         ; +0x88, 0x59a24\nFMUL            S3, S3, S5                                             ; +0x8c, 0x59a28\nFMADD           S5, S6, S0, S2                                         ; +0x90, 0x59a2c\nFMADD           S4, S4, S0, S2                                         ; +0x94, 0x59a30\nFMUL            S3, S3, S5                                             ; +0x98, 0x59a34\nFMUL            S3, S4, S3                                             ; +0x9c, 0x59a38\nTBZ             W2, #0, loc_59A44                                      ; +0xa0, 0x59a3c\nLDR             S1, [X0,#0x218]                                        ; +0xa4, 0x59a40\nLDR             S4, [X9,#0x1F0]                                        ; +0xa8, 0x59a44\nLDR             S5, [X9,#0x1EC]                                        ; +0xac, 0x59a48\nFMUL            S1, S3, S1                                             ; +0xb0, 0x59a4c\nFMADD           S0, S4, S0, S2                                         ; +0xb4, 0x59a50\nFMUL            S0, S5, S0                                             ; +0xb8, 0x59a54\nB               loc_59A60                                              ; +0xbc, 0x59a58\nFMOV            S1, #1.0                                               ; +0xc0, 0x59a5c\nFMUL            S0, S1, S0                                             ; +0xc4, 0x59a60\nB               loc_59AA0                                              ; +0xc8, 0x59a64\nLDR             S0, [X0,#0x78]                                         ; +0xcc, 0x59a68\nLDR             S2, [X0,#0xA4]                                         ; +0xd0, 0x59a6c\nLDR             S3, [X0,#0xC0]                                         ; +0xd4, 0x59a70\nLDR             S4, [X0,#0xD0]                                         ; +0xd8, 0x59a74\nFMUL            S0, S2, S0                                             ; +0xdc, 0x59a78\nFMSUB           S0, S3, S0, S0                                         ; +0xe0, 0x59a7c\nFMSUB           S0, S4, S0, S0                                         ; +0xe4, 0x59a80\nTBZ             W2, #0, loc_59A8C                                      ; +0xe8, 0x59a84\nLDR             S1, [X0,#0x218]                                        ; +0xec, 0x59a88\nLDR             S2, [X9,#0x1F0]                                        ; +0xf0, 0x59a8c\nLDR             S3, [X9,#0x1EC]                                        ; +0xf4, 0x59a90\nFMUL            S0, S0, S1                                             ; +0xf8, 0x59a94\nFMUL            S1, S2, S3                                             ; +0xfc, 0x59a98\nFMUL            S0, S0, S1                                             ; +0x100, 0x59a9c\nSTR             S0, [X1]                                               ; +0x104, 0x59aa0\nLDR             S1, [X0,#0x58]                                         ; +0x108, 0x59aa4\nFMUL            S0, S0, S1                                             ; +0x10c, 0x59aa8\nSTR             S0, [X1]                                               ; +0x110, 0x59aac\nLDR             S1, [X0,#0x5C]                                         ; +0x114, 0x59ab0\nFADD            S0, S1, S0                                             ; +0x118, 0x59ab4\nSTR             S0, [X1]                                               ; +0x11c, 0x59ab8\nLDR             X8, [X8,#0x28]                                         ; +0x120, 0x59abc\nCBZ             X8, loc_59AD8                                          ; +0x124, 0x59ac0\nLDR             S1, [X8,#0x13C]                                        ; +0x128, 0x59ac4\nFCMP            S1, #0.0                                               ; +0x12c, 0x59ac8\nB.EQ            loc_59AD8                                              ; +0x130, 0x59acc\nFMUL            S0, S1, S0                                             ; +0x134, 0x59ad0\nSTR             S0, [X1]                                               ; +0x138, 0x59ad4\nMOV             W0, WZR                                                ; +0x13c, 0x59ad8\nFABS            S0, S0                                                 ; +0x140, 0x59adc\nSTR             S0, [X1]                                               ; +0x144, 0x59ae0\nRET                                                                    ; +0x148, 0x59ae4", "xrefs": ["sub_597E0 @ 0x59828", "sub_5C1A8 @ 0x5c1ac"], "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"}