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

Disassembly:
sub esp, 8
mov edx, dword [esp + 0xc]
mov eax, dword [esp + 0x10]
test eax, eax
push ebx
push ebp
mov ebp, dword [edx + 0x532ec]
push esi
push edi
mov edi, dword [edx + 0x532e8]
lea esi, [edx + 0x1c]
lea ebx, [edx + 0x3c]
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], ebp
je 0x3021a644
xor eax, eax
mov ecx, 0x73
mov edi, ebx
rep stosd dword es:[edi], eax
mov eax, dword [edx + 0x34]
push esi
mov dword [ebx], eax
call fcn.301f4200
push esi
mov dword [ebx + 4], eax
call fcn.301f4200
add esp, 8
cmp eax, 9
mov dword [ebx + 8], eax
jg 0x3021aa4d
cmp eax, 4
jle 0x3021a606
add eax, 0xfffffffb
mov dword [ebx + 8], eax
push esi
call fcn.301f4200
add esp, 4
cmp eax, 0xff
mov dword [ebx + 0xc], eax
jg 0x3021aa4d
test eax, eax
jl 0x3021aa4d
mov edx, dword [esp + 0x1c]
mov eax, dword [edx + 0x38]
xor ecx, ecx
cmp eax, 5
sete cl
pop edi
pop esi
pop ebp
mov eax, 1
mov dword [ebx + 0x64], ecx
pop ebx
add esp, 8
ret
mov eax, dword [edi + 0x3f0]
add eax, 4
push eax
push esi
call fcn.301f4030
mov dword [ebx + 0x10], eax
mov eax, dword [edi + 0x468]
add esp, 8
test eax, eax
jne 0x3021a6f7
mov edi, dword [esi + 0xc]
test edi, edi
jl 0x3021a695
mov ebp, dword [esi + 4]
movzx edx, byte [ebp + 1]
mov dh, byte [ebp]
mov eax, dword [esi + 0x10]
mov ecx, edi
add ebp, 2
mov dword [esi + 4], ebp
mov ebp, dword [esp + 0x10]
shl edx, cl
or eax, edx
add edi, 0xfffffff0
mov dword [esi + 0x10], eax
mov dword [esi + 0xc], edi
mov ecx, dword [esi + 0x10]
mov edx, dword [esi + 0xc]
mov eax, ecx
shr eax, 0x1f
add ecx, ecx
inc edx
test eax, eax
mov dword [esi + 0x10], ecx
mov dword [esi + 0xc], edx
mov dword [ebx + 0x14], eax
je 0x3021a6f3
mov ebp, dword [esi + 0xc]
test ebp, ebp
jl 0x3021a6d8
mov edi, dword [esi + 4]
movzx edx, byte [edi + 1]
mov dh, byte [edi]
mov eax, dword [esi + 0x10]
mov ecx, ebp
add edi, 2
mov dword [esi + 4], edi
shl edx, cl
or eax, edx
add ebp, 0xfffffff0
mov dword [esi + 0x10], eax
mov dword [esi + 0xc], ebp
mov ecx, dword [esi + 0x10]
mov ebp, dword [esp + 0x10]
mov eax, ecx
add ecx, ecx
mov dword [esi + 0x10], ecx
mov ecx, dword [esi + 0xc]
shr eax, 0x1f
inc ecx
mov dword [esi + 0xc], ecx
mov dword [ebx + 0x18], eax
mov edi, dword [esp + 0x14]
mov edx, dword [esp + 0x1c]
mov dword [ebx + 0x1c], 0xffffffff
cmp dword [edx + 0x38], 5
jne 0x3021a727
push esi
call fcn.301f4200
add esp, 4
cmp eax, 0xffff
mov dword [ebx + 0x1c], eax
jg 0x3021aa4d
test eax, eax
jl 0x3021aa4d
mov eax, dword [edi + 0x3f4]
test eax, eax
jne 0x3021a761
mov eax, dword [edi + 0x3f8]
add eax, 4
push eax
push esi
call fcn.301f4030
mov dword [ebx + 0x20], eax
mov eax, dword [ebp + 0xc]
add esp, 8
test eax, eax
je 0x3021a761
mov eax, dword [ebx + 0x14]
test eax, eax
jne 0x3021a761
push esi
call fcn.301f40e0
add esp, 4
mov dword [ebx + 0x24], eax
cmp dword [edi + 0x3f4], 1
jne 0x3021a79a
mov eax, dword [edi + 0x3fc]
test eax, eax
jne 0x3021a79a
push esi
call fcn.301f40e0
mov dword [ebx + 0x28], eax
mov eax, dword [ebp + 0xc]
add esp, 4
test eax, eax
je 0x3021a79a
mov eax, dword [ebx + 0x14]
test eax, eax
jne 0x3021a79a
push esi
call fcn.301f40e0
add esp, 4
mov dword [ebx + 0x2c], eax
mov eax, dword [ebp + 0x48]
test eax, eax
je 0x3021a7be
push esi
call fcn.301f4200
add esp, 4
cmp eax, 0x7f
mov dword [ebx + 0x30], eax
jg 0x3021aa4d
test eax, eax
jl 0x3021aa4d
cmp dword [ebx + 8], 1
jne 0x3021a80c
mov edi, dword [esi + 0xc]
test edi, edi
jl 0x3021a7ed
mov ebp, dword [esi + 4]
movzx edx, byte [ebp + 1]
mov dh, byte [ebp]
mov eax, dword [esi + 0x10]
mov ecx, edi
add ebp, 2
mov dword [esi + 4], ebp
shl edx, cl
or eax, edx
add edi, 0xfffffff0
mov dword [esi + 0x10], eax
mov dword [esi + 0xc], edi
mov ecx, dword [esi + 0x10]
mov ebp, dword [esp + 0x10]
mov edi, dword [esp + 0x14]
mov eax, ecx
add ecx, ecx
mov dword [esi + 0x10], ecx
mov ecx, dword [esi + 0xc]
shr eax, 0x1f
inc ecx
mov dword [esi + 0xc], ecx
mov dword [ebx + 0x34], eax
mov edx, dword [ebp + 0x24]
mov dword [ebx + 0x3c], edx
mov eax, dword [ebp + 0x28]
mov dword [ebx + 0x40], eax
mov eax, dword [ebx + 8]
test eax, eax
je 0x3021a82d
cmp eax, 3
je 0x3021a82d
cmp eax, 1
jne 0x3021a8bb
mov ebp, dword [esi + 0xc]
test ebp, ebp
jl 0x3021a855
mov edi, dword [esi + 4]
movzx edx, byte [edi + 1]
mov dh, byte [edi]
mov eax, dword [esi + 0x10]
mov ecx, ebp
add edi, 2
mov dword [esi + 4], edi
shl edx, cl
or eax, edx
add ebp, 0xfffffff0
mov dword [esi + 0x10], eax
mov dword [esi + 0xc], ebp
mov ecx, dword [esi + 0x10]
mov edx, dword [esi + 0xc]
mov eax, ecx
shr eax, 0x1f
add ecx, ecx
inc edx
test eax, eax
mov dword [esi + 0x10], ecx
mov dword [esi + 0xc], edx
mov dword [ebx + 0x38], eax
je 0x3021a8b3
mov edi, dword [ebx + 0x14]
neg edi
sbb edi, edi
and edi, 0x10
push esi
add edi, 0xf
call fcn.301f4200
add esp, 4
cmp eax, edi
mov dword [ebx + 0x3c], eax
jg 0x3021aa4d
test eax, eax
jl 0x3021aa4d
cmp dword [ebx + 8], 1
jne 0x3021a8b3
push esi
call fcn.301f4200
add esp, 4
cmp eax, edi
mov dword [ebx + 0x40], eax
jg 0x3021a91f
test eax, eax
jl 0x3021a91f
mov ebp, dword [esp + 0x10]
mov edi, dword [esp + 0x14]
mov edx, dword [esp + 0x1c]
mov eax, dword [edx + 0x532e8]
mov ecx, dword [eax + 0x3f0]
add ecx, 4
mov edx, 1
shl edx, cl
mov ecx, dword [ebx + 0x14]
shl edx, cl
push edx
push ebx
call fcn.30219f90
add esp, 8
test eax, eax
je 0x3021aa4d
mov eax, dword [ebp + 0x2c]
test eax, eax
je 0x3021a8ff
mov eax, dword [ebx + 8]
test eax, eax
je 0x3021a910
cmp eax, 3
je 0x3021a910
mov ecx, dword [ebp + 0x30]
mov eax, 1
cmp ecx, eax
jne 0x3021a929
cmp dword [ebx + 8], eax
jne 0x3021a929
push edi
mov edi, ebx
call fcn.3021a120
add esp, 4
test eax, eax
jne 0x3021a932
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 8
ret
mov dword [ebx + 0x78], 0
jmp 0x3021a93a
mov ebp, dword [esp + 0x10]
mov edi, dword [esp + 0x14]
mov eax, dword [esp + 0x1c]
mov ecx, dword [eax + 0x34]
test ecx, ecx
je 0x3021a95c
mov edi, ebx
call fcn.3021a3b0
test eax, eax
je 0x3021aa4d
mov ebp, dword [esp + 0x10]
mov edi, dword [esp + 0x14]
mov eax, dword [ebp + 8]
test eax, eax
je 0x3021a98d
mov eax, dword [ebx + 8]
cmp eax, 2
je 0x3021a98d
cmp eax, 4
je 0x3021a98d
push esi
call fcn.301f4200
add esp, 4
cmp eax, 2
mov dword [ebx + 0x44], eax
jg 0x3021aa4d
test eax, eax
jl 0x3021aa4d
push esi
call fcn.301f40e0
mov dword [ebx + 0x48], eax
mov eax, dword [ebx + 8]
add esp, 4
cmp eax, 3
je 0x3021a9ab
cmp eax, 4
jne 0x3021a9fe
cmp eax, 3
jne 0x3021a9f2
mov ebp, dword [esi + 0xc]
test ebp, ebp
jl 0x3021a9d3
mov edi, dword [esi + 4]
movzx edx, byte [edi + 1]
mov dh, byte [edi]
mov eax, dword [esi + 0x10]
mov ecx, ebp
add edi, 2
mov dword [esi + 4], edi
shl edx, cl
or eax, edx
add ebp, 0xfffffff0
mov dword [esi + 0x10], eax
mov dword [esi + 0xc], ebp
mov ecx, dword [esi + 0x10]
mov ebp, dword [esp + 0x10]
mov edi, dword [esp + 0x14]
mov eax, ecx
add ecx, ecx
mov dword [esi + 0x10], ecx
mov ecx, dword [esi + 0xc]
shr eax, 0x1f
inc ecx
mov dword [esi + 0xc], ecx
mov dword [ebx + 0x4c], eax
push esi
call fcn.301f40e0
add esp, 4
mov dword [ebx + 0x50], eax
mov ecx, dword [ebp + 0x40]
xor eax, eax
cmp ecx, eax
je 0x3021aa57
push esi
call fcn.301f4200
add esp, 4
cmp eax, 2
mov dword [ebx + 0x54], eax
jg 0x3021aa4d
test eax, eax
jl 0x3021aa4d
cmp eax, 1
je 0x3021aa60
push esi
call fcn.301f40e0
add esp, 4
cmp eax, 6
mov dword [ebx + 0x58], eax
jg 0x3021aa4d
cmp eax, 0xfffffffa
jl 0x3021aa4d
push esi
call fcn.301f40e0
add esp, 4
cmp eax, 6
mov dword [ebx + 0x5c], eax
jg 0x3021aa4d
cmp eax, 0xfffffffa
jge 0x3021aa60
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 8
ret
mov dword [ebx + 0x54], eax
mov dword [ebx + 0x5c], eax
mov dword [ebx + 0x58], eax
mov eax, dword [ebp + 0x10]
test eax, eax
jle 0x3021aaa4
mov eax, dword [ebp + 0x14]
cmp eax, 3
jl 0x3021aaa4
cmp eax, 5
jg 0x3021aaa4
mov eax, dword [edi + 0x464]
mov edx, dword [edi + 0x460]
mov ecx, dword [ebp + 0x1c]
inc eax
inc edx
imul eax, edx
inc ecx
cdq
idiv ecx
test edx, edx
je 0x3021aa91
inc eax
push eax
call fcn.3021a550
push eax
push esi
call fcn.301f4030
add esp, 0xc
mov dword [ebx + 0x60], eax
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 8
ret