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

Disassembly:
mov eax, dword [esp + 0x28]
sub esp, 0x48
cmp eax, 1
je 0x51d330
test al, 1
jne 0x51d33e
mov ecx, dword [esp + 0x74]
cmp ecx, 1
je 0x51d345
test cl, 1
je 0x51d345
or eax, 0xffffffff
add esp, 0x48
ret
cdq
sub eax, edx
sar eax, 1
mov dword [esp + 0x20], eax
mov eax, ecx
cdq
sub eax, edx
push ebx
push ebp
mov ecx, eax
mov eax, dword [esp + 0x54]
mov ebp, dword [eax + 0x18]
mov ebx, dword [eax + 0xc]
movzx edx, byte [eax + 8]
mov dword [esp + 0x18], ebp
movzx ebp, byte [eax + 0xb]
mov dword [esp + 0x10], ebp
movzx ebp, word [eax]
push esi
mov esi, dword [eax + 0x10]
push edi
mov edi, dword [eax + 0x14]
mov dword [esp + 0x1c], ebp
movzx ebp, word [eax + 2]
sar ecx, 1
cmp dword [esp + 0x80], 1
mov dword [esp + 0x2c], esi
movzx esi, byte [eax + 9]
mov dword [esp + 0x24], edi
movzx edi, byte [eax + 0xa]
mov dword [esp + 0x34], ecx
mov dword [esp + 0x38], ebx
mov dword [esp + 0x44], ebp
jne 0x51d55e
cmp dword [esp + 0x84], 1
jne 0x51d414
mov edx, dword [esp + 0x7c]
mov eax, dword [esp + 0x6c]
mov ecx, ebp
imul ebp, dword [esp + 0x70]
imul eax, edx
imul ecx, dword [esp + 0x78]
add ecx, dword [esp + 0x68]
add ebp, dword [esp + 0x60]
add eax, ecx
mov ecx, dword [esp + 0x64]
imul ecx, edx
mov edx, dword [esp + 0x1c]
add ecx, ebp
cmp edx, 0x10
je 0x51d404
cmp edx, 0x20
jne 0x51d8b7
mov edx, dword [eax]
pop edi
pop esi
pop ebp
mov dword [ecx], edx
xor eax, eax
pop ebx
add esp, 0x48
ret
mov ax, word [eax]
pop edi
pop esi
pop ebp
mov word [ecx], ax
xor eax, eax
pop ebx
add esp, 0x48
ret
test ecx, ecx
jbe 0x51d8b7
mov ecx, dword [esp + 0x7c]
mov eax, dword [esp + 0x64]
mov ebx, ebp
imul ebp, dword [esp + 0x78]
imul eax, ecx
imul ebx, dword [esp + 0x70]
add ebx, dword [esp + 0x60]
add ebp, dword [esp + 0x68]
add eax, ebx
mov ebx, dword [esp + 0x6c]
mov dword [esp + 0x28], eax
mov eax, ebx
imul eax, ecx
mov ecx, dword [esp + 0x34]
add eax, ebp
mov ebp, dword [esp + 0x1c]
mov dword [esp + 0x40], eax
mov dword [esp + 0x3c], ecx
lea esp, [esp]
cmp ebp, 0x10
mov ecx, dword [esp + 0x18]
je 0x51d475
cmp ebp, 0x20
jne 0x51d487
mov ebp, dword [eax]
mov eax, dword [eax + ebx]
jmp 0x51d47c
movzx ebp, word [eax]
movzx eax, word [eax + ebx]
mov dword [esp + 0x14], eax
mov dword [esp + 0x80], ebp
mov ebx, dword [esp + 0x20]
mov eax, dword [esp + 0x14]
mov ebp, dword [esp + 0x80]
and ebp, ebx
shr ebp, cl
and eax, ebx
mov ebx, dword [esp + 0x24]
shr eax, cl
add eax, ebp
mov ebp, dword [esp + 0x14]
and ebp, ebx
shr eax, 1
shl eax, cl
mov ecx, edi
shr ebp, cl
mov ecx, dword [esp + 0x80]
and ecx, ebx
mov ebx, ecx
mov ecx, edi
shr ebx, cl
add ebp, ebx
mov ebx, dword [esp + 0x2c]
shr ebp, 1
shl ebp, cl
mov ecx, esi
or eax, ebp
mov ebp, dword [esp + 0x14]
and ebp, ebx
shr ebp, cl
mov ecx, dword [esp + 0x80]
and ecx, ebx
mov ebx, ecx
mov ecx, esi
shr ebx, cl
add ebp, ebx
mov ebx, dword [esp + 0x38]
shr ebp, 1
shl ebp, cl
mov ecx, edx
or eax, ebp
mov ebp, dword [esp + 0x14]
and ebp, ebx
shr ebp, cl
mov ecx, dword [esp + 0x80]
and ecx, ebx
mov ebx, ecx
mov ecx, edx
shr ebx, cl
add ebp, ebx
shr ebp, 1
shl ebp, cl
or eax, ebp
mov ebp, dword [esp + 0x1c]
cmp ebp, 0x10
je 0x51d529
cmp ebp, 0x20
jne 0x51d530
mov ecx, dword [esp + 0x28]
mov dword [ecx], eax
jmp 0x51d530
mov ecx, dword [esp + 0x28]
mov word [ecx], ax
mov eax, dword [esp + 0x64]
add dword [esp + 0x28], eax
mov ebx, dword [esp + 0x6c]
mov eax, dword [esp + 0x40]
lea ecx, [ebx + ebx]
add eax, ecx
sub dword [esp + 0x3c], 1
mov dword [esp + 0x40], eax
jne 0x51d460
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x48
ret
cmp dword [esp + 0x84], 1
jne 0x51d6af
cmp dword [esp + 0x30], 0
jbe 0x51d8b7
mov ecx, dword [esp + 0x7c]
mov eax, dword [esp + 0x64]
mov ebx, ebp
imul ebp, dword [esp + 0x78]
imul eax, ecx
imul ebx, dword [esp + 0x70]
add ebx, dword [esp + 0x60]
add ebp, dword [esp + 0x68]
add eax, ebx
mov ebx, dword [esp + 0x1c]
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x6c]
imul eax, ecx
mov ecx, dword [esp + 0x30]
add eax, ebp
mov dword [esp + 0x40], eax
mov dword [esp + 0x3c], ecx
cmp ebx, 0x10
mov ecx, dword [esp + 0x18]
je 0x51d5ca
cmp ebx, 0x20
jne 0x51d5dc
mov ebx, dword [eax]
mov eax, dword [eax + 4]
jmp 0x51d5d1
movzx ebx, word [eax]
movzx eax, word [eax + 2]
mov dword [esp + 0x10], eax
mov dword [esp + 0x80], ebx
mov ebx, dword [esp + 0x20]
mov eax, dword [esp + 0x10]
mov ebp, dword [esp + 0x80]
and ebp, ebx
shr ebp, cl
and eax, ebx
mov ebx, dword [esp + 0x24]
shr eax, cl
add eax, ebp
mov ebp, dword [esp + 0x10]
and ebp, ebx
shr eax, 1
shl eax, cl
mov ecx, edi
shr ebp, cl
mov ecx, dword [esp + 0x80]
and ecx, ebx
mov ebx, ecx
mov ecx, edi
shr ebx, cl
add ebp, ebx
mov ebx, dword [esp + 0x2c]
shr ebp, 1
shl ebp, cl
mov ecx, esi
or eax, ebp
mov ebp, dword [esp + 0x10]
and ebp, ebx
shr ebp, cl
mov ecx, dword [esp + 0x80]
and ecx, ebx
mov ebx, ecx
mov ecx, esi
shr ebx, cl
add ebp, ebx
mov ebx, dword [esp + 0x38]
shr ebp, 1
shl ebp, cl
mov ecx, edx
or eax, ebp
mov ebp, dword [esp + 0x10]
and ebp, ebx
shr ebp, cl
mov ecx, dword [esp + 0x80]
and ecx, ebx
mov ebx, ecx
mov ecx, edx
shr ebx, cl
add ebp, ebx
mov ebx, dword [esp + 0x1c]
shr ebp, 1
shl ebp, cl
or eax, ebp
cmp ebx, 0x10
je 0x51d67e
cmp ebx, 0x20
jne 0x51d685
mov ecx, dword [esp + 0x28]
mov dword [ecx], eax
jmp 0x51d685
mov ecx, dword [esp + 0x28]
mov word [ecx], ax
mov eax, dword [esp + 0x44]
add dword [esp + 0x28], eax
lea ecx, [eax + eax]
mov eax, dword [esp + 0x40]
add eax, ecx
sub dword [esp + 0x3c], 1
mov dword [esp + 0x40], eax
jne 0x51d5b5
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x48
ret
test ecx, ecx
jbe 0x51d8b7
mov ecx, dword [esp + 0x7c]
mov eax, dword [esp + 0x64]
imul eax, ecx
mov dword [esp + 0x3c], eax
mov eax, dword [esp + 0x6c]
imul eax, ecx
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 0x50], eax
lea esp, [esp]
cmp dword [esp + 0x30], 0
jbe 0x51d89a
mov eax, ebp
imul eax, dword [esp + 0x70]
add eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x30]
add eax, dword [esp + 0x60]
mov dword [esp + 0x4c], ecx
mov ecx, dword [esp + 0x1c]
mov dword [esp + 0x34], eax
mov eax, ebp
imul eax, dword [esp + 0x78]
add eax, dword [esp + 0x40]
add eax, dword [esp + 0x68]
mov dword [esp + 0x48], eax
lea ecx, [ecx]
cmp ecx, 0x10
mov ebp, dword [esp + 0x6c]
je 0x51d747
cmp ecx, 0x20
jne 0x51d76a
mov ecx, dword [eax]
mov dword [esp + 0x80], ecx
mov ecx, dword [eax + 4]
mov dword [esp + 0x10], ecx
mov ecx, dword [eax + ebp]
mov eax, dword [eax + ebp + 4]
jmp 0x51d762
movzx ecx, word [eax]
mov dword [esp + 0x80], ecx
movzx ecx, word [eax + 2]
mov dword [esp + 0x10], ecx
movzx ecx, word [eax + ebp]
movzx eax, word [eax + ebp + 2]
mov dword [esp + 0x28], eax
mov dword [esp + 0x14], ecx
mov eax, dword [esp + 0x28]
mov ebp, dword [esp + 0x10]
and ebp, ebx
and eax, ebx
mov ecx, edx
shr ebp, cl
shr eax, cl
add eax, ebp
mov ebp, dword [esp + 0x14]
and ebp, ebx
shr ebp, cl
add eax, ebp
mov ebp, dword [esp + 0x80]
and ebp, ebx
shr ebp, cl
mov ebx, dword [esp + 0x20]
add eax, ebp
mov ebp, dword [esp + 0x28]
and ebp, ebx
shr eax, 2
shl eax, cl
mov ecx, dword [esp + 0x18]
shr ebp, cl
mov ecx, dword [esp + 0x10]
and ecx, ebx
mov ebx, ecx
mov ecx, dword [esp + 0x18]
shr ebx, cl
add ebp, ebx
mov ebx, dword [esp + 0x14]
and ebx, dword [esp + 0x20]
shr ebx, cl
add ebp, ebx
mov ebx, dword [esp + 0x80]
and ebx, dword [esp + 0x20]
shr ebx, cl
add ebp, ebx
mov ebx, dword [esp + 0x24]
shr ebp, 2
shl ebp, cl
mov ecx, edi
or eax, ebp
mov ebp, dword [esp + 0x28]
and ebp, ebx
shr ebp, cl
mov ecx, dword [esp + 0x10]
and ecx, ebx
mov ebx, ecx
mov ecx, edi
shr ebx, cl
add ebp, ebx
mov ebx, dword [esp + 0x14]
and ebx, dword [esp + 0x24]
shr ebx, cl
add ebp, ebx
mov ebx, dword [esp + 0x80]
and ebx, dword [esp + 0x24]
shr ebx, cl
add ebp, ebx
mov ebx, dword [esp + 0x2c]
shr ebp, 2
shl ebp, cl
mov ecx, esi
or eax, ebp
mov ebp, dword [esp + 0x28]
and ebp, ebx
shr ebp, cl
mov ecx, dword [esp + 0x10]
and ecx, ebx
mov ebx, ecx
mov ecx, esi
shr ebx, cl
add ebp, ebx
mov ebx, dword [esp + 0x14]
and ebx, dword [esp + 0x2c]
shr ebx, cl
add ebp, ebx
mov ebx, dword [esp + 0x80]
and ebx, dword [esp + 0x2c]
shr ebx, cl
add ebp, ebx
shr ebp, 2
shl ebp, cl
mov ecx, dword [esp + 0x1c]
or eax, ebp
cmp ecx, 0x10
je 0x51d86e
cmp ecx, 0x20
jne 0x51d875
mov ebx, dword [esp + 0x34]
mov dword [ebx], eax
jmp 0x51d875
mov ebx, dword [esp + 0x34]
mov word [ebx], ax
mov ebp, dword [esp + 0x44]
mov eax, dword [esp + 0x48]
add dword [esp + 0x34], ebp
lea ebx, [ebp + ebp]
add eax, ebx
sub dword [esp + 0x4c], 1
mov ebx, dword [esp + 0x38]
mov dword [esp + 0x48], eax
jne 0x51d720
mov eax, dword [esp + 0x6c]
mov ecx, dword [esp + 0x64]
add dword [esp + 0x3c], ecx
add eax, eax
add dword [esp + 0x40], eax
sub dword [esp + 0x50], 1
jne 0x51d6e0
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x48
ret