Function at 0x36a2c
Capabilities:
Encode data using xor

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x88
mov rax, qword [0x00047100]
xor rax, rsp
mov qword [rsp + 0x78], rax
mov r15, qword [rsp + 0xf0]
mov rbp, rcx
mov rcx, qword [rsp + 0x100]
xor ebx, ebx
mov r13, r9
mov qword [rsp + 0x58], r8
mov qword [rsp + 0x28], rcx
mov qword [rsp + 0x30], rdx
mov r9, r8
cmp rdx, rbx
je 0x36ce5
cmp dword [rbp + 0x10], 1
jne 0x36ce5
cmp qword [rbp + 0x18], 0x10
jne 0x36ce5
lea rax, [r13 - 7]
cmp rax, 6
ja 0x36cde
mov rsi, qword [rsp + 0x118]
lea rax, [rsi - 4]
cmp rax, 0xc
ja 0x36cde
test sil, 1
jne 0x36cde
mov r12, qword [rsp + 0x108]
lea eax, [rsi - 2]
lea r14d, [rbx + 0xf]
and al, 0xfe
sub r14, r13
mov r8, r13
or al, 0x10
lea ecx, [r14 - 1]
mov rdx, r9
shl al, 2
mov byte [rsp + 0x20], cl
mov rdi, r12
or al, cl
lea rcx, [rsp + 0x39]
mov byte [rsp + 0x38], al
call fcn.0003a6f0
cmp r14, rbx
jbe 0x36b1c
lea rax, [rsp + 0x47]
mov rcx, r14
mov byte [rax], dil
dec rax
shr rdi, 8
sub rcx, 1
jne 0x36b0c
cmp rdi, rbx
jne 0x36cde
mov rcx, qword [rsp + 0x30]
lea r8, [rsp + 0x48]
lea rdx, [rsp + 0x38]
call qword [rbp + 0x38]
mov rax, qword [r15]
xor r11d, r11d
mov qword [rsp + 0x38], r11
mov qword [rsp + 0x40], r11
mov qword [rsp + 0x3a], rax
mov eax, dword [r15 + 8]
mov byte [rsp + 0x38], bl
mov byte [rsp + 0x39], 0xd
mov dword [rsp + 0x42], eax
mov al, byte [r15 + 0xc]
mov rcx, rbx
mov byte [rsp + 0x46], al
mov al, byte [rsp + rcx + 0x38]
inc rcx
xor byte [rsp + rcx + 0x47], al
cmp rcx, 0x10
jb 0x36b68
mov r15, qword [rsp + 0x30]
lea r8, [rsp + 0x48]
lea rdx, [rsp + 0x48]
mov rcx, r15
call qword [rbp + 0x38]
mov r11b, byte [rsp + 0x20]
mov rdx, qword [rsp + 0x58]
lea rcx, [rsp + 0x39]
mov r8, r13
mov byte [rsp + 0x38], r11b
call fcn.0003a6f0
lea rcx, [rsp + r13 + 0x39]
mov r8, r14
xor edx, edx
call fcn.0003bc80
lea r8, [rsp + 0x68]
lea rdx, [rsp + 0x38]
mov rcx, r15
call qword [rbp + 0x38]
lea rdx, [rsp + 0x68]
lea rcx, [rsp + 0x58]
mov r8, rsi
call fcn.0003a6f0
cmp r12, rbx
jbe 0x36ca8
mov r13, qword [rsp + 0xf8]
mov edi, 0x10
mov rcx, rbx
cmp r12, rdi
cmovb rdi, r12
cmp r14, rbx
jbe 0x36c15
lea rax, [rsp + 0x47]
add byte [rax], 1
jne 0x36c15
inc rcx
dec rax
cmp rcx, r14
jb 0x36c05
lea r8, [rsp + 0x68]
lea rdx, [rsp + 0x38]
mov rcx, r15
call qword [rbp + 0x38]
mov r9, qword [rsp + 0x28]
mov r11, rbx
cmp rdi, rbx
jbe 0x36c5e
lea rax, [rsp + 0x68]
mov rdx, r13
mov r8, r9
sub rdx, rax
lea rax, [rsp + 0x68]
sub r8, rax
lea rcx, [rsp + r11 + 0x68]
inc r11
mov al, byte [rdx + rcx]
xor al, byte [rcx]
mov byte [r8 + rcx], al
cmp r11, rdi
jb 0x36c48
mov rdx, rbx
cmp rdi, rbx
jbe 0x36c84
lea rax, [rsp + 0x48]
mov r8, r9
sub r8, rax
lea rcx, [rsp + rdx + 0x48]
inc rdx
mov al, byte [r8 + rcx]
xor byte [rcx], al
cmp rdx, rdi
jb 0x36c71
lea r8, [rsp + 0x48]
lea rdx, [rsp + 0x48]
mov rcx, r15
call qword [rbp + 0x38]
add qword [rsp + 0x28], rdi
sub r12, rdi
add r13, rdi
cmp r12, rbx
ja 0x36bec
mov rcx, rbx
cmp rsi, rbx
jbe 0x36cc0
mov al, byte [rsp + rcx + 0x48]
inc rcx
xor byte [rsp + rcx + 0x57], al
cmp rcx, rsi
jb 0x36cb0
mov rdx, qword [rsp + 0x110]
lea rcx, [rsp + 0x58]
mov r8, rsi
call fcn.0003bde0
cmp eax, ebx
setne bl
mov eax, ebx
jmp 0x36cea
mov eax, 0xe5
jmp 0x36cea
mov eax, 2
mov rcx, qword [rsp + 0x78]
xor rcx, rsp
call fcn.0003a660
add rsp, 0x88
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret