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

Disassembly:
sub esp, 0x16c
mov eax, dword [esp + 0x174]
push ebx
push ebp
push esi
mov esi, dword [esp + 0x17c]
mov ecx, dword [eax + 0x510]
mov ebp, dword [eax + 0x504]
mov ebx, dword [esp + 0x184]
mov edx, dword [esi + 0x40]
mov dword [esp + 0x1c], ecx
test ebx, ebx
mov eax, dword [edx + 4]
push edi
mov eax, dword [eax + 0x1c]
mov dword [esp + 0x30], eax
mov ecx, dword [eax + 0xb20]
mov dword [esp + 0x34], ecx
je 0x51fc83
xor edi, edi
test ebp, ebp
jle 0x51f737
mov esi, dword [ebx + edi*4]
mov edx, dword [esp + 0x20]
mov ecx, esi
mov eax, dword [edx + 0x340]
and ecx, 0x7fff
dec eax
cmp eax, 3
ja case.default.0x51f6ff
jmp dword [eax*4 + 0x51fcd0]
sar ecx, 2
jmp case.default.0x51f6ff
sar ecx, 3
jmp case.default.0x51f6ff
mov eax, 0x2aaaaaab
imul ecx
sar edx, 1
mov eax, edx
shr eax, 0x1f
add edx, eax
mov ecx, edx
jmp case.default.0x51f6ff
sar ecx, 4
and esi, 0x8000
or esi, ecx
mov dword [ebx + edi*4], esi
inc edi
cmp edi, ebp
jl 0x51f6e4
mov ecx, dword [ebx]
mov edx, dword [ebx + 4]
cmp ebp, 2
mov dword [esp + 0x78], ecx
mov dword [esp + 0x7c], edx
jle 0x51f896
mov ecx, dword [esp + 0x188]
mov edx, dword [esp + 0x20]
add edx, 0x34c
lea eax, [ecx + 8]
mov dword [esp + 0x14], edx
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x184]
add eax, 0x30c
mov dword [esp + 0x10], eax
lea eax, [esp + 0x78]
sub eax, ecx
add ebp, 0xfffffffe
mov dword [esp + 0x18], eax
mov dword [esp + 0x24], ebp
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x20]
mov edi, dword [eax + 0xfc]
mov ebx, dword [eax]
mov eax, dword [esp + 0x188]
mov ebp, dword [ecx + edi*4 + 0x344]
mov esi, dword [eax + edi*4]
mov ecx, dword [eax + ebx*4]
and esi, 0x7fff
and ecx, 0x7fff
sub ecx, esi
mov eax, ecx
cdq
xor eax, edx
sub eax, edx
mov edx, dword [esp + 0x14]
mov edx, dword [edx]
sub edx, ebp
imul eax, edx
mov edx, dword [esp + 0x20]
mov edx, dword [edx + ebx*4 + 0x344]
sub edx, ebp
mov ebp, edx
cdq
idiv ebp
test ecx, ecx
jge 0x51f7ea
mov ecx, esi
sub ecx, eax
jmp 0x51f7ed
lea ecx, [eax + esi]
mov ebp, dword [esp + 0x1c]
mov eax, dword [ebp]
test ah, ah
js 0x51f857
cmp ecx, eax
je 0x51f857
mov edx, dword [esp + 0x184]
mov edx, dword [edx + 0x50c]
sub edx, ecx
cmp edx, ecx
jl 0x51f811
mov edx, ecx
sub eax, ecx
jns 0x51f82e
mov ecx, edx
neg ecx
cmp eax, ecx
jge 0x51f824
sub edx, eax
dec edx
mov eax, edx
jmp 0x51f838
lea edx, [eax + eax]
or eax, 0xffffffff
sub eax, edx
jmp 0x51f838
cmp eax, edx
jl 0x51f836
add eax, edx
jmp 0x51f838
add eax, eax
mov ecx, dword [esp + 0x18]
mov dword [ecx + ebp], eax
mov eax, dword [esp + 0x188]
mov dword [eax + edi*4], esi
mov ecx, dword [eax + ebx*4]
and ecx, 0x7fff
mov dword [eax + ebx*4], ecx
jmp 0x51f868
mov edx, dword [esp + 0x18]
or ch, 0x80
mov dword [ebp], ecx
mov dword [edx + ebp], 0
mov esi, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
mov eax, 4
add esi, eax
add edx, eax
add ebp, eax
mov eax, dword [esp + 0x24]
dec eax
mov dword [esp + 0x10], esi
mov dword [esp + 0x14], edx
mov dword [esp + 0x1c], ebp
mov dword [esp + 0x24], eax
jne 0x51f78a
mov eax, dword [esp + 0x180]
push 1
push 1
lea edi, [eax + 4]
push edi
mov dword [esp + 0x38], edi
call fcn.00515040
mov esi, dword [esp + 0x190]
add esp, 0xc
xor edx, edx
mov eax, dword [esi + 0x50c]
mov ebp, dword [esi + 0x51c]
inc ebp
lea ecx, [eax - 1]
mov dword [esi + 0x51c], ebp
mov eax, ecx
test eax, eax
je 0x51f8db
inc edx
shr eax, 1
jne 0x51f8d6
mov ebx, dword [esi + 0x518]
add edx, edx
add ebx, edx
xor eax, eax
test ecx, ecx
mov dword [esi + 0x518], ebx
je 0x51f8f6
inc eax
shr ecx, 1
jne 0x51f8f1
push eax
mov eax, dword [esp + 0x7c]
push eax
push edi
call fcn.00515040
mov eax, dword [esi + 0x50c]
add esp, 0xc
dec eax
mov ecx, 0
je 0x51f918
inc ecx
shr eax, 1
jne 0x51f913
push ecx
mov ecx, dword [esp + 0x80]
push ecx
push edi
call fcn.00515040
mov edi, dword [esp + 0x2c]
add esp, 0xc
mov dword [esp + 0x28], 0
mov dword [esp + 0x14], 2
cmp dword [edi], 0
jle 0x51fb11
lea edx, [edi + 4]
mov dword [esp + 0x18], edx
mov eax, dword [esp + 0x18]
mov esi, 1
mov edx, dword [eax]
xor eax, eax
mov dword [esp + 0x24], edx
mov dword [esp + 0x38], eax
mov ecx, dword [edi + edx*4 + 0x80]
mov ebp, dword [edi + edx*4 + 0xc0]
mov dword [esp + 0x10], ecx
mov ecx, ebp
shl esi, cl
xor ecx, ecx
cmp ebp, eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], eax
mov dword [esp + 0x44], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], eax
mov dword [esp + 0x1c], eax
je 0x51fa70
cmp esi, eax
jle 0x51f9d9
add edx, 0xa
shl edx, 5
add edx, edi
mov edi, dword [esp + 0x30]
mov ebx, dword [edx]
test ebx, ebx
jge 0x51f9c3
mov dword [esp + eax*4 + 0x58], 1
jmp 0x51f9d1
mov ebx, dword [edi + ebx*4 + 0x720]
mov ebx, dword [ebx + 4]
mov dword [esp + eax*4 + 0x58], ebx
inc eax
add edx, 4
cmp eax, esi
jl 0x51f9b3
mov edx, dword [esp + 0x10]
xor eax, eax
test edx, edx
jle 0x51fa22
mov edx, dword [esp + 0x14]
lea edi, [esp + edx*4 + 0x78]
xor edx, edx
test esi, esi
jle 0x51fa04
mov ebx, dword [edi]
cmp ebx, dword [esp + edx*4 + 0x58]
jl 0x51fa00
inc edx
cmp edx, esi
jl 0x51f9f3
jmp 0x51fa04
mov dword [esp + eax*4 + 0x38], edx
mov edx, dword [esp + eax*4 + 0x38]
mov ebx, dword [esp + 0x1c]
shl edx, cl
add ecx, ebp
add edi, 4
or ebx, edx
mov edx, dword [esp + 0x10]
inc eax
mov dword [esp + 0x1c], ebx
cmp eax, edx
jl 0x51f9eb
mov eax, dword [esp + 0x2c]
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0x1c]
push eax
mov eax, dword [esp + 0x28]
push ecx
mov eax, dword [edx + eax*4 + 0x100]
lea ecx, [eax + eax*4]
lea edx, [eax + ecx*2]
mov eax, dword [esp + 0x3c]
lea ecx, [eax + edx*4]
push ecx
call fcn.0051b280
mov ecx, dword [esp + 0x190]
mov edi, dword [esp + 0x2c]
add esp, 0xc
mov edx, dword [ecx + 0x514]
add edx, eax
xor eax, eax
mov dword [ecx + 0x514], edx
mov edx, dword [esp + 0x24]
mov ecx, dword [esp + 0x10]
xor esi, esi
cmp ecx, eax
jle 0x51fae5
mov eax, dword [esp + 0x14]
mov ebp, dword [esp + 0x184]
lea edx, [edx*8 + 0x50]
mov dword [esp + 0x24], edx
lea ebx, [esp + eax*4 + 0x78]
mov ecx, dword [esp + esi*4 + 0x38]
mov edx, dword [esp + 0x24]
add ecx, edx
mov eax, dword [edi + ecx*4]
test eax, eax
jl 0x51fad9
mov ecx, dword [esp + 0x34]
lea edx, [eax + eax*4]
lea eax, [eax + edx*2]
mov edx, dword [ecx + eax*4 + 4]
lea eax, [ecx + eax*4]
mov ecx, dword [ebx]
cmp ecx, edx
jge 0x51fad9
mov edx, dword [esp + 0x2c]
push edx
push ecx
push eax
call fcn.0051b280
mov ecx, dword [ebp + 0x518]
add esp, 0xc
add ecx, eax
mov dword [ebp + 0x518], ecx
mov eax, dword [esp + 0x10]
inc esi
add ebx, 4
cmp esi, eax
jl 0x51fa94
mov eax, dword [esp + 0x10]
mov ebx, dword [esp + 0x14]
mov edx, dword [esp + 0x18]
mov ecx, dword [edi]
add ebx, eax
mov eax, dword [esp + 0x28]
inc eax
add edx, 4
cmp eax, ecx
mov dword [esp + 0x14], ebx
mov dword [esp + 0x28], eax
mov dword [esp + 0x18], edx
jl 0x51f94e
mov ecx, dword [esp + 0x20]
mov esi, dword [esp + 0x184]
mov edx, dword [esp + 0x188]
mov eax, 1
mov ebx, dword [ecx + 0x340]
mov ecx, dword [esi + 0x504]
imul ebx, dword [edx]
xor ebp, ebp
cmp ecx, eax
mov dword [esp + 0x18], ebp
mov dword [esp + 0x14], eax
jle 0x51fc3d
lea eax, [esi + 0x108]
mov dword [esp + 0x1c], eax
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x188]
mov edx, dword [ecx]
mov ecx, dword [eax + edx*4]
mov eax, ecx
and eax, 0x7fff
cmp eax, ecx
jne 0x51fc1b
mov esi, dword [esp + 0x20]
mov ecx, dword [esi + 0x340]
mov ebp, dword [esi + edx*4 + 0x344]
imul ecx, eax
mov edx, dword [esp + 0x18]
mov dword [esp + 0x2c], ecx
sub ecx, ebx
mov esi, ebp
mov eax, ecx
sub esi, edx
cdq
mov edi, eax
mov eax, ecx
xor edi, edx
sub edi, edx
cdq
idiv esi
test ecx, ecx
mov dword [esp + 0x10], eax
jge 0x51fbb3
mov ecx, eax
dec ecx
mov dword [esp + 0x28], ecx
jmp 0x51fbbc
mov edx, dword [esp + 0x10]
inc edx
mov dword [esp + 0x28], edx
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0x18c]
imul eax, esi
cdq
xor eax, edx
mov dword [esp + 0x30], 0
sub eax, edx
sub edi, eax
mov eax, dword [esp + 0x18]
mov dword [ecx + eax*4], ebx
inc eax
cmp eax, ebp
jge 0x51fc0c
mov ecx, dword [esp + 0x30]
add ecx, edi
cmp ecx, esi
jl 0x51fbf7
mov edx, dword [esp + 0x28]
sub ecx, esi
jmp 0x51fbfb
mov edx, dword [esp + 0x10]
add ebx, edx
mov edx, dword [esp + 0x18c]
mov dword [edx + eax*4], ebx
inc eax
cmp eax, ebp
jl 0x51fbe9
mov ebx, dword [esp + 0x2c]
mov esi, dword [esp + 0x184]
mov dword [esp + 0x18], ebp
mov eax, dword [esp + 0x14]
mov edx, dword [esp + 0x1c]
mov ecx, dword [esi + 0x504]
inc eax
add edx, 4
cmp eax, ecx
mov dword [esp + 0x14], eax
mov dword [esp + 0x1c], edx
jl 0x51fb53
mov ecx, dword [esp + 0x180]
mov eax, dword [ecx + 0x24]
cdq
sub eax, edx
sar eax, 1
cmp ebp, eax
jge 0x51fc68
mov eax, dword [esp + 0x18c]
inc ebp
mov dword [eax + ebp*4 - 4], ebx
mov eax, dword [ecx + 0x24]
cdq
sub eax, edx
sar eax, 1
cmp ebp, eax
jl 0x51fc50
mov eax, dword [0x5832c0]
pop edi
inc eax
pop esi
mov dword [0x5832c0], eax
pop ebp
mov eax, 1
pop ebx
add esp, 0x16c
ret
push 1
lea ecx, [esi + 4]
push 0
push ecx
call fcn.00515040
mov eax, dword [esi + 0x24]
mov edi, dword [esp + 0x198]
cdq
sub eax, edx
add esp, 0xc
mov ecx, eax
xor eax, eax
sar ecx, 1
shl ecx, 2
mov edx, ecx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [0x5832c0]
pop edi
inc eax
pop esi
mov dword [0x5832c0], eax
pop ebp
xor eax, eax
pop ebx
add esp, 0x16c
ret