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

Disassembly:
sub esp, 0x94
push ebx
mov ebx, dword [esp + 0xa8]
cmp ebx, 0xa
jae 0x508f3e
push 0xffffffffffffffec
pop eax
jmp 0x509ea8
mov eax, dword [esp + 0xa0]
add eax, dword [esp + 0x9c]
push ebp
push esi
mov esi, dword [esp + 0xac]
mov dword [esp + 0x84], eax
add eax, 0xfffffffd
push edi
push esi
mov dword [esp + 0x14], eax
call fcn.0050bfdb
movzx ebp, ax
lea eax, [esi + 2]
push eax
mov dword [esp + 0xa4], ebp
call fcn.0050bfdb
movzx edi, ax
lea eax, [esi + 4]
push eax
mov dword [esp + 0x40], edi
call fcn.0050bfdb
movzx ecx, ax
lea eax, [esi + 6]
mov esi, dword [esp + 0xb4]
sub ebx, ecx
mov dword [esp + 0xac], eax
sub ebx, edi
add eax, ebp
mov dword [esp + 0x20], ecx
mov dword [esp + 0x28], eax
sub ebx, ebp
add eax, edi
sub ebx, 6
mov edi, dword [esp + 0xc4]
mov dword [esp + 0xa0], eax
mov eax, dword [esp + 0xb8]
add eax, 3
mov dword [esp + 0x24], ebx
shr eax, 2
push edi
lea ecx, [eax + esi]
lea edx, [ecx + eax]
mov dword [esp + 0x9c], ecx
add eax, edx
mov dword [esp + 0xa0], edx
mov ebx, ecx
mov dword [esp + 0x30], eax
mov ebp, edx
mov dword [esp + 0x34], ebx
mov dword [esp + 0x3c], ebp
mov dword [esp + 0x40], eax
call fcn.00504f4e
shr eax, 0x10
add esp, 0x10
movzx eax, al
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0xb4]
mov dword [esp + 0x98], 1
cmp dword [esp + 0x18], eax
ja 0x509315
mov eax, dword [esp + 0x88]
cmp dword [esp + 0x20], eax
ja 0x509315
cmp dword [esp + 0xac], 6
jb 0x509315
push dword [esp + 0x9c]
lea eax, [esp + 0x78]
push dword [esp + 0xa4]
push eax
call fcn.005085d9
add esp, 0xc
cmp eax, 0xffffff88
ja 0x509ea5
push dword [esp + 0x34]
lea eax, [esp + 0x64]
push dword [esp + 0x20]
push eax
call fcn.005085d9
add esp, 0xc
cmp eax, 0xffffff88
ja 0x509ea5
push dword [esp + 0x14]
lea eax, [esp + 0x50]
push dword [esp + 0x98]
push eax
call fcn.005085d9
add esp, 0xc
cmp eax, 0xffffff88
ja 0x509ea5
push dword [esp + 0x18]
mov eax, dword [esp + 0x18]
add eax, dword [esp + 0x98]
push eax
lea eax, [esp + 0x40]
push eax
call fcn.005085d9
add esp, 0xc
cmp eax, 0xffffff88
ja 0x509ea5
mov eax, dword [esp + 0x88]
mov ecx, dword [esp + 0x20]
sub eax, ecx
cmp eax, 4
jb 0x5092fd
cmp ecx, dword [esp + 0x10]
jae 0x5092fd
mov eax, dword [esp + 0x28]
neg eax
and eax, 0x1f
mov dword [esp + 0x14], eax
mov ecx, dword [esp + 0x78]
mov edx, dword [esp + 0x74]
and ecx, 0x1f
shl edx, cl
mov ecx, eax
shr edx, cl
mov ecx, dword [esp + 0xa8]
mov esi, dword [esp + 0x3c]
mov al, byte [edi + edx*2 + 5]
movzx ebp, byte [edi + edx*2 + 4]
mov byte [ecx], al
add ebp, dword [esp + 0x78]
inc ecx
mov edx, dword [esp + 0x60]
mov dword [esp + 0xa8], ecx
mov ecx, dword [esp + 0x64]
and ecx, 0x1f
shl edx, cl
mov ecx, dword [esp + 0x14]
shr edx, cl
mov ecx, dword [esp + 0x24]
movzx ebx, byte [edi + edx*2 + 4]
mov al, byte [edi + edx*2 + 5]
add ebx, dword [esp + 0x64]
mov byte [ecx], al
inc ecx
mov edx, dword [esp + 0x4c]
mov eax, dword [esp + 0xb8]
mov dword [esp + 0x24], ecx
mov ecx, dword [esp + 0x50]
and ecx, 0x1f
shl edx, cl
mov ecx, dword [esp + 0x14]
shr edx, cl
mov ecx, dword [esp + 0x2c]
mov al, byte [eax + edx*2 + 5]
movzx edi, byte [edi + edx*2 + 4]
add edi, dword [esp + 0x50]
mov edx, dword [esp + 0x38]
mov byte [ecx], al
inc ecx
mov dword [esp + 0x2c], ecx
mov ecx, esi
and ecx, 0x1f
shl edx, cl
mov ecx, dword [esp + 0x14]
shr edx, cl
mov ecx, dword [esp + 0xb8]
movzx eax, byte [ecx + edx*2 + 4]
add esi, eax
mov al, byte [ecx + edx*2 + 5]
mov ecx, dword [esp + 0x30]
mov edx, dword [esp + 0x74]
mov byte [ecx], al
inc ecx
mov eax, dword [esp + 0xb8]
mov dword [esp + 0x30], ecx
mov ecx, ebp
and ecx, 0x1f
shl edx, cl
mov ecx, dword [esp + 0x14]
shr edx, cl
mov ecx, dword [esp + 0xa8]
movzx eax, byte [eax + edx*2 + 4]
add eax, ebp
mov ebp, dword [esp + 0xb8]
mov dword [esp + 0x78], eax
mov al, byte [ebp + edx*2 + 5]
mov edx, dword [esp + 0x60]
mov byte [ecx], al
inc ecx
mov dword [esp + 0xa8], ecx
mov ecx, ebx
and ecx, 0x1f
shl edx, cl
mov ecx, dword [esp + 0x14]
shr edx, cl
movzx eax, byte [ebp + edx*2 + 4]
add eax, ebx
mov dword [esp + 0x64], eax
mov al, byte [ebp + edx*2 + 5]
mov edx, dword [esp + 0x4c]
mov ecx, edi
mov ebx, dword [esp + 0x24]
and ecx, 0x1f
shl edx, cl
mov ecx, dword [esp + 0x14]
shr edx, cl
mov ecx, dword [esp + 0x2c]
mov byte [ebx], al
inc ebx
mov dword [esp + 0x24], ebx
movzx eax, byte [ebp + edx*2 + 4]
add eax, edi
mov dword [esp + 0x50], eax
mov al, byte [ebp + edx*2 + 5]
mov edx, dword [esp + 0x38]
mov byte [ecx], al
inc ecx
mov dword [esp + 0x2c], ecx
mov ecx, esi
and ecx, 0x1f
shl edx, cl
mov ecx, dword [esp + 0x14]
shr edx, cl
movzx eax, byte [ebp + edx*2 + 4]
add eax, esi
mov dword [esp + 0x3c], eax
mov al, byte [ebp + edx*2 + 5]
mov ebp, dword [esp + 0x30]
mov byte [ebp], al
lea eax, [esp + 0x74]
inc ebp
push eax
mov dword [esp + 0x34], ebp
call fcn.005086fc
xor esi, esi
test eax, eax
lea eax, [esp + 0x64]
cmove esi, dword [esp + 0x9c]
push eax
call fcn.005086fc
neg eax
sbb edi, edi
lea eax, [esp + 0x54]
inc edi
push eax
and edi, esi
call fcn.005086fc
xor esi, esi
test eax, eax
lea eax, [esp + 0x44]
push eax
cmove esi, edi
call fcn.005086fc
mov edi, dword [esp + 0xc8]
add esp, 0x10
neg eax
sbb eax, eax
inc eax
and esi, eax
cmp ebp, dword [esp + 0x10]
mov dword [esp + 0x98], esi
sbb eax, eax
test esi, eax
mov eax, dword [esp + 0x14]
jne 0x509103
mov esi, dword [esp + 0xa8]
mov ebp, dword [esp + 0x2c]
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x8c]
cmp esi, edx
ja 0x509315
cmp ebx, dword [esp + 0x90]
ja 0x509315
cmp ebp, ecx
jbe 0x50931d
push 0xffffffffffffffec
pop eax
jmp 0x509ea5
mov ebp, dword [esp + 0x78]
mov eax, edx
sub eax, esi
push 0x20
cmp eax, 3
jle 0x509469
lea ebx, [edx - 3]
mov dword [esp + 0x38], ebx
pop ebx
cmp ebp, ebx
jbe 0x509349
mov dword [esp + 0x18], 3
jmp 0x5093da
mov ecx, dword [esp + 0x7c]
cmp ecx, dword [esp + 0x84]
jb 0x509367
lea eax, [esp + 0x74]
push eax
call fcn.005086fc
pop ecx
mov dword [esp + 0x18], eax
jmp 0x5093d6
mov edx, dword [esp + 0x80]
cmp ecx, edx
jne 0x50937f
cmp ebp, ebx
sbb eax, eax
add eax, 2
mov dword [esp + 0x18], eax
jmp 0x5093da
and dword [esp + 0x18], 0
mov eax, ebp
shr eax, 3
mov dword [esp + 0x10], eax
mov eax, ecx
sub eax, dword [esp + 0x10]
cmp eax, edx
jae 0x5093a5
mov eax, ecx
mov dword [esp + 0x18], 1
sub eax, edx
jmp 0x5093a9
mov eax, dword [esp + 0x10]
sub ecx, eax
imul eax, eax, 0xfffffff8
push 4
push ecx
mov dword [esp + 0x84], ecx
add ebp, eax
lea eax, [esp + 0x24]
push eax
mov dword [esp + 0x84], ebp
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [esp + 0x28]
add esp, 0xc
mov dword [esp + 0x74], eax
mov ebp, dword [esp + 0x78]
cmp esi, dword [esp + 0x34]
sbb ecx, ecx
xor eax, eax
neg ecx
cmp dword [esp + 0x18], eax
sete al
test eax, ecx
je 0x5094e4
mov edi, dword [esp + 0x28]
mov ecx, ebp
mov ebx, dword [esp + 0x74]
and ecx, 0x1f
neg edi
mov edx, ebx
shl edx, cl
and edi, 0x1f
mov ecx, edi
shr edx, cl
mov ecx, dword [esp + 0xb8]
push 0x20
movzx esi, byte [ecx + edx*2 + 4]
mov al, byte [ecx + edx*2 + 5]
add esi, ebp
mov ecx, dword [esp + 0xac]
mov byte [ecx], al
inc ecx
mov dword [esp + 0xac], ecx
mov ecx, esi
and ecx, 0x1f
shl ebx, cl
mov ecx, edi
mov edi, dword [esp + 0xbc]
shr ebx, cl
movzx ebp, byte [edi + ebx*2 + 4]
mov al, byte [edi + ebx*2 + 5]
add ebp, esi
mov esi, dword [esp + 0xac]
mov dword [esp + 0x7c], ebp
mov byte [esi], al
inc esi
mov dword [esp + 0xac], esi
jmp 0x509337
mov ecx, dword [esp + 0x80]
pop ebx
cmp ebp, ebx
ja 0x5094e8
cmp ecx, dword [esp + 0x84]
jb 0x50948b
lea eax, [esp + 0x74]
push eax
call fcn.005086fc
pop ecx
jmp 0x5094e0
mov edx, dword [esp + 0x80]
cmp ecx, edx
je 0x5094ef
mov eax, ebp
shr eax, 3
mov dword [esp + 0x10], eax
mov eax, ecx
sub eax, dword [esp + 0x10]
cmp eax, edx
jae 0x5094af
mov eax, ecx
sub eax, edx
jmp 0x5094b3
mov eax, dword [esp + 0x10]
sub ecx, eax
imul eax, eax, 0xfffffff8
push 4
push ecx
mov dword [esp + 0x84], ecx
add ebp, eax
lea eax, [esp + 0x24]
push eax
mov dword [esp + 0x84], ebp
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [esp + 0x28]
add esp, 0xc
mov dword [esp + 0x74], eax
mov ebp, dword [esp + 0x78]
mov ecx, dword [esp + 0x7c]
mov edx, dword [esp + 0x80]
cmp ebp, ebx
jbe 0x509500
mov dword [esp + 0x14], 3
jmp 0x509595
cmp ecx, dword [esp + 0x84]
jb 0x50951a
lea eax, [esp + 0x74]
push eax
call fcn.005086fc
pop ecx
mov dword [esp + 0x14], eax
jmp 0x509591
cmp ecx, edx
jne 0x50953a
mov edx, dword [esp + 0x28]
cmp ebp, ebx
jae 0x509530
mov dword [esp + 0x14], 1
jmp 0x509599
mov dword [esp + 0x14], 2
jmp 0x509599
and dword [esp + 0x14], 0
mov eax, ebp
shr eax, 3
mov dword [esp + 0x10], eax
mov eax, ecx
sub eax, dword [esp + 0x10]
cmp eax, edx
jae 0x509560
mov eax, ecx
mov dword [esp + 0x14], 1
sub eax, edx
jmp 0x509564
mov eax, dword [esp + 0x10]
sub ecx, eax
imul eax, eax, 0xfffffff8
push 4
push ecx
mov dword [esp + 0x84], ecx
add ebp, eax
lea eax, [esp + 0x24]
push eax
mov dword [esp + 0x84], ebp
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [esp + 0x28]
add esp, 0xc
mov dword [esp + 0x74], eax
mov ebp, dword [esp + 0x78]
mov edx, dword [esp + 0x28]
neg edx
cmp esi, dword [esp + 0x8c]
mov dword [esp + 0x18], edx
sbb ecx, ecx
xor eax, eax
neg ecx
cmp dword [esp + 0x14], eax
sete al
test eax, ecx
je 0x5095e4
mov edx, dword [esp + 0x74]
mov ecx, ebp
and ecx, 0x1f
shl edx, cl
mov ecx, dword [esp + 0x28]
neg ecx
and ecx, 0x1f
shr edx, cl
movzx eax, byte [edi + edx*2 + 4]
add ebp, eax
mov al, byte [edi + edx*2 + 5]
mov byte [esi], al
inc esi
mov dword [esp + 0x78], ebp
jmp 0x5094e4
cmp esi, dword [esp + 0x8c]
jae 0x509629
mov ebx, dword [esp + 0x8c]
mov eax, edx
and eax, 0x1f
mov dword [esp + 0x1c], eax
mov edx, dword [esp + 0x74]
mov ecx, ebp
and ecx, 0x1f
shl edx, cl
mov ecx, eax
shr edx, cl
movzx eax, byte [edi + edx*2 + 4]
add ebp, eax
mov al, byte [edi + edx*2 + 5]
mov byte [esi], al
inc esi
mov eax, dword [esp + 0x1c]
cmp esi, ebx
jb 0x5095fd
push 0x20
mov dword [esp + 0x7c], ebp
pop ebx
mov ecx, dword [esp + 0x90]
mov eax, ecx
mov esi, dword [esp + 0x24]
sub eax, esi
cmp eax, 3
jle 0x509766
lea ebp, [ecx - 3]
mov dword [esp + 0x34], ebp
mov ebp, dword [esp + 0x64]
cmp ebp, ebx
jbe 0x50965d
mov dword [esp + 0x14], 3
jmp 0x5096e2
mov ecx, dword [esp + 0x68]
cmp ecx, dword [esp + 0x70]
jb 0x509678
lea eax, [esp + 0x60]
push eax
call fcn.005086fc
pop ecx
mov dword [esp + 0x14], eax
jmp 0x5096de
mov edx, dword [esp + 0x6c]
cmp ecx, edx
jne 0x50968d
cmp ebp, ebx
sbb eax, eax
add eax, 2
mov dword [esp + 0x14], eax
jmp 0x5096e2
and dword [esp + 0x14], 0
mov eax, ebp
shr eax, 3
mov dword [esp + 0x10], eax
mov eax, ecx
sub eax, dword [esp + 0x10]
cmp eax, edx
jae 0x5096b3
mov eax, ecx
mov dword [esp + 0x14], 1
sub eax, edx
jmp 0x5096b7
mov eax, dword [esp + 0x10]
sub ecx, eax
imul eax, eax, 0xfffffff8
push 4
push ecx
mov dword [esp + 0x70], ecx
add ebp, eax
lea eax, [esp + 0x24]
push eax
mov dword [esp + 0x70], ebp
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [esp + 0x28]
add esp, 0xc
mov dword [esp + 0x60], eax
mov ebp, dword [esp + 0x64]
cmp esi, dword [esp + 0x34]
sbb ecx, ecx
xor eax, eax
neg ecx
cmp dword [esp + 0x14], eax
sete al
test eax, ecx
je 0x5097d5
mov edi, dword [esp + 0x28]
mov ecx, ebp
mov ebx, dword [esp + 0x60]
and ecx, 0x1f
neg edi
mov edx, ebx
shl edx, cl
and edi, 0x1f
mov ecx, edi
shr edx, cl
mov ecx, dword [esp + 0xb8]
push 0x20
movzx esi, byte [ecx + edx*2 + 4]
mov al, byte [ecx + edx*2 + 5]
add esi, ebp
mov ecx, dword [esp + 0x28]
mov byte [ecx], al
inc ecx
mov dword [esp + 0x28], ecx
mov ecx, esi
and ecx, 0x1f
shl ebx, cl
mov ecx, edi
mov edi, dword [esp + 0xbc]
shr ebx, cl
movzx ebp, byte [edi + ebx*2 + 4]
mov al, byte [edi + ebx*2 + 5]
add ebp, esi
mov esi, dword [esp + 0x28]
mov dword [esp + 0x68], ebp
pop ebx
mov byte [esi], al
inc esi
mov dword [esp + 0x24], esi
jmp 0x50964c
mov ebp, dword [esp + 0x64]
mov ecx, dword [esp + 0x68]
cmp ebp, ebx
ja 0x5097d9
cmp ecx, dword [esp + 0x70]
jb 0x509785
lea eax, [esp + 0x60]
push eax
call fcn.005086fc
pop ecx
jmp 0x5097d1
mov edx, dword [esp + 0x6c]
cmp ecx, edx
je 0x5097dd
mov eax, ebp
shr eax, 3
mov dword [esp + 0x10], eax
mov eax, ecx
sub eax, dword [esp + 0x10]
cmp eax, edx
jae 0x5097a6
mov eax, ecx
sub eax, edx
jmp 0x5097aa
mov eax, dword [esp + 0x10]
sub ecx, eax
imul eax, eax, 0xfffffff8
push 4
push ecx
mov dword [esp + 0x70], ecx
add ebp, eax
lea eax, [esp + 0x24]
push eax
mov dword [esp + 0x70], ebp
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [esp + 0x28]
add esp, 0xc
mov dword [esp + 0x60], eax
mov ebp, dword [esp + 0x64]
mov ecx, dword [esp + 0x68]
mov edx, dword [esp + 0x6c]
cmp ebp, ebx
jbe 0x5097ee
mov dword [esp + 0x14], 3
jmp 0x50987d
cmp ecx, dword [esp + 0x70]
jb 0x509805
lea eax, [esp + 0x60]
push eax
call fcn.005086fc
pop ecx
mov dword [esp + 0x14], eax
jmp 0x509879
cmp ecx, edx
jne 0x509828
mov eax, dword [esp + 0x18]
push 0x1f
pop ecx
cmp ebp, ebx
jae 0x50981e
mov dword [esp + 0x14], 1
jmp 0x509884
mov dword [esp + 0x14], 2
jmp 0x509884
and dword [esp + 0x14], 0
mov eax, ebp
shr eax, 3
mov dword [esp + 0x10], eax
mov eax, ecx
sub eax, dword [esp + 0x10]
cmp eax, edx
jae 0x50984e
mov eax, ecx
mov dword [esp + 0x14], 1
sub eax, edx
jmp 0x509852
mov eax, dword [esp + 0x10]
sub ecx, eax
imul eax, eax, 0xfffffff8
push 4
push ecx
mov dword [esp + 0x70], ecx
add ebp, eax
lea eax, [esp + 0x24]
push eax
mov dword [esp + 0x70], ebp
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [esp + 0x28]
add esp, 0xc
mov dword [esp + 0x60], eax
mov ebp, dword [esp + 0x64]
mov eax, dword [esp + 0x18]
push 0x1f
pop ecx
mov edx, dword [esp + 0x90]
and eax, ecx
cmp esi, edx
mov dword [esp + 0x24], eax
sbb ecx, ecx
xor eax, eax
neg ecx
cmp dword [esp + 0x14], eax
sete al
test eax, ecx
je 0x5098cf
mov edx, dword [esp + 0x60]
mov ecx, ebp
and ecx, 0x1f
shl edx, cl
mov ecx, dword [esp + 0x18]
and ecx, 0x1f
shr edx, cl
movzx eax, byte [edi + edx*2 + 4]
add ebp, eax
mov al, byte [edi + edx*2 + 5]
mov byte [esi], al
inc esi
mov dword [esp + 0x64], ebp
jmp 0x5097d5
cmp esi, edx
jae 0x509904
mov ebx, dword [esp + 0x24]
mov edx, dword [esp + 0x60]
mov ecx, ebp
and ecx, 0x1f
shl edx, cl
mov ecx, ebx
shr edx, cl
movzx eax, byte [edi + edx*2 + 4]
add ebp, eax
mov al, byte [edi + edx*2 + 5]
mov byte [esi], al
inc esi
cmp esi, dword [esp + 0x90]
jb 0x5098d7
push 0x20
mov dword [esp + 0x68], ebp
pop ebx
mov ecx, dword [esp + 0x20]
mov eax, ecx
mov esi, dword [esp + 0x2c]
sub eax, esi
cmp eax, 3
jle 0x509a3e
lea ebp, [ecx - 3]
mov dword [esp + 0x34], ebp
mov ebp, dword [esp + 0x50]
cmp ebp, ebx
jbe 0x509935
mov dword [esp + 0x18], 3
jmp 0x5099ba
mov ecx, dword [esp + 0x54]
cmp ecx, dword [esp + 0x5c]
jb 0x509950
lea eax, [esp + 0x4c]
push eax
call fcn.005086fc
pop ecx
mov dword [esp + 0x18], eax
jmp 0x5099b6
mov edx, dword [esp + 0x58]
cmp ecx, edx
jne 0x509965
cmp ebp, ebx
sbb eax, eax
add eax, 2
mov dword [esp + 0x18], eax
jmp 0x5099ba
and dword [esp + 0x18], 0
mov eax, ebp
shr eax, 3
mov dword [esp + 0x10], eax
mov eax, ecx
sub eax, dword [esp + 0x10]
cmp eax, edx
jae 0x50998b
mov eax, ecx
mov dword [esp + 0x18], 1
sub eax, edx
jmp 0x50998f
mov eax, dword [esp + 0x10]
sub ecx, eax
imul eax, eax, 0xfffffff8
push 4
push ecx
mov dword [esp + 0x5c], ecx
add ebp, eax
lea eax, [esp + 0x24]
push eax
mov dword [esp + 0x5c], ebp
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [esp + 0x28]
add esp, 0xc
mov dword [esp + 0x4c], eax
mov ebp, dword [esp + 0x50]
cmp esi, dword [esp + 0x34]
sbb ecx, ecx
xor eax, eax
neg ecx
cmp dword [esp + 0x18], eax
sete al
test eax, ecx
je 0x509aad
mov edi, dword [esp + 0x28]
mov ecx, ebp
mov ebx, dword [esp + 0x4c]
and ecx, 0x1f
neg edi
mov edx, ebx
shl edx, cl
and edi, 0x1f
mov ecx, edi
shr edx, cl
mov ecx, dword [esp + 0xb8]
push 0x20
movzx esi, byte [ecx + edx*2 + 4]
mov al, byte [ecx + edx*2 + 5]
add esi, ebp
mov ecx, dword [esp + 0x30]
mov byte [ecx], al
inc ecx
mov dword [esp + 0x30], ecx
mov ecx, esi
and ecx, 0x1f
shl ebx, cl
mov ecx, edi
mov edi, dword [esp + 0xbc]
shr ebx, cl
movzx ebp, byte [edi + ebx*2 + 4]
mov al, byte [edi + ebx*2 + 5]
add ebp, esi
mov esi, dword [esp + 0x30]
mov dword [esp + 0x54], ebp
pop ebx
mov byte [esi], al
inc esi
mov dword [esp + 0x2c], esi
jmp 0x509924
mov ebp, dword [esp + 0x50]
mov ecx, dword [esp + 0x54]
cmp ebp, ebx
ja 0x509ab1
cmp ecx, dword [esp + 0x5c]
jb 0x509a5d
lea eax, [esp + 0x4c]
push eax
call fcn.005086fc
pop ecx
jmp 0x509aa9
mov edx, dword [esp + 0x58]
cmp ecx, edx
je 0x509ab5
mov eax, ebp
shr eax, 3
mov dword [esp + 0x10], eax
mov eax, ecx
sub eax, dword [esp + 0x10]
cmp eax, edx
jae 0x509a7e
mov eax, ecx
sub eax, edx
jmp 0x509a82
mov eax, dword [esp + 0x10]
sub ecx, eax
imul eax, eax, 0xfffffff8
push 4
push ecx
mov dword [esp + 0x5c], ecx
add ebp, eax
lea eax, [esp + 0x24]
push eax
mov dword [esp + 0x5c], ebp
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [esp + 0x28]
add esp, 0xc
mov dword [esp + 0x4c], eax
mov ebp, dword [esp + 0x50]
mov ecx, dword [esp + 0x54]
mov edx, dword [esp + 0x58]
cmp ebp, ebx
jbe 0x509ac3
mov dword [esp + 0x18], 3
jmp 0x509b40
cmp ecx, dword [esp + 0x5c]
jb 0x509ada
lea eax, [esp + 0x4c]
push eax
call fcn.005086fc
pop ecx
mov dword [esp + 0x18], eax
jmp 0x509b3c
cmp ecx, edx
jne 0x509aeb
cmp ebp, ebx
sbb eax, eax
add eax, 2
mov dword [esp + 0x18], eax
jmp 0x509b40
and dword [esp + 0x18], 0
mov eax, ebp
shr eax, 3
mov dword [esp + 0x10], eax
mov eax, ecx
sub eax, dword [esp + 0x10]
cmp eax, edx
jae 0x509b11
mov eax, ecx
mov dword [esp + 0x18], 1
sub eax, edx
jmp 0x509b15
mov eax, dword [esp + 0x10]
sub ecx, eax
imul eax, eax, 0xfffffff8
push 4
push ecx
mov dword [esp + 0x5c], ecx
add ebp, eax
lea eax, [esp + 0x24]
push eax
mov dword [esp + 0x5c], ebp
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [esp + 0x28]
add esp, 0xc
mov dword [esp + 0x4c], eax
mov ebp, dword [esp + 0x50]
mov edx, dword [esp + 0x20]
cmp esi, edx
sbb ecx, ecx
xor eax, eax
neg ecx
cmp dword [esp + 0x18], eax
sete al
test eax, ecx
je 0x509b7f
mov edx, dword [esp + 0x4c]
mov ecx, ebp
and ecx, 0x1f
shl edx, cl
mov ecx, dword [esp + 0x24]
shr edx, cl
movzx eax, byte [edi + edx*2 + 4]
add ebp, eax
mov al, byte [edi + edx*2 + 5]
mov byte [esi], al
inc esi
mov dword [esp + 0x50], ebp
jmp 0x509aad
cmp esi, edx
jae 0x509bb1
mov ebx, dword [esp + 0x24]
mov edx, dword [esp + 0x4c]
mov ecx, ebp
and ecx, 0x1f
shl edx, cl
mov ecx, ebx
shr edx, cl
movzx eax, byte [edi + edx*2 + 4]
add ebp, eax
mov al, byte [edi + edx*2 + 5]
mov byte [esi], al
inc esi
cmp esi, dword [esp + 0x20]
jb 0x509b87
push 0x20
mov dword [esp + 0x54], ebp
pop ebx
mov ecx, dword [esp + 0x88]
mov eax, ecx
mov esi, dword [esp + 0x30]
sub eax, esi
cmp eax, 3
jle 0x509cee
lea ebp, [ecx - 3]
mov dword [esp + 0x34], ebp
mov ebp, dword [esp + 0x3c]
cmp ebp, ebx
jbe 0x509be5
mov dword [esp + 0x20], 3
jmp 0x509c6a
mov ecx, dword [esp + 0x40]
cmp ecx, dword [esp + 0x48]
jb 0x509c00
lea eax, [esp + 0x38]
push eax
call fcn.005086fc
pop ecx
mov dword [esp + 0x20], eax
jmp 0x509c66
mov edx, dword [esp + 0x44]
cmp ecx, edx
jne 0x509c15
cmp ebp, ebx
sbb eax, eax
add eax, 2
mov dword [esp + 0x20], eax
jmp 0x509c6a
and dword [esp + 0x20], 0
mov eax, ebp
shr eax, 3
mov dword [esp + 0x10], eax
mov eax, ecx
sub eax, dword [esp + 0x10]
cmp eax, edx
jae 0x509c3b
mov eax, ecx
mov dword [esp + 0x20], 1
sub eax, edx
jmp 0x509c3f
mov eax, dword [esp + 0x10]
sub ecx, eax
imul eax, eax, 0xfffffff8
push 4
push ecx
mov dword [esp + 0x48], ecx
add ebp, eax
lea eax, [esp + 0x24]
push eax
mov dword [esp + 0x48], ebp
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [esp + 0x28]
add esp, 0xc
mov dword [esp + 0x38], eax
mov ebp, dword [esp + 0x3c]
cmp esi, dword [esp + 0x34]
sbb ecx, ecx
xor eax, eax
neg ecx
cmp dword [esp + 0x20], eax
sete al
test eax, ecx
je 0x509d5d
mov edi, dword [esp + 0x28]
mov ecx, ebp
mov ebx, dword [esp + 0x38]
and ecx, 0x1f
neg edi
mov edx, ebx
shl edx, cl
and edi, 0x1f
mov ecx, edi
shr edx, cl
mov ecx, dword [esp + 0xb8]
push 0x20
movzx esi, byte [ecx + edx*2 + 4]
mov al, byte [ecx + edx*2 + 5]
add esi, ebp
mov ecx, dword [esp + 0x34]
mov byte [ecx], al
inc ecx
mov dword [esp + 0x34], ecx
mov ecx, esi
and ecx, 0x1f
shl ebx, cl
mov ecx, edi
mov edi, dword [esp + 0xbc]
shr ebx, cl
movzx ebp, byte [edi + ebx*2 + 4]
mov al, byte [edi + ebx*2 + 5]
add ebp, esi
mov esi, dword [esp + 0x34]
mov dword [esp + 0x40], ebp
pop ebx
mov byte [esi], al
inc esi
mov dword [esp + 0x30], esi
jmp 0x509bd4
mov ebp, dword [esp + 0x3c]
mov ecx, dword [esp + 0x40]
cmp ebp, ebx
ja 0x509d61
cmp ecx, dword [esp + 0x48]
jb 0x509d0d
lea eax, [esp + 0x38]
push eax
call fcn.005086fc
pop ecx
jmp 0x509d59
mov edx, dword [esp + 0x44]
cmp ecx, edx
je 0x509d65
mov eax, ebp
shr eax, 3
mov dword [esp + 0x10], eax
mov eax, ecx
sub eax, dword [esp + 0x10]
cmp eax, edx
jae 0x509d2e
mov eax, ecx
sub eax, edx
jmp 0x509d32
mov eax, dword [esp + 0x10]
sub ecx, eax
imul eax, eax, 0xfffffff8
push 4
push ecx
mov dword [esp + 0x48], ecx
add ebp, eax
lea eax, [esp + 0x24]
push eax
mov dword [esp + 0x48], ebp
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [esp + 0x28]
add esp, 0xc
mov dword [esp + 0x38], eax
mov ebp, dword [esp + 0x3c]
mov ecx, dword [esp + 0x40]
mov edx, dword [esp + 0x44]
cmp ebp, ebx
jbe 0x509d73
mov dword [esp + 0x20], 3
jmp 0x509df0
cmp ecx, dword [esp + 0x48]
jb 0x509d8a
lea eax, [esp + 0x38]
push eax
call fcn.005086fc
pop ecx
mov dword [esp + 0x20], eax
jmp 0x509dec
cmp ecx, edx
jne 0x509d9b
cmp ebp, ebx
sbb eax, eax
add eax, 2
mov dword [esp + 0x20], eax
jmp 0x509df0
and dword [esp + 0x20], 0
mov eax, ebp
shr eax, 3
mov dword [esp + 0x10], eax
mov eax, ecx
sub eax, dword [esp + 0x10]
cmp eax, edx
jae 0x509dc1
mov eax, ecx
mov dword [esp + 0x20], 1
sub eax, edx
jmp 0x509dc5
mov eax, dword [esp + 0x10]
sub ecx, eax
imul eax, eax, 0xfffffff8
push 4
push ecx
mov dword [esp + 0x48], ecx
add ebp, eax
lea eax, [esp + 0x24]
push eax
mov dword [esp + 0x48], ebp
call sub.VCRUNTIME140.dll_memcpy
mov eax, dword [esp + 0x28]
add esp, 0xc
mov dword [esp + 0x38], eax
mov ebp, dword [esp + 0x3c]
mov edx, dword [esp + 0x88]
cmp esi, edx
sbb ecx, ecx
xor eax, eax
neg ecx
cmp dword [esp + 0x20], eax
sete al
test eax, ecx
je 0x509e32
mov edx, dword [esp + 0x38]
mov ecx, ebp
and ecx, 0x1f
shl edx, cl
mov ecx, dword [esp + 0x24]
shr edx, cl
movzx eax, byte [edi + edx*2 + 4]
add ebp, eax
mov al, byte [edi + edx*2 + 5]
mov byte [esi], al
inc esi
mov dword [esp + 0x3c], ebp
jmp 0x509d5d
cmp esi, edx
jae 0x509e62
mov edx, dword [esp + 0x38]
mov ecx, ebp
and ecx, 0x1f
shl edx, cl
mov ecx, dword [esp + 0x24]
shr edx, cl
movzx eax, byte [edi + edx*2 + 4]
add ebp, eax
mov al, byte [edi + edx*2 + 5]
mov byte [esi], al
inc esi
cmp esi, dword [esp + 0x88]
jb 0x509e36
mov dword [esp + 0x3c], ebp
lea eax, [esp + 0x38]
push eax
call fcn.005085c0
mov edx, eax
lea eax, [esp + 0x50]
push eax
call fcn.005085c0
and edx, eax
lea eax, [esp + 0x68]
push eax
call fcn.005085c0
and edx, eax
lea eax, [esp + 0x80]
push eax
call fcn.005085c0
add esp, 0x10
test eax, edx
mov eax, dword [esp + 0xac]
push 0xffffffffffffffec
pop ecx
cmove eax, ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x94
ret