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

Disassembly:
sub esp, 0x30
push ebx
push ebp
mov ebp, dword [esp + 0x4c]
push esi
mov esi, ecx
movsx ecx, ax
mov ebx, edx
mov edx, dword [0x3368dc]
cmp ecx, edx
push edi
jle 0x50669
movsx edi, word [esp + 0x48]
cmp edi, edx
jle 0x50669
movsx edi, word [esp + 0x50]
cmp edi, edx
jle 0x50669
movsx edi, bx
cmp edi, edx
jg 0x50c43
movsx edi, word [esp + 0x44]
mov edx, dword [0x3368e0]
cmp edi, edx
jle 0x50693
movsx edi, word [esp + 0x4c]
cmp edi, edx
jle 0x50693
movsx edi, bp
cmp edi, edx
jle 0x50693
movsx edi, si
cmp edi, edx
jg 0x50c43
mov edx, dword [0x3368d4]
cmp ecx, edx
jge 0x506ba
movsx ecx, word [esp + 0x48]
cmp ecx, edx
jge 0x506ba
movsx ecx, word [esp + 0x50]
cmp ecx, edx
jge 0x506ba
movsx ecx, bx
cmp ecx, edx
jl 0x50c43
movsx ecx, word [esp + 0x44]
mov edi, dword [0x3368d8]
cmp ecx, edi
jge 0x506e4
movsx ecx, word [esp + 0x4c]
cmp ecx, edi
jge 0x506e4
movsx ecx, bp
cmp ecx, edi
jge 0x506e4
movsx ecx, si
cmp ecx, edi
jl 0x50c43
cmp edi, dword [0x3368e0]
jge 0x50c43
cmp edx, dword [0x3368dc]
jge 0x50c43
mov edx, dword [esp + 0x74]
mov ecx, dword [esp + 0x70]
push edx
mov edx, dword [esp + 0x70]
push ecx
mov ecx, dword [esp + 0x70]
push edx
mov edx, dword [esp + 0x70]
push ecx
mov ecx, dword [esp + 0x70]
push edx
mov edx, dword [esp + 0x64]
push ecx
mov ecx, dword [esp + 0x64]
push esi
push ebx
push ebp
push edx
mov edx, dword [esp + 0x70]
push ecx
mov ecx, dword [esp + 0x70]
push edx
mov edx, dword [esp + 0x8c]
push ecx
mov ecx, dword [esp + 0x8c]
call fcn.0004e670
add esp, 0x34
test ax, ax
je 0x50c43
movsx esi, word [0x4530e0]
cmp esi, edi
jge 0x50773
jmp 0x50760
call fcn.0004e560
test ax, ax
jne 0x50c43
inc esi
cmp esi, edi
jl 0x50760
movsx eax, word [esp + 0x7c]
movsx edx, word [esp + 0x78]
mov ebp, dword [0x4530e4]
shl eax, 0xa
add eax, edx
mov edx, dword [0x4530dc]
shl ebp, 0xa
add ebp, edx
shl ebp, 1
cmp word [0x33679c], 0
mov dword [esp + 0x20], eax
jne 0x50a02
cmp word [0x3368f8], 0
jne 0x50a02
movsx eax, word [0x4530fa]
cmp esi, eax
mov dword [esp + 0x18], esi
jg 0x50c43
shl esi, 0xa
mov dword [esp + 0x1c], esi
nop
movsx ebx, word [0x2a8e12]
movsx ecx, word [0x2a8e36]
cmp ebx, ecx
mov dword [esp + 0x10], ebx
jl 0x509c6
sub ebx, ecx
mov esi, dword [0x2a8e14]
mov edi, dword [0x2a8e38]
jne 0x507ff
mov ebx, 1
mov eax, dword [0x2a8e44]
sub eax, esi
cdq
idiv ebx
mov edx, dword [0x2a8e38]
mov dword [esp + 0x28], eax
mov eax, dword [0x2a8e78]
sub eax, edx
cdq
idiv ebx
mov ebx, dword [esp + 0x28]
lea edx, [ebx + ebx]
mov dword [esp + 0x30], edx
lea edx, [eax + eax]
mov dword [esp + 0x34], edx
mov edx, dword [0x3368d4]
cmp ecx, edx
jge 0x50853
mov edi, edx
sub edi, ecx
mov esi, edi
imul edi, eax
imul esi, ebx
mov ecx, edx
add esi, dword [0x2a8e14]
add edi, dword [0x2a8e38]
mov edx, dword [esp + 0x10]
dec edx
cmp dword [0x3368dc], edx
mov dword [esp + 0x10], edx
jge 0x5086e
mov edx, dword [0x3368dc]
mov dword [esp + 0x10], edx
mov edx, dword [esp + 0x10]
cmp ecx, edx
mov dword [esp + 0x14], ecx
jge 0x50972
add eax, edi
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x1c]
add ebx, esi
add eax, ecx
mov dword [esp + 0x24], ebx
mov ebx, dword [0x653190]
lea eax, [ebx + eax*2]
mov dword [esp + 0x38], eax
mov eax, edx
sub eax, ecx
dec eax
shr eax, 1
inc eax
lea ecx, [ecx + eax*2]
mov dword [esp + 0x3c], eax
mov dword [esp + 0x14], ecx
mov eax, dword [0x6533b4]
mov ecx, esi
sar ecx, 0x10
mov ebx, ecx
mov edx, edi
sar edx, 5
and edx, 0xfffff800
add edx, eax
sar ebx, 1
add ebx, edx
mov dl, byte [ebx + ebp]
and cl, 1
shl cl, 2
shr dl, cl
and dl, 0xf
movzx cx, dl
mov edx, dword [esp + 0x28]
mov word [esp + 0x2c], cx
mov ecx, dword [esp + 0x24]
sar ecx, 0x10
sar edx, 5
mov ebx, ecx
and edx, 0xfffff800
add edx, eax
sar ebx, 1
add ebx, edx
movzx eax, byte [ebx + ebp]
mov edx, dword [esp + 0x20]
movsx ebx, word [esp + 0x2c]
and cl, 1
shl cl, 2
shr eax, cl
mov ecx, dword [0x653190]
add ebx, edx
and eax, 0xf
add eax, edx
movzx eax, word [ecx + eax*2]
movzx ecx, word [ecx + ebx*2]
mov ebx, dword [esp + 0x38]
shl eax, 0x10
or eax, ecx
call fcn.0004c040
mov eax, dword [esp + 0x30]
mov edx, dword [esp + 0x24]
add edx, eax
add esi, eax
mov eax, dword [esp + 0x34]
mov dword [esp + 0x24], edx
mov edx, dword [esp + 0x28]
add edx, eax
add edi, eax
mov eax, dword [esp + 0x3c]
add ebx, 4
dec eax
mov dword [esp + 0x28], edx
mov dword [esp + 0x38], ebx
mov dword [esp + 0x3c], eax
jne 0x508b0
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
cmp eax, edx
jne 0x509c6
mov ebx, dword [0x6533b4]
sar esi, 0x10
mov ecx, esi
mov edx, ecx
sar edi, 5
sar edx, 1
and edi, 0xfffff800
add edi, ebx
add edx, edi
movzx edx, byte [edx + ebp]
mov edi, dword [esp + 0x20]
and cl, 1
shl cl, 2
shr edx, cl
mov ecx, dword [esp + 0x1c]
add ecx, eax
mov eax, dword [0x653190]
and edx, 0xf
lea ecx, [eax + ecx*2]
add edx, edi
mov ax, word [eax + edx*2]
push ecx
call fcn.0004ba90
add esp, 4
call fcn.0004e560
test ax, ax
jne 0x50c43
mov ecx, dword [esp + 0x18]
mov esi, dword [esp + 0x1c]
movsx eax, word [0x4530fa]
inc ecx
add esi, 0x400
cmp ecx, eax
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], esi
jle 0x507d0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret
movsx eax, word [0x4530fa]
cmp esi, eax
mov dword [esp + 0x18], esi
jg 0x50c43
shl esi, 0xa
mov dword [esp + 0x1c], esi
lea esp, [esp]
movsx edi, word [0x2a8e12]
movsx ecx, word [0x2a8e36]
cmp edi, ecx
mov dword [esp + 0x10], edi
jl 0x50c13
sub edi, ecx
mov esi, dword [0x2a8e14]
mov ebx, dword [0x2a8e38]
jne 0x50a4f
mov edi, 1
mov eax, dword [0x2a8e44]
sub eax, esi
cdq
idiv edi
mov edx, dword [0x2a8e38]
mov dword [esp + 0x28], eax
mov eax, dword [0x2a8e78]
sub eax, edx
cdq
idiv edi
mov edi, dword [esp + 0x28]
lea edx, [edi + edi]
mov dword [esp + 0x30], edx
lea edx, [eax + eax]
mov dword [esp + 0x34], edx
mov edx, dword [0x3368d4]
cmp ecx, edx
jge 0x50aa3
mov ebx, edx
sub ebx, ecx
mov esi, ebx
imul ebx, eax
imul esi, edi
mov ecx, edx
add esi, dword [0x2a8e14]
add ebx, dword [0x2a8e38]
mov edx, dword [esp + 0x10]
dec edx
cmp dword [0x3368dc], edx
mov dword [esp + 0x10], edx
jge 0x50abe
mov edx, dword [0x3368dc]
mov dword [esp + 0x10], edx
mov edx, dword [esp + 0x10]
cmp ecx, edx
mov dword [esp + 0x14], ecx
jge 0x50bc3
add eax, ebx
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x1c]
add edi, esi
add eax, ecx
mov dword [esp + 0x28], edi
mov edi, dword [0x653190]
lea eax, [edi + eax*2]
mov dword [esp + 0x3c], eax
mov eax, edx
sub eax, ecx
dec eax
shr eax, 1
inc eax
lea ecx, [ecx + eax*2]
mov dword [esp + 0x38], eax
mov dword [esp + 0x14], ecx
mov edi, dword [0x6533b4]
mov ecx, esi
sar ecx, 0x10
mov eax, ecx
sar eax, 1
mov edx, ebx
sar edx, 5
and edx, 0xfffff800
add edx, edi
add eax, edx
mov dl, byte [eax + ebp]
and cl, 1
shl cl, 2
shr dl, cl
mov ecx, dword [esp + 0x28]
sar ecx, 0x10
and dl, 0xf
movzx ax, dl
mov edx, dword [esp + 0x24]
mov word [esp + 0x2c], ax
sar edx, 5
mov eax, ecx
sar eax, 1
and edx, 0xfffff800
add edx, edi
movsx edi, word [esp + 0x2c]
add eax, edx
movzx eax, byte [eax + ebp]
mov edx, dword [esp + 0x20]
and cl, 1
shl cl, 2
shr eax, cl
mov ecx, dword [0x653190]
add edi, edx
and eax, 0xf
add eax, edx
movzx eax, word [ecx + eax*2]
movzx ecx, word [ecx + edi*2]
mov edi, dword [esp + 0x3c]
shl eax, 0x10
or eax, ecx
call fcn.0004bb30
mov eax, dword [esp + 0x30]
mov edx, dword [esp + 0x28]
add edx, eax
add esi, eax
mov eax, dword [esp + 0x34]
mov dword [esp + 0x28], edx
mov edx, dword [esp + 0x24]
add edx, eax
add ebx, eax
mov eax, dword [esp + 0x38]
add edi, 4
dec eax
mov dword [esp + 0x24], edx
mov dword [esp + 0x3c], edi
mov dword [esp + 0x38], eax
jne 0x50b00
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x14]
cmp eax, edx
jne 0x50c13
sar esi, 0x10
mov ecx, esi
mov esi, dword [0x6533b4]
mov edx, ecx
sar ebx, 5
sar edx, 1
and ebx, 0xfffff800
add ebx, esi
add edx, ebx
movzx edx, byte [edx + ebp]
and cl, 1
shl cl, 2
shr edx, cl
mov ecx, dword [esp + 0x20]
and edx, 0xf
add edx, ecx
mov ecx, dword [esp + 0x1c]
add ecx, eax
mov eax, dword [0x653190]
lea edi, [eax + ecx*2]
mov ax, word [eax + edx*2]
call fcn.0004b820
call fcn.0004e560
test ax, ax
jne 0x50c43
mov ecx, dword [esp + 0x18]
mov esi, dword [esp + 0x1c]
movsx eax, word [0x4530fa]
inc ecx
add esi, 0x400
cmp ecx, eax
mov dword [esp + 0x18], ecx
mov dword [esp + 0x1c], esi
jle 0x50a20
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret