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

Disassembly:
mov eax, 0xc34
call fcn.00581be0
mov eax, dword [0x635f14]
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 0x51ad2d
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 0x51ad0f
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.00584440
mov esi, dword [edi + 0x40]
add esp, 0xc
mov eax, esi
sub eax, 1
je 0x51aa87
sub eax, 1
mov eax, dword [esp + 0x10]
jne 0x51ab04
test ebp, ebp
jne 0x51ab04
cmp al, 2
jae 0x51ab04
push 0x400
lea eax, [esp + 0x844]
push 0
push eax
call fcn.00584440
push 0x400
lea eax, [esp + 0x50]
push 0
push eax
call fcn.00584440
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 0x51ab5c
test al, al
jne 0x51ab5c
lea ebx, [ebp + 2]
sub esi, 1
je 0x51ab1b
sub esi, 1
jne 0x51ab5c
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.005192c0
push 0
lea eax, [esp + 0x454]
push eax
push eax
lea eax, [esp + 0x85c]
push eax
call fcn.005192c0
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 0x51ab87
dec ecx
add ecx, esi
jmp 0x51ab8a
lea ecx, [esi - 1]
cmp ebx, ebp
jae 0x51acf5
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.00519290
add esp, 0xc
test eax, eax
je 0x51ac1d
mov esi, ebx
and esi, 0x7f
jne 0x51ac09
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.005192c0
push esi
lea eax, [esp + 0x454]
push eax
push eax
lea eax, [esp + 0x85c]
push eax
call fcn.005192c0
add esp, 0x20
mov eax, dword [esp + esi*8 + 0x440]
mov dword [esp + 0x28], eax
mov eax, dword [esp + esi*8 + 0x444]
jmp 0x51ac30
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.00582350
cmp dword [esp + 0x14], 0
mov ecx, eax
mov dword [esp + 0x2c], ecx
jne 0x51ac68
cmp byte [esp + 0x10], 0
jne 0x51ac68
mov eax, dword [esp + 0x18]
mov dword [esp + 0x2c], eax
mov eax, 1
mov dword [esp + 0x3c], 0
jmp 0x51ac79
cmp ecx, dword [esp + 0x18]
jne 0x51ac77
test edx, edx
jne 0x51ac77
lea eax, [edx + 1]
jmp 0x51ac79
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.0051b1d0
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 0x51acb3
push 0
jmp 0x51acbd
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.005192c0
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 0x51aba2
mov ebx, dword [esp + 0x18]
mov ebp, dword [esp + 0x14]
inc ebx
mov dword [esp + 0x18], ebx
cmp ebx, dword [edi + 0x30]
jb 0x51aa50
mov eax, dword [esp + 0x34]
inc eax
mov dword [esp + 0x34], eax
cmp eax, 4
jb 0x51aa30
inc ebp
mov dword [esp + 0x14], ebp
cmp ebp, dword [edi + 0x48]
jb 0x51aa22
pop esi
pop ebx
mov ecx, dword [esp + 0xc38]
mov eax, 1
pop edi
pop ebp
xor ecx, esp
call fcn.00581392
add esp, 0xc34
ret