Function at 0x404e00
Capabilities:
Accept command line arguments
Check if file exists
Check mutex on windows
Get file attributes

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x51f9de
mov eax, dword fs:[0]
push eax
mov eax, 0x187c
call fcn.005068e0
mov eax, dword [0x579ec0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
xor esi, esi
push esi
mov ebx, ecx
call fcn.0040d134
add esp, 4
call fcn.0040c5ba
xor ecx, ecx
cmp eax, esi
setne cl
cmp ecx, esi
jne 0x404e59
push 0x80004005
call fcn.00404210
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x1880], eax
mov dword [ebp - 4], 1
call fcn.0040c5ba
xor ecx, ecx
cmp eax, esi
setne cl
cmp ecx, esi
jne 0x404e8c
push 0x80004005
call fcn.00404210
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x1884], eax
mov byte [ebp - 4], 3
mov dword [ebp - 0x187c], esi
mov dword [ebp - 0x1874], esi
call fcn.00403960
lea ecx, [ebp - 0x186c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
push eax
call dword [sym.imp.SHELL32.dll_CommandLineToArgvW]
dec dword [ebp - 0x186c]
push 0x30c
lea edx, [ebp - 0x628]
push edx
mov edi, eax
push esi
mov dword [ebp - 0x1878], edi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [ebp - 0x628]
push eax
lea ecx, [ebx + 0x1318]
call fcn.00401f50
call fcn.0040c5ba
xor ecx, ecx
test eax, eax
setne cl
test ecx, ecx
jne 0x404f14
push 0x80004005
call fcn.00404210
mov edx, dword [eax]
mov ecx, eax
mov eax, dword [edx + 0xc]
call eax
add eax, 0x10
mov dword [ebp - 0x1870], eax
mov byte [ebp - 4], 5
lea ecx, [ebx + 0x1318]
call fcn.00401fc0
test eax, eax
jne 0x404f3d
xor ecx, ecx
jmp 0x404f51
mov ecx, eax
lea esi, [ecx + 2]
mov dx, word [ecx]
add ecx, 2
test dx, dx
jne 0x404f42
sub ecx, esi
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x1870]
call fcn.00404a90
push str.BGIForInstalling.exe
lea ecx, [ebp - 0x1870]
call fcn.00404d50
mov esi, dword [sym.imp.KERNEL32.dll_CreateMutexW]
push str.Buriko_General_Interpreter_for_AmairoChocolate3_is_executing.
push 0
push 0
call esi
mov dword [ebx + 0xb8], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
xor ecx, ecx
cmp eax, 0xb7
sete cl
push str.Uninstaller_for_AmairoChocolate3_is_executing.
push 0
push 0
mov dword [ebp - 0x1888], ecx
call esi
cmp dword [ebp - 0x186c], 0
mov dword [ebx + 0xbc], eax
jle 0x4050aa
mov edi, dword [edi + 4]
mov ecx, str.main
mov eax, edi
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x404fe9
test dx, dx
je 0x404fe5
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x404fe9
add eax, 4
add ecx, 4
test dx, dx
jne 0x404fc3
xor eax, eax
jmp 0x404fee
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x40506a
mov eax, 1
cmp dword [ebp - 0x186c], eax
jle 0x40506a
push str.Syncronization_with_uninstaller_for_AmairoChocolate3.
push 0
push 0
mov dword [ebp - 0x187c], eax
call esi
push 0
lea ecx, [ebp - 0x1868]
mov dword [ebx + 0xc0], eax
call fcn.00405720
mov byte [ebp - 4], 6
mov edx, dword [ebp - 0x1878]
mov eax, dword [edx + 8]
push eax
lea ecx, [ebp - 0x1868]
call fcn.00405310
lea ecx, [ebp - 0x628]
push ecx
lea ecx, [ebp - 0x1868]
call fcn.00405340
lea ecx, [ebp - 0x1868]
call fcn.0040a427
mov byte [ebp - 4], 5
lea ecx, [ebp - 0x1868]
call fcn.00403f40
jmp 0x4050aa
mov ecx, str.CallFromLauncher
mov eax, edi
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x405097
test dx, dx
je 0x405093
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x405097
add eax, 4
add ecx, 4
test dx, dx
jne 0x405071
xor eax, eax
jmp 0x40509c
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x4050aa
mov dword [ebp - 0x1874], 1
mov edx, dword [ebp - 0x1878]
push edx
call dword [sym.imp.KERNEL32.dll_LocalFree]
cmp dword [ebp - 0x187c], 0
mov edi, dword [ebp - 0x1870]
jne 0x40515c
cmp dword [ebp - 0x1874], 0
jne 0x4050e5
mov eax, dword [ebp - 0x1888]
push eax
mov ecx, ebx
call fcn.00403ff0
test eax, eax
je 0x40515c
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x40515c
lea esi, [ebx + 0xc4]
push esi
mov ecx, ebx
call fcn.00404000
test eax, eax
jne 0x405114
push 0x2010
push str.PRODUCTNAME_SHOW
push str.SELFCLONINGHASBEENFAILED
jmp 0x405152
lea eax, [ebx + 0x1318]
push eax
push esi
mov ecx, ebx
call fcn.00404550
test eax, eax
jne 0x405138
push 0x2010
push str.PRODUCTNAME_SHOW
push str.EXECUTIONOFCLONEHASBEENFAILED
jmp 0x405152
mov ecx, ebx
call fcn.00404120
test eax, eax
jne 0x40515c
push 0x2010
push str.PRODUCTNAME_SHOW
push str.EXECUTIONOFCLONEMAYHAVEFAILED
push 0
call fcn.004038a0
add esp, 0x10
call fcn.00403910
mov byte [ebp - 4], 3
lea eax, [edi - 0x10]
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x405181
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [ebp - 4], 1
mov eax, dword [ebp - 0x1884]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4051a7
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 0x1880]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x4051d0
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0050629a
mov esp, ebp
pop ebp
ret