Function at 0x40fd20
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0xc], ecx
push ebx
push esi
push edi
test eax, eax
je 0x40fd36
mov byte [eax], 0
mov esi, dword [ebp + 0xc]
test esi, esi
je 0x40ff3b
cmp dword [ebp + 8], 0
je 0x40ff3b
lea ecx, [esi*4]
mov eax, 0xc6a4a793
mul ecx
xor edi, edi
mov ebx, eax
mov eax, 0x5bd1e995
mul ecx
add ebx, edx
xor eax, 0x9747b28c
xor ebx, 0x9747b28c
mov dword [ebp - 4], eax
test esi, esi
je 0x40fdd5
nop dword [eax + eax]
mov eax, dword [ebp + 8]
push 0xc6a4a793
push 0x5bd1e995
mov ecx, dword [eax + edi*4]
mov eax, 0xc6a4a793
mul ecx
mov esi, eax
mov eax, 0x5bd1e995
mul ecx
xor ecx, ecx
add esi, edx
mov edx, esi
xor ecx, esi
shr edx, 0xf
xor edx, eax
push ecx
push edx
call fcn.00590280
xor eax, dword [ebp - 4]
xor edx, ebx
push 0xc6a4a793
push 0x5bd1e995
push edx
push eax
call fcn.00590280
inc edi
mov dword [ebp - 4], eax
mov ebx, edx
cmp edi, dword [ebp + 0xc]
jb 0x40fd80
mov eax, 0xc6a4a793
xor ecx, ecx
mul dword [ebp + 0x10]
push 0xc6a4a793
mov esi, eax
mov eax, 0x5bd1e995
mul dword [ebp + 0x10]
push 0x5bd1e995
add esi, edx
mov edx, esi
xor ecx, esi
shr edx, 0xf
xor edx, eax
push ecx
push edx
call fcn.00590280
xor eax, dword [ebp - 4]
xor edx, ebx
push 0xc6a4a793
push 0x5bd1e995
push edx
push eax
call fcn.00590280
push 0xc6a4a793
mov esi, edx
xor ecx, ecx
push 0x5bd1e995
xor ecx, edx
shr esi, 0xf
xor esi, eax
push ecx
push esi
call fcn.00590280
mov esi, dword [ebp - 0xc]
mov ecx, edx
shr ecx, 0xf
xor ebx, ebx
xor ecx, eax
xor ebx, edx
mov eax, ecx
mov dword [ebp - 8], ecx
and eax, 0xfffff
mov dword [ebp - 4], ebx
lea edi, [esi + eax*4]
mov dword [ebp - 0x10], edi
nop
mov edx, dword [edi]
nop
movq xmm0, qword [ebp + 8]
and edx, 0x7fffffff
mov eax, dword [ebp + 0x10]
push ebx
push ecx
sub esp, 0xc
mov dword [ebp - 0xc], edx
mov ecx, esp
push edx
movq qword [ecx], xmm0
mov dword [ecx + 8], eax
mov ecx, esi
call fcn.004100b0
test eax, eax
jne 0x40ff3d
push edi
call fcn.00410150
mov ebx, eax
add esp, 4
cmp ebx, dword [ebp - 0xc]
je 0x40feda
push dword [ebp - 4]
movq xmm0, qword [ebp + 8]
push dword [ebp - 8]
mov eax, dword [ebp + 0x10]
sub esp, 0xc
mov ecx, esp
push ebx
movq qword [ecx], xmm0
mov dword [ecx + 8], eax
mov ecx, esi
call fcn.004100b0
mov dword [ebp - 0xc], eax
test eax, eax
je 0x40feda
push ebx
push edi
call fcn.004101f0
mov eax, dword [ebp - 0xc]
add esp, 8
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov edi, 1
lea eax, [esi + 0x400000]
lock xadd dword [eax], edi
inc edi
xor ecx, ecx
mov eax, edi
and eax, 0x7fffffff
cmp eax, edi
jne 0x40ff46
push edi
lea ecx, [esi + 0x400004]
call fcn.0040f990
push dword [ebp - 4]
mov esi, eax
lea eax, [ebp + 8]
push dword [ebp - 8]
mov ecx, esi
push eax
push edi
call fcn.004101a0
push edi
push dword [ebp - 0x10]
mov dword [esi + 8], ebx
call fcn.004101f0
mov eax, dword [ebp + 0x14]
add esp, 8
test eax, eax
je 0x40ff30
mov byte [eax], 1
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
push 0
push edi
push ecx
push eax
push str.__s__kUnlockMask______s__
push 0x8c
push str.D:_a_work1_s_src_vctools_asanllvmcompiler_rtlib_sanitizer_common_sanitizer_stackdepotbase.h
call fcn.004123d0
int3