Function at 0x506040
Capabilities:
Encode data using xor
Hash data using fnv

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
mov edi, dword [ebp + 0xc]
mov eax, ecx
mov dword [ebp - 4], eax
cmp dword [edi + 0x14], 8
mov esi, dword [edi + 0x10]
jb 0x50605e
mov edx, dword [edi]
jmp 0x506060
mov edx, edi
mov ebx, 0x811c9dc5
xor ecx, ecx
mov dword [ebp - 8], ebx
add esi, esi
je 0x506087
nop
movzx eax, byte [edx + ecx]
inc ecx
xor eax, ebx
imul ebx, eax, 0x1000193
cmp ecx, esi
jb 0x506070
mov eax, dword [ebp - 4]
mov dword [ebp - 8], ebx
lea ecx, [eax + 0x94]
mov dword [ebp - 0xc], 0
xor edx, edx
mov eax, ebx
div dword [ecx]
mov esi, edx
mov eax, esi
or eax, 1
mov dword [ebp - 0x14], eax
bsr eax, eax
mov dword [ebp - 0xc], eax
movzx ecx, al
mov eax, dword [ebp - 4]
mov eax, dword [eax + ecx*4 + 4]
mov dword [ebp - 0xc], eax
test eax, eax
je 0x5060d7
mov edx, 1
mov eax, esi
shl edx, cl
mov ecx, dword [ebp - 0xc]
and edx, 0xfffffffe
sub eax, edx
cmp dword [ecx + eax*4], 0
setne al
test al, al
jne 0x5060e0
mov ecx, dword [ebp - 4]
push esi
call fcn.00505920
movzx eax, bl
mov dword [ebp - 0xc], 0
push edi
movzx eax, byte [eax + 0x5c68f0]
mov byte [ebp - 0xd], al
movzx eax, bh
movzx eax, byte [eax + 0x5c68f0]
mov byte [ebp - 0xe], al
movzx eax, byte [ebp - 6]
movzx eax, byte [eax + 0x5c68f0]
mov byte [ebp - 0xf], al
movzx eax, byte [ebp - 5]
movzx eax, byte [eax + 0x5c68f0]
mov byte [ebp - 0x10], al
mov eax, dword [ebp - 0x14]
mov ebx, dword [ebp - 0x10]
bsr eax, eax
or ebx, 1
mov dword [ebp - 0xc], eax
movzx ecx, al
mov eax, 1
shl eax, cl
and eax, 0xfffffffe
mov dword [ebp - 8], ebx
sub esi, eax
mov eax, dword [ebp - 4]
push ebx
mov eax, dword [eax + ecx*4 + 4]
mov eax, dword [eax + esi*4]
mov dword [ebp - 0x14], eax
call fcn.00506430
mov ecx, dword [ebp - 0x14]
mov edi, eax
mov esi, dword [ecx]
nop dword [eax]
test esi, esi
je 0x5061a9
mov eax, dword [esi + 0x24]
cmp eax, ebx
ja 0x5061a9
jne 0x5061a3
cmp dword [edi + 0x18], 8
lea eax, [edi + 4]
lea edx, [eax + 0x10]
lea ecx, [esi + 4]
mov dword [ebp - 0x14], edx
jb 0x506181
mov eax, dword [eax]
cmp dword [ecx + 0x14], 8
lea edx, [ecx + 0x10]
jb 0x50618c
mov ecx, dword [ecx]
mov ebx, dword [ebp - 0x14]
mov edx, dword [edx]
push dword [ebx]
push eax
call fcn.004af3c0
mov ebx, dword [ebp - 8]
add esp, 8
test eax, eax
je 0x5061c8
mov ecx, esi
mov esi, dword [esi]
jmp 0x506160
mov dword [edi], esi
mov edx, edi
mov eax, esi
lock cmpxchg dword [ecx], edx
cmp eax, esi
je 0x5061f4
cmp eax, edi
je 0x5061f4
mov dword [ebp - 0x10], 0
mov byte [ebp - 0xc], 0
jmp 0x506157
mov al, byte [edi + 0x24]
not al
test al, 1
jne 0x5061d9
lea ecx, [edi + 4]
call fcn.005055c0
push edi
call fcn.00405150
mov eax, dword [ebp + 8]
add esp, 4
pop edi
mov dword [eax], esi
pop esi
mov byte [eax + 4], 0
pop ebx
mov esp, ebp
pop ebp
ret 8
mov ecx, dword [ebp - 4]
mov eax, 1
lock xadd dword [ecx + 0x8c], eax
inc eax
mov edx, dword [ecx + 0x94]
lea esi, [ecx + 0x94]
movd xmm0, eax
cvtdq2pd xmm0, xmm0
shr eax, 0x1f
mov byte [ebp - 0xc], 1
addsd xmm0, qword [eax*8 + 0x5edf30]
mov eax, edx
shr eax, 0x1f
cvtpd2ps xmm1, xmm0
movd xmm0, edx
cvtdq2pd xmm0, xmm0
addsd xmm0, qword [eax*8 + 0x5edf30]
cvtpd2ps xmm0, xmm0
divss xmm1, xmm0
comiss xmm1, dword [ecx + 0x98]
jbe 0x50625d
lea ecx, [edx + edx]
mov eax, edx
lock cmpxchg dword [esi], ecx
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0xc]
mov dword [eax], edi
pop edi
pop esi
mov dword [eax + 4], ecx
pop ebx
mov esp, ebp
pop ebp
ret 8