Function at 0x401000
Capabilities:
Check mutex on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x774
mov eax, dword [0x40d178]
xor eax, esp
mov dword [esp + 0x770], eax
mov eax, dword [ebp + 8]
push ebx
push esi
mov esi, dword [ebp + 0x10]
push edi
push 0x40ba5c
push esi
mov dword [esp + 0x14], eax
or ebx, 0xffffffff
call fcn.00401f63
xor edi, edi
add esp, 8
cmp eax, edi
jne 0x401050
push 0x40ba64
push esi
call fcn.00401f63
add esp, 8
cmp eax, edi
je 0x40105e
add eax, 6
push eax
call fcn.00402041
add esp, 4
mov ebx, eax
lea ecx, [esp + 0x570]
push ecx
call fcn.00401290
add esp, 4
test eax, eax
je 0x401198
lea edx, [esp + 0x570]
push edx
lea eax, [esp + 0x44]
push 0x104
mov esi, vtable.CListener.0
push eax
mov dword [esp + 0x3c], esi
mov dword [esp + 0x48], edi
mov dword [esp + 0x254], edi
mov dword [esp + 0x44], edi
mov dword [esp + 0x25c], 0xffffffff
mov dword [esp + 0x258], edi
mov dword [esp + 0x370], edi
call fcn.00402063
add esp, 0xc
push 0x208
lea ecx, [esp + 0x36c]
push edi
push ecx
mov dword [esp + 0x25c], ebx
call fcn.004068c0
add esp, 0xc
push str.kyoceramita_kmpop_10_
lea edx, [esp + 0x36c]
push 0x104
push edx
call fcn.00402063
add esp, 0xc
lea eax, [esp + 0x570]
push eax
lea ecx, [esp + 0x36c]
push 0x104
push ecx
call fcn.00401fc4
add esp, 0xc
lea edx, [esp + 0x368]
push 0x5c
push edx
call fcn.004020e1
add esp, 8
test eax, eax
je 0x40115c
lea eax, [esp + 0x368]
push 0x5c
push eax
call fcn.004020e1
add esp, 8
cmp eax, edi
je 0x40115c
lea ecx, [esp + 0x368]
push 0x5c
push ecx
mov word [eax], 0x5f
call fcn.004020e1
add esp, 8
cmp eax, edi
jne 0x401141
lea edx, [esp + 0x368]
push edx
push 1
push edi
call dword [sym.imp.KERNEL32.dll_CreateMutexW]
mov dword [esp + 0x10], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xb7
jne 0x4011b1
mov eax, dword [0x40e8a4]
cmp eax, edi
mov dword [esp + 0x30], esi
je 0x401198
push eax
call dword [sym.imp.USER32.dll_DestroyWindow]
mov dword [0x40e8a4], edi
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x770]
xor ecx, esp
call fcn.004020d2
mov esp, ebp
pop ebp
ret 0x10
mov esi, dword [esp + 0xc]
mov eax, esi
call fcn.00401430
mov eax, esi
lea esi, [esp + 0x30]
call fcn.004014c0
test eax, eax
jne 0x401202
mov eax, dword [0x40e8a4]
cmp eax, edi
mov dword [esp + 0x30], vtable.CListener.0
je 0x401198
push eax
call dword [sym.imp.USER32.dll_DestroyWindow]
mov dword [0x40e8a4], edi
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x770]
xor ecx, esp
call fcn.004020d2
mov esp, ebp
pop ebp
ret 0x10
mov esi, dword [sym.imp.USER32.dll_GetMessageW]
push edi
push edi
push edi
lea eax, [esp + 0x20]
push eax
call esi
test eax, eax
je 0x401240
mov ebx, dword [sym.imp.USER32.dll_TranslateMessage]
lea esp, [esp]
lea ecx, [esp + 0x14]
push ecx
call ebx
lea edx, [esp + 0x14]
push edx
call dword [sym.imp.USER32.dll_DispatchMessageW]
push edi
push edi
push edi
lea eax, [esp + 0x20]
push eax
call esi
test eax, eax
jne 0x401220
mov ecx, dword [esp + 0x10]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x40e8a4]
cmp eax, edi
mov esi, dword [esp + 0x1c]
mov dword [esp + 0x30], vtable.CListener.0
je 0x40126d
push eax
call dword [sym.imp.USER32.dll_DestroyWindow]
mov dword [0x40e8a4], edi
mov ecx, dword [esp + 0x77c]
pop edi
mov eax, esi
pop esi
pop ebx
xor ecx, esp
call fcn.004020d2
mov esp, ebp
pop ebp
ret 0x10