; ; sub_180040AD0 from 0x180040ad0 to 0x180040ca3 (467 bytes) ; ; 4 xrefs: ; > sub_18003FD60 @ 0x18004097f ; > sub_180040CB0 @ 0x180041782 ; > @ 0x1801f7f5c ; > @ 0x1801f7f68 ; ; This function is hookable on this platform! ; ; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA ; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings ; mov [rsp+arg_0], rbx ; +0x0, 0x180040ad0 mov [rsp+arg_8], rsi ; +0x5, 0x180040ad5 push rdi ; +0xa, 0x180040ada sub rsp, 30h ; +0xb, 0x180040adb mov eax, [r8+40h] ; +0xf, 0x180040adf mov r10, r9 ; +0x13, 0x180040ae3 mov rbx, r8 ; +0x16, 0x180040ae6 mov rsi, rdx ; +0x19, 0x180040ae9 mov rdi, rcx ; +0x1c, 0x180040aec mov [rsp+38h+arg_10], 0 ; +0x1f, 0x180040aef add eax, [r8+50h] ; +0x24, 0x180040af4 jnz short loc_180040AFF ; +0x28, 0x180040af8 and byte ptr [r8+3Ch], 0FEh ; +0x2a, 0x180040afa movzx eax, byte ptr [r8+3Ch] ; +0x2f, 0x180040aff test al, 8 ; +0x34, 0x180040b04 jz short loc_180040B1C ; +0x36, 0x180040b06 xor r9d, r9d ; +0x38, 0x180040b08 mov [rsp+38h+var_18], 0 ; +0x3b, 0x180040b0b mov rdx, r10 ; +0x44, 0x180040b14 call sub_1800D57B0 ; +0x47, 0x180040b17 mov rcx, [rbx+20h] ; +0x4c, 0x180040b1c test rcx, rcx ; +0x50, 0x180040b20 jz short loc_180040B33 ; +0x53, 0x180040b23 mov rax, [rcx] ; +0x55, 0x180040b25 lea rdx, [rsp+38h+arg_10] ; +0x58, 0x180040b28 call qword ptr [rax+0A8h] ; +0x5d, 0x180040b2d cmp [rsp+38h+arg_10], 0 ; +0x63, 0x180040b33 jz loc_180040C91 ; +0x68, 0x180040b38 movzx eax, byte ptr [rbx+3Ch] ; +0x6e, 0x180040b3e test al, 2 ; +0x72, 0x180040b42 jz short loc_180040B9E ; +0x74, 0x180040b44 mov eax, [rbx+4Ch] ; +0x76, 0x180040b46 xorps xmm1, xmm1 ; +0x79, 0x180040b49 add eax, [rbx+44h] ; +0x7c, 0x180040b4c xorps xmm0, xmm0 ; +0x7f, 0x180040b4f cvtsi2ss xmm0, dword ptr [rbx+70h] ; +0x82, 0x180040b52 mov rcx, [rbx+20h] ; +0x87, 0x180040b57 xor r8d, r8d ; +0x8b, 0x180040b5b mov rdx, [rcx] ; +0x8e, 0x180040b5e xorps xmm2, xmm2 ; +0x91, 0x180040b61 cvtsi2ss xmm2, dword ptr [rbx+0B0h] ; +0x94, 0x180040b64 cvtsi2ss xmm1, eax ; +0x9c, 0x180040b6c mulss xmm1, xmm0 ; +0xa0, 0x180040b70 xorps xmm0, xmm0 ; +0xa4, 0x180040b74 cvtsi2ss xmm0, dword ptr [rdi+0BE0h] ; +0xa7, 0x180040b77 mulss xmm1, xmm2 ; +0xaf, 0x180040b7f mulss xmm1, xmm0 ; +0xb3, 0x180040b83 mulss xmm1, cs:dword_18016560C ; +0xb7, 0x180040b87 mulss xmm1, dword ptr [rsi+0F0h] ; +0xbf, 0x180040b8f call qword ptr [rdx+20h] ; +0xc7, 0x180040b97 movzx eax, byte ptr [rbx+3Ch] ; +0xca, 0x180040b9a test al, 4 ; +0xce, 0x180040b9e jz short loc_180040BD3 ; +0xd0, 0x180040ba0 movd xmm1, dword ptr [rbx+48h] ; +0xd2, 0x180040ba2 mov rcx, [rbx+20h] ; +0xd7, 0x180040ba7 cvtdq2ps xmm1, xmm1 ; +0xdb, 0x180040bab mov rax, [rcx] ; +0xde, 0x180040bae subss xmm1, cs:dword_180164A34 ; +0xe1, 0x180040bb1 mulss xmm1, dword ptr [rdi+0BD8h] ; +0xe9, 0x180040bb9 mulss xmm1, cs:dword_180165610 ; +0xf1, 0x180040bc1 call qword ptr [rax+0B0h] ; +0xf9, 0x180040bc9 movzx eax, byte ptr [rbx+3Ch] ; +0xff, 0x180040bcf test al, 1 ; +0x103, 0x180040bd3 jz loc_180040C78 ; +0x105, 0x180040bd5 mov ecx, [rbx+40h] ; +0x10b, 0x180040bdb mov eax, 1 ; +0x10e, 0x180040bde add ecx, [rbx+50h] ; +0x113, 0x180040be3 cmp ecx, eax ; +0x116, 0x180040be6 cmovl ecx, eax ; +0x118, 0x180040be8 test [rdi+0BE6h], al ; +0x11b, 0x180040beb jz short loc_180040C5B ; +0x121, 0x180040bf1 movss xmm1, cs:dword_180165614 ; +0x123, 0x180040bf3 movd xmm0, ecx ; +0x12b, 0x180040bfb cvtdq2ps xmm0, xmm0 ; +0x12f, 0x180040bff subss xmm1, xmm0 ; +0x132, 0x180040c02 movss xmm0, cs:flt_180145750; X ; +0x136, 0x180040c06 mulss xmm1, cs:dword_180164628; Y ; +0x13e, 0x180040c0e call powf ; +0x146, 0x180040c16 mulss xmm0, cs:dword_180164650 ; +0x14b, 0x180040c1b addss xmm0, cs:dword_18014573C ; +0x153, 0x180040c23 cvttss2si ecx, xmm0 ; +0x15b, 0x180040c2b cmp ecx, 80000000h ; +0x15f, 0x180040c2f jz short loc_180040C55 ; +0x165, 0x180040c35 movd xmm1, ecx ; +0x167, 0x180040c37 cvtdq2ps xmm1, xmm1 ; +0x16b, 0x180040c3b ucomiss xmm1, xmm0 ; +0x16e, 0x180040c3e jz short loc_180040C55 ; +0x171, 0x180040c41 unpcklps xmm0, xmm0 ; +0x173, 0x180040c43 movmskps eax, xmm0 ; +0x176, 0x180040c46 and eax, 1 ; +0x179, 0x180040c49 sub ecx, eax ; +0x17c, 0x180040c4c movd xmm0, ecx ; +0x17e, 0x180040c4e cvtdq2ps xmm0, xmm0 ; +0x182, 0x180040c52 cvttss2si eax, xmm0 ; +0x185, 0x180040c55 jmp short loc_180040C64 ; +0x189, 0x180040c59 xor edx, edx ; +0x18b, 0x180040c5b mov eax, 0DA7600h ; +0x18d, 0x180040c5d div ecx ; +0x192, 0x180040c62 mov rcx, [rbx+20h] ; +0x194, 0x180040c64 movd xmm1, eax ; +0x198, 0x180040c68 cvtdq2ps xmm1, xmm1 ; +0x19c, 0x180040c6c call sub_1800CEE10 ; +0x19f, 0x180040c6f movzx eax, byte ptr [rbx+3Ch] ; +0x1a4, 0x180040c74 test al, 20h ; +0x1a8, 0x180040c78 jz short loc_180040C91 ; +0x1aa, 0x180040c7a mov rcx, [rbx+20h] ; +0x1ac, 0x180040c7c mov edx, 80h ; +0x1b0, 0x180040c80 call sub_1800CFDB0 ; +0x1b5, 0x180040c85 mov dword ptr [rbx+58h], 0 ; +0x1ba, 0x180040c8a mov rbx, [rsp+38h+arg_0] ; +0x1c1, 0x180040c91 xor eax, eax ; +0x1c6, 0x180040c96 mov rsi, [rsp+38h+arg_8] ; +0x1c8, 0x180040c98 add rsp, 30h ; +0x1cd, 0x180040c9d pop rdi ; +0x1d1, 0x180040ca1 retn ; +0x1d2, 0x180040ca2