Function at 0x140039680
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x2e8
mov r10, rdx
mov qword [rsp + 0x50], rcx
movabs rax, 0x3fffffffffffffff
add rax, rdx
mov rcx, rax
or rcx, rdx
shr rcx, 0x20
je 0x1400396e7
xor edx, edx
div r10
mov qword [rsp + 0x58], rax
mov rax, r10
cmp r10, 0x1001
jae 0x1400396fd
shr rax, 1
mov rcx, r10
sub rcx, rax
cmp rcx, 0x40
mov eax, 0x40
cmovb rax, rcx
mov qword [rsp + 0x48], rax
jmp 0x140039726
xor edx, edx
div r10d
mov qword [rsp + 0x58], rax
mov rax, r10
cmp r10, 0x1001
jb 0x1400396ca
or rax, 1
bsr rcx, rax
xor ecx, 0xffffffc0
add ecx, 0x41
shr ecx, 1
mov eax, 1
shl rax, cl
mov rdx, r10
shr rdx, cl
add rdx, rax
shr rdx, 1
mov qword [rsp + 0x48], rdx
mov rax, qword [rsp + 0x50]
lea rcx, [rax + 0xc]
mov qword [rsp + 0x70], rcx
add rax, 0xfffffffffffffff8
mov qword [rsp + 0x60], rax
mov r12d, 1
xor ebp, ebp
movabs rsi, 0x1ffffffffffffffe
xor r14d, r14d
mov qword [rsp + 0x40], r9
mov qword [rsp + 0x38], r8
mov qword [rsp + 0x80], r10
nop word cs:[rax + rax]
mov rax, qword [rsp + 0x50]
lea rax, [rax + rbp*8]
mov qword [rsp + 0x30], rax
sub r10, rbp
jbe 0x1400397e0
cmp r10, qword [rsp + 0x48]
jae 0x140039800
cmp byte [rsp + 0x350], 0
je 0x14003980e
mov rdi, r10
cmp r10, 0x20
mov eax, 0x20
cmovae rdi, rax
mov qword [rsp + 0x28], 0
mov dword [rsp + 0x20], 0
mov rcx, qword [rsp + 0x30]
mov rdx, rdi
call fcn.14003a3b0
mov r8, qword [rsp + 0x38]
mov r9, qword [rsp + 0x40]
mov eax, edi
lea rcx, [rax*2 + 1]
jmp 0x1400399e2
xor ecx, ecx
mov eax, 1
mov qword [rsp + 0x68], rax
cmp r14, 2
jae 0x140039a40
jmp 0x140039cc6
cmp r10, 2
jae 0x140039825
mov r11, r8
jmp 0x1400399d7
mov rax, qword [rsp + 0x48]
mov rcx, r10
cmp rax, r10
cmovb rcx, rax
add rcx, rcx
jmp 0x1400399e2
mov rdi, r10
mov rax, qword [rsp + 0x30]
movzx ecx, byte [rax]
movzx edx, byte [rax + 8]
cmp dl, cl
jae 0x140039890
cmp rdi, 2
jne 0x1400398cc
mov rax, qword [rsp + 0x30]
lea rcx, [rax + 8]
mov edx, 1
mov eax, 2
xor r8d, r8d
mov r9, r8
not r9
add r9, rdx
mov rdi, qword [rsp + 0x30]
movzx edx, byte [rdi + r8*8]
mov r10d, dword [rdi + r8*8 + 4]
mov r11, qword [rcx + r9*8]
mov qword [rdi + r8*8], r11
mov r11, qword [rsp + 0x38]
mov byte [rcx + r9*8], dl
mov dword [rcx + r9*8 + 4], r10d
mov r9, qword [rsp + 0x40]
jmp 0x1400399d4
mov r11, r8
mov r10d, 2
cmp rdi, 2
je 0x1400399d7
mov eax, 2
mov r8d, edx
nop dword [rax + rax]
mov r10d, r8d
mov r8, qword [rsp + 0x30]
movzx r8d, byte [r8 + rax*8]
cmp r8b, r10b
jb 0x1400398fd
inc rax
cmp rdi, rax
jne 0x1400398b0
jmp 0x1400398fa
mov r11, r8
mov eax, 2
mov r8d, edx
nop word [rax + rax]
mov r10d, r8d
mov r8, qword [rsp + 0x30]
movzx r8d, byte [r8 + rax*8]
cmp r8b, r10b
jae 0x1400398fd
inc rax
cmp rdi, rax
jne 0x1400398e0
mov rax, rdi
cmp rax, qword [rsp + 0x48]
mov r8, r11
mov r10, rdi
jb 0x14003978a
mov r11, r8
cmp dl, cl
jae 0x1400399d4
mov r10d, 1
cmp rax, 2
jb 0x1400399d7
mov rdx, rax
shr rdx, 1
mov rcx, qword [rsp + 0x30]
lea rcx, [rcx + rax*8]
lea r8, [rdx*8]
sub rcx, r8
cmp rdx, 1
je 0x140039855
mov r9, rdx
and r9, 0xfffffffffffffffe
mov r8, qword [rsp + 0x70]
lea r10, [r8 + rbp*8]
lea r8, [rax + rbp]
mov r11, qword [rsp + 0x60]
lea r11, [r11 + r8*8]
xor r8d, r8d
mov r13, rsi
movzx ebx, byte [r10 + r8*8 - 0xc]
mov esi, dword [r10 + r8*8 - 8]
mov rdi, qword [r11]
mov qword [r10 + r8*8 - 0xc], rdi
mov byte [r11], bl
mov dword [r11 + 4], esi
mov rsi, r8
xor rsi, r13
add rsi, rdx
movzx ebx, byte [r10 + r8*8 - 4]
mov edi, dword [r10 + r8*8]
mov r15, qword [rcx + rsi*8]
mov qword [r10 + r8*8 - 4], r15
mov byte [rcx + rsi*8], bl
mov dword [rcx + rsi*8 + 4], edi
add r8, 2
add r11, 0xfffffffffffffff0
cmp r9, r8
jne 0x140039970
mov r10, rax
test dl, 1
mov r9, qword [rsp + 0x40]
mov r11, qword [rsp + 0x38]
mov rsi, r13
je 0x1400399d7
jmp 0x140039858
mov r10, rax
lea rcx, [r10*2 + 1]
mov r8, r11
mov rax, r12
shr rax, 1
mov qword [rsp + 0x68], rcx
shr rcx, 1
lea rdx, [rbp*2]
sub rdx, rax
lea rax, [rcx + rbp*2]
mov rcx, qword [rsp + 0x58]
imul rdx, rcx
imul rax, rcx
xor rax, rdx
je 0x140039a24
bsr rcx, rax
xor rcx, 0x3f
cmp r14, 2
jae 0x140039a40
jmp 0x140039cc6
mov ecx, 0x40
cmp r14, 2
jb 0x140039cc6
nop word cs:[rax + rax]
mov rax, qword [rsp + 0x60]
lea rax, [rax + rbp*8]
mov qword [rsp + 0x78], rax
mov qword [rsp + 0x88], rbp
jmp 0x140039a9a
mov rbp, r12
mov rdx, r10
sub r8, rdx
mov rcx, rbp
call fcn.1401253f0
mov r9, qword [rsp + 0x40]
mov r8, qword [rsp + 0x38]
mov rcx, rsi
lea r12, [r13*2 + 1]
mov rbp, qword [rsp + 0x88]
movabs rsi, 0x1ffffffffffffffe
cmp r14, 1
jbe 0x140039cc0
cmp byte [rsp + r14 + 0x95], cl
jb 0x140039cc6
dec r14
mov rdi, qword [rsp + r14*8 + 0xd8]
mov r15, rdi
shr r15, 1
mov rbx, r12
shr rbx, 1
lea r13, [r15 + rbx]
cmp r13, r9
ja 0x140039af0
mov eax, edi
or eax, r12d
and eax, 1
jne 0x140039af0
add r13, r13
mov r12, r13
cmp r14, 1
ja 0x140039a9a
jmp 0x140039cc0
mov rsi, rcx
mov rax, rbp
sub rax, r13
mov rcx, qword [rsp + 0x50]
lea rbp, [rcx + rax*8]
test dil, 1
jne 0x140039b60
mov rax, r15
or rax, 1
bsr rax, rax
xor eax, 0x3f
add eax, eax
xor eax, 0x7e
mov dword [rsp + 0x20], eax
mov qword [rsp + 0x28], 0
mov rcx, rbp
mov rdx, r15
call fcn.14003a3b0
mov r8, qword [rsp + 0x38]
mov r9, qword [rsp + 0x40]
test r12b, 1
je 0x140039b66
cmp rdi, 2
mov rcx, rsi
jae 0x140039bb0
jmp 0x140039a76
test r12b, 1
jne 0x140039b43
lea rcx, [r15*8]
add rcx, rbp
mov rax, rbx
or rax, 1
bsr rax, rax
xor eax, 0x3f
add eax, eax
xor eax, 0x7e
mov dword [rsp + 0x20], eax
mov qword [rsp + 0x28], 0
mov rdx, rbx
call fcn.14003a3b0
mov r8, qword [rsp + 0x38]
mov r9, qword [rsp + 0x40]
cmp rdi, 2
mov rcx, rsi
jb 0x140039a76
cmp r12, 2
jb 0x140039a76
cmp r15, rbx
mov rdi, rbx
cmovb rdi, r15
cmp rdi, r9
ja 0x140039a76
lea r12, [r15*8]
add r12, rbp
cmp rbx, r15
mov rdx, rbp
cmovb rdx, r12
mov rcx, r8
lea r8, [rdi*8]
call fcn.1401253f0
mov r10, qword [rsp + 0x38]
lea r8, [r10 + rdi*8]
cmp rbx, r15
jae 0x140039c5b
mov rax, qword [rsp + 0x78]
nop word cs:[rax + rax]
movzx ecx, byte [r8 - 8]
xor edx, edx
xor r9d, r9d
cmp cl, byte [r12 - 8]
setb dl
setae r9b
mov rcx, r8
cmovb rcx, r12
mov rcx, qword [rcx - 8]
mov qword [rax], rcx
lea r12, [r12 + r9*8]
add r12, 0xfffffffffffffff8
lea r8, [r8 + rdx*8]
add r8, 0xfffffffffffffff8
cmp r12, rbp
je 0x140039a58
add rax, 0xfffffffffffffff8
cmp r8, r10
jne 0x140039c10
jmp 0x140039a58
mov rdx, r10
test rdi, rdi
je 0x140039a5e
nop word [rax + rax]
movzx ecx, byte [r12]
xor eax, eax
xor r9d, r9d
cmp cl, byte [rdx]
setb cl
setae r9b
mov r10, rdx
cmovb r10, r12
mov r10, qword [r10]
mov qword [rbp], r10
lea rdx, [rdx + r9*8]
add rbp, 8
cmp rdx, r8
je 0x140039a5e
mov al, cl
lea r12, [r12 + rax*8]
cmp r12, qword [rsp + 0x30]
jne 0x140039c70
jmp 0x140039a5e
mov r14d, 1
mov qword [rsp + r14*8 + 0xd8], r12
mov byte [rsp + r14 + 0x96], cl
mov r10, qword [rsp + 0x80]
cmp r10, rbp
jbe 0x140039cf9
inc r14
mov r12, qword [rsp + 0x68]
mov rax, r12
shr rax, 1
add rbp, rax
jmp 0x140039770
test r12b, 1
jne 0x140039d2c
mov rax, r10
or rax, 1
bsr rax, rax
xor eax, 0x3f
add eax, eax
xor eax, 0x7e
mov dword [rsp + 0x20], eax
mov qword [rsp + 0x28], 0
mov rcx, qword [rsp + 0x50]
mov rdx, r10
call fcn.14003a3b0
nop
add rsp, 0x2e8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret