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

Disassembly:
push ebp
mov ebp, ecx
push edi
push esi
push ebx
sub esp, 0xfc
mov ecx, dword [esp + 0x11c]
mov esi, dword [esp + 0x118]
test ecx, ecx
je 0x405d50
mov eax, dword [esp + 0x114]
mov dword [esp + 8], esi
mov ecx, ebp
mov dword [esp + 4], eax
mov eax, dword [esp + 0x110]
mov dword [esp], eax
call fcn.00405790
sub esp, 0xc
mov ecx, eax
test eax, eax
js 0x406540
movzx eax, byte [ebp + 0x738]
mov ebx, 0x51eb851f
mov dword [esp + 0x12c], 1
mov edx, eax
shr dl, 7
add edx, eax
sar dl, 1
movsx edx, dl
add edx, 0x96
imul edx, ecx
mov eax, edx
mul ebx
shr edx, 5
mov dword [esp + 0x24], edx
movzx edx, byte [ebp + 0x73e]
mov eax, edx
shr al, 7
add eax, edx
sar al, 1
movsx esi, al
mov eax, 0x64
sub eax, esi
imul eax, ecx
mul ebx
xor ebx, ebx
shr edx, 5
cmp word [ebp + 0x896], 0
mov dword [esp + 0x1c], edx
je 0x405db3
add esp, 0xfc
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret 0x20
movzx ebx, byte [ebp + 0x738]
mov ecx, 0x51eb851f
mov eax, ebx
shr al, 7
add eax, ebx
sar al, 1
movsx edi, al
add edi, 0x96
imul edi, esi
mov eax, edi
sar edi, 0x1f
imul ecx
lea eax, [ebx + 3]
sar edx, 5
sub edx, edi
test bl, bl
cmovns eax, ebx
mov dword [esp + 0x24], edx
sar al, 2
movsx eax, al
add eax, 0x7d
imul eax, esi
mov ebx, eax
imul ecx
sar ebx, 0x1f
mov ecx, edx
sar ecx, 5
sub ecx, ebx
xor ebx, ebx
cmp word [ebp + 0x896], 0
mov dword [esp + 0x1c], ecx
jne 0x405d38
mov eax, dword [esp + 0x114]
imul eax, dword [0x59ad30]
add eax, dword [esp + 0x110]
mov edx, dword [esp + 0x114]
imul eax, eax, 0xe
add eax, dword [0x5b39d0]
movzx eax, byte [eax + 0xc]
mov byte [esp + 0x14], al
movzx eax, word [esp + 0x110]
mov word [ebp + 0x764], ax
movzx eax, word [esp + 0x114]
mov word [ebp + 0x766], ax
mov eax, dword [esp + 0x110]
call fcn.004053d0
mov edx, dword [esp + 0x128]
mov word [ebp + 0x768], ax
xor eax, eax
mov word [ebp + 0x896], ax
movzx eax, word [esp + 0x128]
mov word [ebp + 0x898], ax
test edx, edx
je 0x405e92
mov word [ebp + 0x76a], ax
jle 0x406550
mov eax, dword [0x5b504c]
cmp dword [esp + 0x128], eax
jg 0x406550
mov eax, dword [esp + 0x128]
mov edx, dword [0x5b5059]
sub eax, 1
imul eax, dword [0x5b5050]
mov ecx, dword [edx + eax]
call fcn.0043fb60
movsx edx, word [ebp + 0x896]
mov ecx, eax
mov eax, edx
lea edx, [edx + edx*4]
add eax, 1
mov word [ebp + edx*2 + 0x76c], cx
mov word [ebp + 0x896], ax
movsx eax, word [ebp + 4]
test eax, eax
jle 0x406668
cmp eax, dword [0x5b508c]
jg 0x406668
sub eax, 1
imul eax, dword [0x5b5090]
mov edx, dword [0x5b5099]
mov eax, dword [edx + eax]
mov dword [esp + 0x20], eax
movsx eax, word [ebp + 0xa]
test ax, ax
jne 0x406390
mov dword [esp + 0x18], 0
movzx ecx, word [ebp + 0x6d3]
movzx edx, byte [esp + 0x14]
xor ebx, ebx
mov edi, 0x64
test cx, cx
jle 0x40605a
lea esi, [esi]
mov eax, dword [ebp + 0x68d]
movsx eax, word [eax + ebx*2]
test eax, eax
jle 0x40683f
cmp eax, dword [0x5b504c]
jg 0x40683f
sub eax, 1
imul eax, dword [0x5b5050]
mov ecx, dword [0x5b5059]
mov esi, dword [ecx + eax]
cmp dl, byte [esi + 0x29]
jne 0x406048
movsx eax, word [esi + 0x36]
test ax, ax
je 0x406048
cmp byte [esi + 0x45], 0
je 0x406048
cmp byte [esi + 0x11d], 0
jg 0x406048
cmp word [esi + 0x143], 0
jne 0x406048
cmp byte [esi + 0x146], 0
jne 0x406048
movsx ecx, word [esi + 7]
cmp ecx, dword [esp + 0x18]
je 0x406048
cmp ecx, dword [esp + 0x128]
jne 0x405f97
mov ecx, dword [esp + 0x128]
test ecx, ecx
jne 0x406048
test eax, eax
jle 0x406835
cmp eax, dword [0x5b5310]
jg 0x406835
sub eax, 1
imul eax, dword [0x5b5314]
mov ecx, dword [0x5b531d]
mov eax, dword [ecx + eax]
fld dword [eax + 0x58]
fstp dword [esp + 0x54]
fild word [eax + 0x5c]
fstp dword [esp + 0x58]
fld dword [esp + 0x54]
fld dword [esp + 0x58]
fcompi st(1)
jbe 0x406010
mov eax, dword [esp + 0x20]
movzx ecx, byte [eax + 0x73e]
mov eax, ecx
shr al, 7
add eax, ecx
mov ecx, edi
sar al, 1
movsx eax, al
sub ecx, eax
mov dword [esp + 0x28], ecx
fild dword [esp + 0x28]
fstp dword [esp + 0x5c]
fld dword [esp + 0x5c]
fcompi st(1)
fstp st(0)
ja 0x406048
jmp 0x406012
fstp st(0)
mov eax, dword [esp + 0x124]
test eax, eax
jne 0x406730
mov ecx, dword [esp + 0x12c]
test ecx, ecx
jne 0x406032
cmp byte [esi + 0x4a], 0
jne 0x406048
movsx eax, word [ebp + 0x896]
cmp ax, 0x1d
jle 0x4066c2
lea esi, [esi]
nop
movsx eax, word [ebp + 0x6d3]
add ebx, 1
cmp eax, ebx
jg 0x405ef8
mov ebx, dword [esp + 0x12c]
test ebx, ebx
jne 0x406238
cmp word [ebp + 0x6cb], 0
jle 0x406238
xor esi, esi
lea eax, [ebp + 0x76a]
mov dword [esp + 0x34], eax
mov edi, esi
jmp 0x4060a2
movsx eax, word [ebp + 0x6cb]
add edi, 1
cmp eax, edi
jle 0x406238
mov eax, dword [ebp + 0x67d]
movsx eax, word [eax + edi*2]
test eax, eax
jle 0x406851
cmp eax, dword [0x5b522c]
jg 0x406851
sub eax, 1
imul eax, dword [0x5b5230]
mov edx, dword [0x5b5239]
mov esi, dword [edx + eax]
movzx eax, byte [esp + 0x14]
cmp al, byte [esi + 0x27]
jne 0x406090
mov ecx, esi
call fcn.004fc590
movsx ebx, word [esi + 0x298]
sub ebx, 1
js 0x406090
xor edx, edx
mov dword [esp + 0x2c], edi
mov edi, eax
mov dword [esp + 0x20], 0
mov word [esp + 0x30], dx
jmp 0x40614d
cmp al, 4
je 0x406658
fld dword [ecx + 0x3d]
fnstcw word [esp + 0x3e]
movzx eax, word [esp + 0x3e]
fstp dword [esp + 0x64]
fld dword [esp + 0x64]
or ah, 0xc
mov word [esp + 0x3c], ax
fldcw word [esp + 0x3c]
fistp dword [esp + 0x28]
fldcw word [esp + 0x3e]
add edi, dword [esp + 0x28]
sub ebx, 1
jb 0x406560
movsx eax, word [esi + ebx*2 + 0x29c]
test eax, eax
jle 0x406848
cmp eax, dword [0x5b504c]
jg 0x406848
sub eax, 1
imul eax, dword [0x5b5050]
mov edx, dword [0x5b5059]
mov ecx, dword [edx + eax]
movzx eax, word [ebp + 4]
cmp word [ecx + 0xf], ax
jne 0x406144
movsx edx, word [ecx + 7]
cmp edx, dword [esp + 0x18]
je 0x406144
movzx eax, byte [ecx + 4]
cmp al, 5
jne 0x406110
cmp word [ecx + 0x36], 0
jne 0x4061a9
cmp byte [ecx + 0x45], 0
je 0x406144
cmp byte [ecx + 0x11d], 0
jg 0x406144
cmp word [ecx + 0x143], 0
jne 0x406144
cmp byte [ecx + 0x146], 0
jne 0x406144
mov eax, dword [esp + 0x128]
test eax, eax
je 0x4061e1
cmp edx, dword [esp + 0x128]
je 0x406144
mov dword [esp + 0x28], ecx
call fcn.0043fb60
add dword [esp + 0x20], eax
cmp word [esp + 0x30], 9
mov ecx, dword [esp + 0x28]
jg 0x406144
movsx eax, word [esp + 0x30]
lea edx, [eax + eax*4]
movzx eax, word [ecx + 7]
add edx, edx
mov word [esp + edx + 0x8c], ax
mov dword [esp + 0x28], edx
call fcn.0043fb60
mov edx, dword [esp + 0x28]
add word [esp + 0x30], 1
mov word [esp + edx + 0x8e], ax
jmp 0x406144
movsx edx, word [ebp + 0x896]
test dx, dx
jle 0x406710
lea edx, [edx + edx*4]
mov eax, ebp
xor ebx, ebx
lea ecx, [ebp + edx*2]
lea esi, [esi]
nop
movsx edx, word [eax + 0x76c]
add eax, 0xa
add ebx, edx
cmp ecx, eax
jne 0x406258
cmp dword [esp + 0x1c], ebx
jg 0x406638
lea eax, [ebp + 0x76a]
xor edi, edi
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], eax
mov ebx, edi
mov edi, dword [esp + 0x114]
mov esi, eax
lea esi, [esi]
movsx eax, word [esi]
test eax, eax
jle 0x40685a
cmp eax, dword [0x5b504c]
jg 0x40685a
sub eax, 1
mov ecx, dword [0x5b5059]
add ebx, 1
add esi, 0xa
imul eax, dword [0x5b5050]
mov eax, dword [ecx + eax]
mov ecx, dword [esp + 0x110]
mov dword [esp + 0xc], edi
mov dword [esp + 8], ecx
movsx ecx, word [eax + 0x27]
mov dword [esp + 4], ecx
movsx eax, word [eax + 0x25]
mov ecx, 0x5ba360
mov dword [esp], eax
call fcn.00499d60
mov word [esi - 6], ax
movsx eax, word [ebp + 0x896]
sub esp, 0x10
cmp eax, ebx
jg 0x406290
mov ebx, dword [esp + 0x18]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0xc], 0x4053a0
mov dword [esp], eax
mov dword [esp + 8], 0xa
call sub.msvcrt.dll_qsort
movsx eax, word [ebp + 0x896]
test ax, ax
jle 0x406358
lea eax, [eax + eax*4]
mov esi, dword [esp + 0x24]
lea eax, [ebp + eax*2]
lea esi, [esi]
movsx ecx, word [eax + 0x762]
mov edx, ebx
sub edx, ecx
cmp edx, esi
jle 0x406351
sub word [ebp + 0x896], 1
mov ebx, edx
sub eax, 0xa
cmp ebp, eax
jne 0x406338
mov ecx, ebp
call fcn.004054d0
mov edx, dword [esp + 0x120]
xor eax, eax
mov ecx, ebp
test edx, edx
sete al
mov dword [esp], eax
call fcn.00405a30
mov eax, ebx
sub esp, 4
add esp, 0xfc
pop ebx
pop esi
pop edi
pop ebp
ret 0x20
test eax, eax
jle 0x406863
cmp eax, dword [0x5b5310]
jg 0x406863
sub eax, 1
imul eax, dword [0x5b5314]
mov edx, dword [0x5b531d]
mov dword [esp + 0x18], 0
movzx ecx, word [ebp + 0x6d3]
mov esi, dword [edx + eax]
cmp byte [esi + 0x64], 1
jne 0x405edd
movsx eax, cx
movsx edx, word [esi + 0x65]
mov ebx, 0x64
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x20]
mov edi, edx
mov dword [esp + 0x18], edx
mov edx, 0x66666667
movsx eax, byte [eax + 0x73e]
sub ebx, eax
mov byte [esp + 0x2c], al
mov dword [esp + 0x30], eax
mov eax, ebx
sar ebx, 0x1f
imul edx
sar edx, 3
sub edx, ebx
lea eax, [edx + 3]
mov edx, edi
test edi, edi
jle 0x406767
mov ebx, dword [0x5b504c]
cmp edi, ebx
jg 0x406760
sub edx, 1
imul edx, dword [0x5b5050]
mov edi, dword [0x5b5059]
mov edx, dword [edi + edx]
fld dword [esi + 0x58]
fstp dword [esp + 0x78]
cmp dword [esp + 0x28], eax
jg 0x406685
mov eax, 0xe6
sub eax, dword [esp + 0x30]
mov dword [esp + 0x28], eax
fild dword [esp + 0x28]
fstp dword [esp + 0x6c]
fld dword [esp + 0x78]
fld dword [esp + 0x6c]
fcompi st(1)
fstp st(0)
ja 0x4067f4
cmp byte [edx + 0x45], 7
jg 0x406529
movsx ax, byte [esp + 0x2c]
mov edx, 4
fld dword [esi + 0x58]
idiv dl
fstp dword [esp + 0x7c]
mov edx, 0x96
movsx eax, al
sub edx, eax
mov dword [esp + 0x28], edx
fild dword [esp + 0x28]
fstp dword [esp + 0x80]
fld dword [esp + 0x80]
fld dword [esp + 0x7c]
fcompi st(1)
fstp st(0)
jb 0x405edd
mov eax, dword [esp + 0x18]
cmp eax, ebx
jg 0x4067eb
sub eax, 1
imul eax, dword [0x5b5050]
mov edx, dword [0x5b5059]
mov eax, dword [edx + eax]
cmp byte [eax + 0x45], 8
jne 0x405edd
mov edi, dword [esp + 0x114]
mov ecx, 0x5ba360
mov dword [esp + 0xc], edi
mov edi, dword [esp + 0x110]
mov dword [esp + 8], edi
movsx edx, word [eax + 0x27]
mov dword [esp + 4], edx
movsx eax, word [eax + 0x25]
mov dword [esp], eax
call fcn.00499d60
movzx ecx, word [ebp + 0x6d3]
sub esp, 0x10
cmp eax, 8
jg 0x405edd
mov dword [esp + 0x18], 0
jmp 0x405edd
sub esi, ecx
mov ebx, esi
jmp 0x405d38
xor ecx, ecx
jmp 0x405e6d
mov dword [esp + 0x28], edi
mov eax, edi
mov edi, dword [esp + 0x2c]
cmp dword [esp + 0x20], eax
jle 0x406090
movzx esi, word [esp + 0x30]
test si, si
je 0x406090
movsx edx, si
lea eax, [esp + 0x8c]
mov dword [esp + 0x38], edi
lea edx, [edx + edx*4]
mov dword [esp + 0x30], ebp
lea esi, [eax + edx*2]
mov dword [esp + 0x2c], esi
jmp 0x4065ad
add eax, 0xa
cmp dword [esp + 0x2c], eax
je 0x406678
movsx edx, word [eax + 2]
mov ebx, dword [esp + 0x20]
sub ebx, edx
cmp ebx, dword [esp + 0x28]
jle 0x4065a0
mov edi, dword [esp + 0x30]
movzx esi, word [edi + 0x896]
cmp si, 0x1d
jg 0x4065a0
movsx edi, si
test si, si
jle 0x406752
movzx ebp, word [eax]
mov edx, dword [esp + 0x34]
xor ecx, ecx
lea esi, [esi]
nop
cmp word [edx], bp
je 0x4065a0
add ecx, 1
add edx, 0xa
cmp edi, ecx
jne 0x4065e8
mov ebp, dword [esp + 0x30]
lea edx, [edi + edi*4]
mov edi, dword [eax]
add esi, 1
mov dword [esp + 0x20], ebx
lea ecx, [ebp + edx*2]
mov dword [ecx + 0x76a], edi
lea edx, [ecx + 0x76a]
mov ecx, dword [eax + 4]
mov dword [edx + 4], ecx
movzx ecx, word [eax + 8]
mov word [edx + 8], cx
mov word [ebp + 0x896], si
jmp 0x4065a0
xor ecx, ecx
xor ebx, ebx
mov word [ebp + 0x896], cx
add esp, 0xfc
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret 0x20
call fcn.0044ab70
add edi, eax
jmp 0x406144
mov dword [esp + 0x20], 0
jmp 0x405ec1
mov edi, dword [esp + 0x38]
mov ebp, dword [esp + 0x30]
jmp 0x406090
movzx edx, byte [esp + 0x2c]
test dl, dl
lea eax, [edx + 3]
cmovns eax, edx
mov edx, 0x96
sar al, 2
movsx eax, al
sub edx, eax
mov dword [esp + 0x28], edx
fild dword [esp + 0x28]
fstp dword [esp + 0x68]
fld dword [esp + 0x68]
fld dword [esp + 0x78]
fcompi st(1)
fstp st(0)
jb 0x405edd
jmp 0x4064be
movzx ecx, word [esi + 7]
lea eax, [eax + eax*4]
mov byte [esp + 0x28], dl
mov word [ebp + eax*2 + 0x76a], cx
mov ecx, esi
call fcn.0043fb60
movsx ecx, word [ebp + 0x896]
movzx edx, byte [esp + 0x28]
mov esi, eax
mov eax, ecx
lea ecx, [ecx + ecx*4]
add eax, 1
mov word [ebp + ecx*2 + 0x76c], si
mov word [ebp + 0x896], ax
jmp 0x406048
mov eax, dword [esp + 0x1c]
test eax, eax
jg 0x406638
lea eax, [ebp + 0x76a]
xor ebx, ebx
mov dword [esp + 0x14], eax
movsx eax, dx
jmp 0x4062fe
mov ecx, esi
mov byte [esp + 0x28], dl
call fcn.00440040
cmp dword [esp + 0x124], eax
movzx edx, byte [esp + 0x28]
jle 0x406021
jmp 0x406048
test edi, edi
jne 0x4065a0
jmp 0x4065f7
xor edx, edx
jmp 0x40643a
cmp dword [esp + 0x28], eax
jg 0x406797
fld dword [esi + 0x58]
mov eax, 0xe6
sub eax, dword [esp + 0x30]
mov dword [esp + 0x28], eax
fstp dword [esp + 0x4c]
fild dword [esp + 0x28]
fstp dword [esp + 0x50]
fld dword [esp + 0x4c]
fld dword [esp + 0x50]
fcompi st(1)
fstp st(0)
jbe 0x4067eb
mov edi, dword [esp + 0x18]
test edi, edi
je 0x405edd
movsx ax, byte [esp + 0x2c]
mov edx, 4
fld dword [esi + 0x58]
idiv dl
fstp dword [esp + 0x84]
mov edx, 0x96
movsx eax, al
sub edx, eax
mov dword [esp + 0x28], edx
fild dword [esp + 0x28]
fstp dword [esp + 0x88]
fld dword [esp + 0x88]
fld dword [esp + 0x84]
fcompi st(1)
fstp st(0)
jb 0x405edd
movzx eax, byte [0x45]
ud2
movsx ax, byte [esp + 0x2c]
mov edx, 4
fld dword [esi + 0x58]
idiv dl
fstp dword [esp + 0x60]
mov edx, 0x96
movsx eax, al
sub edx, eax
mov dword [esp + 0x28], edx
fild dword [esp + 0x28]
fstp dword [esp + 0x74]
fld dword [esp + 0x74]
fld dword [esp + 0x60]
fcompi st(1)
fstp st(0)
jae 0x4064be
jmp 0x405edd
fld dword [0x58]
fstp st(0)
ud2
movzx eax, byte [0x29]
ud2
movzx eax, word [0xf]
ud2
movzx eax, byte [0x27]
ud2
movzx eax, word [0x27]
ud2
movzx eax, byte [0x64]
ud2