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

Disassembly:
sub esp, 0x7c
push ebp
mov ebp, dword [esp + 0x88]
imul ebp, dword [esp + 0x8c]
push edi
mov edi, dword [esp + 0x88]
add ebp, edi
cmp edi, ebp
mov dword [esp + 0x80], ebp
jae 0x40d4e2
push ebx
push esi
mov edi, edi
movsx eax, word [edi]
mov ecx, dword [esp + 0x9c]
mov esi, dword [esp + 0xa0]
lea edx, [ecx + eax*2]
movsx eax, word [edi + 2]
movzx ecx, word [edx]
lea ebx, [edx + eax*2]
lea eax, [esi + ecx*8]
movzx ecx, word [edx + 2]
add edx, 2
add edx, 2
cmp edx, ebx
mov dword [esp + 0x2c], eax
mov dword [esp + 0x84], ebx
lea ecx, [esi + ecx*8]
lea eax, [esp + 0x68]
jae 0x40d4ca
jmp 0x40cf7f
mov ecx, dword [esp + 0x6c]
mov eax, dword [esp + 0x78]
mov esi, dword [esp + 0xa0]
mov dword [eax], ecx
mov edi, dword [esp + 0x2c]
lea ecx, [esp + 0x68]
xor eax, ecx
lea ecx, [esp + 0x2c]
xor eax, ecx
mov ecx, dword [esp + 0x68]
mov dword [esp + 0x78], eax
movzx eax, word [edx]
add edx, 2
cmp edi, ecx
lea eax, [esi + eax*8]
mov dword [esp + 0x6c], eax
mov dword [esp + 0x80], edx
je 0x40d4a8
cmp ecx, eax
je 0x40d4a8
cmp eax, edi
je 0x40d4a8
mov esi, dword [edi]
test esi, esi
mov dword [esp + 0x20], edi
mov dword [esp + 0x14], ecx
jl 0x40d4e0
mov ebp, dword [esp + 0xa4]
cmp esi, ebp
jge 0x40d4e0
mov edx, dword [edi + 4]
test edx, edx
jl 0x40d4e0
cmp edx, ebp
jge 0x40d4e0
mov edx, dword [ecx]
test edx, edx
jl 0x40d4e0
cmp edx, ebp
jge 0x40d4e0
mov edx, dword [ecx + 4]
test edx, edx
jl 0x40d4e0
cmp edx, ebp
jge 0x40d4e0
mov edx, dword [eax]
test edx, edx
jl 0x40d4e0
cmp edx, ebp
jge 0x40d4e0
mov ebx, dword [eax + 4]
test ebx, ebx
jl 0x40d4e0
cmp ebx, ebp
jge 0x40d4e0
sub edx, dword [ecx]
mov ebx, dword [ecx + 4]
mov ebp, dword [edi + 4]
sub esi, dword [ecx]
sub ebp, ebx
imul ebp, edx
mov edx, dword [eax + 4]
sub edx, ebx
imul edx, esi
cmp edx, ebp
jg 0x40d4a8
mov edx, eax
mov esi, dword [edx + 4]
cmp ebx, esi
jg 0x40d080
mov esi, edi
cmp ebx, dword [esi + 4]
jge 0x40d095
mov dword [esp + 0x20], ecx
mov dword [esp + 0x14], edx
mov eax, esi
mov edi, ecx
jmp 0x40d095
mov ebx, dword [esp + 0x2c]
cmp esi, dword [ebx + 4]
jg 0x40d095
mov dword [esp + 0x20], edx
mov eax, ecx
mov dword [esp + 0x14], ebx
mov edi, edx
mov esi, dword [esp + 0x14]
mov ebp, dword [edi + 4]
xor ecx, ecx
mov dword [esp + 0x34], ecx
mov dword [esp + 0x3c], ecx
mov ecx, dword [esi + 4]
cmp ebp, ecx
mov dword [esp + 0x1c], ecx
jne 0x40d1bf
mov edx, dword [eax + 4]
mov ebx, dword [esi + 4]
mov ecx, edx
mov esi, edx
sub ecx, ebp
sub esi, ebx
cmp ebx, edx
mov dword [esp + 0x54], ecx
mov dword [esp + 0x28], esi
mov dword [esp + 0x40], edx
mov dword [esp + 0x1c], edx
jne 0x40d138
mov ecx, dword [esp + 0x14]
mov edi, dword [edi]
mov ecx, dword [ecx]
cmp edi, ecx
mov edx, edi
jl 0x40d0e7
mov edx, ecx
mov eax, dword [eax]
cmp edx, eax
jge 0x40d0ff
cmp edi, ecx
jge 0x40d0f9
mov ebp, edi
mov dword [esp + 0x10], ebp
jmp 0x40d107
mov dword [esp + 0x10], ecx
jmp 0x40d103
mov dword [esp + 0x10], eax
mov ebp, dword [esp + 0x10]
cmp edi, ecx
mov edx, edi
jg 0x40d10f
mov edx, ecx
cmp edx, eax
jle 0x40d11f
cmp edi, ecx
jle 0x40d11b
mov ebx, edi
jmp 0x40d121
mov ebx, ecx
jmp 0x40d121
mov ebx, eax
xor ecx, ecx
mov eax, 1
mov dword [esp + 0x38], ecx
mov dword [esp + 0x30], ecx
xor edi, edi
mov dword [esp + 0x24], eax
jmp 0x40d196
mov ebx, dword [edi]
mov edi, dword [eax]
mov esi, edi
sub esi, ebx
mov eax, esi
cdq
idiv ecx
mov edx, ecx
mov ecx, edi
mov dword [esp + 0x10], ebx
mov ebp, dword [esp + 0x10]
imul edx, eax
mov dword [esp + 0x30], eax
sub ecx, edx
mov edx, dword [esp + 0x14]
xor eax, eax
sub ecx, ebx
mov ebx, dword [edx]
test esi, esi
setg al
mov esi, edi
sub esi, ebx
lea eax, [eax + eax - 1]
mov dword [esp + 0x24], eax
mov eax, esi
cdq
idiv dword [esp + 0x28]
mov edx, dword [esp + 0x28]
imul edx, eax
mov dword [esp + 0x38], eax
sub edi, edx
xor eax, eax
sub edi, ebx
test esi, esi
setg al
lea eax, [eax + eax - 1]
mov dword [esp + 0x14], eax
lea edx, [esp + 0x44]
lea eax, [esp + 0x48]
mov dword [esp + 0x58], edx
mov dword [esp + 0x5c], eax
lea edx, [esp + 0x18]
lea eax, [esp + 0x4c]
mov dword [esp + 0x60], edx
mov dword [esp + 0x64], eax
jmp 0x40d337
mov esi, dword [eax]
mov ecx, dword [eax + 4]
mov ebx, dword [edi]
mov edi, esi
sub edi, ebx
mov eax, edi
cdq
mov dword [esp + 0x50], ecx
sub ecx, ebp
idiv ecx
mov edx, ecx
mov dword [esp + 0x54], ecx
mov ecx, esi
mov dword [esp + 0x70], ebx
mov dword [esp + 0x10], ebx
imul edx, eax
mov dword [esp + 0x30], eax
xor eax, eax
sub ecx, edx
mov edx, dword [esp + 0x14]
sub ecx, ebx
test edi, edi
mov edi, dword [esp + 0x1c]
setg al
sub edi, ebp
mov ebp, dword [edx]
mov dword [esp + 0x28], edi
lea eax, [eax + eax - 1]
mov dword [esp + 0x24], eax
mov eax, ebp
sub eax, ebx
mov dword [esp + 0x74], eax
cdq
idiv edi
mov edx, edi
mov edi, ebp
imul edx, eax
mov dword [esp + 0x38], eax
sub edi, edx
mov edx, dword [esp + 0x1c]
xor eax, eax
sub edi, ebx
cmp dword [esp + 0x74], eax
setg al
lea eax, [eax + eax - 1]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x50]
cmp edx, eax
jge 0x40d2b5
lea ebx, [esp + 0x28]
mov dword [esp + 0x58], ebx
lea ebx, [esp + 0x38]
mov dword [esp + 0x5c], ebx
lea ebx, [esp + 0x50]
mov dword [esp + 0x60], ebx
lea ebx, [esp + 0x14]
mov dword [esp + 0x64], ebx
mov ebx, eax
sub ebx, edx
mov eax, esi
sub eax, ebp
mov dword [esp + 0x74], eax
cdq
idiv ebx
xor edx, edx
mov dword [esp + 0x44], ebx
mov dword [esp + 0x48], eax
imul eax, ebx
mov ebx, dword [esp + 0x70]
sub esi, eax
mov eax, dword [esp + 0x1c]
sub esi, ebp
cmp dword [esp + 0x74], edx
mov dword [esp + 0x18], esi
setg dl
add eax, 0xffffffff
mov dword [esp + 0x40], eax
lea edx, [edx + edx - 1]
mov dword [esp + 0x4c], edx
mov edx, dword [esp + 0x50]
mov dword [esp + 0x1c], edx
jmp 0x40d333
lea edx, [esp + 0x54]
mov dword [esp + 0x58], edx
lea edx, [esp + 0x30]
mov dword [esp + 0x5c], edx
lea edx, [esp + 0x70]
mov dword [esp + 0x60], edx
lea edx, [esp + 0x24]
mov dword [esp + 0x64], edx
mov edx, dword [esp + 0x1c]
sub edx, eax
mov dword [esp + 0x44], edx
je 0x40d309
mov ebx, dword [esp + 0x44]
mov eax, ebp
sub eax, esi
cdq
idiv ebx
mov edx, eax
imul edx, ebx
mov ebx, dword [esp + 0x70]
mov dword [esp + 0x48], eax
mov eax, ebp
sub eax, edx
sub eax, esi
mov dword [esp + 0x18], eax
mov eax, dword [esp + 0x50]
jmp 0x40d313
xor edx, edx
mov dword [esp + 0x48], edx
mov dword [esp + 0x18], edx
xor edx, edx
sub ebp, esi
test ebp, ebp
setg dl
add eax, 0xffffffff
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x1c], eax
lea edx, [edx + edx - 1]
mov dword [esp + 0x4c], edx
mov ebp, dword [esp + 0x10]
imul ecx, dword [esp + 0x24]
imul edi, dword [esp + 0x14]
mov edx, dword [esp + 0x20]
mov eax, dword [edx + 4]
mov dword [esp + 0x70], ecx
mov ecx, dword [esp + 0x4c]
imul ecx, dword [esp + 0x18]
mov dword [esp + 0x18], ecx
mov ecx, dword [esp + 0xa4]
sar ecx, 5
mov edx, eax
imul edx, ecx
cmp eax, dword [esp + 0x1c]
mov dword [esp + 0x7c], ecx
mov ecx, dword [esp + 0xa8]
mov dword [esp + 0x50], edi
lea edi, [ecx + edx*4]
mov dword [esp + 0x20], edi
mov dword [esp + 0x74], eax
jg 0x40d4a8
jmp 0x40d394
mov edi, dword [esp + 0x20]
cmp ebp, ebx
jg 0x40d4e0
mov edx, ebp
and edx, 0x1f
mov eax, dword [edx*4 + 0x9712e8]
mov ecx, ebx
and ecx, 0x1f
mov esi, dword [ecx*4 + 0x971368]
mov edx, ebx
mov ecx, ebp
xor edx, ebp
sar ecx, 5
test edx, 0xffffffe0
je 0x40d3ff
or dword [edi + ecx*4], eax
lea edx, [edi + ecx*4]
mov eax, ebx
sar eax, 5
lea eax, [edi + eax*4]
add edx, 4
cmp edx, eax
jae 0x40d3fb
sub eax, edx
sub eax, 1
shr eax, 2
add eax, 1
mov ebp, eax
mov ecx, eax
mov edi, edx
or eax, 0xffffffff
rep stosd dword es:[edi], eax
mov edi, dword [esp + 0x20]
lea edx, [edx + ebp*4]
mov ebp, dword [esp + 0x10]
or dword [edx], esi
jmp 0x40d406
lea ecx, [edi + ecx*4]
and esi, eax
or dword [ecx], esi
mov ecx, dword [esp + 0x34]
add ecx, dword [esp + 0x70]
add ebp, dword [esp + 0x30]
mov eax, dword [esp + 0x54]
cmp ecx, eax
mov dword [esp + 0x10], ebp
mov dword [esp + 0x34], ecx
jl 0x40d42e
add ebp, dword [esp + 0x24]
sub dword [esp + 0x34], eax
mov dword [esp + 0x10], ebp
mov ecx, dword [esp + 0x3c]
add ecx, dword [esp + 0x50]
mov eax, dword [esp + 0x28]
add ebx, dword [esp + 0x38]
cmp ecx, eax
mov dword [esp + 0x3c], ecx
jl 0x40d44e
add ebx, dword [esp + 0x14]
sub dword [esp + 0x3c], eax
mov edx, dword [esp + 0x7c]
mov ecx, dword [esp + 0x74]
lea eax, [edi + edx*4]
mov edx, ecx
add ecx, 1
cmp edx, dword [esp + 0x40]
mov dword [esp + 0x20], eax
mov dword [esp + 0x74], ecx
jl 0x40d390
mov edx, dword [esp + 0x44]
mov esi, dword [esp + 0x58]
mov eax, dword [esp + 0x1c]
cmp ecx, eax
mov dword [esi], edx
mov edx, dword [esp + 0x48]
mov esi, dword [esp + 0x5c]
mov dword [esi], edx
mov edx, dword [esp + 0x18]
mov esi, dword [esp + 0x60]
mov dword [esi], edx
mov edx, dword [esp + 0x4c]
mov esi, dword [esp + 0x64]
mov dword [esp + 0x40], eax
mov dword [esi], edx
jle 0x40d390
mov edx, dword [esp + 0x80]
cmp edx, dword [esp + 0x84]
jb 0x40cf70
mov ebp, dword [esp + 0x88]
mov edi, dword [esp + 0x90]
add edi, dword [esp + 0x98]
cmp edi, ebp
mov dword [esp + 0x90], edi
jb 0x40cf20
pop esi
pop ebx
pop edi
pop ebp
add esp, 0x7c
ret