Function at 0x5107a0
Capabilities:
Encode data using xor

Disassembly:
mov eax, 0x48
call fcn.005638a0
mov eax, dword [0x66c214]
xor eax, esp
mov dword [esp + 0x44], eax
mov eax, dword [esp + 0x4c]
push esi
mov esi, dword [esp + 0x54]
mov dword [esp + 4], eax
test esi, esi
je 0x510b10
cmp dword [0x67729c], 0
push ebx
push ebp
push edi
je 0x510827
lea eax, [esp + 0x18]
push eax
call fcn.004b29b0
push 0xdf
push str..crypto_randmd_rand.c
push 0x13
push 5
call fcn.004b2b90
lea eax, [esp + 0x2c]
push eax
push 0x6776cc
call fcn.004b2940
neg eax
push 0xe1
push str..crypto_randmd_rand.c
sbb ebx, ebx
push 0x13
inc ebx
push 6
mov dword [esp + 0x40], ebx
call fcn.004b2b90
add esp, 0x2c
test ebx, ebx
jne 0x510843
jmp 0x51082d
xor ebx, ebx
mov dword [esp + 0x14], ebx
push 0xe6
push str..crypto_randmd_rand.c
push 0x12
push 9
call fcn.004b2b90
add esp, 0x10
mov ecx, dword [0x677284]
mov edi, ecx
mov eax, dword [0x677288]
add ecx, esi
mov ebp, dword [0x67728c]
mov dword [esp + 0x20], eax
mov eax, dword [0x6772b4]
mov dword [esp + 0x24], ebp
mov dword [esp + 0x50], eax
mov dword [0x677284], ecx
movups xmm0, xmmword [0x6772a4]
movups xmmword [esp + 0x40], xmm0
cmp ecx, 0x3ff
jb 0x5108af
mov eax, 0x401005
mov dword [0x677280], 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 [0x677284], ecx
jmp 0x5108c5
mov eax, dword [0x677280]
cmp eax, 0x3ff
jae 0x5108c5
cmp ecx, eax
cmova eax, ecx
mov dword [0x677280], eax
mov ecx, dword [esp + 0x60]
mov eax, 0x66666667
imul esi
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 [0x67728c], ebp
test ebx, ebx
jne 0x51090d
push 0x106
push str..crypto_randmd_rand.c
push 0x12
push 0xa
call fcn.004b2b90
add esp, 0x10
lea eax, [esp + 0x28]
push eax
call fcn.004b0260
mov eax, dword [esp + 0x64]
add esp, 4
mov dword [esp + 0x18], 0
test eax, eax
jle 0x510a6c
mov ebp, eax
mov eax, 0x14
cmp ebp, 0x14
mov esi, ebp
push 0
cmovg esi, eax
call fcn.004b0790
push eax
lea eax, [esp + 0x30]
push eax
call fcn.004afe40
add esp, 0xc
test eax, eax
je 0x510b00
push 0x14
lea eax, [esp + 0x44]
push eax
lea eax, [esp + 0x30]
push eax
call fcn.004afff0
add esp, 0xc
test eax, eax
je 0x510b00
lea ebx, [edi - 0x3ff]
add ebx, esi
test ebx, ebx
jle 0x5109ab
mov eax, esi
sub eax, ebx
push eax
lea eax, [edi + 0x6772b8]
push eax
lea eax, [esp + 0x30]
push eax
call fcn.004afff0
add esp, 0xc
test eax, eax
je 0x510b00
push ebx
push 0x6772b8
jmp 0x5109b3
push esi
lea eax, [edi + 0x6772b8]
push eax
lea eax, [esp + 0x30]
push eax
call fcn.004afff0
add esp, 0xc
test eax, eax
je 0x510b00
mov ebx, dword [esp + 0x10]
lea eax, [esp + 0x28]
push esi
push ebx
push eax
call fcn.004afff0
add esp, 0xc
test eax, eax
je 0x510b00
push 8
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x30]
push eax
call fcn.004afff0
add esp, 0xc
test eax, eax
je 0x510b00
push 0
lea eax, [esp + 0x44]
push eax
lea eax, [esp + 0x30]
push eax
call fcn.004afdc0
add esp, 0xc
test eax, eax
je 0x510b00
inc dword [esp + 0x24]
add ebx, esi
xor ecx, ecx
mov dword [esp + 0x10], ebx
test esi, esi
jle 0x510a4b
nop dword [eax + eax]
mov al, byte [esp + ecx + 0x40]
xor byte [edi + 0x6772b8], al
inc edi
xor eax, eax
cmp edi, 0x3ff
cmovge edi, eax
inc ecx
cmp ecx, esi
jl 0x510a30
mov ebx, dword [esp + 0x18]
sub ebp, 0x14
add ebx, 0x14
mov eax, 0x14
mov dword [esp + 0x18], ebx
cmp ebx, dword [esp + 0x60]
jl 0x510935
mov ebx, dword [esp + 0x14]
test ebx, ebx
jne 0x510a86
push 0x13b
push str..crypto_randmd_rand.c
push 0x12
push 9
call fcn.004b2b90
add esp, 0x10
movups xmm1, xmmword [0x6772a4]
xor ecx, ecx
mov edx, 4
movups xmm0, xmmword [esp + 0x40]
pxor xmm1, xmm0
movups xmmword [0x6772a4], xmm1
nop dword [eax]
nop dword [eax + eax]
mov al, byte [esp + ecx + 0x50]
lea ecx, [ecx + 1]
xor byte [ecx + 0x6772b3], al
sub edx, 1
jne 0x510ab0
movsd xmm0, qword [0x60fea8]
movsd xmm1, qword [0x677290]
comisd xmm0, xmm1
jbe 0x510ae6
addsd xmm1, qword [esp + 0x64]
movsd qword [0x677290], xmm1
test ebx, ebx
jne 0x510b00
push 0x148
push str..crypto_randmd_rand.c
push 0x12
push 0xa
call fcn.004b2b90
add esp, 0x10
lea eax, [esp + 0x28]
push eax
call fcn.004b0000
add esp, 4
pop edi
pop ebp
pop ebx
mov ecx, dword [esp + 0x48]
pop esi
xor ecx, esp
call fcn.00562e44
add esp, 0x48
ret