{"type": "func", "start": 4297632736, "end": 4297632828, "name": "GJBaseGameLayer::convertToClosestDirection", "pseudocode": "// \n// GJBaseGameLayer::convertToClosestDirection from 0x10028abe0 to 0x10028ac3c (92 bytes)\n// \n// 2 xrefs:\n// > sub_1002C2774 @ 0x1002c27d4\n// > sub_1002C9D20 @ 0x1002c9d80\n// \n// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!\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:02:00 +0000\n// \n\nfloat __fastcall GJBaseGameLayer::convertToClosestDirection(float result, float a2)\n{\n  if ( (float)-a2 > result )\n    return result + (float)(ceilf(floorf(fabsf(result) / a2) * 0.5) * (float)(a2 + a2));\n  if ( result > a2 )\n    return result - (float)(ceilf(floorf(fabsf(result) / a2) * 0.5) * (float)(a2 + a2));\n  return result;\n}", "assembly": "; \n; GJBaseGameLayer::convertToClosestDirection from 0x10028abe0 to 0x10028ac3c (92 bytes)\n; \n; 2 xrefs:\n; > sub_1002C2774 @ 0x1002c27d4\n; > sub_1002C9D20 @ 0x1002c9d80\n; \n; This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!\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:02:00 +0000\n; \nFNEG            S2, S1                                                 ; +0x0, 0x10028abe0\nFCMP            S2, S0                                                 ; +0x4, 0x10028abe4\nB.LE            loc_10028AC10                                          ; +0x8, 0x10028abe8\nFABS            S2, S0                                                 ; +0xc, 0x10028abec\nFDIV            S2, S2, S1                                             ; +0x10, 0x10028abf0\nFRINTM          S2, S2                                                 ; +0x14, 0x10028abf4\nFMOV            S3, #0.5                                               ; +0x18, 0x10028abf8\nFMUL            S2, S2, S3                                             ; +0x1c, 0x10028abfc\nFRINTP          S2, S2                                                 ; +0x20, 0x10028ac00\nFADD            S1, S1, S1                                             ; +0x24, 0x10028ac04\nFMADD           S0, S2, S1, S0                                         ; +0x28, 0x10028ac08\nRET                                                                    ; +0x2c, 0x10028ac0c\nFCMP            S0, S1                                                 ; +0x30, 0x10028ac10\nB.LE            locret_10028AC38                                       ; +0x34, 0x10028ac14\nFABS            S2, S0                                                 ; +0x38, 0x10028ac18\nFDIV            S2, S2, S1                                             ; +0x3c, 0x10028ac1c\nFRINTM          S2, S2                                                 ; +0x40, 0x10028ac20\nFMOV            S3, #0.5                                               ; +0x44, 0x10028ac24\nFMUL            S2, S2, S3                                             ; +0x48, 0x10028ac28\nFRINTP          S2, S2                                                 ; +0x4c, 0x10028ac2c\nFADD            S1, S1, S1                                             ; +0x50, 0x10028ac30\nFMSUB           S0, S2, S1, S0                                         ; +0x54, 0x10028ac34\nRET                                                                    ; +0x58, 0x10028ac38", "xrefs": ["sub_1002C2774 @ 0x1002c27d4", "sub_1002C9D20 @ 0x1002c9d80"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "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"}