; ; sub_180047910 from 0x180047910 to 0x180047e3c (1324 bytes) ; ; 2 xrefs: ; > sub_1800447A0 @ 0x1800448e0 ; > @ 0x1801f828c ; ; 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_18], r9 ; +0x0, 0x180047910 mov [rsp+arg_0], rcx ; +0x5, 0x180047915 push rbx ; +0xa, 0x18004791a push rbp ; +0xb, 0x18004791b push rsi ; +0xc, 0x18004791c push rdi ; +0xd, 0x18004791d push r12 ; +0xe, 0x18004791e push r13 ; +0x10, 0x180047920 push r14 ; +0x12, 0x180047922 push r15 ; +0x14, 0x180047924 sub rsp, 48h ; +0x16, 0x180047926 mov r11, [rdx+8] ; +0x1a, 0x18004792a xor ebp, ebp ; +0x1e, 0x18004792e mov r12, r8 ; +0x20, 0x180047930 mov [rsp+88h+arg_8], 1 ; +0x23, 0x180047933 mov rbx, rdx ; +0x2e, 0x18004793e mov r13, [r11+1AC0h] ; +0x31, 0x180047941 cmp [r11+1D8h], ebp ; +0x38, 0x180047948 jz short loc_18004795A ; +0x3f, 0x18004794f mov r9, [r11+210h] ; +0x41, 0x180047951 jmp short loc_18004795D ; +0x48, 0x180047958 mov r9, rbp ; +0x4a, 0x18004795a mov rax, [rbx] ; +0x4d, 0x18004795d lea r15, [r11+2A0h] ; +0x50, 0x180047960 cmp [r11+1DCh], ebp ; +0x57, 0x180047967 mov edx, [r11+1F0h] ; +0x5e, 0x18004796e mov r8d, [r11+1FCh] ; +0x65, 0x180047975 cmovz r15, rbp ; +0x6c, 0x18004797c mov ecx, [rax+4] ; +0x70, 0x180047980 mov r10d, [r11+1F8h] ; +0x73, 0x180047983 mov esi, [rax+0Ch] ; +0x7a, 0x18004798a test ecx, ecx ; +0x7d, 0x18004798d jnz short loc_180047998 ; +0x7f, 0x18004798f mov ecx, [r11+204h] ; +0x81, 0x180047991 test esi, esi ; +0x88, 0x180047998 jnz short loc_1800479A3 ; +0x8a, 0x18004799a mov esi, [r11+208h] ; +0x8c, 0x18004799c test r8d, r8d ; +0x93, 0x1800479a3 jz short loc_1800479B2 ; +0x96, 0x1800479a6 lea esi, [r10+r8] ; +0x98, 0x1800479a8 shr esi, 1 ; +0x9c, 0x1800479ac inc esi ; +0x9e, 0x1800479ae jmp short loc_1800479D3 ; +0xa0, 0x1800479b0 cmp edx, [r11+1F4h] ; +0xa2, 0x1800479b2 jnz short loc_1800479C7 ; +0xa9, 0x1800479b9 test edx, edx ; +0xab, 0x1800479bb jz short loc_1800479C7 ; +0xad, 0x1800479bd imul esi, ecx ; +0xaf, 0x1800479bf imul esi, edx ; +0xb2, 0x1800479c2 jmp short loc_1800479CD ; +0xb5, 0x1800479c5 imul esi, ecx ; +0xb7, 0x1800479c7 shl esi, 0Ch ; +0xba, 0x1800479ca shr esi, 3 ; +0xbd, 0x1800479cd add esi, 40h ; '@' ; +0xc0, 0x1800479d0 mov r10, [rsp+88h+arg_18] ; +0xc3, 0x1800479d3 test r9, r9 ; +0xcb, 0x1800479db mov rdi, r10 ; +0xce, 0x1800479de mov [rsp+88h+var_60], r13 ; +0xd1, 0x1800479e1 cmovnz rdi, r9 ; +0xd6, 0x1800479e6 mov [rsp+88h+var_50], rbp ; +0xda, 0x1800479ea mov [rsp+88h+var_68], r12 ; +0xdf, 0x1800479ef mov r14, rbp ; +0xe4, 0x1800479f4 test r15, r15 ; +0xe7, 0x1800479f7 jz loc_180047B02 ; +0xea, 0x1800479fa mov r14d, [r15] ; +0xf0, 0x180047a00 mov [rsp+88h+arg_10], rbp ; +0xf3, 0x180047a03 mov rbp, cs:qword_180165968 ; +0xfb, 0x180047a0b lea r8d, [r14-1] ; +0x102, 0x180047a12 test r8d, r8d ; +0x106, 0x180047a16 js short loc_180047A57 ; +0x109, 0x180047a19 mov rdx, [r15+8] ; +0x10b, 0x180047a1b movsxd rax, r8d ; +0x10f, 0x180047a1f lea rcx, [rax+rax*2] ; +0x112, 0x180047a22 lea rax, [rdx+rcx*8] ; +0x116, 0x180047a26 nop word ptr [rax+rax+00h] ; +0x11a, 0x180047a2a mov rcx, [rax] ; +0x120, 0x180047a30 cmp rcx, rbp ; +0x123, 0x180047a33 jz short loc_180047A4D ; +0x126, 0x180047a36 cmp dword ptr [rax+10h], 0 ; +0x128, 0x180047a38 jbe short loc_180047A4D ; +0x12c, 0x180047a3c test r9, r9 ; +0x12e, 0x180047a3e jz short loc_180047A48 ; +0x131, 0x180047a41 cmp rcx, r9 ; +0x133, 0x180047a43 jnb short loc_180047A4D ; +0x136, 0x180047a46 cmp rcx, r10 ; +0x138, 0x180047a48 jbe short loc_180047A57 ; +0x13b, 0x180047a4b sub rax, 18h ; +0x13d, 0x180047a4d sub r8d, 1 ; +0x141, 0x180047a51 jns short loc_180047A30 ; +0x145, 0x180047a55 mov r10, r13 ; +0x147, 0x180047a57 test r8d, r8d ; +0x14a, 0x180047a5a js short loc_180047A78 ; +0x14d, 0x180047a5d mov rcx, [r15+8] ; +0x14f, 0x180047a5f movsxd rax, r8d ; +0x153, 0x180047a63 lea rdx, [rax+rax*2] ; +0x156, 0x180047a66 mov r10, [rcx+rdx*8+8] ; +0x15a, 0x180047a6a mov r8, [rcx+rdx*8] ; +0x15f, 0x180047a6f add r10, r13 ; +0x163, 0x180047a73 jmp short loc_180047A80 ; +0x166, 0x180047a76 mov r8, [rsp+88h+arg_10] ; +0x168, 0x180047a78 xor edx, edx ; +0x170, 0x180047a80 test r14d, r14d ; +0x172, 0x180047a82 jle short loc_180047ABD ; +0x175, 0x180047a85 mov rax, [r15+8] ; +0x177, 0x180047a87 nop dword ptr [rax+rax+00h] ; +0x17b, 0x180047a8b mov rcx, [rax] ; +0x180, 0x180047a90 cmp rcx, rbp ; +0x183, 0x180047a93 jz short loc_180047AB2 ; +0x186, 0x180047a96 cmp dword ptr [rax+10h], 0 ; +0x188, 0x180047a98 jbe short loc_180047AB2 ; +0x18c, 0x180047a9c test r9, r9 ; +0x18e, 0x180047a9e jz short loc_180047AA8 ; +0x191, 0x180047aa1 cmp rcx, r9 ; +0x193, 0x180047aa3 jnb short loc_180047AB2 ; +0x196, 0x180047aa6 cmp rcx, [rsp+88h+arg_18] ; +0x198, 0x180047aa8 ja short loc_180047ABD ; +0x1a0, 0x180047ab0 inc edx ; +0x1a2, 0x180047ab2 add rax, 18h ; +0x1a4, 0x180047ab4 cmp edx, r14d ; +0x1a8, 0x180047ab8 jl short loc_180047A90 ; +0x1ab, 0x180047abb cmp edx, r14d ; +0x1ad, 0x180047abd jge short loc_180047ADB ; +0x1b0, 0x180047ac0 mov rcx, [r15+8] ; +0x1b2, 0x180047ac2 movsxd rax, edx ; +0x1b6, 0x180047ac6 lea rdx, [rax+rax*2] ; +0x1b9, 0x180047ac9 mov r12, [rcx+rdx*8+8] ; +0x1bd, 0x180047acd mov rax, [rcx+rdx*8] ; +0x1c2, 0x180047ad2 add r12, r13 ; +0x1c6, 0x180047ad6 jmp short loc_180047ADE ; +0x1c9, 0x180047ad9 mov rax, rdi ; +0x1cb, 0x180047adb cmp r12, r10 ; +0x1ce, 0x180047ade jb short loc_180047AF5 ; +0x1d1, 0x180047ae1 mov [rsp+88h+var_60], r10 ; +0x1d3, 0x180047ae3 mov r14, r8 ; +0x1d8, 0x180047ae8 mov [rsp+88h+var_68], r12 ; +0x1db, 0x180047aeb mov rdi, rax ; +0x1e0, 0x180047af0 jmp short loc_180047AFA ; +0x1e3, 0x180047af3 mov r14, [rsp+88h+var_50] ; +0x1e5, 0x180047af5 mov r10, [rsp+88h+arg_18] ; +0x1ea, 0x180047afa cmp rdi, r14 ; +0x1f2, 0x180047b02 mov [r11+1AC8h], r10 ; +0x1f5, 0x180047b05 lea rbp, [rdi+1] ; +0x1fc, 0x180047b0c cmovnz rbp, rdi ; +0x200, 0x180047b10 cmp r14, rbp ; +0x204, 0x180047b14 jnb def_180047C0E; jumptable 0000000180047C0E default case, cases 5,6 ; +0x207, 0x180047b17 mov r9, [rsp+88h+var_60] ; +0x20d, 0x180047b1d lea r13, cs:180000000h ; +0x212, 0x180047b22 mov r8, [rsp+88h+var_68] ; +0x219, 0x180047b29 mov r15, [rsp+88h+arg_0] ; +0x21e, 0x180047b2e mov r12d, [rsp+88h+arg_8] ; +0x226, 0x180047b36 xchg ax, ax ; +0x22e, 0x180047b3e cmp r9, r8 ; +0x230, 0x180047b40 ja def_180047C0E; jumptable 0000000180047C0E default case, cases 5,6 ; +0x233, 0x180047b43 xorps xmm1, xmm1 ; +0x239, 0x180047b49 xorps xmm0, xmm0 ; +0x23c, 0x180047b4c mov rax, r10 ; +0x23f, 0x180047b4f sub rax, r14 ; +0x242, 0x180047b52 cvtsi2sd xmm1, rax ; +0x245, 0x180047b55 mov rax, rbp ; +0x24a, 0x180047b5a sub rax, r14 ; +0x24d, 0x180047b5d cvtsi2sd xmm0, rax ; +0x250, 0x180047b60 mov rax, r8 ; +0x255, 0x180047b65 sub rax, r9 ; +0x258, 0x180047b68 divsd xmm1, xmm0 ; +0x25b, 0x180047b6b xorps xmm0, xmm0 ; +0x25f, 0x180047b6f cvtsi2sd xmm0, rax ; +0x262, 0x180047b72 mov eax, esi ; +0x267, 0x180047b77 mulsd xmm1, xmm0 ; +0x269, 0x180047b79 cvttsd2si rdi, xmm1 ; +0x26d, 0x180047b7d sub rdi, rax ; +0x272, 0x180047b82 add rdi, r9 ; +0x275, 0x180047b85 cmp rdi, r8 ; +0x278, 0x180047b88 jl short loc_180047B91 ; +0x27b, 0x180047b8b lea rdi, [r8-1] ; +0x27d, 0x180047b8d mov rax, [rbx+8] ; +0x281, 0x180047b91 cmp rdi, r9 ; +0x285, 0x180047b95 mov rcx, rbx ; +0x288, 0x180047b98 cmovl rdi, r9 ; +0x28b, 0x180047b9b mov rdx, rdi ; +0x28f, 0x180047b9f mov r8, [rax+68h] ; +0x292, 0x180047ba2 call qword ptr [rax+8] ; +0x296, 0x180047ba6 test eax, eax ; +0x299, 0x180047ba9 jnz short def_180047C0E; jumptable 0000000180047C0E default case, cases 5,6 ; +0x29b, 0x180047bab mov rax, [rbx+8] ; +0x29d, 0x180047bad xor ecx, ecx ; +0x2a1, 0x180047bb1 mov [rax+1D0h], rcx ; +0x2a3, 0x180047bb3 mov rax, [rbx+8] ; +0x2aa, 0x180047bba mov [rax+1008h], ecx ; +0x2ae, 0x180047bbe mov rcx, [rbx+8] ; +0x2b4, 0x180047bc4 mov rcx, [rcx+78h] ; +0x2b8, 0x180047bc8 call sub_1800419B0 ; +0x2bc, 0x180047bcc mov rcx, [rbx] ; +0x2c1, 0x180047bd1 test eax, eax ; +0x2c4, 0x180047bd4 jz loc_180047E10 ; +0x2c6, 0x180047bd6 mov dword ptr [rcx], 2 ; +0x2cc, 0x180047bdc mov rax, [rbx+8] ; +0x2d2, 0x180047be2 mov dword ptr [rax+1AD0h], 0 ; +0x2d6, 0x180047be6 mov rax, [rbx] ; +0x2e0, 0x180047bf0 mov ecx, [rax] ; +0x2e3, 0x180047bf3 cmp ecx, 7; switch 8 cases ; +0x2e5, 0x180047bf5 ja short def_180047C0E; jumptable 0000000180047C0E default case, cases 5,6 ; +0x2e8, 0x180047bf8 nop word ptr [rax+rax+00h] ; +0x2ea, 0x180047bfa movsxd rax, ecx ; +0x2f0, 0x180047c00 mov ecx, ds:(jpt_180047C0E - 180000000h)[r13+rax*4] ; +0x2f3, 0x180047c03 add rcx, r13 ; +0x2fb, 0x180047c0b jmp rcx; switch jump ; +0x2fe, 0x180047c0e mov rdx, rbx; jumptable 0000000180047C0E case 0 ; +0x300, 0x180047c10 mov rcx, r15 ; +0x303, 0x180047c13 call sub_180044980 ; +0x306, 0x180047c16 test eax, eax ; +0x30b, 0x180047c1b jnz short loc_180047C73 ; +0x30d, 0x180047c1d mov rax, [rbx]; jumptable 0000000180047C0E default case, cases 5,6 ; +0x30f, 0x180047c1f mov dword ptr [rax], 6 ; +0x312, 0x180047c22 xor eax, eax ; +0x318, 0x180047c28 add rsp, 48h ; +0x31a, 0x180047c2a pop r15 ; +0x31e, 0x180047c2e pop r14 ; +0x320, 0x180047c30 pop r13 ; +0x322, 0x180047c32 pop r12 ; +0x324, 0x180047c34 pop rdi ; +0x326, 0x180047c36 pop rsi ; +0x327, 0x180047c37 pop rbp ; +0x328, 0x180047c38 pop rbx ; +0x329, 0x180047c39 retn ; +0x32a, 0x180047c3a mov rdx, rbx; jumptable 0000000180047C0E case 2 ; +0x32b, 0x180047c3b mov rcx, r15 ; +0x32e, 0x180047c3e call sub_180044B90 ; +0x331, 0x180047c41 test eax, eax ; +0x336, 0x180047c46 jz short loc_180047C8E; jumptable 0000000180047C0E cases 4,7 ; +0x338, 0x180047c48 jmp short loc_180047C73 ; +0x33a, 0x180047c4a mov r9d, 1; jumptable 0000000180047C0E case 3 ; +0x33c, 0x180047c4c lea r8, [rsp+88h+arg_10] ; +0x342, 0x180047c52 mov rdx, rbx ; +0x34a, 0x180047c5a mov rcx, r15 ; +0x34d, 0x180047c5d call sub_180044E10 ; +0x350, 0x180047c60 test eax, eax ; +0x355, 0x180047c65 jz short def_180047C0E; jumptable 0000000180047C0E default case, cases 5,6 ; +0x357, 0x180047c67 cmp dword ptr [rsp+88h+arg_10], 0 ; +0x359, 0x180047c69 jnz short loc_180047C8E; jumptable 0000000180047C0E cases 4,7 ; +0x361, 0x180047c71 mov rax, [rbx] ; +0x363, 0x180047c73 mov ecx, [rax] ; +0x366, 0x180047c76 cmp ecx, 7 ; +0x368, 0x180047c78 jbe short loc_180047C00 ; +0x36b, 0x180047c7b jmp short def_180047C0E; jumptable 0000000180047C0E default case, cases 5,6 ; +0x36d, 0x180047c7d mov rdx, rbx; jumptable 0000000180047C0E case 1 ; +0x36f, 0x180047c7f mov rcx, r15 ; +0x372, 0x180047c82 call sub_180045B60 ; +0x375, 0x180047c85 test eax, eax ; +0x37a, 0x180047c8a jz short def_180047C0E; jumptable 0000000180047C0E default case, cases 5,6 ; +0x37c, 0x180047c8c mov r8, [rbx+8]; jumptable 0000000180047C0E cases 4,7 ; +0x37e, 0x180047c8e cmp dword ptr [r8+1010h], 0 ; +0x382, 0x180047c92 jz loc_180047E06 ; +0x38a, 0x180047c9a cmp qword ptr [r8+1D0h], 0 ; +0x390, 0x180047ca0 mov rcx, [r8+10A8h] ; +0x398, 0x180047ca8 jz loc_180047DD0 ; +0x39f, 0x180047caf mov edx, [r8+1090h] ; +0x3a5, 0x180047cb5 add rdx, rcx ; +0x3ac, 0x180047cbc cmp rdx, rbp ; +0x3af, 0x180047cbf jb short loc_180047CCD ; +0x3b2, 0x180047cc2 test r12d, r12d ; +0x3b4, 0x180047cc4 jz loc_180047DD0 ; +0x3b7, 0x180047cc7 mov [rsp+88h+arg_8], 0 ; +0x3bd, 0x180047ccd cmp rcx, r14 ; +0x3c8, 0x180047cd8 jb def_180047C0E; jumptable 0000000180047C0E default case, cases 5,6 ; +0x3cb, 0x180047cdb mov rax, [r8+10h] ; +0x3d1, 0x180047ce1 cmp [rsp+88h+arg_18], rcx ; +0x3d5, 0x180047ce5 jnb short loc_180047D4F ; +0x3dd, 0x180047ced mov rbp, rdx ; +0x3df, 0x180047cef test rax, rax ; +0x3e2, 0x180047cf2 jz def_180047C0E; jumptable 0000000180047C0E default case, cases 5,6 ; +0x3e5, 0x180047cf5 mov r8, [r8+68h] ; +0x3eb, 0x180047cfb lea rdx, [rsp+88h+var_68] ; +0x3ef, 0x180047cff mov rcx, rbx ; +0x3f4, 0x180047d04 call rax ; +0x3f7, 0x180047d07 test eax, eax ; +0x3f9, 0x180047d09 jnz def_180047C0E; jumptable 0000000180047C0E default case, cases 5,6 ; +0x3fb, 0x180047d0b mov rcx, [rbx+8] ; +0x401, 0x180047d11 mov rcx, [rcx+78h] ; +0x405, 0x180047d15 call sub_180041B90 ; +0x409, 0x180047d19 test eax, eax ; +0x40e, 0x180047d1e jz def_180047C0E; jumptable 0000000180047C0E default case, cases 5,6 ; +0x410, 0x180047d20 mov rcx, [rbx+8] ; +0x416, 0x180047d26 mov rcx, [rcx+78h] ; +0x41a, 0x180047d2a call sub_180041A40 ; +0x41e, 0x180047d2e mov r8, [rsp+88h+var_68] ; +0x423, 0x180047d33 mov r9, [rsp+88h+var_60] ; +0x428, 0x180047d38 shr eax, 3 ; +0x42d, 0x180047d3d mov ecx, eax ; +0x430, 0x180047d40 sub r8, rcx ; +0x432, 0x180047d42 mov [rsp+88h+var_68], r8 ; +0x435, 0x180047d45 mov rcx, r8 ; +0x43a, 0x180047d4a jmp short loc_180047DAD ; +0x43d, 0x180047d4d mov r14, rdx ; +0x43f, 0x180047d4f test rax, rax ; +0x442, 0x180047d52 jz def_180047C0E; jumptable 0000000180047C0E default case, cases 5,6 ; +0x445, 0x180047d55 mov r8, [r8+68h] ; +0x44b, 0x180047d5b lea rdx, [rsp+88h+var_60] ; +0x44f, 0x180047d5f mov rcx, rbx ; +0x454, 0x180047d64 call rax ; +0x457, 0x180047d67 test eax, eax ; +0x459, 0x180047d69 jnz def_180047C0E; jumptable 0000000180047C0E default case, cases 5,6 ; +0x45b, 0x180047d6b mov rcx, [rbx+8] ; +0x461, 0x180047d71 mov rcx, [rcx+78h] ; +0x465, 0x180047d75 call sub_180041B90 ; +0x469, 0x180047d79 test eax, eax ; +0x46e, 0x180047d7e jz def_180047C0E; jumptable 0000000180047C0E default case, cases 5,6 ; +0x470, 0x180047d80 mov rcx, [rbx+8] ; +0x476, 0x180047d86 mov rcx, [rcx+78h] ; +0x47a, 0x180047d8a call sub_180041A40 ; +0x47e, 0x180047d8e mov r9, [rsp+88h+var_60] ; +0x483, 0x180047d93 mov r8, [rsp+88h+var_68] ; +0x488, 0x180047d98 shr eax, 3 ; +0x48d, 0x180047d9d mov ecx, eax ; +0x490, 0x180047da0 sub r9, rcx ; +0x492, 0x180047da2 mov [rsp+88h+var_60], r9 ; +0x495, 0x180047da5 mov rcx, r9 ; +0x49a, 0x180047daa mov r12d, [rsp+88h+arg_8] ; +0x49d, 0x180047dad sub rcx, rdi ; +0x4a5, 0x180047db5 add rcx, rcx ; +0x4a8, 0x180047db8 mov rax, 0AAAAAAAAAAAAAAABh ; +0x4ab, 0x180047dbb mul rcx ; +0x4b5, 0x180047dc5 shr rdx, 1 ; +0x4b8, 0x180047dc8 lea esi, [rdx+10h] ; +0x4bb, 0x180047dcb jmp short loc_180047DF0 ; +0x4be, 0x180047dce mov r9, [rsp+88h+var_60] ; +0x4c0, 0x180047dd0 cmp rdi, r9 ; +0x4c5, 0x180047dd5 jz def_180047C0E; jumptable 0000000180047C0E default case, cases 5,6 ; +0x4c8, 0x180047dd8 mov r8, [rsp+88h+var_68] ; +0x4ce, 0x180047dde test esi, esi ; +0x4d3, 0x180047de3 jz short loc_180047DEB ; +0x4d5, 0x180047de5 add esi, esi ; +0x4d7, 0x180047de7 jmp short loc_180047DF0 ; +0x4d9, 0x180047de9 mov esi, 10h ; +0x4db, 0x180047deb cmp r14, rbp ; +0x4e0, 0x180047df0 jnb def_180047C0E; jumptable 0000000180047C0E default case, cases 5,6 ; +0x4e3, 0x180047df3 mov r10, [rsp+88h+arg_18] ; +0x4e9, 0x180047df9 jmp loc_180047B40 ; +0x4f1, 0x180047e01 mov eax, 1 ; +0x4f6, 0x180047e06 jmp loc_180047C2A ; +0x4fb, 0x180047e0b mov dword ptr [rcx], 8 ; +0x500, 0x180047e10 jmp loc_180047C28 ; +0x506, 0x180047e16 align 4 ; +0x50b, 0x180047e1b dd offset loc_180047C10 - 180000000h; jump table for switch statement ; +0x50c, 0x180047e1c