Function at 0x140021e50
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x78
movabs rax, 0x100000000
cmp rdx, rax
ja 0x1400221a6
mov rbp, r9
mov r15, r8
mov rbx, rdx
mov r14, rcx
mov rax, qword [rsp + 0xe0]
lea r12, [rax + 4]
lea rax, [r8 + 0x28]
mov qword [rsp + 0x30], rax
lea rax, [rcx + 1]
mov qword [rsp + 0x68], rax
lea rax, [rcx + 0x10]
mov qword [rsp + 0x60], rax
xor r13d, r13d
mov dword [rsp + 0x2c], 0
xor eax, eax
mov qword [rsp + 0x40], rax
xor eax, eax
mov qword [rsp + 0x38], rax
xor edi, edi
mov qword [rsp + 0x48], r12
mov qword [rsp + 0x70], r9
jmp 0x140021ee9
mov rcx, qword [0x14004b178]
xor edx, edx
mov r8, qword [rsp + 0x58]
call rsi
cmp rdi, rbx
jae 0x14002217f
test r12, r12
js 0x14002219f
mov rax, qword [0x14004b178]
test rax, rax
jne 0x140021f14
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
test rax, rax
je 0x140022190
mov qword [0x14004b178], rax
mov rcx, rax
mov edx, 8
mov r8, r12
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
test rax, rax
je 0x140022190
mov rcx, rax
mov qword [rsp + 0x58], rax
mov rdx, rbp
mov rsi, qword [rsp + 0xe0]
mov r8, rsi
call sub.VCRUNTIME140.dll_memcpy
mov rdx, qword [rsp + 0x58]
mov qword [rsp + 0x50], r13
movzx eax, r13b
shl eax, 0x18
movzx ecx, byte [rsp + 0x2c]
shl ecx, 0x10
or ecx, eax
movzx eax, byte [rsp + 0x40]
shl eax, 8
or eax, ecx
movzx ecx, byte [rsp + 0x38]
or ecx, eax
mov dword [rdx + rsi], ecx
mov rsi, r15
movzx eax, byte [r15 + 0x68]
movzx r15d, al
mov r8d, 0x40
sub r8, r15
mov r13, r12
sub r13, r8
jae 0x140021fc0
mov rax, qword [rsp + 0x30]
lea rcx, [rax + r15]
mov r8, r12
call sub.VCRUNTIME140.dll_memcpy
add r15, r12
mov r12, r15
mov r15, rsi
jmp 0x140022037
mov rbp, rdx
test al, al
je 0x140021ff5
mov rbp, rdx
add rbp, r8
mov r12, qword [rsp + 0x30]
add r15, r12
mov rcx, r15
call sub.VCRUNTIME140.dll_memcpy
mov rcx, rsi
inc qword [rsi + 0x20]
mov r8d, 1
mov rdx, r12
call fcn.140029d10
mov r12, r13
cmp r12, 0x40
mov r15, rsi
jb 0x140022014
mov r8, r12
shr r8, 6
add qword [r15 + 0x20], r8
mov rcx, r15
mov rdx, rbp
call fcn.140029d10
mov rax, r12
and rax, 0xffffffffffffffc0
and r12d, 0x3f
add rbp, rax
mov rcx, qword [rsp + 0x30]
mov rdx, rbp
mov r8, r12
call sub.VCRUNTIME140.dll_memcpy
mov rbp, qword [rsp + 0x70]
mov r13, qword [rsp + 0x50]
mov rsi, qword [sym.imp.KERNEL32.dll_HeapFree]
mov byte [r15 + 0x68], r12b
mov rcx, r15
call fcn.140002b30
test rdx, rdx
je 0x1400220d0
cmp rdi, rbx
mov r12, qword [rsp + 0x48]
jae 0x140022130
mov r9, rdi
not r9
add r9, rbx
lea rcx, [rdx - 1]
cmp r9, rcx
mov r8, rcx
cmovb r8, r9
inc r8
cmp r8, 0x20
jb 0x1400220a9
lea r10, [r14 + rdi]
cmp r9, rcx
cmovb rcx, r9
lea r9, [rax + rcx]
inc r9
cmp r10, r9
jae 0x1400220d7
mov r9, qword [rsp + 0x68]
add r9, rdi
add rcx, r9
cmp rax, rcx
jae 0x1400220d7
xor ecx, ecx
inc rcx
nop
movzx r8d, byte [rax + rcx - 1]
xor byte [r14 + rdi], r8b
inc rdi
cmp rcx, rdx
jae 0x140022130
inc rcx
cmp rdi, rbx
jb 0x1400220b0
jmp 0x140022130
mov r12, qword [rsp + 0x48]
jmp 0x140022130
mov rcx, r8
and rcx, 0xffffffffffffffe0
mov r9, qword [rsp + 0x60]
add r9, rdi
add rdi, rcx
xor r10d, r10d
nop dword [rax]
movups xmm0, xmmword [rax + r10]
movups xmm1, xmmword [rax + r10 + 0x10]
movups xmm2, xmmword [r9 + r10 - 0x10]
xorps xmm2, xmm0
movups xmm0, xmmword [r9 + r10]
xorps xmm0, xmm1
movups xmmword [r9 + r10 - 0x10], xmm2
movups xmmword [r9 + r10], xmm0
add r10, 0x20
cmp rcx, r10
jne 0x1400220f0
cmp r8, rcx
jne 0x1400220ab
nop word cs:[rax + rax]
inc r13b
jne 0x140022163
mov ecx, dword [rsp + 0x2c]
inc cl
mov dword [rsp + 0x2c], ecx
jne 0x140022163
mov rcx, qword [rsp + 0x40]
add cl, 1
mov qword [rsp + 0x40], rcx
mov rcx, qword [rsp + 0x38]
adc cl, 0
mov qword [rsp + 0x38], rcx
mov dword [rsp + 0x2c], 0
test rdx, rdx
je 0x140021ed0
mov rcx, qword [0x14004b178]
xor edx, edx
mov r8, rax
call rsi
jmp 0x140021ed0
add rsp, 0x78
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov ecx, 1
mov rdx, r12
call fcn.14003a940
ud2
call fcn.140009df0
ud2
lea rcx, str.assertion_failed:_out.len___as_u64___MAX_LENC:Userswilliamcanin.cargo_registry_srcindex.crates.io_6f17d22bba15001f_rsa_0.9.6_src_algorithmsmgf.rs
lea r8, [0x140042090]
mov edx, 0x2d
call fcn.14003abe0
ud2