Function at 0x40cde0
Capabilities:
Check if file exists

Disassembly:
push 0xffffffffffffffff
push 0x52a688
mov eax, dword fs:[0]
push eax
sub esp, 0x28
push ebx
push ebp
push esi
push edi
mov eax, dword [0x56b1dc]
xor eax, esp
push eax
lea eax, [esp + 0x3c]
mov dword fs:[0], eax
lea edi, [esp + 0x14]
call fcn.0045e680
mov dword [esp + 0x44], 0
mov edi, dword [esp + 0x14]
mov eax, dword [edi - 0xc]
test eax, eax
jle 0x40ce4f
lea ecx, [eax - 1]
test ecx, ecx
jl 0x40cec9
cmp ecx, eax
jg 0x40cec9
movzx eax, word [edi + ecx*2]
cmp ax, 0x5c
je 0x40ce4f
push 0x5c
lea edi, [esp + 0x18]
call fcn.004118c0
mov edi, dword [esp + 0x14]
lea eax, [esp + 0x14]
push eax
lea ecx, [esp + 0x1c]
push ecx
mov ebx, str.unselectdict.dat
call fcn.004036c0
add esp, 8
mov byte [esp + 0x44], 1
mov edx, dword [esp + 0x18]
push edx
call dword [0x5313c0]
test eax, eax
jne 0x40ced3
mov byte [esp + 0x44], al
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40ce9e
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [edi - 0x10]
mov dword [esp + 0x44], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40cec2
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor eax, eax
jmp 0x40d118
push 0x80070057
call fcn.004026a0
mov ecx, dword [esp + 0x18]
push ecx
xor ebx, ebx
push ebx
push str.unselectcount
push str.unselectdict
call dword [0x53133c]
mov edx, dword [0x5759e8]
mov esi, eax
mov eax, dword [edx + 0xc]
mov ecx, 0x5759e8
mov dword [esp + 0x24], esi
call eax
add eax, 0x10
mov dword [esp + 0x20], eax
xor ebp, ebp
cmp esi, ebx
mov byte [esp + 0x44], 2
jbe 0x40d0a6
push ebp
push str.unselect_u
lea edi, [esp + 0x28]
call fcn.00401f20
mov edx, dword [0x5759e8]
mov eax, dword [edx + 0xc]
add esp, 8
mov ecx, 0x5759e8
call eax
lea esi, [eax + 0x10]
mov dword [esp + 0x1c], esi
mov byte [esp + 0x44], 3
mov eax, dword [esi - 8]
mov edi, dword [esp + 0x18]
mov ecx, 1
sub ecx, dword [esi - 4]
sub eax, 0x400
or eax, ecx
jge 0x40cf6f
mov ecx, 0x400
lea eax, [esp + 0x1c]
call fcn.00402120
mov esi, dword [esp + 0x1c]
mov ecx, dword [esp + 0x20]
push edi
push 0x400
push esi
push ebx
push ecx
push str.unselectdict
call dword [0x531350]
cmp esi, ebx
jne 0x40cf8f
xor eax, eax
jmp 0x40cfa9
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40cf94
sub eax, edx
sar eax, 1
js 0x40cec9
cmp eax, dword [esi - 8]
jg 0x40cec9
mov dword [esi - 0xc], eax
mov word [esi + eax*2], bx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], ebx
push 0x2c
lea edx, [esp + 0x2c]
push edx
lea eax, [esp + 0x24]
push eax
mov byte [esp + 0x50], 4
call fcn.00466500
mov eax, dword [esp + 0x38]
add esp, 0xc
cmp eax, 3
jae 0x40d02c
mov edi, dword [esp + 0x28]
cmp edi, ebx
je 0x40d009
mov ebx, eax
call fcn.00401fc0
mov ecx, dword [esp + 0x28]
push ecx
call fcn.004ff948
add esp, 4
xor ebx, ebx
lea eax, [esi - 0x10]
mov byte [esp + 0x44], 2
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x40d095
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
jmp 0x40d095
cmp eax, 2
jbe 0x40cec9
mov ecx, dword [esp + 0x28]
mov eax, dword [ecx + 8]
mov ebx, dword [esp + 0x4c]
push eax
add ebx, 0x60
call fcn.0040e8c0
test eax, eax
je 0x40d054
mov dword [eax + 0x1c], 0
mov edi, dword [esp + 0x28]
test edi, edi
je 0x40d072
mov ebx, dword [esp + 0x2c]
call fcn.00401fc0
mov edx, dword [esp + 0x28]
push edx
call fcn.004ff948
add esp, 4
lea eax, [esi - 0x10]
mov byte [esp + 0x44], 2
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d093
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
xor ebx, ebx
add ebp, 1
cmp ebp, dword [esp + 0x24]
jb 0x40cf17
mov edi, dword [esp + 0x14]
mov byte [esp + 0x44], 1
mov eax, dword [esp + 0x20]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d0cb
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov byte [esp + 0x44], bl
mov eax, dword [esp + 0x18]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d0ef
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
lea eax, [edi - 0x10]
mov dword [esp + 0x44], 0xffffffff
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d113
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
mov ecx, dword [esp + 0x3c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x34
ret 4