Function at 0x401598
Capabilities:
Accept command line arguments
Check if file exists

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rbp
mov qword [rsp + 0x18], rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x60
mov rsi, r8
mov r14, rcx
call qword [sym.imp.KERNEL32.dll_GetCommandLineW]
xor ecx, ecx
mov rdi, rax
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
xor r9d, r9d
mov r8, rdi
mov rcx, rax
xor edx, edx
call fcn.0040b404
lea r8, str.Systweak_GameOptimizer_v0.9
xor edx, edx
mov ecx, 0x1f0001
call qword [sym.imp.KERNEL32.dll_OpenMutexW]
xor r15d, r15d
mov rbx, rax
cmp rax, r15
jne 0x401c69
lea r8, str.Systweak_GameOptimizer_v0.9
lea edx, [r15 + 1]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateMutexW]
mov r13, rax
cmp rax, r15
je 0x401d33
lea rcx, [rsp + 0x28]
mov rdx, rsi
call fcn.00406688
lea rcx, [rsp + 0x28]
call fcn.004053d4
mov rcx, rax
call fcn.00405488
mov rcx, qword [rsp + 0x28]
add rcx, 0xffffffffffffffe8
call fcn.0040617c
lea edx, [r15 + 1]
add rax, 0x18
mov qword [rsp + 0x20], rax
movsxd rdi, dword [rax - 0x10]
mov ecx, dword [rax - 0xc]
sub edx, dword [rax - 8]
sub ecx, edi
or edx, ecx
jge 0x401678
lea rcx, [rsp + 0x20]
mov edx, edi
call fcn.00406554
mov rax, qword [rsp + 0x20]
lea ecx, [rdi + 1]
movsxd rdx, ecx
mov rcx, rax
call fcn.0041b924
cmp edi, r15d
jl 0x401c5e
mov rax, qword [rsp + 0x20]
cmp edi, dword [rax - 0xc]
jg 0x401c5e
mov dword [rax - 0x10], edi
mov rax, qword [rsp + 0x20]
mov word [rax + rdi*2], r15w
call fcn.0040b984
mov rcx, rax
cmp rax, r15
jne 0x4016c2
mov ecx, 0x80004005
call fcn.0040659c
int3
mov rax, qword [rax]
call qword [rax + 0x18]
mov rcx, qword [rsp + 0x28]
or rsi, 0xffffffffffffffff
add rax, 0x18
mov qword [rsp + 0x38], rax
cmp dword [rcx - 0x10], r15d
jne 0x401742
lea rdx, [rax - 0x18]
mov eax, esi
lock xadd dword [rdx + 0x10], eax
add eax, esi
cmp eax, r15d
jg 0x4016fb
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov rdx, qword [rsp + 0x20]
mov eax, esi
add rdx, 0xffffffffffffffe8
lock xadd dword [rdx + 0x10], eax
add eax, esi
cmp eax, r15d
jg 0x40171b
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov rdx, qword [rsp + 0x28]
mov ecx, esi
add rdx, 0xffffffffffffffe8
lock xadd dword [rdx + 0x10], ecx
add ecx, esi
cmp ecx, r15d
jg 0x40173b
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov eax, esi
jmp 0x401d35
mov rax, qword [rsp + 0x20]
mov ebx, 5
cmp dword [rax - 0x10], r15d
jl 0x401778
lea rdx, str..exe_
mov rcx, rax
call fcn.0041b658
mov rdi, rax
cmp rax, r15
mov rax, qword [rsp + 0x20]
je 0x401778
sub rdi, rax
sar rdi, 1
cmp edi, esi
jne 0x4017b5
cmp dword [rax - 0x10], r15d
mov ebx, 4
jl 0x401c04
lea rdx, str..exe
mov rcx, rax
call fcn.0041b658
mov rdi, rax
cmp rax, r15
je 0x401c04
mov rax, qword [rsp + 0x20]
sub rdi, rax
sar rdi, 1
cmp edi, esi
je 0x401c04
lea ebp, [rdi + rbx]
cmp dword [rax - 0x10], ebp
jle 0x401862
mov rax, qword [rsp + 0x28]
lea rdx, [rsp + 0x48]
lea rcx, [rsp + 0x28]
mov r8d, dword [rax - 0x10]
sub r8d, edi
sub r8d, ebx
call fcn.0040557c
lea rcx, [rsp + 0x38]
mov rdx, rax
call fcn.004060fc
mov rdx, qword [rsp + 0x48]
mov eax, esi
add rdx, 0xffffffffffffffe8
lock xadd dword [rdx + 0x10], eax
add eax, esi
cmp eax, r15d
jg 0x40180c
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
lea rcx, [rsp + 0x38]
call fcn.004053d4
mov rcx, rax
call fcn.00405488
lea rdx, [rsp + 0x50]
lea rcx, [rsp + 0x28]
mov r8d, ebp
call fcn.00405620
lea rcx, [rsp + 0x28]
mov rdx, rax
call fcn.004060fc
mov rdx, qword [rsp + 0x50]
mov eax, esi
add rdx, 0xffffffffffffffe8
lock xadd dword [rdx + 0x10], eax
add eax, esi
cmp eax, r15d
jg 0x40185d
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov rax, qword [rsp + 0x20]
cmp edi, r15d
jl 0x401894
cmp edi, dword [rax - 0x10]
jg 0x401894
movsxd rcx, edi
lea rdx, str._service
lea rcx, [rax + rcx*2]
call fcn.0041b658
mov rbx, rax
cmp rax, r15
mov rax, qword [rsp + 0x20]
je 0x401894
sub rbx, rax
sar rbx, 1
jmp 0x401896
mov ebx, esi
cmp edi, r15d
jl 0x4018c2
cmp edi, dword [rax - 0x10]
jg 0x4018c2
movsxd rcx, edi
lea rdx, str._sound
lea rcx, [rax + rcx*2]
call fcn.0041b658
cmp rax, r15
je 0x4018c2
sub rax, qword [rsp + 0x20]
sar rax, 1
jmp 0x4018c4
mov eax, esi
mov rdx, qword [rsp + 0x28]
cmp ebx, edi
lea rcx, [rsp + 0x30]
setg r12b
cmp eax, edi
setg byte [0x00446ea4]
call fcn.00406688
mov rcx, qword [rsp + 0x30]
mov edi, dword [rcx - 0x10]
mov eax, dword [rcx - 0xc]
mov edx, 1
sub edx, dword [rcx - 8]
sub eax, edi
or edx, eax
jge 0x40190c
lea rcx, [rsp + 0x30]
mov edx, edi
call fcn.00406554
mov rcx, qword [rsp + 0x30]
call qword [sym.imp.SHLWAPI.dll_PathUnquoteSpacesW]
mov rcx, qword [rsp + 0x30]
movsxd rdx, dword [rcx - 0xc]
call fcn.0041b638
cmp eax, r15d
jl 0x401bf9
mov rcx, qword [rsp + 0x30]
cmp eax, dword [rcx - 0xc]
jg 0x401bf9
mov dword [rcx - 0x10], eax
movsxd rcx, eax
mov rax, qword [rsp + 0x30]
mov word [rax + rcx*2], r15w
mov rdx, qword [rsp + 0x30]
cmp rdx, r15
jne 0x401956
mov ecx, r15d
jmp 0x401967
xor eax, eax
mov rcx, rsi
mov rdi, rdx
repne scasw ax, word [rdi]
not rcx
dec rcx
mov r8d, ecx
lea rcx, [rsp + 0x28]
call fcn.004065b4
lea rcx, [rsp + 0x30]
call fcn.00405820
lea rcx, [rsp + 0x28]
call fcn.004053d4
mov rcx, rax
call fcn.00405488
mov rdx, qword [rsp + 0x30]
cmp rdx, r15
jne 0x40199f
mov ecx, r15d
jmp 0x4019b0
xor eax, eax
mov rcx, rsi
mov rdi, rdx
repne scasw ax, word [rdi]
not rcx
dec rcx
mov r8d, ecx
lea rcx, [rsp + 0x20]
call fcn.004065b4
lea rcx, [rsp + 0x20]
call fcn.004053d4
mov rcx, rax
call fcn.00405488
cmp r12b, r15b
je 0x401aae
mov ecx, 0x60
call fcn.00409fe4
mov rbp, rax
cmp rax, r15
je 0x401a35
lea rax, vtable.CServiceOptimize.0
lea rcx, [rbp + 0x10]
mov qword [rbp], rax
call fcn.0040cf84
lea rcx, [rbp + 0x38]
call fcn.0040cf84
lea rdx, [rbp + 0x10]
mov rcx, rbp
call fcn.00405254
lea rdx, [rbp + 0x38]
mov rcx, rbp
call fcn.00405254
mov rcx, rbp
call fcn.00402c90
mov rcx, rbp
call fcn.00404da4
mov byte [rbp + 8], r15b
jmp 0x401a38
mov rbp, r15
mov qword [0x00446ea8], rbp
call fcn.00402074
cmp eax, r15d
je 0x401aae
cmp qword [rbp + 0x48], r15
mov ebx, r15d
mov rdi, r15
jle 0x401aaa
cmp rdi, r15
jl 0x401b23
cmp rdi, qword [rbp + 0x48]
jge 0x401b23
mov rax, qword [rbp + 0x40]
mov rcx, qword [rax + rdi*8]
cmp byte [rcx + 0x12], r15b
je 0x401a9c
cmp byte [rcx + 0x10], r15b
je 0x401a9c
mov rcx, qword [rcx + 8]
sub rcx, 0x18
call fcn.0040617c
lea rcx, [rsp + 0x58]
add rax, 0x18
mov qword [rsp + 0x58], rax
call fcn.00402a44
inc ebx
inc rdi
movsxd rax, ebx
cmp rax, qword [rbp + 0x48]
jl 0x401a55
mov byte [rbp + 8], 1
lea rcx, [0x0040153c]
call qword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
lea rcx, [0x0044b4f0]
xor edx, edx
mov r8d, 0x2000
call fcn.0041cbe0
mov r8, qword [rsp + 0x28]
mov edi, 0x1000
lea rcx, [0x0044b4f0]
mov rdx, rdi
call fcn.0041b9c8
mov r8, qword [rsp + 0x20]
lea rcx, [0x0044d4f0]
mov rdx, rdi
call fcn.0041b9c8
mov rcx, qword [rsp + 0x28]
cmp dword [rcx - 0x10], r15d
je 0x401b29
call qword [sym.imp.SHLWAPI.dll_PathFileExistsW]
cmp eax, r15d
je 0x401b29
lea rcx, [0x00447050]
mov rdx, r14
call fcn.00406e38
jmp 0x401b31
call fcn.0040b74c
int3
xor ecx, ecx
call qword [sym.imp.USER32.dll_PostQuitMessage]
cmp r12b, r15b
je 0x401b7e
mov rcx, qword [0x00446ea8]
cmp rcx, r15
je 0x401b7e
mov edx, 0x60
lea r8d, [rdx - 0x5f]
call fcn.0040b10c
cmp eax, r15d
je 0x401b7e
mov rcx, qword [0x00446ea8]
call fcn.0040513c
mov rcx, qword [0x00446ea8]
cmp rcx, r15
je 0x401b77
mov rax, qword [rcx]
mov edx, 1
call qword [rax]
mov qword [0x00446ea8], r15
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rdx, qword [rsp + 0x30]
mov eax, esi
add rdx, 0xffffffffffffffe8
lock xadd dword [rdx + 0x10], eax
add eax, esi
cmp eax, r15d
jg 0x401baf
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov rdx, qword [rsp + 0x38]
mov eax, esi
add rdx, 0xffffffffffffffe8
lock xadd dword [rdx + 0x10], eax
add eax, esi
cmp eax, r15d
jg 0x401bcf
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov rdx, qword [rsp + 0x20]
mov eax, esi
add rdx, 0xffffffffffffffe8
lock xadd dword [rdx + 0x10], eax
add eax, esi
cmp eax, r15d
jg 0x401bef
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov rdx, qword [rsp + 0x28]
jmp 0x401d18
mov ecx, 0x80070057
call fcn.0040659c
int3
mov rdx, qword [rsp + 0x38]
mov eax, esi
add rdx, 0xffffffffffffffe8
lock xadd dword [rdx + 0x10], eax
add eax, esi
cmp eax, r15d
jg 0x401c24
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov rdx, qword [rsp + 0x20]
mov eax, esi
add rdx, 0xffffffffffffffe8
lock xadd dword [rdx + 0x10], eax
add eax, esi
cmp eax, r15d
jg 0x401c44
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
mov rdx, qword [rsp + 0x28]
mov eax, esi
add rdx, 0xffffffffffffffe8
lock xadd dword [rdx + 0x10], eax
add eax, esi
cmp eax, r15d
jmp 0x401730
mov ecx, 0x80070057
call fcn.0040659c
int3
lea rdx, str.Game_optimizer_test_application
lea rcx, [rsp + 0x40]
call fcn.00406688
mov rdx, qword [rsp + 0x40]
lea rcx, str.32770
call qword [sym.imp.USER32.dll_FindWindowW]
mov rcx, rax
mov rdi, rax
call qword [sym.imp.USER32.dll_IsWindow]
cmp eax, r15d
jne 0x401cad
mov rdx, qword [rsp + 0x40]
xor ecx, ecx
call qword [sym.imp.USER32.dll_FindWindowW]
mov rdi, rax
lea r8, str.Error
lea rdx, str.Game_is_already_running_do_you_want_to_close_it_now_
mov r9d, 0x24
xor ecx, ecx
call qword [sym.imp.USER32.dll_MessageBoxW]
mov rcx, rdi
cmp eax, 7
jne 0x401ce4
call qword [sym.imp.USER32.dll_IsWindow]
cmp eax, r15d
je 0x401d06
mov r8d, 0xc9
jmp 0x401cf5
call qword [sym.imp.USER32.dll_IsWindow]
cmp eax, r15d
je 0x401d06
mov r8d, 0xc8
xor r9d, r9d
mov edx, 0x111
mov rcx, rdi
call qword [sym.imp.USER32.dll_PostMessageW]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rdx, qword [rsp + 0x40]
or rsi, 0xffffffffffffffff
add rdx, 0xffffffffffffffe8
mov eax, esi
lock xadd dword [rdx + 0x10], eax
add eax, esi
cmp eax, r15d
jg 0x401d33
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
xor eax, eax
lea r11, [rsp + 0x60]
mov rbx, qword [r11 + 0x30]
mov rbp, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret