Function at 0x5146f0
Capabilities:
Encode data using xor

Disassembly:
mov eax, 0x34
call fcn.00584ea0
mov eax, dword [0x6009e4]
xor eax, esp
mov dword [esp + 0x30], eax
cmp dword [esp + 0x3c], 0
mov eax, dword [esp + 0x38]
mov dword [esp + 4], eax
mov dword [esp + 0x10], 0
jne 0x514730
mov eax, 1
mov ecx, dword [esp + 0x30]
xor ecx, esp
call fcn.00584a28
add esp, 0x34
ret
push ebx
call fcn.004e0660
mov ebx, eax
test ebx, ebx
je 0x514a53
push 0x514bb0
push 0x6221e4
call fcn.004f67c0
add esp, 8
neg eax
sbb eax, eax
test dword [0x6221ec], eax
je 0x514a53
cmp dword [0x6221e8], 0
push ebp
push esi
je 0x5147a5
call fcn.00401730
push dword [0x6221e0]
mov esi, eax
call fcn.004f6790
push esi
push dword [0x62261c]
call fcn.004f66e0
push dword [0x6221e0]
mov ebp, eax
mov dword [esp + 0x1c], ebp
call fcn.004f6810
add esp, 0x10
test ebp, ebp
jne 0x5147bb
jmp 0x5147ad
mov dword [esp + 0xc], 0
push dword [0x6221dc]
call fcn.004f6840
add esp, 4
mov ecx, dword [0x6221c4]
mov eax, dword [0x6221c8]
movups xmm0, xmmword [0x6221f4]
mov ebp, dword [0x6221cc]
push edi
mov edi, ecx
mov dword [esp + 0x24], eax
add ecx, dword [esp + 0x4c]
mov eax, dword [0x622204]
mov dword [esp + 0x28], ebp
mov dword [esp + 0x3c], eax
mov dword [0x6221c4], ecx
movups xmmword [esp + 0x2c], xmm0
cmp ecx, 0x3ff
jb 0x51482a
mov eax, 0x401005
mov dword [0x6221c0], 0x3ff
mul ecx
mov eax, ecx
sub eax, edx
shr eax, 1
add eax, edx
shr eax, 9
imul eax, eax, 0xfffffc01
add ecx, eax
mov dword [0x6221c4], ecx
jmp 0x514840
mov eax, dword [0x6221c0]
cmp eax, 0x3ff
jae 0x514840
cmp ecx, eax
cmova eax, ecx
mov dword [0x6221c0], eax
mov ecx, dword [esp + 0x4c]
mov eax, 0x66666667
imul ecx
sar edx, 3
mov esi, edx
shr esi, 0x1f
add esi, edx
lea eax, [esi + esi*4]
shl eax, 2
sub ecx, eax
xor eax, eax
test ecx, ecx
setg al
add eax, esi
add ebp, eax
mov dword [0x6221cc], ebp
mov ebp, dword [esp + 0x10]
test ebp, ebp
jne 0x514884
push dword [0x6221dc]
call fcn.004f6810
add esp, 4
mov eax, dword [esp + 0x4c]
mov dword [esp + 0x18], 0
test eax, eax
jle 0x5149c5
mov dword [esp + 0x1c], eax
mov ecx, 0x14
cmp eax, 0x14
mov esi, eax
push 0
cmovg esi, ecx
call fcn.004d13c0
push eax
push ebx
call fcn.004e0310
add esp, 0xc
test eax, eax
je 0x514a50
push 0x14
lea eax, [esp + 0x30]
push eax
push ebx
call fcn.004e04a0
add esp, 0xc
test eax, eax
je 0x514a50
lea ebp, [edi - 0x3ff]
add ebp, esi
test ebp, ebp
jle 0x51490b
mov eax, esi
sub eax, ebp
push eax
lea eax, [edi + 0x622208]
push eax
push ebx
call fcn.004e04a0
add esp, 0xc
test eax, eax
je 0x514a50
push ebp
push 0x622208
jmp 0x514913
push esi
lea eax, [edi + 0x622208]
push eax
push ebx
call fcn.004e04a0
add esp, 0xc
test eax, eax
je 0x514a50
mov ebp, dword [esp + 0x14]
push esi
push ebp
push ebx
call fcn.004e04a0
add esp, 0xc
test eax, eax
je 0x514a50
push 8
lea eax, [esp + 0x28]
push eax
push ebx
call fcn.004e04a0
add esp, 0xc
test eax, eax
je 0x514a50
push 0
lea eax, [esp + 0x30]
push eax
push ebx
call fcn.004e0270
add esp, 0xc
test eax, eax
je 0x514a50
inc dword [esp + 0x28]
add ebp, esi
xor ecx, ecx
mov dword [esp + 0x14], ebp
test esi, esi
jle 0x51499c
nop dword [eax + eax]
mov al, byte [esp + ecx + 0x2c]
inc ecx
xor byte [edi + 0x622208], al
lea eax, [edi + 1]
xor edi, edi
cmp eax, 0x3ff
cmovl edi, eax
cmp ecx, esi
jl 0x514980
mov ebp, dword [esp + 0x18]
mov ecx, 0x14
mov eax, dword [esp + 0x1c]
add ebp, 0x14
sub eax, 0x14
mov dword [esp + 0x18], ebp
mov dword [esp + 0x1c], eax
cmp ebp, dword [esp + 0x4c]
jl 0x5148a1
mov ebp, dword [esp + 0x10]
test ebp, ebp
jne 0x5149e0
push dword [0x6221dc]
call fcn.004f6840
add esp, 4
nop word [eax + eax]
movups xmm1, xmmword [0x6221f4]
xor ecx, ecx
mov edx, 4
movups xmm0, xmmword [esp + 0x2c]
pxor xmm1, xmm0
movups xmmword [0x6221f4], xmm1
nop
mov al, byte [esp + ecx + 0x3c]
lea ecx, [ecx + 1]
xor byte [ecx + 0x622203], al
sub edx, 1
jne 0x514a00
movsd xmm0, qword [0x5c9830]
movsd xmm1, qword [0x6221d0]
comisd xmm0, xmm1
jbe 0x514a36
addsd xmm1, qword [esp + 0x50]
movsd qword [0x6221d0], xmm1
test ebp, ebp
jne 0x514a48
push dword [0x6221dc]
call fcn.004f6810
add esp, 4
mov dword [esp + 0x20], 1
pop edi
pop esi
pop ebp
push ebx
call fcn.004e0640
mov ecx, dword [esp + 0x38]
add esp, 4
mov eax, dword [esp + 0x14]
pop ebx
xor ecx, esp
call fcn.00584a28
add esp, 0x34
ret