Function at 0x1802a8650
Capabilities:
Encode data using xor

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xa8
mov rax, qword [0x1806c4cd8]
xor rax, rsp
mov qword [rsp + 0x98], rax
mov eax, dword [rsp + 0x118]
mov r14, rdx
mov ebx, dword [rsp + 0x128]
mov rdi, rcx
mov rsi, qword [rsp + 0x138]
mov r12, r9
mov r13, qword [rsp + 0x148]
mov r15, r8
mov dword [rsp + 0x4c], eax
mov eax, dword [rsp + 0x120]
lea rdx, [rbx*8]
mov dword [rsp + 0x38], eax
xor eax, eax
mov qword [rsp + 0x68], rax
mov ebp, eax
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x70], rax
mov qword [rsp + 0x58], rax
mov rax, qword [rcx]
mov qword [rsp + 0x30], rcx
mov rcx, rax
mov dword [rsp + 0x48], ebx
mov qword [rsp + 0x60], rbx
call qword [rax]
mov qword [rsp + 0x40], rax
mov rdx, rax
test rax, rax
jne 0x1802a8712
mov r8d, dword [r14]
lea r9, str.failed_to_allocate__d_bytes_for_GSPLANES
lea edx, [rbp + 3]
mov dword [rsp + 0x20], ebx
mov rcx, rdi
call fcn.18021cc40
xor eax, eax
jmp 0x1802a8c5e
xor edi, edi
test ebx, ebx
je 0x1802a8754
mov rbx, rax
nop dword [rax + rax]
mov r8d, dword [rsp + 0x38]
mov edx, dword [rsp + 0x4c]
mov rcx, qword [rsp + 0x30]
call fcn.1802891c0
mov qword [rbx], rax
test rax, rax
je 0x1802a87f6
inc edi
add rbx, 8
cmp edi, dword [rsp + 0x48]
jb 0x1802a8720
mov ebx, dword [rsp + 0x48]
mov rdx, qword [rsp + 0x40]
mov ecx, dword [rsp + 0x140]
cmp ecx, 1
mov eax, dword [rsp + 0x130]
mov r8d, dword [rsp + 0x110]
mov dword [rsp + 0x84], eax
setle al
add al, 2
mov qword [rsp + 0x88], rsi
mov rsi, qword [rsp + 0x30]
mov dword [rsp + 0x78], r8d
mov dword [rsp + 0x7c], ecx
mov dword [rsp + 0x80], ebp
mov byte [rsp + 0x90], al
mov dword [rsp + 0x91], 0x2fffdff
mov word [rsp + 0x95], 0xfefe
mov byte [rsp + 0x97], 0xfe
test r8d, r8d
je 0x1802a8877
lea rcx, [rsp + 0x50]
mov r9, r12
mov qword [rsp + 0x28], rcx
lea edi, [rbx - 1]
mov rax, qword [rdx + rdi*8]
mov rcx, rsi
mov r8, r15
mov qword [rsp + 0x20], rax
call fcn.1802b58b0
mov rbp, qword [rsp + 0x50]
mov rbx, qword [rsp + 0x40]
jmp 0x1802a8901
mov eax, dword [rsp + 0x38]
lea r9, str.failed_to_allocate__dx_d_image_for_GSPLANES
mov r8d, dword [r14]
mov edx, 2
mov r14, qword [rsp + 0x30]
mov dword [rsp + 0x28], eax
mov rcx, r14
mov eax, dword [rsp + 0x4c]
mov dword [rsp + 0x20], eax
call fcn.18021cc40
test edi, edi
je 0x1802a8862
mov rdx, qword [rsp + 0x40]
lea rsi, [rdx + rdi*8]
nop
mov rbx, qword [rsi - 8]
lea rsi, [rsi - 8]
dec edi
test rbx, rbx
je 0x1802a885e
sub dword [rbx + 0x18], 1
jne 0x1802a885e
mov rax, qword [r14]
mov rdx, qword [rbx + 0x10]
mov rcx, rax
call qword [rax + 8]
mov rax, qword [r14]
mov rdx, rbx
mov rcx, rax
call qword [rax + 8]
test edi, edi
jne 0x1802a8830
mov rax, qword [r14]
mov rdx, qword [rsp + 0x40]
mov rcx, rax
call qword [rax + 8]
xor eax, eax
jmp 0x1802a8c5e
mov r8, r12
mov rdx, r15
mov rcx, rsi
call fcn.18021d590
mov qword [rsp + 0x70], rax
mov rcx, rsi
test rax, rax
jne 0x1802a88a9
mov r8d, dword [r14]
lea r9, str.failed_to_allocate_word_stream_when_decoding_gray_scale_image
lea edx, [rax + 2]
call fcn.18021cc40
jmp 0x1802a8be2
mov rdx, rax
call fcn.1802b48c0
mov qword [rsp + 0x58], rax
mov rcx, rax
test rax, rax
jne 0x1802a88d8
mov r8d, dword [r14]
lea r9, str.failed_to_allocate_arithmetic_coding_state_when_decoding_gray_scale_image
lea edx, [rax + 2]
mov rcx, rsi
call fcn.18021cc40
jmp 0x1802a8be2
lea edi, [rbx - 1]
mov qword [rsp + 0x28], r13
mov rbx, qword [rsp + 0x40]
lea r8, [rsp + 0x78]
mov r9, rcx
mov rdx, r14
mov rcx, rsi
mov rax, qword [rbx + rdi*8]
mov qword [rsp + 0x20], rax
call fcn.1802afeb0
test eax, eax
jns 0x1802a8921
mov r8d, dword [r14]
lea r9, str.error_decoding_GSPLANES_for_halftone_image
mov edx, 2
mov rcx, rsi
call fcn.18021cc40
jmp 0x1802a8bd8
test edi, edi
jne 0x1802a8975
mov rax, qword [rsi]
mov r15d, dword [rsp + 0x4c]
mov rcx, rax
mov edx, r15d
shl rdx, 3
call qword [rax]
mov qword [rsp + 0x68], rax
mov r12, rax
test rax, rax
jne 0x1802a8a56
mov r8d, dword [r14]
lea r9, str.failed_to_allocate_GSVALS:__d_bytes
lea edx, [rax + 3]
mov dword [rsp + 0x20], r15d
mov rcx, rsi
call fcn.18021cc40
jmp 0x1802a8bd8
mov rbx, qword [rsp + 0x40]
mov esi, edi
dec edi
cmp dword [rsp + 0x110], 0
lea rbx, [rbx + rdi*8]
mov rax, qword [rbx]
je 0x1802a89b4
lea rcx, [rsp + 0x50]
mov r9, r12
mov qword [rsp + 0x28], rcx
lea r8, [r15 + rbp]
mov rcx, qword [rsp + 0x30]
sub r9, rbp
mov qword [rsp + 0x20], rax
call fcn.1802b58b0
mov rbp, qword [rsp + 0x50]
jmp 0x1802a89d5
mov r9, qword [rsp + 0x58]
lea r8, [rsp + 0x78]
mov rcx, qword [rsp + 0x30]
mov rdx, r14
mov qword [rsp + 0x28], r13
mov qword [rsp + 0x20], rax
call fcn.1802afeb0
test eax, eax
js 0x1802a8a35
mov rax, qword [rbx]
mov ecx, dword [rax + 8]
imul ecx, dword [rsp + 0x38]
test ecx, ecx
je 0x1802a8a23
mov rdx, qword [rsp + 0x40]
xor r8d, r8d
mov r9d, ecx
lea r10, [rdx + rsi*8]
nop word [rax + rax]
mov rax, qword [rbx]
lea r8, [r8 + 1]
mov rdx, qword [rax + 0x10]
mov rax, qword [r10]
mov rcx, qword [rax + 0x10]
movzx eax, byte [rcx + r8 - 1]
xor byte [rdx + r8 - 1], al
sub r9, 1
jne 0x1802a8a00
test edi, edi
jne 0x1802a8970
mov rsi, qword [rsp + 0x30]
jmp 0x1802a8925
mov rsi, qword [rsp + 0x30]
lea r9, str.failed_to_decode_GSPLANES_for_halftone_image
mov r8d, dword [r14]
mov rcx, rsi
mov edx, 2
call fcn.18021cc40
jmp 0x1802a8bd8
xor r13d, r13d
mov ebx, r13d
test r15d, r15d
je 0x1802a8b0b
mov ebp, dword [rsp + 0x38]
mov rdi, r12
mov esi, ebp
add rsi, rsi
nop dword [rax]
nop word [rax + rax]
mov rax, qword [rsp + 0x30]
mov rdx, rsi
mov rax, qword [rax]
mov rcx, rax
call qword [rax]
mov qword [rdi], rax
test rax, rax
je 0x1802a8aaa
inc ebx
add rdi, 8
cmp ebx, r15d
jb 0x1802a8a80
mov rsi, qword [rsp + 0x30]
jmp 0x1802a8b0f
mov rsi, qword [rsp + 0x30]
lea r9, str.failed_to_allocate_GSVALS:__d_bytes
mov r8d, dword [r14]
mov edx, 3
imul ebp, r15d
mov rcx, rsi
mov dword [rsp + 0x20], ebp
call fcn.18021cc40
test ebx, ebx
je 0x1802a8af5
mov eax, ebx
lea rdi, [r12 + rax*8]
nop dword [rax + rax]
mov rax, qword [rsi]
lea rdi, [rdi - 8]
mov rdx, qword [rdi]
mov rcx, rax
call qword [rax + 8]
add ebx, 0xffffffff
jne 0x1802a8ae0
mov rax, qword [rsi]
mov rdx, r12
mov rcx, rax
call qword [rax + 8]
mov qword [rsp + 0x68], r13
jmp 0x1802a8bd8
mov ebp, dword [rsp + 0x38]
mov r9d, r13d
test r15d, r15d
je 0x1802a8bd8
nop dword [rax + rax]
mov r8d, r13d
test ebp, ebp
je 0x1802a8bc7
mov esi, dword [rsp + 0x48]
mov rbx, r13
mov eax, r9d
lea rdi, [r12 + rax*8]
nop dword [rax]
mov rax, qword [rdi]
mov r10d, r13d
mov word [rbx + rax], r13w
test esi, esi
je 0x1802a8bb7
mov r11, qword [rsp + 0x40]
test r9d, r9d
js 0x1802a8b9b
mov rdx, qword [r11]
cmp r9d, dword [rdx]
jge 0x1802a8b9b
test r8d, r8d
js 0x1802a8b9b
cmp r8d, dword [rdx + 4]
jge 0x1802a8b9b
mov ecx, dword [rdx + 8]
mov eax, r9d
imul ecx, r8d
sar eax, 3
add ecx, eax
mov rax, qword [rdx + 0x10]
movsxd rcx, ecx
movzx edx, r9b
and dl, 7
movzx eax, byte [rcx + rax]
mov ecx, 7
sub cl, dl
shr eax, cl
and eax, 1
jmp 0x1802a8b9e
mov eax, r13d
mov rdx, qword [rdi]
mov ecx, r10d
shl ax, cl
inc r10d
add r11, 8
add word [rdx + rbx], ax
cmp r10d, esi
jb 0x1802a8b54
inc r8d
add rbx, 2
cmp r8d, ebp
jb 0x1802a8b40
inc r9d
cmp r9d, r15d
jb 0x1802a8b20
mov rsi, qword [rsp + 0x30]
cmp dword [rsp + 0x110], 0
jne 0x1802a8bfe
mov rax, qword [rsi]
mov rdx, qword [rsp + 0x58]
mov rcx, rax
call qword [rax + 8]
mov rax, qword [rsi]
mov rdx, qword [rsp + 0x70]
mov rcx, rax
call qword [rax + 8]
cmp dword [rsp + 0x48], 0
jbe 0x1802a8c4b
mov rdi, qword [rsp + 0x40]
mov rax, qword [rsp + 0x60]
nop
mov rbx, qword [rdi]
test rbx, rbx
je 0x1802a8c3c
sub dword [rbx + 0x18], 1
jne 0x1802a8c3c
mov rax, qword [rsi]
mov rdx, qword [rbx + 0x10]
mov rcx, rax
call qword [rax + 8]
mov rax, qword [rsi]
mov rdx, rbx
mov rcx, rax
call qword [rax + 8]
mov rax, qword [rsp + 0x60]
add rdi, 8
sub rax, 1
mov qword [rsp + 0x60], rax
jne 0x1802a8c10
mov rax, qword [rsi]
mov rdx, qword [rsp + 0x40]
mov rcx, rax
call qword [rax + 8]
mov rax, qword [rsp + 0x68]
mov rcx, qword [rsp + 0x98]
xor rcx, rsp
call fcn.1804688c0
add rsp, 0xa8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret