Function at 0x14004d97c
Capabilities:
Encode data using xor

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x20
lea rbp, [rsp + 0x20]
mov r14, rdx
mov qword [rbp + 0x58], rbx
xor edi, edi
xor edx, edx
mov rbx, rcx
lea r8d, [rdi + 0x58]
call fcn.1400220a0
movsxd r8, dword [r14 + 4]
lea r12, [r14 + 8]
test r8d, r8d
jle 0x14004d9d0
mov r9, qword [r12]
xor ecx, ecx
cmp byte [r9 + rcx], 0
lea eax, [rdi + 1]
cmovle eax, edi
inc rcx
mov edi, eax
cmp rcx, r8
jl 0x14004d9bb
mov dword [rbx + 4], r8d
mov dword [rbx + 8], edi
mov eax, dword [r14]
mov dword [rbx], eax
test edi, edi
jle 0x14004de97
mov edx, dword [r14 + 4]
mov r8d, edi
mov rcx, qword [r12]
call fcn.14004d6d0
movsxd rsi, edi
mov r13, rax
movabs r15, 0xffffffffffffff0
lea rcx, [rsi*8]
lea rax, [rcx + 0xf]
cmp rax, rcx
ja 0x14004da18
mov rax, r15
and rax, 0xfffffffffffffff0
call fcn.1400d6380
sub rsp, rax
lea r10, [rsp + 0x20]
mov qword [rbp + 0x40], r10
test r13, r13
jne 0x14004da42
mov rcx, rbx
call fcn.14004d918
or eax, 0xffffffff
jmp 0x14004de99
xor r11d, r11d
test edi, edi
jle 0x14004dac2
xor r9d, r9d
mov ecx, dword [r13 + r9*4]
bswap ecx
mov r8d, ecx
mov eax, ecx
shl ecx, 4
shl eax, 4
shr r8d, 4
xor r8d, eax
and r8d, 0xf0f0f0f
xor r8d, ecx
mov edx, r8d
shr edx, 2
lea eax, [r8*4]
xor edx, eax
lea eax, [r8*4]
and edx, 0x33333333
xor edx, eax
mov ecx, edx
shr ecx, 1
lea eax, [rdx + rdx]
xor ecx, eax
lea eax, [rdx + rdx]
and ecx, 0x55555555
xor ecx, eax
mov dword [r13 + r9*4], ecx
lea rcx, [r11*4]
add rcx, r13
inc r11d
mov qword [r10 + r9*8], rcx
inc r9
cmp r9, rsi
jl 0x14004da4c
lea r9, [0x14004d8f8]
mov r8d, 8
mov rdx, rsi
mov rcx, r10
call fcn.140019bc0
lea rcx, [rsi*4]
lea rax, [rcx + 0xf]
mov qword [rbp + 0x48], rcx
cmp rax, rcx
ja 0x14004daf2
mov rax, r15
and rax, 0xfffffffffffffff0
call fcn.1400d6380
sub rsp, rax
lea r15, [rsp + 0x20]
call fcn.1400d65e0
xor edx, edx
mov qword [rbx + 0x20], rax
test edi, edi
jle 0x14004db55
mov r8, qword [rbp + 0x40]
xor ecx, ecx
mov rax, qword [r8 + rcx*8]
inc rcx
sub rax, r13
sar rax, 2
cdqe
mov dword [r15 + rax*4], edx
inc edx
cmp rcx, rsi
jl 0x14004db18
mov r9, r13
mov rdx, r15
sub r9, r15
movsxd r8, dword [rdx]
mov eax, dword [r9 + rdx]
lea rdx, [rdx + 4]
mov rcx, qword [rbx + 0x20]
mov dword [rcx + r8*4], eax
sub rsi, 1
jne 0x14004db3c
mov rcx, r13
call fcn.1400d65e8
mov r8, r15
mov edx, edi
mov rcx, r14
call fcn.14004d34c
mov rcx, qword [rbp + 0x48]
mov qword [rbx + 0x18], rax
call fcn.1400d65e0
xor r13d, r13d
mov qword [rbx + 0x28], rax
mov r10d, r13d
mov edx, r13d
lea esi, [r13 + 1]
cmp dword [r14 + 4], r13d
jle 0x14004dbba
mov r8d, r13d
mov r9, r15
mov rax, qword [r12]
cmp byte [r8 + rax], r13b
jle 0x14004dbaf
movsxd rcx, dword [r9]
add r10d, esi
mov rax, qword [rbx + 0x28]
add r9, 4
mov dword [rax + rcx*4], edx
add edx, esi
add r8, rsi
cmp edx, dword [r14 + 4]
jl 0x14004db94
movsxd rcx, r10d
call fcn.1400d65e0
mov qword [rbx + 0x30], rax
mov edi, r13d
mov dword [rbx + 0x44], r13d
mov r9d, r13d
cmp dword [r14 + 4], r13d
jle 0x14004dc3d
mov r8, r13
mov rax, qword [r12]
mov dl, byte [r8 + rax]
test dl, dl
jle 0x14004dc06
movsxd rcx, dword [r15]
add edi, esi
mov rax, qword [rbx + 0x30]
add r15, 4
mov byte [rcx + rax], dl
mov rax, qword [r12]
movsx ecx, byte [r8 + rax]
cmp ecx, dword [rbx + 0x44]
jle 0x14004dc06
mov dword [rbx + 0x44], ecx
add r9d, esi
add r8, rsi
cmp r9d, dword [r14 + 4]
jl 0x14004dbd9
cmp edi, esi
jne 0x14004dc3d
cmp dword [rbx + 0x44], esi
jne 0x14004dc3d
mov edx, 4
mov dword [rbx + 0x40], esi
lea ecx, [rdx - 2]
call fcn.1400d65fc
mov qword [rbx + 0x38], rax
mov dword [rax + 4], esi
mov rax, qword [rbx + 0x38]
mov dword [rax], esi
jmp 0x14004de97
mov eax, dword [rbx + 8]
mov ecx, r13d
test eax, eax
je 0x14004dc4d
add ecx, esi
shr eax, 1
jne 0x14004dc47
lea eax, [rcx - 4]
mov ecx, 5
mov dword [rbx + 0x40], eax
cmp eax, ecx
jge 0x14004dc61
mov dword [rbx + 0x40], ecx
jmp 0x14004dc74
mov ecx, eax
cmp eax, 8
jle 0x14004dc74
mov dword [rbx + 0x40], 8
mov ecx, 8
shl esi, cl
mov edx, 4
movsxd rcx, esi
call fcn.1400d65fc
mov qword [rbx + 0x38], rax
movsxd r15, edi
test edi, edi
jle 0x14004dd66
mov r9, r13
mov r11d, 1
mov r10, qword [rbx + 0x30]
mov r14d, dword [rbx + 0x40]
movsx r12d, byte [r10 + r9]
cmp r12d, r14d
jg 0x14004dd57
mov rax, qword [rbx + 0x20]
sub r14d, r12d
mov ecx, dword [rax + r9*4]
bswap ecx
mov r8d, ecx
mov eax, ecx
shr r8d, 4
shl eax, 4
xor r8d, eax
shl ecx, 4
and r8d, 0xf0f0f0f
xor r8d, ecx
mov cl, r14b
mov edx, r8d
shr edx, 2
lea eax, [r8*4]
xor edx, eax
lea eax, [r8*4]
and edx, 0x33333333
xor edx, eax
mov r8d, edx
shr r8d, 1
lea eax, [rdx + rdx]
xor r8d, eax
lea eax, [rdx + rdx]
and r8d, 0x55555555
mov edx, r13d
xor r8d, eax
mov eax, 1
shl eax, cl
test eax, eax
jle 0x14004dd57
mov cl, byte [r10 + r9]
mov eax, edx
shl eax, cl
inc edx
mov ecx, eax
mov eax, r8d
or rcx, rax
mov rax, qword [rbx + 0x38]
mov dword [rax + rcx*4], r11d
mov r10, qword [rbx + 0x30]
mov ecx, dword [rbx + 0x40]
movsx eax, byte [r10 + r9]
sub ecx, eax
mov eax, 1
shl eax, cl
cmp edx, eax
jl 0x14004dd24
inc r11d
inc r9
cmp r9, r15
jl 0x14004dc9b
mov r10d, dword [rbx + 0x40]
mov ecx, 0x1f
sub ecx, r10d
mov r14d, 0xfffffffe
shl r14d, cl
xor r11d, r11d
mov r9d, r13d
test esi, esi
jle 0x14004de97
xor r12d, r12d
xor r8d, r8d
mov eax, r11d
mov ecx, 0x20
sub ecx, r10d
shl eax, cl
mov ecx, eax
mov dword [rbp + 0x40], eax
bswap ecx
mov eax, ecx
mov edx, ecx
shr edx, 4
shl ecx, 4
shl eax, 4
xor edx, eax
and edx, 0xf0f0f0f
xor edx, ecx
mov ecx, edx
shr ecx, 2
lea eax, [rdx*4]
xor ecx, eax
lea eax, [rdx*4]
and ecx, 0x33333333
xor ecx, eax
mov edx, ecx
shr rdx, 1
lea eax, [rcx + rcx]
add ecx, ecx
xor rdx, rax
mov rax, qword [rbx + 0x38]
and edx, 0x55555555
mov qword [rbp + 0x50], rax
xor rdx, rcx
mov qword [rbp + 0x48], rdx
cmp dword [rax + rdx*4], 0
jne 0x14004de8b
mov r10d, dword [rbp + 0x40]
lea ecx, [r9 + 1]
cmp ecx, edi
jge 0x14004de34
mov rdx, qword [rbx + 0x20]
add rdx, 4
lea rdx, [rdx + r12*4]
cmp dword [rdx], r10d
ja 0x14004de30
inc r9d
inc ecx
inc r12
add rdx, 4
cmp ecx, edi
jl 0x14004de1b
mov rdx, qword [rbp + 0x48]
cmp r8, r15
jge 0x14004de5a
mov rax, qword [rbx + 0x20]
lea rcx, [rax + r8*4]
mov eax, dword [rcx]
and eax, r14d
cmp r10d, eax
jb 0x14004de5a
inc r13d
inc r8
add rcx, 4
cmp r8, r15
jl 0x14004de41
mov r10d, 0x7fff
mov ecx, edi
sub ecx, r13d
mov eax, r9d
cmp r9d, r10d
cmova eax, r10d
cmp ecx, r10d
cmova ecx, r10d
or eax, 0xffff0000
shl eax, 0xf
or eax, ecx
mov rcx, qword [rbp + 0x50]
mov dword [rcx + rdx*4], eax
mov r10d, dword [rbx + 0x40]
inc r11d
cmp r11d, esi
jl 0x14004dd8f
xor eax, eax
mov rbx, qword [rbp + 0x58]
mov rsp, rbp
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret