Function at 0x1802711d0
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 [0x18066dcd8]
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 0x180271292
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.1801e5770
xor eax, eax
jmp 0x1802717de
xor edi, edi
test ebx, ebx
je 0x1802712d4
mov rbx, rax
nop dword [rax + rax]
mov r8d, dword [rsp + 0x38]
mov edx, dword [rsp + 0x4c]
mov rcx, qword [rsp + 0x30]
call fcn.180251ca0
mov qword [rbx], rax
test rax, rax
je 0x180271376
inc edi
add rbx, 8
cmp edi, dword [rsp + 0x48]
jb 0x1802712a0
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 0x1802713f7
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.18027e680
mov rbp, qword [rsp + 0x50]
mov rbx, qword [rsp + 0x40]
jmp 0x180271481
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.1801e5770
test edi, edi
je 0x1802713e2
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 0x1802713de
sub dword [rbx + 0x18], 1
jne 0x1802713de
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 0x1802713b0
mov rax, qword [r14]
mov rdx, qword [rsp + 0x40]
mov rcx, rax
call qword [rax + 8]
xor eax, eax
jmp 0x1802717de
mov r8, r12
mov rdx, r15
mov rcx, rsi
call fcn.1801e60c0
mov qword [rsp + 0x70], rax
mov rcx, rsi
test rax, rax
jne 0x180271429
mov r8d, dword [r14]
lea r9, str.failed_to_allocate_word_stream_when_decoding_gray_scale_image
lea edx, [rax + 2]
call fcn.1801e5770
jmp 0x180271762
mov rdx, rax
call fcn.18027d690
mov qword [rsp + 0x58], rax
mov rcx, rax
test rax, rax
jne 0x180271458
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.1801e5770
jmp 0x180271762
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.180278bb0
test eax, eax
jns 0x1802714a1
mov r8d, dword [r14]
lea r9, str.error_decoding_GSPLANES_for_halftone_image
mov edx, 2
mov rcx, rsi
call fcn.1801e5770
jmp 0x180271758
test edi, edi
jne 0x1802714f5
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 0x1802715d6
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.1801e5770
jmp 0x180271758
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 0x180271534
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.18027e680
mov rbp, qword [rsp + 0x50]
jmp 0x180271555
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.180278bb0
test eax, eax
js 0x1802715b5
mov rax, qword [rbx]
mov ecx, dword [rax + 8]
imul ecx, dword [rsp + 0x38]
test ecx, ecx
je 0x1802715a3
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 0x180271580
test edi, edi
jne 0x1802714f0
mov rsi, qword [rsp + 0x30]
jmp 0x1802714a5
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.1801e5770
jmp 0x180271758
xor r13d, r13d
mov ebx, r13d
test r15d, r15d
je 0x18027168b
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 0x18027162a
inc ebx
add rdi, 8
cmp ebx, r15d
jb 0x180271600
mov rsi, qword [rsp + 0x30]
jmp 0x18027168f
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.1801e5770
test ebx, ebx
je 0x180271675
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 0x180271660
mov rax, qword [rsi]
mov rdx, r12
mov rcx, rax
call qword [rax + 8]
mov qword [rsp + 0x68], r13
jmp 0x180271758
mov ebp, dword [rsp + 0x38]
mov r9d, r13d
test r15d, r15d
je 0x180271758
nop dword [rax + rax]
mov r8d, r13d
test ebp, ebp
je 0x180271747
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 0x180271737
mov r11, qword [rsp + 0x40]
test r9d, r9d
js 0x18027171b
mov rdx, qword [r11]
cmp r9d, dword [rdx]
jge 0x18027171b
test r8d, r8d
js 0x18027171b
cmp r8d, dword [rdx + 4]
jge 0x18027171b
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 0x18027171e
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 0x1802716d4
inc r8d
add rbx, 2
cmp r8d, ebp
jb 0x1802716c0
inc r9d
cmp r9d, r15d
jb 0x1802716a0
mov rsi, qword [rsp + 0x30]
cmp dword [rsp + 0x110], 0
jne 0x18027177e
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 0x1802717cb
mov rdi, qword [rsp + 0x40]
mov rax, qword [rsp + 0x60]
nop
mov rbx, qword [rdi]
test rbx, rbx
je 0x1802717bc
sub dword [rbx + 0x18], 1
jne 0x1802717bc
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 0x180271790
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.18042cdf0
add rsp, 0xa8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret