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

Disassembly:
push ebp
push edi
xor eax, eax
push esi
push ebx
sub esp, 0x1cc
mov ecx, dword [esp + 0x1f0]
cmp ecx, 0x64
ja 0x50e5e6
mov edx, dword [esp + 0x1e0]
mov ebx, dword [esp + 0x1e4]
mov esi, dword [esp + 0x1e8]
test edx, edx
sete dl
test ebx, ebx
setle bl
or edx, ebx
test esi, esi
setle bl
or dl, bl
mov byte [esp + 0x2c], dl
je 0x50e5f1
add esp, 0x1cc
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, ecx
mov edx, 0x51eb851f
sar ecx, 0x1f
imul edx
sar edx, 3
sub edx, ecx
mov dword [esp + 0x18], edx
add edx, edx
cmp edx, dword [esp + 0x1e4]
jl 0x50e623
mov eax, dword [esp + 0x1e4]
lea edx, [eax - 1]
sar edx, 1
mov dword [esp + 0x18], edx
add edx, edx
mov eax, dword [esp + 0x1e8]
sub eax, 1
sar eax, 1
cmp dword [esp + 0x1e8], edx
cmovg eax, dword [esp + 0x18]
mov ebx, eax
mov dword [esp + 0x18], eax
mov eax, 1
test ebx, ebx
je 0x50e5e6
lea edx, [esp + 0x74]
xor esi, esi
mov ecx, 0x13
mov eax, esi
mov edi, edx
rep stosd dword es:[edi], eax
lea edi, [ebx + ebx]
mov eax, dword [esp + 0x1e4]
mov dword [esp], 1
mov dword [esp + 4], 0
lea ebx, [edi + 2]
imul ebx, dword [esp + 0x1e4]
add eax, eax
mov dword [esp + 0x30], eax
add ebx, ebx
lea eax, [ebx + eax + 0xffe]
mov dword [esp + 8], eax
call fcn.0050ce10
test eax, eax
mov dword [esp + 0x34], eax
je 0x50e5e6
mov eax, dword [esp + 0x1e4]
add edi, 1
mov ebp, dword [esp + 0x34]
mov ecx, dword [esp + 0x30]
mov dword [esp + 4], 0
imul eax, edi
mov dword [esp + 0x94], ebp
mov dword [esp + 0x98], ebp
mov dword [esp + 8], ecx
mov dword [esp + 0x9c], ebp
add ebx, ebp
lea eax, [ebp + eax*2]
xor ebp, ebp
imul edi, edi
mov dword [esp + 0x1c], eax
mov dword [esp + 0xa0], eax
sub eax, ecx
mov dword [esp], eax
mov dword [esp + 0x50], eax
mov dword [esp + 0xa4], eax
call sub.msvcrt.dll_memset
mov eax, dword [esp + 0x1e4]
mov dword [esp + 0x38], ebx
mov ecx, 0x40
mov dword [esp + 0xa8], ebx
mov ebx, dword [esp + 0x18]
mov dword [esp + 0xb0], 0xff
mov dword [esp + 0x20], 0
mov dword [esp + 0x74], eax
mov eax, dword [esp + 0x1e8]
mov dword [esp + 0x8c], ebx
neg ebx
mov dword [esp + 0x28], ebx
mov dword [esp + 0x80], ebx
lea ebx, [esp + 0xc0]
mov dword [esp + 0x78], eax
mov eax, dword [esp + 0x1ec]
mov dword [esp + 0x7c], eax
mov eax, dword [esp + 0x1e0]
mov dword [esp + 0x84], eax
mov dword [esp + 0x88], eax
mov eax, 0x40000
cdq
idiv edi
mov edi, ebx
xor edx, edx
mov dword [esp + 0x24], eax
mov dword [esp + 0x90], eax
mov eax, esi
rep stosd dword es:[edi], eax
mov esi, dword [esp + 0x1e0]
mov edi, dword [esp + 0x1e4]
mov eax, ebp
mov ecx, 0xff
mov byte [esp + 0x10], al
mov byte [esp + 0x14], al
mov ebp, edx
lea esi, [esi]
lea edi, [edi]
xor edx, edx
movzx eax, byte [esi + edx]
cmp eax, ecx
jge 0x50e7d1
mov ecx, eax
mov byte [esp + 0x10], 1
cmp eax, ebp
jle 0x50e7dc
mov ebp, eax
mov byte [esp + 0x14], 1
add edx, 1
mov byte [esp + eax + 0xc0], 1
cmp edi, edx
jg 0x50e7c2
add dword [esp + 0x20], 1
add esi, dword [esp + 0x1ec]
mov eax, dword [esp + 0x20]
cmp dword [esp + 0x1e8], eax
jg 0x50e7c0
movzx edi, byte [esp + 0x14]
mov dword [esp + 0x20], ebp
movzx ebp, byte [esp + 0x10]
mov eax, edi
test al, al
jne 0x50ec4c
mov dword [esp + 0x20], 0
mov eax, ebp
test al, al
jne 0x50ec40
mov eax, dword [esp + 0xb0]
xor esi, esi
xor ebp, ebp
xor ecx, ecx
mov edx, 0xffffffff
mov edi, eax
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x20]
sub eax, edi
mov edi, eax
mov dword [esp + 0x10], eax
mov dword [esp + 0xb8], eax
xor eax, eax
jmp 0x50e88a
mov esi, eax
sub esi, edx
cmp esi, edi
jge 0x50e898
mov edi, esi
mov edx, eax
mov esi, 1
mov ebp, 1
lea esi, [esi]
lea edi, [edi]
add eax, 1
cmp eax, 0x100
je 0x50e8a1
cmp byte [ebx + eax], 0
je 0x50e880
add ecx, 1
cmp edx, 0xffffffff
jne 0x50e860
mov edx, eax
mov esi, 1
jmp 0x50e880
mov eax, ebp
test al, al
jne 0x50ec30
mov eax, esi
test al, al
jne 0x50ec24
mov eax, dword [esp + 0x38]
mov edi, dword [esp + 0x30]
mov ecx, 1
lea ebp, [eax + edi + 0x7fe]
mov edi, dword [esp + 0x10]
mov dword [esp + 0xbc], ebp
lea ebx, [ebp - 2]
lea eax, [edi*4]
lea edi, [eax + edi*8]
mov esi, eax
mov dword [esp + 0x10], eax
sar edi, 2
sub esi, edi
mov dword [esp + 0x14], esi
lea esi, [eax - 1]
imul esi, edi
jmp 0x50e921
mov eax, ecx
sar eax, 2
mov edx, eax
neg eax
mov word [ebp + ecx*2], dx
add ecx, 1
mov word [ebx], ax
sub esi, edi
sub ebx, 2
cmp ecx, 0x400
je 0x50e950
cmp edi, ecx
jge 0x50e900
cmp dword [esp + 0x10], ecx
jle 0x50e940
mov eax, esi
cdq
idiv dword [esp + 0x14]
sar eax, 2
mov edx, eax
neg eax
jmp 0x50e909
xor eax, eax
xor edx, edx
jmp 0x50e909
xor eax, eax
cmp dword [esp + 0xac], 2
mov word [ebp], ax
jle 0x50ec0e
mov ebx, dword [esp + 0x18]
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x30]
mov esi, dword [esp + 0x1e4]
mov dword [esp + 0x4c], ebp
mov ebp, dword [esp + 0x50]
lea edx, [ecx + ebx*2]
lea edi, [ecx + eax - 2]
lea eax, [ebx + 1]
sub esi, ebx
mov dword [esp + 0x44], edx
mov dword [esp + 0x58], esi
mov dword [esp + 0x48], eax
lea eax, [ebx*4]
mov dword [esp + 0x50], edi
mov edi, dword [esp + 0x1e0]
sub edx, eax
mov eax, dword [esp + 0x48]
mov dword [esp + 0x5c], edx
cmp eax, esi
cmovge esi, eax
mov eax, dword [esp + 0x1e4]
mov dword [esp + 0x54], esi
lea eax, [eax + eax - 2]
sub eax, ebx
sub eax, esi
lea eax, [ecx + eax*2]
mov dword [esp + 0x6c], eax
mov eax, dword [esp + 0x1e4]
sub eax, esi
add eax, eax
mov dword [esp + 0x60], eax
mov eax, esi
sub eax, ebx
lea eax, [ecx + eax*2]
mov dword [esp + 0x68], eax
mov eax, dword [esp + 0x38]
lea eax, [eax + esi*2]
mov esi, dword [esp + 0x1e0]
mov dword [esp + 0x64], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 0x40], esi
mov esi, dword [esp + 0x1e8]
sub esi, 1
mov dword [esp + 0x14], esi
xor ecx, ecx
xor edx, edx
mov dword [esp + 0x10], ebp
lea esi, [esi]
movzx ebx, byte [edi + edx]
mov esi, dword [esp + 0x10]
mov ebp, dword [esp + 0x1c]
add ecx, ebx
mov ebx, ecx
add bx, word [esi + edx*2]
mov esi, ebx
sub si, word [eax + edx*2]
mov word [ebp + edx*2], si
mov word [eax + edx*2], bx
add edx, 1
cmp dword [esp + 0x1e4], edx
jne 0x50ea20
mov esi, dword [esp + 0x30]
mov ebx, dword [esp + 0x28]
add esi, eax
cmp ebp, esi
cmove esi, dword [esp + 0x34]
test ebx, ebx
js 0x50ebe1
mov edx, dword [esp + 0x1ec]
add edx, edi
cmp dword [esp + 0x14], ebx
cmovg edi, edx
cmp dword [esp + 0x18], ebx
jg 0x50ebe1
mov ebp, dword [esp + 0x44]
mov dword [esp + 0x10], eax
xor ecx, ecx
mov eax, dword [esp + 0x38]
mov ebx, ebp
movzx edx, word [ebx]
sub ebx, 2
add dx, word [ebp + ecx*2 - 2]
movzx edx, dx
imul edx, dword [esp + 0x24]
shr edx, 0x10
mov word [eax + ecx*2], dx
add ecx, 1
cmp dword [esp + 0x18], ecx
jge 0x50ea92
mov ebx, dword [esp + 0x48]
mov edx, dword [esp + 0x58]
mov eax, dword [esp + 0x10]
cmp ebx, edx
jge 0x50eb10
mov ecx, ebx
mov dword [esp + 0x1e0], edi
mov eax, dword [esp + 0x38]
mov ebx, dword [esp + 0x44]
mov ebp, dword [esp + 0x5c]
mov edi, dword [esp + 0x24]
mov dword [esp + 0x2c], esi
mov esi, edx
movzx edx, word [ebx + ecx*2]
sub dx, word [ebp + ecx*2 - 2]
movzx edx, dx
imul edx, edi
shr edx, 0x10
mov word [eax + ecx*2], dx
add ecx, 1
cmp ecx, esi
jne 0x50eae4
mov eax, dword [esp + 0x10]
mov esi, dword [esp + 0x2c]
mov edi, dword [esp + 0x1e0]
mov ebx, dword [esp + 0x54]
cmp dword [esp + 0x1e4], ebx
jle 0x50eb79
mov dword [esp + 0x10], eax
mov dword [esp + 0x2c], esi
xor ecx, ecx
mov dword [esp + 0x1e0], edi
mov ebx, dword [esp + 0x6c]
mov ebp, dword [esp + 0x50]
mov eax, dword [esp + 0x60]
mov esi, dword [esp + 0x64]
mov edi, dword [esp + 0x68]
movzx edx, word [ebp]
sub ebx, 2
add edx, edx
sub dx, word [ebx + 2]
sub dx, word [edi + ecx - 2]
movzx edx, dx
imul edx, dword [esp + 0x24]
shr edx, 0x10
mov word [esi + ecx], dx
add ecx, 2
cmp eax, ecx
jne 0x50eb42
mov eax, dword [esp + 0x10]
mov esi, dword [esp + 0x2c]
mov edi, dword [esp + 0x1e0]
mov edx, dword [esp + 0x40]
xor ecx, ecx
mov ebp, eax
mov dword [esp + 0x10], esi
movzx eax, byte [edx + ecx]
cmp eax, dword [esp + 0x20]
jge 0x50ebbf
cmp dword [esp + 0x3c], eax
jge 0x50ebbf
mov ebx, dword [esp + 0x38]
lea esi, [eax*4]
movzx ebx, word [ebx + ecx*2]
sub ebx, esi
mov esi, dword [esp + 0x4c]
movsx ebx, word [esi + ebx*2]
add eax, ebx
test eax, 0xffffff00
je 0x50ebbc
not eax
sar eax, 0x1f
mov byte [edx + ecx], al
add ecx, 1
cmp dword [esp + 0x1e4], ecx
jne 0x50eb85
mov ecx, dword [esp + 0x1ec]
add dword [esp + 0x40], ecx
mov eax, ebp
mov esi, dword [esp + 0x10]
mov byte [esp + 0x2c], 1
add dword [esp + 0x28], 1
mov ebp, eax
mov ebx, dword [esp + 0x28]
cmp ebx, dword [esp + 0x1e8]
je 0x50ebfc
mov eax, esi
jmp 0x50ea14
cmp byte [esp + 0x2c], 0
je 0x50ec0e
mov eax, dword [esp + 0x40]
mov dword [esp + 0x88], eax
mov eax, dword [esp + 0x34]
mov dword [esp], eax
call fcn.0050cf10
mov eax, 1
jmp 0x50e5e6
mov dword [esp + 0xac], ecx
jmp 0x50e8b5
mov dword [esp + 0xb8], edi
mov dword [esp + 0x10], edi
jmp 0x50e8ab
mov dword [esp + 0xb0], ecx
jmp 0x50e82e
mov eax, dword [esp + 0x20]
mov dword [esp + 0xb4], eax
jmp 0x50e824