Function at 0x10040ef4
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x10065d43
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x428
cmp byte [ebp + 0x10], 0
push ebx
push esi
push edi
mov dword [esp + 0x54], ecx
je 0x1004104f
mov dword [esp + 0x1c], 0x1b81
cmp dword [esp + 0x1c], 0xacc
jge 0x1004101c
lea eax, [esp + 0x14]
push eax
push 0x1006db3c
call fcn.1004be5b
mov eax, dword [esp + 0x1c]
pop ecx
pop ecx
test eax, eax
je 0x1004101c
xor ebx, ebx
dec eax
mov dword [esp + 0x14], eax
lea eax, [esp + 0x10]
push eax
push 0x1006db3c
call fcn.1004be5b
mov eax, dword [esp + 0x18]
pop ecx
pop ecx
add eax, eax
lea ecx, [esp + 0x44]
push eax
call fcn.1002c31e
mov dword [esp + 0x43c], ebx
mov eax, dword [esp + 0x10]
mov esi, dword [esp + 0x44]
add eax, eax
mov dword [esp + 0x1c], ebx
test eax, eax
jle 0x10040fbd
mov edi, esi
mov esi, ebx
push edi
push 0x1006db3c
call fcn.1004be5b
mov eax, dword [esp + 0x18]
inc esi
add eax, eax
add edi, 4
pop ecx
pop ecx
cmp esi, eax
jl 0x10040f9e
mov esi, dword [esp + 0x44]
mov edx, dword [esp + 0x48]
mov ecx, esi
mov eax, edx
mov byte [esp + 0x30], bl
push dword [esp + 0x30]
sub eax, esi
sar eax, 2
push eax
call fcn.1002d41b
mov ecx, dword [esp + 0x18]
mov eax, dword [esi + ecx*4]
sub eax, dword [esi + ecx*4 - 4]
push eax
push str._ld_n
call fcn.1004c39e
or dword [esp + 0x44c], 0xffffffff
add esp, 0x10
test esi, esi
je 0x10041010
push esi
call fcn.1004c569
pop ecx
mov dword [esp + 0x44], ebx
mov dword [esp + 0x48], ebx
mov dword [esp + 0x4c], ebx
mov eax, dword [esp + 0x14]
test eax, eax
jne 0x10040f5b
mov eax, dword [ebp + 8]
cmp byte [eax], 0
je 0x10041477
xor eax, eax
mov edx, 0x3c81
inc eax
mov ecx, 0x6826
push eax
push 0x1def
push 0x52c9
push eax
push eax
call fcn.10040360
add esp, 0x14
jmp 0x10041477
mov dword [esp + 0x1c], 0x6d17
cmp dword [esp + 0x1c], 0x6e32
push 0
pop ebx
mov dword [esp + 0x38], 1
jle 0x100410b5
mov esi, ebx
mov edi, ebx
mov eax, edi
lea ecx, [esp + 0xd8]
xor eax, esi
cdq
push edx
push eax
call fcn.10001a6a
pop ecx
pop ecx
cmp dword [eax + 0x14], 0x10
jb 0x1004108d
mov eax, dword [eax]
push eax
call fcn.1004c39e
pop ecx
push ebx
push 1
lea ecx, [esp + 0xe0]
call fcn.1000205a
inc edi
cmp edi, 0x2c90
jl 0x10041070
inc esi
cmp esi, 0x3d33
jl 0x1004106e
mov dword [esp + 0x2c], 0x1fde
cmp dword [esp + 0x2c], 0x57a
jge 0x10041445
movdqa xmm0, xmmword [0x10074170]
movdqu xmmword [esp + 0x58], xmm0
movdqa xmm0, xmmword [0x10074130]
movdqu xmmword [esp + 0x68], xmm0
movdqa xmm0, xmmword [0x10074220]
movdqu xmmword [esp + 0x78], xmm0
movdqa xmm0, xmmword [0x10074150]
movdqu xmmword [esp + 0x88], xmm0
movdqa xmm0, xmmword [0x10074190]
movdqu xmmword [esp + 0xb8], xmm0
movdqa xmm0, xmmword [0x10074140]
movdqu xmmword [esp + 0xc8], xmm0
movdqa xmm0, xmmword [0x10074160]
movdqu xmmword [esp + 0x98], xmm0
movdqa xmm0, xmmword [0x100741a0]
movdqu xmmword [esp + 0xa8], xmm0
jmp 0x10041422
mov edi, ebx
test eax, eax
jle 0x1004118d
mov esi, ebx
mov eax, dword [esp + 0x20]
lea ecx, [esi + 0x10146320]
lea eax, [eax + 0x10146320]
add eax, esi
sub eax, ecx
push eax
push 0x45
push ecx
call fcn.1004c450
mov ebx, dword [esp + 0x24]
add esp, 0xc
inc edi
mov dword [esp + 0x10], ebx
add esi, 0x34
cmp edi, ebx
jl 0x10041157
mov eax, dword [esp + 0x10]
xor ebx, ebx
imul eax, dword [esp + 0x20]
mov dword [esp + 0x10], eax
lea eax, [esp + 0x24]
push eax
push 0x1006db38
call fcn.1004be5b
cmp dword [esp + 0x2c], 0
mov eax, ebx
pop ecx
pop ecx
mov dword [esp + 0x14], ebx
jle 0x1004120c
mov ebx, dword [esp + 0x10]
lea edi, [esp + 0xf0]
lea edi, [edi + eax*4]
lea esi, [esp + 0x290]
lea esi, [esi + eax*4]
push edi
push esi
push str._d__d
call fcn.1004be5b
add esp, 0xc
dec dword [esi]
imul eax, dword [esi], 0x34
dec dword [edi]
mov ecx, dword [edi]
cmp byte [eax + ecx + 0x10146320], 0x45
jne 0x100411f7
mov byte [eax + ecx + 0x10146320], 0x51
dec ebx
mov eax, dword [esp + 0x14]
inc eax
mov dword [esp + 0x14], eax
cmp eax, dword [esp + 0x24]
jl 0x100411b8
mov dword [esp + 0x10], ebx
xor ebx, ebx
lea eax, [esp + 0x28]
push eax
push 0x1006db38
call fcn.1004be5b
cmp dword [esp + 0x30], 0
mov eax, ebx
pop ecx
pop ecx
mov dword [esp + 0x14], ebx
jle 0x10041282
mov ebx, dword [esp + 0x10]
lea edi, [esp + 0x360]
lea edi, [edi + eax*4]
lea esi, [esp + 0x1c0]
lea esi, [esi + eax*4]
push edi
push esi
push str._d__d
call fcn.1004be5b
add esp, 0xc
dec dword [esi]
imul eax, dword [esi], 0x34
dec dword [edi]
mov ecx, dword [edi]
cmp byte [eax + ecx + 0x10146320], 0x45
jne 0x1004126d
mov byte [eax + ecx + 0x10146320], 0x4b
dec ebx
mov eax, dword [esp + 0x14]
inc eax
mov dword [esp + 0x14], eax
cmp eax, dword [esp + 0x28]
jl 0x1004122e
mov dword [esp + 0x10], ebx
xor ebx, ebx
lea eax, [esp + 0x40]
push eax
push 0x1006db38
call fcn.1004be5b
cmp dword [esp + 0x48], 0
mov esi, ebx
pop ecx
pop ecx
jle 0x100412ec
mov ebx, dword [esp + 0x10]
lea eax, [esp + 0x3c]
push eax
lea eax, [esp + 0x38]
push eax
push str._d__d
call fcn.1004be5b
mov eax, dword [esp + 0x40]
add esp, 0xc
mov ecx, dword [esp + 0x3c]
dec eax
mov dword [esp + 0x34], eax
dec ecx
imul eax, eax, 0x34
mov dword [esp + 0x3c], ecx
cmp byte [eax + ecx + 0x10146320], 0x45
jne 0x100412df
mov byte [eax + ecx + 0x10146320], 0x50
dec ebx
inc esi
cmp esi, dword [esp + 0x40]
jl 0x100412a0
mov dword [esp + 0x10], ebx
xor ebx, ebx
cmp dword [esp + 0x24], 0
mov eax, ebx
mov dword [esp + 0x14], ebx
jle 0x1004139a
mov edx, dword [esp + eax*4 + 0x290]
mov ecx, ebx
mov edi, dword [esp + eax*4 + 0xf0]
mov ebx, dword [esp + 0x10]
mov dword [esp + 0x50], edx
mov dword [esp + 0x30], edi
mov eax, dword [esp + ecx + 0x58]
lea esi, [eax + edx]
mov edx, dword [esp + ecx + 0x78]
add edx, edi
test esi, esi
js 0x10041378
imul edi, esi, 0x34
imul eax, eax, 0x34
mov dword [esp + 0x2c], eax
cmp esi, dword [esp + 0x18]
jge 0x10041370
test edx, edx
js 0x10041370
cmp edx, dword [esp + 0x20]
jge 0x10041370
mov al, byte [edi + edx + 0x10146320]
cmp al, 0x58
je 0x10041353
cmp al, 0x45
jne 0x10041370
cmp al, 0x45
jne 0x10041360
mov byte [edi + edx + 0x10146320], 0x58
dec ebx
add esi, dword [esp + ecx + 0x58]
add edi, dword [esp + 0x2c]
add edx, dword [esp + ecx + 0x78]
test esi, esi
jns 0x10041334
mov edi, dword [esp + 0x30]
mov dword [esp + 0x10], ebx
mov edx, dword [esp + 0x50]
add ecx, 4
cmp ecx, 0x20
jl 0x10041319
mov eax, dword [esp + 0x14]
inc eax
push 0
mov dword [esp + 0x18], eax
pop ebx
cmp eax, dword [esp + 0x24]
jl 0x100412fd
cmp dword [esp + 0x28], 0
mov ecx, ebx
jle 0x10041405
mov edx, ebx
mov ebx, dword [esp + 0x10]
mov esi, dword [esp + edx + 0xb8]
mov eax, dword [esp + edx + 0x98]
add esi, dword [esp + ecx*4 + 0x1c0]
add eax, dword [esp + ecx*4 + 0x360]
test esi, esi
js 0x100413ef
cmp esi, dword [esp + 0x18]
jge 0x100413ef
test eax, eax
js 0x100413ef
cmp eax, dword [esp + 0x20]
jge 0x100413ef
imul esi, esi, 0x34
cmp byte [esi + eax + 0x10146320], 0x45
jne 0x100413ef
mov byte [esi + eax + 0x10146320], 0x58
dec ebx
add edx, 4
cmp edx, 0x20
jl 0x100413a9
inc ecx
mov dword [esp + 0x10], ebx
push 0
pop ebx
cmp ecx, dword [esp + 0x28]
jl 0x100413a3
mov esi, dword [esp + 0x38]
mov eax, esi
push dword [esp + 0x10]
inc esi
push eax
push str.Board__d_has__d_safe_squares._n
mov dword [esp + 0x44], esi
call fcn.1004c39e
add esp, 0xc
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x1c]
push eax
push str._d__d
call fcn.1004be5b
mov eax, dword [esp + 0x24]
add esp, 0xc
test eax, eax
jne 0x1004114f
cmp dword [esp + 0x1c], 0x6bc8
jge 0x1004145a
push str.mwdadac_bxay_tbxxcr_yvfqi_xbftrotr
call fcn.1004c39e
pop ecx
mov eax, dword [esp + 0x54]
or dword [esp + 0x43c], 0xffffffff
cmp byte [eax], 0
je 0x10041477
mov edx, 0x110
xor cl, cl
call fcn.1004159b
mov ecx, dword [esp + 0x434]
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
mov esp, ebp
pop ebp
ret