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

Disassembly:
sub esp, 0x38
mov dword [esp + 0xc], ecx
mov eax, edx
mov ecx, dword [esp + 0x7c]
xor edx, edx
push ebx
cmp ecx, 1
mov dword [esp + 4], eax
push ebp
lea ebp, [ecx*8]
mov dword [esp + 0x10], 6
mov ecx, dword [esp + 0x88]
setg dl
shl ecx, 3
mov ebx, 0x40
mov dword [esp + 0x3c], ecx
xor ecx, ecx
push esi
mov dword [esp + 0x24], edx
mov edx, dword [esp + 0x48]
push edi
mov dword [esp + 0x30], ebp
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], ebx
lea edi, [ebx + ecx]
xor esi, esi
sar edi, 1
xor ecx, ecx
cmp edx, eax
jle 0x54626f
mov ebx, dword [esp + 0x4c]
mov edx, dword [esp + 0x54]
lea edx, [edx + ebx*4]
mov ebx, dword [esp + 0x58]
sub ebx, dword [esp + 0x54]
mov dword [esp + 0x38], ebx
mov ebx, dword [esp + 0x5c]
sub ebx, dword [esp + 0x54]
mov dword [esp + 0x34], ebx
mov ebx, dword [esp + 0x60]
sub ebx, dword [esp + 0x54]
mov dword [esp + 0x2c], ebx
mov ebx, dword [esp + 0x4c]
sub ebx, eax
jmp 0x546220
mov eax, dword [esp + 0x38]
lea edx, [edx - 4]
mov ebp, dword [esp + 0x34]
mov eax, dword [eax + edx]
imul eax, edi
sar eax, 6
add eax, dword [edx]
cmp eax, dword [edx + ebp]
mov ebp, dword [esp + 0x30]
jge 0x54624b
test ecx, ecx
jne 0x54624b
cmp eax, ebp
jl 0x54625e
add esi, ebp
jmp 0x54625e
mov ecx, dword [esp + 0x2c]
mov ecx, dword [ecx + edx]
cmp eax, ecx
cmovge eax, ecx
mov ecx, 1
add esi, eax
sub ebx, 1
jne 0x546220
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x4c]
mov ebx, dword [esp + 0x24]
cmp esi, dword [esp + 0x64]
mov ecx, dword [esp + 0x20]
cmovle ecx, edi
cmovle edi, ebx
sub dword [esp + 0x18], 1
mov ebx, edi
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], ebx
jne 0x5461d5
xor ebx, ebx
mov dword [esp + 0x18], ebx
mov dword [esp + 0x24], ebx
cmp edx, eax
jle 0x546345
mov ecx, dword [esp + 0x54]
mov esi, dword [esp + 0x5c]
mov edi, dword [esp + 0x4c]
sub esi, ecx
sub dword [esp + 0x58], ecx
mov dword [esp + 0x38], esi
lea edx, [ecx + edx*4]
mov esi, dword [esp + 0x60]
sub esi, ecx
mov dword [esp + 0x30], esi
mov esi, dword [esp + 0x80]
sub esi, ecx
sub edi, eax
mov dword [esp + 0x2c], esi
mov esi, dword [esp + 0x20]
lea ebx, [ebx]
mov eax, dword [esp + 0x58]
lea edx, [edx - 4]
mov ecx, dword [edx + eax]
mov eax, dword [esp + 0x38]
imul ecx, esi
sar ecx, 6
add ecx, dword [edx]
cmp ecx, dword [edx + eax]
jge 0x546317
cmp dword [esp + 0x24], 0
jne 0x546317
cmp ecx, ebp
mov dword [esp + 0x34], 0
mov eax, ebp
cmovl eax, dword [esp + 0x34]
mov ecx, eax
jmp 0x54631f
mov dword [esp + 0x24], 1
mov eax, dword [esp + 0x30]
mov eax, dword [edx + eax]
cmp ecx, eax
cmovl eax, ecx
mov ecx, dword [esp + 0x2c]
add ebx, eax
mov dword [ecx + edx], eax
sub edi, 1
jne 0x5462e0
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x4c]
mov dword [esp + 0x18], ebx
mov ebp, dword [esp + 0x94]
lea ecx, [edx - 1]
mov esi, edx
mov dword [esp + 0x20], ecx
mov dword [esp + 0x14], esi
cmp ecx, dword [esp + 0x50]
jle 0x546543
mov edi, dword [esp + 0x8c]
lea edx, [edx*4 - 4]
add eax, eax
mov dword [esp + 0x38], ecx
mov dword [esp + 0x3c], eax
mov dword [esp + 0x34], edx
lea eax, [edi*8]
add eax, 8
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x74]
mov dword [esp + 0x74], eax
jmp 0x5463a0
mov eax, dword [esp + 0x1c]
mov edx, dword [esp + 0x3c]
mov edi, dword [esp + 0x64]
sub edi, ebx
mov ecx, dword [eax + 0x20]
movsx eax, word [ecx + esi*2]
movsx ebx, word [edx + ecx]
mov esi, eax
mov dword [esp + 0x24], eax
sub esi, ebx
mov eax, edi
cdq
idiv esi
mov edx, eax
mov eax, dword [esp + 0x20]
imul esi, edx
movsx eax, word [ecx + eax*2]
mov ecx, dword [esp + 0x80]
sub ebx, esi
sub ebx, eax
add ebx, edi
mov edi, dword [esp + 0x24]
sub edi, eax
mov eax, dword [esp + 0x20]
mov esi, dword [ecx + eax*4]
lea eax, [ecx + eax*4]
mov dword [esp + 0x30], eax
xor eax, eax
test ebx, ebx
mov dword [esp + 0x24], edi
cmovle ebx, eax
mov eax, dword [esp + 0x5c]
imul edi, edx
add ebx, esi
mov edx, dword [esp + 0x20]
mov eax, dword [eax + edx*4]
add edi, ebx
cmp eax, dword [esp + 0x40]
mov dword [esp + 0x2c], edi
cmovle eax, dword [esp + 0x40]
cmp edi, eax
jl 0x5464d3
cmp dword [esp + 0x98], 0
je 0x54648d
mov esi, dword [esp + 0x10]
mov edi, dword [esp + 0x14]
lea eax, [esi + 2]
cmp edi, eax
jle 0x546559
mov ecx, dword [esp + 0x90]
xor eax, eax
cmp edx, dword [esp + 0x9c]
setge al
lea eax, [eax*2 + 7]
imul eax, dword [esp + 0x24]
shl eax, cl
shl eax, 3
sar eax, 4
cmp dword [esp + 0x2c], eax
jg 0x546559
mov ecx, dword [ebp + 0x1c]
mov eax, ecx
shr eax, 1
sub ecx, eax
mov dword [ebp + 0x1c], ecx
mov ecx, ebp
call fcn.00537a70
mov edi, dword [esp + 0x2c]
jmp 0x5464bd
mov ecx, dword [ebp + 0x1c]
mov esi, ecx
mov ebx, dword [ebp + 0x20]
shr esi, 1
cmp ebx, esi
jb 0x5464a2
mov eax, ebx
sub eax, esi
mov dword [ebp + 0x20], eax
sub ecx, esi
mov eax, esi
cmp ebx, esi
cmovae eax, ecx
mov ecx, ebp
mov dword [ebp + 0x1c], eax
call fcn.0053eba0
cmp ebx, esi
jb 0x546571
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x20]
add ecx, 8
sub edi, 8
mov esi, dword [eax]
jmp 0x5464d7
mov ecx, dword [esp + 0x18]
mov ebx, dword [esp + 0x74]
lea eax, [esi + ebx]
sub ecx, eax
test ebx, ebx
jle 0x5464f3
sub edx, dword [esp + 0x10]
movzx ebx, byte [edx + 0x5e9020]
mov dword [esp + 0x74], ebx
mov eax, dword [esp + 0x8c]
xor esi, esi
add ecx, ebx
lea edx, [eax*8]
cmp edi, edx
lea ebx, [ecx + edx]
mov eax, edx
cmovl eax, esi
mov esi, dword [esp + 0x30]
sub dword [esp + 0x34], 4
mov dword [esi], eax
mov esi, dword [esp + 0x14]
mov eax, dword [esp + 0x38]
dec esi
dec eax
mov dword [esp + 0x14], esi
cmp edi, edx
mov dword [esp + 0x38], eax
mov dword [esp + 0x20], eax
cmovl ebx, ecx
mov dword [esp + 0x18], ebx
cmp eax, dword [esp + 0x50]
jg 0x5463a0
mov ecx, dword [esp + 0x64]
add ecx, dword [esp + 0x6c]
mov esi, dword [esp + 0x10]
mov edi, dword [esp + 0x14]
mov dword [esp + 0x64], ecx
jmp 0x54657d
mov eax, dword [ebp + 0x1c]
mov ecx, eax
shr ecx, 1
sub eax, ecx
mov dword [ebp + 0x1c], ecx
add dword [ebp + 0x20], eax
mov ecx, ebp
call fcn.00537a70
jmp 0x546579
mov esi, dword [esp + 0x10]
mov edi, dword [esp + 0x14]
mov ebx, dword [esp + 0x18]
mov eax, dword [esp + 0x74]
test eax, eax
jle 0x5465ca
mov eax, edi
sub eax, esi
inc eax
cmp dword [esp + 0x98], 0
je 0x5465b6
mov ecx, dword [esp + 0x70]
push eax
mov edx, dword [ecx]
cmp edx, edi
cmovge edx, edi
mov dword [ecx], edx
sub edx, esi
mov ecx, ebp
call fcn.00537c80
mov eax, dword [esp + 0x74]
add esp, 4
mov edx, dword [eax]
jmp 0x5465d6
mov edx, eax
mov ecx, ebp
call fcn.0053ed90
lea edx, [eax + esi]
mov eax, dword [esp + 0x70]
mov dword [eax], edx
jmp 0x5465d6
mov eax, dword [esp + 0x70]
xor edx, edx
mov dword [eax], 0
mov eax, dword [esp + 0x64]
cmp edx, esi
mov ecx, dword [esp + 0x7c]
lea edi, [eax + ecx]
cmovg edi, eax
xor eax, eax
cmp edx, esi
cmovg eax, ecx
test eax, eax
jle 0x546665
cmp dword [esp + 0x98], 0
mov ecx, dword [ebp + 0x1c]
je 0x546622
mov edx, dword [esp + 0x78]
mov eax, ecx
shr eax, 1
sub ecx, eax
mov edx, dword [edx]
test edx, edx
je 0x546613
add dword [ebp + 0x20], ecx
test edx, edx
cmovne ecx, eax
mov dword [ebp + 0x1c], ecx
mov ecx, ebp
call fcn.00537a70
jmp 0x54666f
mov eax, dword [ebp + 0x20]
mov edx, ecx
shr edx, 1
cmp eax, edx
mov dword [esp + 0x64], eax
sbb ebx, ebx
neg ebx
mov dword [esp + 0x50], ebx
mov ebx, dword [esp + 0x18]
cmp eax, edx
jb 0x546648
sub eax, edx
mov dword [ebp + 0x20], eax
mov eax, dword [esp + 0x64]
sub ecx, edx
cmp eax, edx
cmovae edx, ecx
mov ecx, ebp
mov dword [ebp + 0x1c], edx
call fcn.0053eba0
mov edx, dword [esp + 0x78]
mov eax, dword [esp + 0x50]
mov dword [edx], eax
jmp 0x54666f
mov edx, dword [esp + 0x78]
mov dword [edx], 0
mov eax, dword [esp + 0x1c]
sub edi, ebx
mov ebx, dword [esp + 0x14]
mov eax, dword [eax + 0x20]
movsx ecx, word [eax + ebx*2]
movsx eax, word [eax + esi*2]
sub ecx, eax
mov eax, edi
cdq
idiv ecx
mov edx, esi
mov ebp, eax
imul ecx, ebp
sub edi, ecx
mov dword [esp + 0x64], edi
cmp esi, ebx
jge 0x5466d1
mov esi, dword [esp + 0x80]
mov edi, dword [esp + 0x1c]
jmp 0x5466b0
mov eax, dword [edi + 0x20]
movsx ecx, word [eax + edx*2 + 2]
movsx eax, word [eax + edx*2]
sub ecx, eax
imul ecx, ebp
add dword [esi + edx*4], ecx
inc edx
cmp edx, ebx
jl 0x5466b0
mov esi, dword [esp + 0x10]
mov edi, dword [esp + 0x64]
mov ebp, dword [esp + 0x1c]
mov edx, esi
cmp esi, ebx
jge 0x546705
mov esi, dword [esp + 0x80]
mov eax, dword [ebp + 0x20]
movsx ecx, word [eax + edx*2 + 2]
movsx eax, word [eax + edx*2]
sub ecx, eax
mov eax, edi
cmp edi, ecx
cmovge eax, ecx
add dword [esi + edx*4], eax
sub edi, eax
inc edx
cmp edx, ebx
jl 0x5466e2
mov esi, dword [esp + 0x10]
xor edi, edi
mov dword [esp + 0x7c], edi
cmp esi, ebx
jge 0x546929
mov eax, dword [esp + 0x80]
mov ecx, dword [esp + 0x84]
sub dword [esp + 0x60], eax
sub ecx, eax
mov dword [esp + 0x50], ecx
mov ecx, dword [esp + 0x88]
lea ebx, [eax + esi*4]
sub ecx, eax
mov dword [esp + 0x64], ecx
jmp 0x546740
mov eax, dword [ebp + 0x20]
mov ecx, dword [esp + 0x90]
mov ebp, dword [ebx]
add ebp, edi
movsx edx, word [eax + esi*2 + 2]
movsx eax, word [eax + esi*2]
sub edx, eax
shl edx, cl
mov dword [esp + 0x74], edx
cmp edx, 1
jle 0x546891
mov eax, dword [esp + 0x60]
mov edi, ebp
sub edi, dword [eax + ebx]
xor eax, eax
test edi, edi
cmovle edi, eax
sub ebp, edi
cmp dword [esp + 0x8c], 2
mov dword [ebx], ebp
jne 0x5467a3
cmp edx, 2
jle 0x5467a3
mov eax, dword [esp + 0x78]
cmp dword [eax], 0
jne 0x5467a3
mov eax, dword [esp + 0x70]
cmp esi, dword [eax]
jge 0x5467a3
mov eax, 1
jmp 0x5467a5
xor eax, eax
mov ecx, edx
imul ecx, dword [esp + 0x8c]
add ecx, eax
mov eax, dword [esp + 0x1c]
mov eax, dword [eax + 0x38]
movsx edx, word [eax + esi*2]
add edx, dword [esp + 0x44]
imul edx, ecx
imul eax, ecx, 0x15
mov esi, edx
sar esi, 1
sub esi, eax
cmp dword [esp + 0x74], 2
jne 0x5467df
lea eax, [ecx*8]
sar eax, 2
add esi, eax
lea eax, [esi + ebp]
mov dword [esp + 0x74], eax
mov eax, ecx
shl eax, 4
cmp dword [esp + 0x74], eax
jge 0x5467f6
sar edx, 2
jmp 0x546805
lea eax, [ecx + ecx*2]
shl eax, 3
cmp dword [esp + 0x74], eax
jge 0x546807
sar edx, 3
add esi, edx
lea eax, [ecx*8]
mov dword [esp + 0x74], eax
lea eax, [ecx*4]
add eax, ebp
xor ebp, ebp
add eax, esi
cdq
idiv dword [esp + 0x74]
mov edx, dword [esp + 0x50]
test eax, eax
cmovns ebp, eax
mov ecx, ebp
mov dword [edx + ebx], ebp
imul ecx, dword [esp + 0x8c]
mov eax, dword [ebx]
sar eax, 3
cmp ecx, eax
jle 0x546851
mov ebp, dword [ebx]
mov ecx, dword [esp + 0x28]
sar ebp, cl
sar ebp, 3
mov dword [edx + ebx], ebp
mov edx, 8
cmp ebp, edx
cmovl edx, ebp
mov ebp, dword [esp + 0x50]
add ebp, ebx
xor eax, eax
mov dword [ebp], edx
imul edx, dword [esp + 0x74]
mov ecx, dword [ebx]
add ecx, esi
mov esi, dword [esp + 0x10]
cmp edx, ecx
mov ecx, dword [esp + 0x64]
setge al
mov dword [ecx + ebx], eax
mov eax, dword [ebp]
imul eax, dword [esp + 0x8c]
shl eax, 3
sub dword [ebx], eax
jmp 0x5468c7
mov edx, dword [esp + 0x8c]
mov eax, ebp
mov edi, 0
lea ecx, [edx*8]
sub eax, ecx
cmovns edi, eax
mov eax, dword [esp + 0x64]
sub ebp, edi
mov dword [ebx], ebp
mov ebp, dword [esp + 0x50]
add ebp, ebx
mov dword [ebp], 0
mov dword [eax + ebx], 1
test edi, edi
jle 0x54690b
mov ecx, dword [esp + 0x28]
mov esi, edi
mov eax, 8
sub eax, dword [ebp]
lea ecx, [ecx + 3]
sar esi, cl
cmp esi, eax
cmovge esi, eax
mov eax, edi
add dword [ebp], esi
xor ecx, ecx
imul esi, dword [esp + 0x8c]
sub eax, dword [esp + 0x7c]
shl esi, 3
cmp esi, eax
mov eax, dword [esp + 0x64]
setge cl
sub edi, esi
mov esi, dword [esp + 0x10]
mov dword [eax + ebx], ecx
mov ebp, dword [esp + 0x1c]
inc esi
add ebx, 4
mov dword [esp + 0x7c], edi
mov dword [esp + 0x10], esi
cmp esi, dword [esp + 0x14]
jl 0x546740
mov ebx, dword [esp + 0x14]
mov eax, dword [esp + 0x68]
mov ebp, dword [esp + 0x4c]
mov dword [eax], edi
cmp esi, ebp
jge 0x546998
mov eax, dword [esp + 0x84]
mov edi, dword [esp + 0x80]
sub dword [esp + 0x88], eax
sub edi, eax
mov ebx, dword [esp + 0x88]
sub ebp, esi
lea edx, [eax + esi*4]
lea ebx, [ebx]
mov eax, dword [edi + edx]
lea edx, [edx + 4]
mov ecx, dword [esp + 0x28]
sar eax, cl
xor ecx, ecx
sar eax, 3
mov dword [edx - 4], eax
mov dword [edi + edx - 4], 0
cmp dword [edx - 4], 1
setl cl
mov dword [ebx + edx - 4], ecx
sub ebp, 1
jne 0x546960
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x38
ret
pop edi
pop esi
pop ebp
mov eax, ebx
pop ebx
add esp, 0x38
ret