Function at 0x180270be4
Capabilities:
Encode data using xor
Encrypt data using aes
Reference aes constants

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x88
mov esi, r8d
mov qword [rsp + 0x58], rdx
mov r12d, r8d
add r12d, 0xfffffff9
js 0x180270c42
movsxd rdx, r12d
mov eax, 6
sub eax, esi
cmp eax, 0xfffffffe
mov ebp, 0xffffffff
cmovg ebp, eax
lea ebp, [rsi + rbp]
add ebp, 0xfffffffa
sub rdx, rbp
lea rax, [rsp + rdx*4]
add rax, 0x20
lea rdx, [rcx + rdx*4]
lea r8, [rbp*4 + 4]
mov rcx, rax
call fcn.1803e4840
lea r14d, [rsi - 6]
xor ebp, ebp
mov qword [rsp + 0x48], rsi
test esi, esi
jns 0x180270c9e
xor edi, edi
cmp ebp, dword [rsp + 0x48]
jg 0x180270ee0
movsxd rax, r12d
mov qword [rsp + 0x78], rax
mov eax, r14d
shr eax, 0x1f
add eax, r14d
sar eax, 1
mov dword [rsp + 0x54], eax
movsxd r13, eax
lea rax, [r13 + 1]
mov qword [rsp + 0x68], rax
movsxd r12, r14d
mov ebx, r14d
lea eax, [r13 - 1]
cdqe
mov qword [rsp + 0x60], rax
xor r8d, r8d
mov qword [rsp + 0x70], rbx
jmp 0x180270d44
mov edi, 0
test r14d, r14d
jle 0x180270c53
movsxd rsi, r14d
xor r15d, r15d
xor ebx, ebx
xor edi, edi
xor ebp, ebp
cmp edi, 3
jg 0x180270d09
cmp ebx, r14d
jge 0x180270d09
mov eax, ebp
movsxd rbx, ebx
movsxd rdi, edi
shl rax, 4
add rax, qword [rsp + 0x58]
mov r8, rbx
sub r8, rsi
lea rcx, [rdi - 4]
cmp r8, rcx
cmovbe r8, rcx
lea rcx, [rax + rdi*4]
lea rdx, [rsp + rbx*4]
add rdx, 0x20
shl r8, 2
neg r8
call fcn.1803e4840
inc rbx
inc rdi
cmp rdi, 3
jg 0x180270d09
cmp rbx, rsi
jl 0x180270cf8
xor eax, eax
cmp edi, 4
sete al
cmove edi, r15d
add ebp, eax
cmp ebp, dword [rsp + 0x48]
jg 0x180270c53
cmp ebx, r14d
jge 0x180270c53
jmp 0x180270cb4
mov r8, qword [rsp + 0x80]
inc r8
cmp ebp, esi
mov rbx, qword [rsp + 0x70]
jg 0x180270ee0
mov rdx, qword [rsp + 0x78]
movzx eax, byte [rsp + rdx*4 + 0x21]
mov cl, byte [rsp + 0x20]
lea rsi, str.cw
xor cl, byte [rax + rsi]
mov byte [rsp + 0x20], cl
movzx eax, byte [rsp + rdx*4 + 0x22]
mov al, byte [rax + rsi]
xor byte [rsp + 0x21], al
movzx eax, byte [rsp + rdx*4 + 0x23]
mov al, byte [rax + rsi]
xor byte [rsp + 0x22], al
movzx eax, byte [rsp + rdx*4 + 0x20]
mov al, byte [rax + rsi]
xor byte [rsp + 0x23], al
lea rax, [0x18058fdc0]
xor cl, byte [rax + r8*4]
mov byte [rsp + 0x20], cl
cmp r14d, 8
je 0x180270dc6
cmp r14d, 2
mov rsi, qword [rsp + 0x48]
jl 0x180270e49
mov eax, 1
mov ecx, dword [rsp + 0x20]
xor ecx, dword [rsp + rax*4 + 0x20]
mov dword [rsp + rax*4 + 0x20], ecx
inc rax
cmp rax, rbx
jne 0x180270db1
jmp 0x180270e49
mov eax, 1
mov ecx, dword [rsp + 0x20]
xor ecx, dword [rsp + rax*4 + 0x20]
mov dword [rsp + rax*4 + 0x20], ecx
inc rax
cmp rax, r13
jl 0x180270dcf
mov rcx, qword [rsp + 0x60]
movzx eax, byte [rsp + rcx*4 + 0x20]
lea rdx, str.cw
mov al, byte [rax + rdx]
xor byte [rsp + r13*4 + 0x20], al
movzx eax, byte [rsp + rcx*4 + 0x21]
mov al, byte [rax + rdx]
xor byte [rsp + r13*4 + 0x21], al
movzx eax, byte [rsp + rcx*4 + 0x22]
mov al, byte [rax + rdx]
xor byte [rsp + r13*4 + 0x22], al
movzx eax, byte [rsp + rcx*4 + 0x23]
mov al, byte [rax + rdx]
xor byte [rsp + r13*4 + 0x23], al
mov rax, qword [rsp + 0x68]
mov ecx, dword [rsp + 0x54]
cmp r14d, 0xd
mov rsi, qword [rsp + 0x48]
jg 0x180270e49
movsxd rcx, ecx
mov ecx, dword [rsp + rcx*4 + 0x20]
xor dword [rsp + rax*4 + 0x20], ecx
mov ecx, eax
lea rax, [rax + 1]
cmp eax, 8
jne 0x180270e33
cmp ebp, esi
mov qword [rsp + 0x80], r8
jg 0x180270d2c
xor r15d, r15d
test r14d, r14d
mov ebx, 0
jle 0x180270d2c
cmp edi, 3
jg 0x180270ec0
cmp r15d, r14d
jge 0x180270ec0
movsxd rax, ebp
movsxd r15, r15d
movsxd rdi, edi
shl rax, 4
add rax, qword [rsp + 0x58]
mov r8, r15
sub r8, r12
lea rcx, [rdi - 4]
cmp r8, rcx
cmovbe r8, rcx
lea rcx, [rax + rdi*4]
lea rdx, [rsp + r15*4]
add rdx, 0x20
shl r8, 2
neg r8
call fcn.1803e4840
inc r15
inc rdi
cmp rdi, 3
jg 0x180270ec0
cmp r15, r12
jl 0x180270eaf
xor eax, eax
cmp edi, 4
sete al
cmove edi, ebx
add ebp, eax
cmp ebp, esi
jg 0x180270d2c
cmp r15d, r14d
jge 0x180270d2c
jmp 0x180270e6a
xor eax, eax
add rsp, 0x88
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret