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

Disassembly:
sub esp, 0x2c
push ebx
push ebp
push esi
mov esi, 1
push edi
cmp dword [0x12429638], esi
je 0x1002173c
cmp dword [0x12429648], esi
jne 0x10021753
cmp dword [0x100a96a0], 0
jbe 0x10021753
call fcn.10041090
cmp eax, 0xa
je 0x10021814
call dword [0x1005d080]
mov eax, dword [esp + 0x44]
mov edi, dword [esp + 0x40]
mov ebx, dword [0x124016dc]
mov ebp, dword [0x124016e0]
mov dword [esp + 0x2c], eax
mov eax, dword [0x12418ba4]
mov dword [0x12401530], 0
mov dword [esp + 0x28], edi
test eax, eax
jge 0x100217a0
mov dword [0x12418b94], ebx
mov dword [0x12418b98], ebp
mov dword [0x12418b9c], ebx
mov dword [0x12418ba0], ebp
mov ecx, dword [0x12418ba0]
add eax, esi
mov esi, dword [0x12418b9c]
mov dword [0x12418ba4], eax
mov dword [esp + 0x30], esi
mov dword [esp + 0x34], ecx
cmp dword [0x12418b94], ebx
jne 0x1002188d
cmp dword [0x12418b98], ebp
jne 0x1002188d
cmp eax, 0xc0
jle 0x10021801
cmp dword [0x12405be8], 0xa
je 0x10021801
xor eax, eax
mov dword [0x12418ba4], eax
mov dword [0x12418b30], eax
mov dword [0x12405be8], eax
mov eax, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret
cmp eax, 0x18
jne 0x1002181e
push 1
call fcn.1002f520
push 0
call fcn.1002f520
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x2c
ret
cdq
mov edi, 3
idiv edi
test edx, edx
jne 0x10021987
mov ecx, dword [esp + 0x44]
mov edx, dword [esp + 0x40]
push ecx
push edx
call fcn.10020bd0
mov eax, dword [0x12418b9c]
mov ecx, dword [0x12418ba0]
add esp, 8
cmp eax, dword [0x12418b94]
jne 0x1002185b
cmp ecx, dword [0x12418b98]
je 0x10021864
push ecx
push eax
push 1
call fcn.1002f490
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x28]
push eax
push ecx
push ebp
push ebx
push 0x3c
lea edx, [esp + 0x44]
push edx
call fcn.1002f130
test eax, eax
je 0x10021814
mov esi, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
jmp 0x1002196f
push 1
call fcn.1002f520
mov eax, dword [esp + 0x2c]
push eax
push edi
call fcn.10020bd0
mov esi, dword [0x124015a8]
mov edx, dword [esi + 0x78]
mov ecx, dword [0x12418b98]
mov edi, dword [0x12418b94]
add esi, 0x70
add esp, 8
push edx
mov dword [esp + 0x28], ecx
call fcn.10030970
mov edx, dword [esp + 0x24]
mov dword [eax + 8], edi
mov dword [eax + 0xc], edx
mov ecx, dword [esi + 8]
test ecx, ecx
je 0x100218d9
mov dword [ecx], eax
jmp 0x100218dc
mov dword [esi + 4], eax
cmp dword [0x12418c00], 0
mov dword [esi + 8], eax
jne 0x10021917
push edx
push edi
push 0x12429b48
call dword [0x1005d1c4]
test eax, eax
je 0x10021917
sub edi, dword [0x12429b48]
mov eax, dword [esp + 0x24]
imul edi, edi, 0x3e8
sub edi, dword [0x12429b4c]
mov byte [edi + eax + 0x12309910], 1
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x28]
push ecx
push edx
push ebp
push ebx
push 0x28
lea eax, [esp + 0x44]
push eax
call fcn.1002f130
test eax, eax
jne 0x1002195d
mov eax, dword [esp + 0x40]
cmp eax, ebx
mov esi, ebx
mov ecx, ebp
jle 0x10021944
lea esi, [ebx + 1]
jmp 0x10021949
jge 0x10021949
lea esi, [ebx - 1]
mov eax, dword [esp + 0x44]
cmp eax, ebp
jle 0x10021956
lea ecx, [ebp + 1]
jmp 0x10021965
jge 0x10021965
lea ecx, [ebp - 1]
jmp 0x10021965
mov ecx, dword [esp + 0x34]
mov esi, dword [esp + 0x30]
mov dword [0x12418ba4], 0
mov dword [0x12418ba0], ecx
mov dword [0x12418b9c], esi
mov dword [0x12418b98], ebp
mov dword [0x12418b94], ebx
sub esi, ebx
mov eax, esi
sub ecx, ebp
test eax, eax
jge 0x10021996
or eax, 0xffffffff
jmp 0x1002199d
jle 0x1002199d
mov eax, 1
test ecx, ecx
jge 0x100219a6
or ecx, 0xffffffff
jmp 0x100219ad
jle 0x100219ad
mov ecx, 1
mov edx, ecx
neg edx
mov dword [esp + 0x28], edx
mov edx, eax
neg edx
mov dword [esp + 0x20], edx
lea edx, [eax + eax*2]
neg eax
add eax, eax
lea ebx, [ebx + edx*2]
mov dword [esp + 0x1c], eax
lea ecx, [ecx + ecx*2]
lea eax, [ebx + ebx - 0x8000]
mov dword [esp + 0x18], 6
lea esi, [ebp + ecx*2]
mov dword [esp + 0x14], eax
mov ecx, dword [0x12429ac4]
mov edx, dword [ecx + 4]
mov eax, dword [esp + 0x14]
sub eax, dword [edx]
mov ecx, esi
sub ecx, dword [edx + 4]
mov dword [esp + 0x30], ebx
lea edx, [ecx + ecx]
lea ecx, [eax + 1]
and ecx, 0xfffffffe
add ecx, edx
and eax, 0xfffffffe
sub edx, eax
lea ebp, [edx + edx*2]
lea edi, [ecx + ecx*2]
lea ebp, [ebp + ebp - 0x2f]
lea edi, [edi*4 - 0x4e]
push ebp
push edi
mov dword [esp + 0x3c], esi
call fcn.10020b00
add esp, 8
test eax, eax
jne 0x10021a4a
cmp edi, 0xa
jle 0x10021a4a
cmp ebp, 0xa
jle 0x10021a4a
cmp edi, 0x315
jge 0x10021a4a
cmp ebp, 0x1cc
jl 0x10021a6c
mov eax, dword [esp + 0x18]
mov edx, dword [esp + 0x1c]
add dword [esp + 0x14], edx
add ebx, dword [esp + 0x20]
add esi, dword [esp + 0x28]
dec eax
mov dword [esp + 0x18], eax
cmp eax, 1
jne 0x100219e5
mov eax, dword [esp + 0x34]
mov ecx, dword [esp + 0x30]
push eax
push ecx
call fcn.10021af0
add esp, 8
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x2c
ret