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

Disassembly:
sub esp, 0x98
mov eax, dword [0x5d60c4]
xor eax, esp
mov dword [esp + 0x94], eax
push ebx
mov ebx, dword [esp + 0xa0]
push ebp
push esi
mov esi, dword [esp + 0xac]
cmp dword [ebx + 0x1c], 0
mov ecx, dword [ebx + 0x40]
push edi
mov dword [ebx + 0x38], 0
jne 0x50a1f8
mov edx, dword [esp + 0xb4]
mov ebp, 1
mov eax, dword [ebx + 0x38]
cmp edx, 8
cmovbe eax, ebp
mov dword [ebx + 0x38], eax
mov eax, dword [ebx + 0x3c]
cmp dword [eax + 0x404], 2
jne 0x509df3
mov dword [ebx + 0x38], 0
cmp ecx, 2
je 0x509cc8
mov dword [ebx + 0x18], 0
xor esi, esi
push esi
push dword [ebx + 0x3c]
call fcn.0051b770
add esp, 8
mov edx, ebp
test eax, eax
je 0x509cb2
mov ecx, 0xb
sub ecx, eax
shl edx, cl
mov eax, dword [ebx]
mov dword [eax + esi*4], edx
mov eax, dword [ebx]
mov eax, dword [eax + esi*4]
inc esi
add dword [ebx + 0x18], eax
cmp esi, 0xff
jbe 0x509c97
mov eax, dword [ebx + 0x3c]
mov ebp, 4
add eax, 0xcb8
mov esi, ebp
movzx ecx, word [eax]
test ecx, ecx
je 0x509ce1
dec ecx
shl esi, cl
mov edi, dword [ebx + 4]
add esi, 8
xor edx, edx
mov dword [ebx + 0x1c], 0
add esi, eax
mov eax, dword [esi]
add eax, 0xffff
shr eax, 0x10
test eax, eax
je 0x509d10
mov ecx, 0xa
sub ecx, eax
mov eax, 1
shl eax, cl
jmp 0x509d15
mov eax, 1
mov dword [edx + edi], eax
add esi, 8
mov edi, dword [ebx + 4]
mov eax, dword [edx + edi]
add edx, ebp
add dword [ebx + 0x1c], eax
cmp edx, 0x8c
jbe 0x509cf2
mov eax, dword [ebx + 0x3c]
mov esi, ebp
add eax, 0x70c
movzx ecx, word [eax]
test ecx, ecx
je 0x509d42
dec ecx
shl esi, cl
mov edi, dword [ebx + 8]
add esi, 8
xor edx, edx
mov dword [ebx + 0x20], 0
add esi, eax
mov eax, dword [esi]
add eax, 0xffff
shr eax, 0x10
test eax, eax
je 0x509d71
mov ecx, 0xa
sub ecx, eax
mov eax, 1
shl eax, cl
jmp 0x509d76
mov eax, 1
mov dword [edx + edi], eax
add esi, 8
mov edi, dword [ebx + 8]
mov eax, dword [edx + edi]
add edx, ebp
add dword [ebx + 0x20], eax
cmp edx, 0xd0
jbe 0x509d53
mov eax, dword [ebx + 0x3c]
movzx ecx, word [eax + 0x408]
test ecx, ecx
je 0x509da0
dec ecx
shl ebp, cl
mov edi, dword [ebx + 0xc]
lea esi, [eax + 0x410]
xor edx, edx
mov dword [ebx + 0x24], 0
add esi, ebp
mov eax, dword [esi]
add eax, 0xffff
shr eax, 0x10
test eax, eax
je 0x509dd2
mov ecx, 0xa
sub ecx, eax
mov eax, 1
shl eax, cl
jmp 0x509dd7
mov eax, 1
mov dword [edx + edi], eax
add esi, 8
mov edi, dword [ebx + 0xc]
mov eax, dword [edx + edi]
add edx, 4
add dword [ebx + 0x24], eax
cmp edx, 0x7c
jbe 0x509db4
jmp 0x50a241
cmp ecx, 2
je 0x509e63
push edx
push esi
lea eax, [esp + 0x18]
mov dword [esp + 0x18], 0xff
push eax
push dword [ebx]
call fcn.00518c50
mov ebp, dword [ebx]
add esp, 0x10
xor edx, edx
xor esi, esi
xor edi, edi
nop dword [eax]
mov eax, dword [ebp + esi*4]
xor ecx, ecx
cmp ecx, eax
sbb ecx, ecx
shr eax, 8
neg ecx
add ecx, eax
mov eax, dword [ebp + esi*4 + 4]
add edx, ecx
mov dword [ebp + esi*4], ecx
xor ecx, ecx
cmp ecx, eax
sbb ecx, ecx
shr eax, 8
neg ecx
add ecx, eax
mov dword [ebp + esi*4 + 4], ecx
add edi, ecx
add esi, 2
cmp esi, 0x100
jb 0x509e20
add edx, edi
mov ebp, 1
mov dword [ebx + 0x18], edx
mov edi, dword [ebx + 4]
lea eax, [esp + 0x14]
mov dword [esp + 0x14], 4
lea esi, [esp + 0x14]
mov dword [esp + 0x18], 2
mov ecx, 0x24
mov dword [esp + 0x1c], 1
mov dword [esp + 0x20], 1
mov dword [esp + 0x24], 1
mov dword [esp + 0x28], 1
mov dword [esp + 0x2c], 1
mov dword [esp + 0x30], 1
mov dword [esp + 0x34], 1
mov dword [esp + 0x38], 1
mov dword [esp + 0x3c], 1
mov dword [esp + 0x40], 1
mov dword [esp + 0x44], 1
mov dword [esp + 0x48], 1
mov dword [esp + 0x4c], 1
mov dword [esp + 0x50], 1
mov dword [esp + 0x54], 1
mov dword [esp + 0x58], 1
mov dword [esp + 0x5c], 1
mov dword [esp + 0x60], 1
mov dword [esp + 0x64], 1
mov dword [esp + 0x68], 1
mov dword [esp + 0x6c], 1
mov dword [esp + 0x70], 1
mov dword [esp + 0x74], 1
mov dword [esp + 0x78], 1
mov dword [esp + 0x7c], 1
mov dword [esp + 0x80], 1
mov dword [esp + 0x84], 1
mov dword [esp + 0x88], 1
mov dword [esp + 0x8c], 1
mov dword [esp + 0x90], 1
mov dword [esp + 0x94], 1
mov dword [esp + 0x98], 1
mov dword [esp + 0x9c], 1
mov dword [esp + 0xa0], 1
push 0x24
rep movsd dword es:[edi], dword [esi]
push eax
call fcn.0050a650
mov edi, dword [ebx + 8]
lea esi, [ebx + 8]
add esp, 8
mov dword [ebx + 0x1c], eax
xor edx, edx
lea ecx, [edi + 0xd0]
cmp edi, esi
ja 0x509fd4
cmp ecx, esi
jae 0x509fe0
mov edx, 0x34
mov eax, ebp
mov ecx, edx
rep stosd dword es:[edi], eax
nop
mov eax, dword [esi]
mov dword [eax + edx*4], 1
inc edx
cmp edx, 0x34
jbe 0x509fe0
mov eax, dword [ebx + 0xc]
mov dword [esp + 0x14], 6
mov dword [esp + 0x18], 2
mov dword [esp + 0x1c], 1
mov dword [esp + 0x20], 1
mov dword [esp + 0x24], 2
mov dword [esp + 0x28], 3
mov dword [esp + 0x2c], 4
mov dword [esp + 0x30], 4
mov dword [esp + 0x34], 4
mov dword [esp + 0x38], 3
mov dword [esp + 0x3c], 2
mov dword [esp + 0x40], 1
mov dword [esp + 0x44], 1
mov dword [esp + 0x48], 1
mov dword [esp + 0x4c], 1
mov dword [esp + 0x50], 1
mov dword [esp + 0x54], 1
mov dword [esp + 0x58], 1
mov dword [esp + 0x5c], 1
mov dword [esp + 0x60], 1
mov dword [esp + 0x64], 1
mov dword [esp + 0x68], 1
mov dword [esp + 0x6c], 1
mov dword [esp + 0x70], 1
mov dword [esp + 0x74], 1
mov dword [esp + 0x78], 1
mov dword [esp + 0x7c], 1
mov dword [esp + 0x80], 1
mov dword [esp + 0x84], 1
mov dword [esp + 0x88], 1
mov dword [esp + 0x8c], 1
mov dword [esp + 0x90], 1
mov dword [ebx + 0x20], 0x35
mov dword [eax], 6
mov dword [eax + 4], 2
mov dword [eax + 8], 1
mov dword [eax + 0xc], 1
mov dword [eax + 0x10], 2
mov dword [eax + 0x14], 3
mov dword [eax + 0x18], 4
mov dword [eax + 0x1c], 4
mov dword [eax + 0x20], 4
mov dword [eax + 0x24], 3
mov dword [eax + 0x28], 2
mov dword [eax + 0x2c], 1
mov dword [eax + 0x30], 1
mov dword [eax + 0x34], 1
mov dword [eax + 0x38], 1
mov dword [eax + 0x3c], 1
mov dword [eax + 0x40], 1
mov dword [eax + 0x44], 1
mov dword [eax + 0x48], 1
mov dword [eax + 0x4c], 1
mov dword [eax + 0x50], 1
mov dword [eax + 0x54], 1
mov dword [eax + 0x58], 1
mov dword [eax + 0x5c], 1
mov dword [eax + 0x60], 1
mov dword [eax + 0x64], 1
mov dword [eax + 0x68], 1
mov dword [eax + 0x6c], 1
mov dword [eax + 0x70], 1
mov dword [eax + 0x74], 1
mov dword [eax + 0x78], 1
mov dword [eax + 0x7c], 1
lea eax, [esp + 0x14]
push 0x20
push eax
call fcn.0050a650
add esp, 8
jmp 0x50a23e
cmp ecx, 2
je 0x50a211
push 0xc
push 0xff
push dword [ebx]
call fcn.0050a2e0
add esp, 0xc
mov dword [ebx + 0x18], eax
push 0xb
push 0x23
push dword [ebx + 4]
call fcn.0050a2e0
push 0xb
push 0x34
push dword [ebx + 8]
mov dword [ebx + 0x1c], eax
call fcn.0050a2e0
push 0xb
push 0x1f
push dword [ebx + 0xc]
mov dword [ebx + 0x20], eax
call fcn.0050a2e0
add esp, 0x24
mov dword [ebx + 0x24], eax
push dword [esp + 0xb8]
push ebx
call fcn.0050a4c0
mov ecx, dword [esp + 0xac]
add esp, 8
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0052b789
add esp, 0x98
ret