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

Disassembly:
sub esp, 0x34
push ebx
push ebp
mov ebp, dword [esp + 0x50]
push esi
mov esi, ecx
movsx ecx, ax
mov ebx, edx
mov edx, dword [0x3368dc]
cmp ecx, edx
push edi
jle 0x54f29
movsx edi, word [esp + 0x4c]
cmp edi, edx
jle 0x54f29
movsx edi, word [esp + 0x54]
cmp edi, edx
jle 0x54f29
movsx edi, bx
cmp edi, edx
jg 0x5556e
movsx edi, word [esp + 0x48]
mov edx, dword [0x3368e0]
cmp edi, edx
jle 0x54f53
movsx edi, word [esp + 0x50]
cmp edi, edx
jle 0x54f53
movsx edi, bp
cmp edi, edx
jle 0x54f53
movsx edi, si
cmp edi, edx
jg 0x5556e
mov edx, dword [0x3368d4]
cmp ecx, edx
jge 0x54f7a
movsx ecx, word [esp + 0x4c]
cmp ecx, edx
jge 0x54f7a
movsx ecx, word [esp + 0x54]
cmp ecx, edx
jge 0x54f7a
movsx ecx, bx
cmp ecx, edx
jl 0x5556e
movsx ecx, word [esp + 0x48]
mov edi, dword [0x3368d8]
cmp ecx, edi
jge 0x54fa4
movsx ecx, word [esp + 0x50]
cmp ecx, edi
jge 0x54fa4
movsx ecx, bp
cmp ecx, edi
jge 0x54fa4
movsx ecx, si
cmp ecx, edi
jl 0x5556e
cmp edi, dword [0x3368e0]
jge 0x5556e
cmp edx, dword [0x3368dc]
jge 0x5556e
mov edx, dword [esp + 0x78]
mov ecx, dword [esp + 0x74]
push edx
mov edx, dword [esp + 0x74]
push ecx
mov ecx, dword [esp + 0x74]
push edx
mov edx, dword [esp + 0x74]
push ecx
mov ecx, dword [esp + 0x74]
push edx
mov edx, dword [esp + 0x68]
push ecx
mov ecx, dword [esp + 0x68]
push esi
push ebx
push ebp
push edx
mov edx, dword [esp + 0x74]
push ecx
mov ecx, dword [esp + 0x74]
push edx
mov edx, dword [esp + 0x90]
push ecx
mov ecx, dword [esp + 0x90]
call fcn.0004e670
add esp, 0x34
test ax, ax
je 0x5556e
movsx esi, word [0x4530e0]
cmp esi, edi
jge 0x55033
jmp 0x55020
call fcn.0004e560
test ax, ax
jne 0x5556e
inc esi
cmp esi, edi
jl 0x55020
cmp word [0x33679c], 0
jne 0x552ef
cmp word [0x3368f8], 0
jne 0x552ef
movsx eax, word [0x4530fa]
cmp esi, eax
mov dword [esp + 0x18], esi
jg 0x5556e
shl esi, 0xa
mov dword [esp + 0x1c], esi
lea esp, [esp]
movsx ebx, word [0x2a8e12]
movsx ecx, word [0x2a8e36]
cmp ebx, ecx
mov dword [esp + 0x10], ebx
jl 0x552b3
sub ebx, ecx
mov ebp, dword [0x2a8e14]
mov edx, dword [0x2a8e38]
mov edi, ebp
mov dword [esp + 0x14], edx
jne 0x550a5
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
lea edx, [esi + esi]
mov dword [esp + 0x30], edx
lea edx, [eax + eax]
mov dword [esp + 0x34], edx
jge 0x550f5
mov edx, ebx
sub edx, ecx
mov edi, edx
imul edx, eax
imul edi, esi
mov ecx, ebx
mov ebx, dword [0x2a8e38]
add edi, ebp
add edx, ebx
mov dword [esp + 0x14], edx
mov ebx, dword [esp + 0x10]
mov edx, dword [0x3368dc]
dec ebx
cmp edx, ebx
mov dword [esp + 0x10], ebx
jge 0x5510c
mov dword [esp + 0x10], edx
cmp ecx, dword [esp + 0x10]
jge 0x5524c
movsx edx, word [0x453104]
movsx ebx, word [0x453102]
movsx ebp, word [0x453100]
mov dword [esp + 0x20], edx
mov edx, dword [esp + 0x14]
add esi, edi
add eax, edx
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x24], 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 + 0x28], ebx
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], edx
mov dword [esp + 0x38], ecx
jmp 0x55170
mov ebx, dword [esp + 0x28]
lea ecx, [ecx]
movsx ecx, word [0x453106]
sar eax, 0x10
cdq
idiv ecx
mov eax, dword [esp + 0x20]
mov dword [esp + 0x2c], ecx
mov ecx, edx
mov edx, dword [0x4530e4]
add ecx, eax
mov eax, dword [esp + 0x24]
sar eax, 0x10
add ecx, edx
cdq
idiv ebx
mov eax, dword [0x4530dc]
shl ecx, 0xa
add ecx, ebp
mov ebp, dword [0x4530e4]
add edx, ecx
add edx, eax
mov eax, dword [0x653190]
movzx ecx, word [eax + edx*2]
mov eax, dword [esp + 0x14]
sar eax, 0x10
cdq
idiv dword [esp + 0x2c]
shl ecx, 0x10
mov eax, edx
add eax, ebp
shl eax, 0xa
mov dword [esp + 0x2c], eax
mov eax, edi
sar eax, 0x10
cdq
idiv ebx
movsx ebp, word [0x453100]
mov eax, dword [esp + 0x2c]
mov ebx, dword [esp + 0x40]
add eax, ebp
add edx, eax
movsx eax, word [0x453104]
add edx, eax
mov dword [esp + 0x20], eax
add edx, dword [0x4530dc]
mov eax, dword [0x653190]
movzx edx, word [eax + edx*2]
or ecx, edx
mov eax, ecx
call fcn.0004c040
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x24]
add ecx, eax
add edi, eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x24], ecx
mov ecx, dword [esp + 0x34]
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 + 0x40], ebx
jne 0x55169
mov ecx, dword [esp + 0x38]
cmp ecx, dword [esp + 0x10]
jne 0x552b3
mov eax, dword [esp + 0x14]
movsx esi, word [0x453106]
sar eax, 0x10
cdq
idiv esi
mov eax, dword [0x4530e4]
movsx esi, word [0x453104]
mov ebp, dword [0x4530dc]
add edx, eax
add esi, edx
mov eax, edi
movsx edi, word [0x453102]
sar eax, 0x10
cdq
idiv edi
mov eax, dword [esp + 0x1c]
movsx edi, word [0x453100]
add ecx, eax
mov eax, dword [0x653190]
shl esi, 0xa
add edx, ebp
add edx, esi
add edi, edx
lea edx, [eax + ecx*2]
mov ax, word [eax + edi*2]
push edx
call fcn.0004ba90
add esp, 4
call fcn.0004e560
test ax, ax
jne 0x5556e
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 0x55070
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x34
ret
movsx eax, word [0x4530fa]
cmp esi, eax
mov dword [esp + 0x18], esi
jg 0x5556e
shl esi, 0xa
mov dword [esp + 0x1c], esi
lea esp, [esp]
movsx ebx, word [0x2a8e12]
movsx ecx, word [0x2a8e36]
cmp ebx, ecx
mov dword [esp + 0x10], ebx
jl 0x5553e
sub ebx, ecx
mov ebp, dword [0x2a8e14]
mov eax, dword [0x2a8e38]
mov edi, ebp
mov dword [esp + 0x14], eax
jne 0x55344
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
lea edx, [esi + esi]
mov dword [esp + 0x30], edx
lea edx, [eax + eax]
mov dword [esp + 0x34], edx
jge 0x55394
mov edx, ebx
sub edx, ecx
mov edi, edx
imul edx, eax
imul edi, esi
mov ecx, ebx
mov ebx, dword [0x2a8e38]
add edi, ebp
add edx, ebx
mov dword [esp + 0x14], edx
mov ebx, dword [esp + 0x10]
mov edx, dword [0x3368dc]
dec ebx
cmp edx, ebx
mov dword [esp + 0x10], ebx
jge 0x553ab
mov dword [esp + 0x10], edx
cmp ecx, dword [esp + 0x10]
jge 0x554da
mov edx, dword [esp + 0x14]
movsx ebx, word [0x453102]
movsx ebp, word [0x453100]
add esi, edi
add eax, edx
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x24], 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 + 0x28], ebx
mov dword [esp + 0x40], eax
mov dword [esp + 0x3c], edx
mov dword [esp + 0x38], ecx
jmp 0x55401
mov ebx, dword [esp + 0x28]
movsx ecx, word [0x453106]
sar eax, 0x10
cdq
idiv ecx
movsx eax, word [0x453104]
mov dword [esp + 0x20], eax
mov dword [esp + 0x2c], ecx
mov ecx, edx
mov edx, dword [0x4530e4]
add ecx, eax
mov eax, dword [esp + 0x24]
sar eax, 0x10
add ecx, edx
cdq
idiv ebx
mov eax, dword [0x653190]
shl ecx, 0xa
add ecx, ebp
mov ebp, dword [0x4530e4]
add edx, ecx
add edx, dword [0x4530dc]
movzx ecx, word [eax + edx*2]
mov eax, dword [esp + 0x14]
sar eax, 0x10
cdq
idiv dword [esp + 0x2c]
shl ecx, 0x10
mov eax, edx
add eax, dword [esp + 0x20]
add eax, ebp
shl eax, 0xa
mov dword [esp + 0x2c], eax
mov eax, edi
sar eax, 0x10
cdq
idiv ebx
movsx ebp, word [0x453100]
mov eax, dword [esp + 0x2c]
mov ebx, dword [esp + 0x3c]
add eax, ebp
add edx, eax
add edx, dword [0x4530dc]
mov eax, dword [0x653190]
movzx edx, word [eax + edx*2]
or ecx, edx
mov eax, ecx
call fcn.0004c1a0
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x24]
add ecx, eax
add edi, eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0x24], ecx
mov ecx, dword [esp + 0x34]
add eax, ecx
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x40]
add eax, ecx
add ebx, 4
dec esi
mov dword [esp + 0x40], eax
mov dword [esp + 0x3c], ebx
jne 0x553fd
mov ecx, dword [esp + 0x38]
cmp ecx, dword [esp + 0x10]
jne 0x5553e
mov eax, dword [esp + 0x14]
movsx esi, word [0x453106]
sar eax, 0x10
cdq
idiv esi
movsx esi, word [0x453104]
mov ebp, dword [0x4530e4]
mov eax, edi
movsx edi, word [0x453102]
sar eax, 0x10
mov ebx, dword [0x4530dc]
add edx, ebp
add esi, edx
cdq
idiv edi
mov eax, dword [esp + 0x1c]
shl esi, 0xa
add ecx, eax
mov eax, dword [0x653190]
lea edi, [eax + ecx*2]
add edx, ebx
movsx ebx, word [0x453100]
add edx, esi
add ebx, edx
mov ax, word [eax + ebx*2]
call fcn.0004b820
call fcn.0004e560
test ax, ax
jne 0x5556e
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 0x55310
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x34
ret