Function at 0x36758
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 + 0x70], rax
mov r15, qword [rsp + 0xf0]
mov rdi, qword [rsp + 0x110]
mov r13, rcx
mov rcx, qword [rsp + 0x100]
mov rbp, r9
mov qword [rsp + 0x38], r8
mov r9, r8
mov qword [rsp + 0x30], rdx
mov qword [rsp + 0x28], rcx
test rdx, rdx
je 0x369fe
cmp dword [r13 + 0x10], 1
jne 0x369fe
cmp qword [r13 + 0x18], 0x10
jne 0x369fe
lea rax, [rbp - 7]
cmp rax, 6
ja 0x369f7
mov rsi, qword [rsp + 0x118]
lea rax, [rsi - 4]
cmp rax, 0xc
ja 0x369f7
test sil, 1
jne 0x369f7
mov r12, qword [rsp + 0x108]
lea eax, [rsi - 2]
mov r14d, 0xf
and al, 0xfe
sub r14, rbp
mov r8, rbp
or al, 0x10
lea ecx, [r14 - 1]
mov rdx, r9
shl al, 2
mov byte [rsp + 0x20], cl
mov rbx, r12
or al, cl
lea rcx, [rsp + 0x41]
mov byte [rsp + 0x40], al
call fcn.0003a6f0
test r14, r14
je 0x36850
lea rax, [rsp + 0x4f]
mov rcx, r14
mov byte [rax], bl
dec rax
shr rbx, 8
sub rcx, 1
jne 0x36841
test rbx, rbx
jne 0x369f7
mov rcx, qword [rsp + 0x30]
lea r8, [rsp + 0x50]
lea rdx, [rsp + 0x40]
call qword [r13 + 0x38]
mov rax, qword [r15]
xor r11d, r11d
mov qword [rsp + 0x40], r11
mov qword [rsp + 0x48], r11
mov qword [rsp + 0x42], rax
mov eax, dword [r15 + 8]
mov byte [rsp + 0x40], r11b
mov byte [rsp + 0x41], 0xd
mov dword [rsp + 0x4a], eax
mov al, byte [r15 + 0xc]
xor ecx, ecx
mov byte [rsp + 0x4e], al
mov al, byte [rsp + rcx + 0x40]
inc rcx
xor byte [rsp + rcx + 0x4f], al
cmp rcx, 0x10
jb 0x3689d
mov r15, qword [rsp + 0x30]
lea r8, [rsp + 0x50]
lea rdx, [rsp + 0x50]
mov rcx, r15
call qword [r13 + 0x38]
mov r11b, byte [rsp + 0x20]
mov rdx, qword [rsp + 0x38]
lea rcx, [rsp + 0x41]
mov r8, rbp
mov byte [rsp + 0x40], r11b
call fcn.0003a6f0
lea rcx, [rsp + rbp + 0x41]
mov r8, r14
xor edx, edx
call fcn.0003bc80
lea r8, [rsp + 0x60]
lea rdx, [rsp + 0x40]
mov rcx, r15
call qword [r13 + 0x38]
lea rdx, [rsp + 0x60]
mov r8, rsi
mov rcx, rdi
call fcn.0003a6f0
test r12, r12
je 0x369d8
mov rbp, qword [rsp + 0xf8]
mov ebx, 0x10
cmp r12, rbx
cmovb rbx, r12
xor edx, edx
test rbx, rbx
je 0x36952
lea rax, [rsp + 0x50]
mov r8, rbp
sub r8, rax
lea rcx, [rsp + rdx + 0x50]
inc rdx
mov al, byte [r8 + rcx]
xor byte [rcx], al
cmp rdx, rbx
jb 0x3693f
lea r8, [rsp + 0x50]
lea rdx, [rsp + 0x50]
mov rcx, r15
call qword [r13 + 0x38]
xor r11d, r11d
test r14, r14
je 0x36980
lea rax, [rsp + 0x4f]
add byte [rax], 1
jne 0x36980
inc r11
dec rax
cmp r11, r14
jb 0x36970
lea r8, [rsp + 0x60]
lea rdx, [rsp + 0x40]
mov rcx, r15
call qword [r13 + 0x38]
xor r11d, r11d
test rbx, rbx
je 0x369c7
mov r8, qword [rsp + 0x28]
lea rax, [rsp + 0x60]
mov rdx, rbp
sub rdx, rax
lea rax, [rsp + 0x60]
sub r8, rax
lea rcx, [rsp + r11 + 0x60]
inc r11
mov al, byte [rdx + rcx]
xor al, byte [rcx]
mov byte [r8 + rcx], al
cmp r11, rbx
jb 0x369b1
add qword [rsp + 0x28], rbx
add rbp, rbx
sub r12, rbx
jne 0x36921
test rsi, rsi
je 0x369f3
lea rcx, [rsp + 0x50]
sub rcx, rdi
mov al, byte [rcx + rdi]
xor byte [rdi], al
inc rdi
sub rsi, 1
jne 0x369e5
xor eax, eax
jmp 0x36a03
mov eax, 0xe5
jmp 0x36a03
mov eax, 2
mov rcx, qword [rsp + 0x70]
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