Function at 0x409f04
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x2a8
mov rax, qword [0x0040f278]
mov qword [rsp + 0x290], rax
dec r8d
mov rax, r9
mov rsi, rdx
mov rdi, rcx
je 0x40a38e
dec r8d
je 0x40a381
sub r8d, 0xd
je 0x40a0e8
dec r8d
je 0x40a0ca
sub r8d, 0x101
je 0x40a0ac
sub r8d, 2
je 0x40a0d9
cmp r8d, 0x12d
jne 0x40a38e
movzx r13d, ax
mov r12, r13
lea rcx, [r13 + r13*2]
shl rcx, 4
call sub.msvcrt.dll_void____ptr64___cdecl_operator_new_unsigned_long_long_unsigned___int64__
mov ebx, 1
add dword [rdi + 0xac], ebx
test rax, rax
mov rbp, rax
je 0x40a099
mov r14, qword [rsp + 0x310]
lea r9d, [rbx + 0x2f]
mov r8, rax
mov rcx, r14
mov edx, r13d
call fcn.00409ea0
test eax, eax
je 0x40a089
test r13d, r13d
jle 0x40a089
mov r13, rbp
lea rcx, [rsp + 0xa0]
mov rdx, r13
mov r8d, 0x30
call sub.msvcrt.dll_memcpy
mov r15d, dword [rsp + 0xb0]
test r15d, r15d
je 0x40a074
mov rcx, qword [rsp + 0xa0]
mov r8d, 0x51eb851f
mov eax, r8d
imul ecx
shr rcx, 0x20
sar edx, 5
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, r8d
mov dword [rsp + 0x70], edx
imul ecx
sar edx, 5
mov rcx, rsi
mov eax, edx
shr eax, 0x1f
add edx, eax
mov dword [rsp + 0x74], edx
lea rdx, [rsp + 0x70]
call qword [sym.imp.USER32.dll_ScreenToClient]
test byte [rsp + 0xb4], 4
mov edx, r15d
mov rcx, rdi
je 0x40a059
call fcn.00409d98
add dword [rdi + 0xa8], ebx
jmp 0x40a074
call fcn.00409d28
movsxd rdx, eax
mov eax, dword [rsp + 0x70]
add rdx, rdx
mov dword [rdi + rdx*8 + 0x10], eax
mov eax, dword [rsp + 0x74]
mov dword [rdi + rdx*8 + 0x14], eax
mov rcx, r14
call fcn.00409e50
add r13, 0x30
sub r12, rbx
jne 0x409fd3
mov rcx, r14
call fcn.00409e50
mov rcx, rbp
call sub.msvcrt.dll_void___cdecl_operator_delete_void____ptr64_
xor r8d, r8d
xor edx, edx
mov rcx, rsi
call qword [sym.imp.USER32.dll_InvalidateRect]
jmp 0x40a37c
mov r9, qword [rsp + 0x310]
mov r8, rax
mov edx, 0x111
mov rcx, rsi
call qword [sym.imp.USER32.dll_DefWindowProcW]
jmp 0x40a390
mov rcx, qword [0x005b7580]
xor edx, edx
call qword [sym.imp.USER32.dll_ShowWindow]
movabs rax, 1
jmp 0x40a390
lea rdx, [rsp + 0xd0]
mov rcx, rsi
call qword [sym.imp.USER32.dll_BeginPaint]
lea rdx, [rsp + 0x78]
mov rcx, rsi
mov rbp, rax
call qword [sym.imp.USER32.dll_GetClientRect]
cmp qword [0x005b75b0], 0
jne 0x40a124
mov rcx, rbp
call qword [sym.imp.GDI32.dll_CreateCompatibleDC]
mov qword [0x005b75b0], rax
mov r8d, dword [rsp + 0x84]
mov edx, dword [rsp + 0x80]
mov rcx, rbp
call qword [sym.imp.GDI32.dll_CreateCompatibleBitmap]
mov rcx, qword [0x005b75b0]
mov rdx, rax
mov qword [0x005b75a8], rax
call qword [sym.imp.GDI32.dll_SelectObject]
cmp qword [0x005b75b0], 0
mov ebx, 1
mov qword [rsp + 0x88], rax
je 0x40a344
xor ecx, ecx
call qword [sym.imp.GDI32.dll_CreateSolidBrush]
mov rcx, qword [0x005b75b0]
lea rdx, [rsp + 0x78]
mov r8, rax
mov qword [rsp + 0x98], rax
call qword [sym.imp.USER32.dll_FillRect]
lea r13d, [rbx + 9]
xor r11d, r11d
mov rdx, r13
lea rcx, [rdi + 0xc]
cmp dword [rcx], 0xffffffff
cmovne r11d, ebx
add rcx, 0x10
sub rdx, rbx
jne 0x40a1a1
movsxd r14, r11d
lea r12, [rdi + 0x10]
mov eax, dword [rdi + 0x9c]
mov r9d, dword [rdi + 0xa8]
mov r8d, dword [rdi + 0xac]
mov dword [rsp + 0x68], eax
mov eax, dword [rdi + 0x8c]
lea rdx, str.Touch_commands__d_tc__d_ID:__d__d__d__d__d__d__d__d__d__d
mov dword [rsp + 0x60], eax
mov eax, dword [rdi + 0x7c]
lea rcx, [rsp + 0x120]
mov dword [rsp + 0x58], eax
mov eax, dword [rdi + 0x6c]
mov dword [rsp + 0x50], eax
mov eax, dword [rdi + 0x5c]
mov dword [rsp + 0x48], eax
mov eax, dword [rdi + 0x4c]
mov dword [rsp + 0x40], eax
mov eax, dword [rdi + 0x3c]
mov dword [rsp + 0x38], eax
mov eax, dword [rdi + 0x2c]
mov dword [rsp + 0x30], eax
mov eax, dword [rdi + 0x1c]
mov dword [rsp + 0x28], eax
mov eax, dword [rdi + 0xc]
mov dword [rsp + 0x20], eax
call qword [sym.imp.USER32.dll_wsprintfW]
mov rcx, qword [0x005b75b0]
xor edx, edx
call qword [sym.imp.GDI32.dll_SetBkColor]
mov rcx, qword [0x005b75b0]
mov edx, 0xffffff
call qword [sym.imp.GDI32.dll_SetTextColor]
test r14, r14
mov rcx, qword [0x005b75b0]
mov dword [rsp + 0x20], 0x28
lea r9, [rsp + 0x78]
mov r8d, 0xffffffff
lea rdx, [rsp + 0x120]
jne 0x40a276
lea rdx, [rdi + 0xb0]
call qword [sym.imp.USER32.dll_DrawTextW]
mov ecx, dword [r12 - 8]
call qword [sym.imp.GDI32.dll_CreateSolidBrush]
mov rcx, qword [0x005b75b0]
mov rdx, rax
mov r15, rax
call qword [sym.imp.GDI32.dll_SelectObject]
mov edx, dword [r12]
mov r8d, dword [r12 + 4]
test edx, edx
jle 0x40a2d1
test r8d, r8d
jle 0x40a2d1
mov ecx, dword [0x0040f258]
lea r10d, [r8 + rcx]
lea r9d, [rdx + rcx]
sub r8d, ecx
sub edx, ecx
mov rcx, qword [0x005b75b0]
mov dword [rsp + 0x20], r10d
call qword [sym.imp.GDI32.dll_Ellipse]
mov rdx, qword [0x005b75b0]
mov rcx, rsi
call qword [sym.imp.USER32.dll_ReleaseDC]
mov rcx, r15
call qword [sym.imp.GDI32.dll_DeleteObject]
add r12, 0x10
sub r13, rbx
jne 0x40a1b8
mov rax, qword [0x005b75b0]
mov r9d, dword [rsp + 0x80]
mov dword [rsp + 0x40], 0xcc0020
mov dword [rsp + 0x38], r13d
mov dword [rsp + 0x30], r13d
mov qword [rsp + 0x28], rax
mov eax, dword [rsp + 0x84]
xor r8d, r8d
xor edx, edx
mov rcx, rbp
mov dword [rsp + 0x20], eax
call qword [sym.imp.GDI32.dll_BitBlt]
mov rcx, qword [rsp + 0x98]
call qword [sym.imp.GDI32.dll_DeleteObject]
lea rdx, [rsp + 0xd0]
mov rcx, rsi
call qword [sym.imp.USER32.dll_EndPaint]
mov rdx, rbp
mov rcx, rsi
call qword [sym.imp.USER32.dll_ReleaseDC]
mov rcx, qword [0x005b75a8]
call qword [sym.imp.GDI32.dll_DeleteObject]
mov rcx, qword [rsp + 0x88]
call qword [sym.imp.GDI32.dll_DeleteObject]
mov rax, rbx
jmp 0x40a390
mov rcx, qword [0x005b75b0]
call qword [sym.imp.GDI32.dll_DeleteDC]
xor eax, eax
mov rcx, qword [rsp + 0x290]
call fcn.0040b190
add rsp, 0x2a8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret