Function at 0x40a020
Capabilities:
Check mutex on windows

Disassembly:
sub esp, 0x68
push ebp
push edi
xor ebp, ebp
mov edi, eax
cmp edi, ebp
mov dword [esp + 8], ebp
je 0x40a2eb
cmp byte [edi], 0
je 0x40a2eb
push ebx
push str.KaseyaLangXlateListSema
push ebp
lea eax, [esp + 0x20]
push eax
mov dword [esp + 0x24], 0xc
mov dword [esp + 0x28], ebp
mov dword [esp + 0x2c], 1
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov ebx, eax
cmp ebx, ebp
mov dword [esp + 0x10], ebx
jne 0x40a084
push str.ERROR:_Failed_to_create_list_mutex_in_parseLangXml___n
call fcn.00409e90
add esp, 4
pop ebx
pop edi
mov eax, ebp
pop ebp
add esp, 0x68
ret
push esi
mov esi, dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
push 0x1388
push ebx
call esi
cmp eax, 0x80
jne 0x40a0a2
push 0x1388
push ebx
call esi
cmp eax, ebp
je 0x40a0c6
push str.ERROR:_Failed_to_obtain_list_mutex_in_parseLangXml___n
call fcn.00409e90
add esp, 4
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x10]
pop esi
pop ebx
pop edi
pop ebp
add esp, 0x68
ret
mov ecx, dword [str._Translation]
push ecx
push edi
call fcn.00414350
mov esi, eax
add esp, 8
cmp esi, ebp
jne 0x40a0e9
mov dword [esp + 0x10], 0xfffffffe
jmp 0x40a2d1
mov eax, dword [str._Translation]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a0f1
sub eax, edx
mov edx, dword [str.__Translation_]
add esi, eax
push edx
push esi
call fcn.00414350
mov ebp, eax
mov eax, dword [str._XlateString]
push eax
push esi
call fcn.00414350
mov esi, eax
add esp, 0x10
test esi, esi
je 0x40a2d1
test ebp, ebp
je 0x40a130
cmp esi, ebp
jae 0x40a2d1
mov edx, dword [str._XlateString]
mov eax, edx
lea edi, [eax + 1]
jmp 0x40a140
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a140
sub eax, edi
add esi, eax
push edx
push esi
call fcn.00414350
mov ecx, dword [str.ID_]
mov dl, byte [0x421ecc]
mov ebx, eax
lea eax, [esp + 0x30]
push eax
push esi
mov dword [esp + 0x38], ecx
mov byte [esp + 0x3c], dl
call fcn.00414350
mov edi, eax
add esp, 0x10
test edi, edi
je 0x40a19b
test ebx, ebx
je 0x40a188
cmp edi, ebx
jb 0x40a188
xor edi, edi
jmp 0x40a19b
lea eax, [esp + 0x28]
lea edx, [eax + 1]
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a190
sub eax, edx
add edi, eax
mov edx, dword [0x421ebc]
mov ecx, dword [str.Translation_]
mov eax, dword [0x421ec0]
mov dword [esp + 0x2c], edx
lea edx, [esp + 0x28]
mov dword [esp + 0x28], ecx
mov cx, word [0x421ec4]
push edx
push esi
mov dword [esp + 0x38], eax
mov word [esp + 0x3c], cx
call fcn.00414350
mov esi, eax
add esp, 8
test esi, esi
je 0x40a1fb
test ebx, ebx
je 0x40a1e4
cmp esi, ebx
jb 0x40a1e4
xor esi, esi
jmp 0x40a1fb
lea eax, [esp + 0x28]
lea edx, [eax + 1]
jmp 0x40a1f0
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a1f0
sub eax, edx
add esi, eax
test edi, edi
je 0x40a2ae
test esi, esi
je 0x40a2ae
lea eax, [esp + 0x18]
push eax
push 0x421c18
push edi
call fcn.00415170
add esp, 0xc
cmp eax, 1
je 0x40a232
push str.ERROR:_parseLangXml___XlateString_entry_is_missing_its_ID_attribute._n
call fcn.00409e90
jmp 0x40a2c0
push 0x22
push esi
call fcn.00414460
add esp, 8
test eax, eax
je 0x40a2a2
mov byte [eax], 0
mov eax, esi
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a250
sub eax, edx
lea edi, [eax + 0x10]
push edi
push 1
call fcn.004151a4
add esp, 8
test eax, eax
jne 0x40a27b
push edi
push str.ERROR:_parseLangXml___Unable_to_allocate__d_bytes_of_memory_for_XlateString_entry._n
call fcn.00409e90
add esp, 8
jmp 0x40a2c3
mov ecx, dword [esp + 0x7c]
mov edx, dword [ecx]
mov dword [eax], edx
mov dword [ecx], eax
mov ecx, dword [esp + 0x18]
lea edx, [eax + 0xc]
mov dword [eax + 8], edx
mov dword [eax + 4], ecx
mov eax, esi
sub edx, esi
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x40a296
jmp 0x40a2c3
push str.ERROR:_parseLangXml___XlateString_entry_is_missing_its_translation_attribute._n
call fcn.00409e90
jmp 0x40a2c0
push str.ERROR:_parseLangXml___XlateString_entry_is_missing_a_required_attribute._n
call fcn.00409e90
mov dword [esp + 0x14], 1
add esp, 4
mov esi, ebx
test ebx, ebx
mov ebx, dword [esp + 0x14]
jne 0x40a124
push ebx
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x10]
pop esi
pop ebx
pop edi
pop ebp
add esp, 0x68
ret
pop edi
or eax, 0xffffffff
pop ebp
add esp, 0x68
ret