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

Disassembly:
mov eax, 0xc34
call fcn.00581890
mov eax, dword [0x634f14]
xor eax, esp
mov dword [esp + 0xc30], eax
push ebp
push edi
mov edi, dword [esp + 0xc40]
xor ebp, ebp
mov dword [esp + 0xc], ebp
cmp dword [edi + 0x48], ebp
jbe 0x51a9dd
push ebx
push esi
xor eax, eax
mov dword [esp + 0x34], eax
nop dword [eax + eax]
xor ebx, ebx
mov dword [esp + 0x18], ebx
cmp dword [edi + 0x30], ebx
jbe 0x51a9bf
mov dword [esp + 0x10], eax
movzx eax, al
mov dword [esp + 0x24], eax
nop word [eax + eax]
push 0x400
lea eax, [esp + 0x44]
push 0
push eax
call fcn.005840f0
mov esi, dword [edi + 0x40]
add esp, 0xc
mov eax, esi
sub eax, 1
je 0x51a737
sub eax, 1
mov eax, dword [esp + 0x10]
jne 0x51a7b4
test ebp, ebp
jne 0x51a7b4
cmp al, 2
jae 0x51a7b4
push 0x400
lea eax, [esp + 0x844]
push 0
push eax
call fcn.005840f0
push 0x400
lea eax, [esp + 0x50]
push 0
push eax
call fcn.005840f0
mov eax, dword [esp + 0x3c]
add esp, 0x18
mov dword [esp + 0x50], eax
mov eax, dword [edi + 0x4c]
mov dword [esp + 0x58], eax
mov eax, dword [edi + 0x48]
mov dword [esp + 0x60], eax
mov eax, esi
cdq
mov dword [esp + 0x68], eax
mov eax, dword [esp + 0x10]
mov dword [esp + 0x40], ebp
mov dword [esp + 0x44], 0
mov dword [esp + 0x48], ebx
mov dword [esp + 0x4c], 0
mov dword [esp + 0x54], 0
mov dword [esp + 0x5c], 0
mov dword [esp + 0x64], 0
mov dword [esp + 0x6c], edx
xor ebx, ebx
test ebp, ebp
jne 0x51a80c
test al, al
jne 0x51a80c
lea ebx, [ebp + 2]
sub esi, 1
je 0x51a7cb
sub esi, 1
jne 0x51a80c
add dword [esp + 0x70], 1
lea eax, [esp + 0x440]
push 0
adc dword [esp + 0x78], 0
push eax
lea eax, [esp + 0x48]
push eax
lea eax, [esp + 0x84c]
push eax
call fcn.00518f70
push 0
lea eax, [esp + 0x454]
push eax
push eax
lea eax, [esp + 0x85c]
push eax
call fcn.00518f70
add esp, 0x20
mov ecx, dword [edi + 0x54]
xor edx, edx
mov eax, dword [esp + 0x24]
mov esi, ecx
mov ebp, dword [edi + 0x50]
imul esi, dword [esp + 0x18]
imul eax, ebp
add eax, ebx
add esi, eax
mov eax, esi
mov dword [esp + 0x30], esi
div ecx
test edx, edx
jne 0x51a837
dec ecx
add ecx, esi
jmp 0x51a83a
lea ecx, [esi - 1]
cmp ebx, ebp
jae 0x51a9a5
mov eax, esi
lea ebp, [esi - 1]
shl eax, 0xa
mov dword [esp + 0x1c], eax
mov dword [esp + 0x20], ebp
xor edx, edx
mov eax, esi
div dword [edi + 0x54]
push dword [esp + 0x10]
cmp edx, 1
push dword [esp + 0x18]
cmovne ebp, ecx
push edi
call fcn.00518f40
add esp, 0xc
test eax, eax
je 0x51a8cd
mov esi, ebx
and esi, 0x7f
jne 0x51a8b9
add dword [esp + 0x70], 1
lea eax, [esp + 0x440]
push esi
adc dword [esp + 0x78], esi
push eax
lea eax, [esp + 0x48]
push eax
lea eax, [esp + 0x84c]
push eax
call fcn.00518f70
push esi
lea eax, [esp + 0x454]
push eax
push eax
lea eax, [esp + 0x85c]
push eax
call fcn.00518f70
add esp, 0x20
mov eax, dword [esp + esi*8 + 0x440]
mov dword [esp + 0x28], eax
mov eax, dword [esp + esi*8 + 0x444]
jmp 0x51a8e0
mov eax, dword [edi + 0x44]
mov ecx, ebp
shl ecx, 0xa
mov edx, dword [ecx + eax]
mov eax, dword [ecx + eax + 4]
mov dword [esp + 0x28], edx
push 0
push dword [edi + 0x30]
push 0
push eax
call fcn.00582000
cmp dword [esp + 0x14], 0
mov ecx, eax
mov dword [esp + 0x2c], ecx
jne 0x51a918
cmp byte [esp + 0x10], 0
jne 0x51a918
mov eax, dword [esp + 0x18]
mov dword [esp + 0x2c], eax
mov eax, 1
mov dword [esp + 0x3c], 0
jmp 0x51a929
cmp ecx, dword [esp + 0x18]
jne 0x51a927
test edx, edx
jne 0x51a927
lea eax, [edx + 1]
jmp 0x51a929
xor eax, eax
mov esi, dword [edi + 0x44]
push eax
push dword [esp + 0x2c]
push ebx
push dword [esp + 0x1c]
push dword [esp + 0x24]
push edi
call fcn.0051ae80
mov edx, dword [edi + 0x54]
add esp, 0x18
imul edx, dword [esp + 0x2c]
mov ecx, dword [esp + 0x1c]
add ecx, esi
lea edx, [edx + eax]
shl edx, 0xa
add edx, esi
cmp dword [edi + 0x38], 0x10
jne 0x51a963
push 0
jmp 0x51a96d
xor eax, eax
cmp dword [esp + 0x14], eax
setne al
push eax
mov eax, ebp
push ecx
shl eax, 0xa
push edx
add eax, esi
push eax
call fcn.00518f70
mov esi, dword [esp + 0x40]
lea ecx, [ebp + 1]
inc dword [esp + 0x30]
inc ebx
add dword [esp + 0x2c], 0x400
inc esi
mov ebp, dword [esp + 0x30]
add esp, 0x10
mov dword [esp + 0x30], esi
cmp ebx, dword [edi + 0x50]
jb 0x51a852
mov ebx, dword [esp + 0x18]
mov ebp, dword [esp + 0x14]
inc ebx
mov dword [esp + 0x18], ebx
cmp ebx, dword [edi + 0x30]
jb 0x51a700
mov eax, dword [esp + 0x34]
inc eax
mov dword [esp + 0x34], eax
cmp eax, 4
jb 0x51a6e0
inc ebp
mov dword [esp + 0x14], ebp
cmp ebp, dword [edi + 0x48]
jb 0x51a6d2
pop esi
pop ebx
mov ecx, dword [esp + 0xc38]
mov eax, 1
pop edi
pop ebp
xor ecx, esp
call fcn.00581041
add esp, 0xc34
ret