Function at 0x531e9
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 0x53219
movsx edi, word [esp + 0x48]
cmp edi, edx
jle 0x53219
movsx edi, word [esp + 0x50]
cmp edi, edx
jle 0x53219
movsx edi, bx
cmp edi, edx
jg 0x53827
movsx edi, word [esp + 0x44]
mov edx, dword [0x3368e0]
cmp edi, edx
jle 0x53243
movsx edi, word [esp + 0x4c]
cmp edi, edx
jle 0x53243
movsx edi, bp
cmp edi, edx
jle 0x53243
movsx edi, si
cmp edi, edx
jg 0x53827
mov edx, dword [0x3368d4]
cmp ecx, edx
jge 0x5326a
movsx ecx, word [esp + 0x48]
cmp ecx, edx
jge 0x5326a
movsx ecx, word [esp + 0x50]
cmp ecx, edx
jge 0x5326a
movsx ecx, bx
cmp ecx, edx
jl 0x53827
movsx ecx, word [esp + 0x44]
mov edi, dword [0x3368d8]
cmp ecx, edi
jge 0x53294
movsx ecx, word [esp + 0x4c]
cmp ecx, edi
jge 0x53294
movsx ecx, bp
cmp ecx, edi
jge 0x53294
movsx ecx, si
cmp ecx, edi
jl 0x53827
cmp edi, dword [0x3368e0]
jge 0x53827
cmp edx, dword [0x3368dc]
jge 0x53827
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 0x53827
movsx esi, word [0x4530e0]
cmp esi, edi
jge 0x53323
jmp 0x53310
call fcn.0004e560
test ax, ax
jne 0x53827
inc esi
cmp esi, edi
jl 0x53310
movsx eax, word [esp + 0x7c]
movsx edx, word [esp + 0x78]
mov edi, dword [0x4530e4]
mov ecx, dword [0x4530dc]
shl eax, 0xa
add eax, edx
mov dword [esp + 0x1c], eax
movsx eax, word [0x453104]
add eax, edi
shl eax, 0xa
add eax, ecx
cmp word [0x33679c], 0
movsx ecx, word [0x453100]
lea edx, [ecx + eax*2]
mov dword [esp + 0x18], edx
jne 0x535d9
cmp word [0x3368f8], 0
jne 0x535d9
movsx eax, word [0x4530fa]
cmp esi, eax
mov dword [esp + 0x20], esi
jg 0x53827
shl esi, 0xa
mov dword [esp + 0x24], esi
jmp 0x533a0
movsx ebx, word [0x2a8e12]
movsx ecx, word [0x2a8e36]
cmp ebx, ecx
mov dword [esp + 0x10], ebx
jl 0x5359d
sub ebx, ecx
mov ebp, dword [0x2a8e14]
mov eax, dword [0x2a8e38]
mov edi, ebp
mov dword [esp + 0x14], eax
jne 0x533d4
mov ebx, 1
mov eax, dword [0x2a8e44]
sub eax, ebp
cdq
idiv ebx
mov edx, dword [0x2a8e38]
mov esi, eax
mov eax, dword [0x2a8e78]
sub eax, edx
cdq
idiv ebx
mov ebx, dword [0x3368d4]
cmp ecx, ebx
mov edx, eax
lea eax, [esi + esi]
mov dword [esp + 0x30], edx
mov dword [esp + 0x2c], eax
jge 0x53423
mov eax, ebx
sub eax, ecx
mov edi, eax
imul eax, edx
imul edi, esi
mov ecx, ebx
mov ebx, dword [0x2a8e38]
add edi, ebp
add eax, ebx
mov dword [esp + 0x14], eax
mov ebx, dword [esp + 0x10]
mov eax, dword [0x3368dc]
dec ebx
cmp eax, ebx
mov dword [esp + 0x10], ebx
jge 0x53439
mov dword [esp + 0x10], eax
cmp ecx, dword [esp + 0x10]
jge 0x53541
mov eax, dword [esp + 0x14]
movsx ebp, word [0x453102]
add esi, edi
add eax, edx
mov edx, dword [esp + 0x24]
mov dword [esp + 0x28], esi
mov esi, dword [0x653190]
add edx, ecx
lea edx, [esi + edx*2]
mov esi, dword [esp + 0x10]
sub esi, ecx
dec esi
shr esi, 1
inc esi
lea ecx, [ecx + esi*2]
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], edx
mov dword [esp + 0x34], ecx
mov edi, edi
movsx ecx, word [0x453106]
sar eax, 0x10
cdq
idiv ecx
mov eax, dword [esp + 0x28]
sar eax, 0x10
mov ebx, edx
cdq
idiv ebp
mov eax, dword [0x6533b4]
shl ebx, 0xb
add ebx, eax
mov eax, dword [esp + 0x18]
add edx, ebx
movzx edx, byte [edx + eax]
mov ebx, dword [esp + 0x1c]
mov eax, dword [0x653190]
add edx, ebx
movzx ebx, word [eax + edx*2]
mov eax, dword [esp + 0x14]
sar eax, 0x10
cdq
idiv ecx
mov eax, edi
sar eax, 0x10
shl ebx, 0x10
mov ecx, edx
cdq
idiv ebp
mov eax, dword [0x6533b4]
shl ecx, 0xb
add ecx, eax
mov eax, dword [esp + 0x18]
add edx, ecx
movzx ecx, byte [edx + eax]
add ecx, dword [esp + 0x1c]
mov edx, dword [0x653190]
movzx eax, word [edx + ecx*2]
or eax, ebx
mov ebx, dword [esp + 0x3c]
call fcn.0004c040
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x30]
add ecx, eax
add edi, eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x28], ecx
lea ecx, [edx + edx]
add eax, ecx
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x38]
add eax, ecx
add ebx, 4
dec esi
mov dword [esp + 0x38], eax
mov dword [esp + 0x3c], ebx
jne 0x53480
mov ecx, dword [esp + 0x34]
cmp ecx, dword [esp + 0x10]
jne 0x5359d
mov eax, dword [esp + 0x14]
movsx esi, word [0x453106]
add eax, edx
sar eax, 0x10
cdq
idiv esi
mov eax, edi
movsx edi, word [0x453102]
sar eax, 0x10
mov ebp, dword [0x6533b4]
mov esi, edx
cdq
idiv edi
mov eax, dword [esp + 0x18]
mov edi, dword [esp + 0x1c]
shl esi, 0xb
add esi, ebp
add edx, esi
movzx edx, byte [edx + eax]
mov eax, dword [esp + 0x24]
add ecx, eax
mov eax, dword [0x653190]
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 0x53827
mov ecx, dword [esp + 0x20]
mov esi, dword [esp + 0x24]
movsx eax, word [0x4530fa]
inc ecx
add esi, 0x400
cmp ecx, eax
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], esi
jle 0x533a0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret
movsx eax, word [0x4530fa]
cmp esi, eax
mov dword [esp + 0x20], esi
jg 0x53827
shl esi, 0xa
mov dword [esp + 0x24], esi
jmp 0x53600
movsx ebx, word [0x2a8e12]
movsx ecx, word [0x2a8e36]
cmp ebx, ecx
mov dword [esp + 0x10], ebx
jl 0x537f7
sub ebx, ecx
mov ebp, dword [0x2a8e14]
mov edx, dword [0x2a8e38]
mov edi, ebp
mov dword [esp + 0x14], edx
jne 0x53635
mov ebx, 1
mov eax, dword [0x2a8e44]
sub eax, ebp
cdq
idiv ebx
mov edx, dword [0x2a8e38]
mov esi, eax
mov eax, dword [0x2a8e78]
sub eax, edx
cdq
idiv ebx
mov ebx, dword [0x3368d4]
cmp ecx, ebx
mov edx, eax
lea eax, [esi + esi]
mov dword [esp + 0x30], edx
mov dword [esp + 0x2c], eax
jge 0x53684
mov eax, ebx
sub eax, ecx
mov edi, eax
imul eax, edx
imul edi, esi
mov ecx, ebx
mov ebx, dword [0x2a8e38]
add edi, ebp
add eax, ebx
mov dword [esp + 0x14], eax
mov ebx, dword [esp + 0x10]
mov eax, dword [0x3368dc]
dec ebx
cmp eax, ebx
mov dword [esp + 0x10], ebx
jge 0x5369a
mov dword [esp + 0x10], eax
cmp ecx, dword [esp + 0x10]
jge 0x537a1
mov eax, dword [esp + 0x14]
movsx ebp, word [0x453102]
add esi, edi
add eax, edx
mov edx, dword [esp + 0x24]
mov dword [esp + 0x28], esi
mov esi, dword [0x653190]
add edx, ecx
lea edx, [esi + edx*2]
mov esi, dword [esp + 0x10]
sub esi, ecx
dec esi
shr esi, 1
inc esi
lea ecx, [ecx + esi*2]
mov dword [esp + 0x3c], eax
mov dword [esp + 0x38], edx
mov dword [esp + 0x34], ecx
nop
movsx ecx, word [0x453106]
sar eax, 0x10
cdq
idiv ecx
mov eax, dword [esp + 0x28]
sar eax, 0x10
mov ebx, edx
cdq
idiv ebp
mov eax, dword [0x6533b4]
shl ebx, 0xb
add ebx, eax
mov eax, dword [esp + 0x18]
add edx, ebx
movzx edx, byte [edx + eax]
mov ebx, dword [esp + 0x1c]
mov eax, dword [0x653190]
add edx, ebx
movzx ebx, word [eax + edx*2]
mov eax, dword [esp + 0x14]
sar eax, 0x10
cdq
idiv ecx
mov eax, edi
sar eax, 0x10
shl ebx, 0x10
mov ecx, edx
cdq
idiv ebp
mov eax, dword [0x6533b4]
shl ecx, 0xb
add ecx, eax
mov eax, dword [esp + 0x18]
add edx, ecx
movzx ecx, byte [edx + eax]
add ecx, dword [esp + 0x1c]
mov edx, dword [0x653190]
movzx eax, word [edx + ecx*2]
or eax, ebx
mov ebx, dword [esp + 0x38]
call fcn.0004c1a0
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x30]
add ecx, eax
add edi, eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x28], ecx
lea ecx, [edx + edx]
add eax, ecx
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x3c]
add eax, ecx
add ebx, 4
dec esi
mov dword [esp + 0x3c], eax
mov dword [esp + 0x38], ebx
jne 0x536e0
mov ecx, dword [esp + 0x34]
cmp ecx, dword [esp + 0x10]
jne 0x537f7
mov eax, dword [esp + 0x14]
movsx esi, word [0x453106]
add eax, edx
sar eax, 0x10
cdq
idiv esi
mov eax, edi
movsx edi, word [0x453102]
sar eax, 0x10
mov ebx, dword [0x6533b4]
mov esi, edx
cdq
idiv edi
mov eax, dword [esp + 0x18]
shl esi, 0xb
add esi, ebx
add edx, esi
movzx edx, byte [edx + eax]
add edx, dword [esp + 0x1c]
mov eax, dword [esp + 0x24]
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 0x53827
mov ecx, dword [esp + 0x20]
mov esi, dword [esp + 0x24]
movsx eax, word [0x4530fa]
inc ecx
add esi, 0x400
cmp ecx, eax
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], esi
jle 0x53600
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x30
ret