Function at 0x1403207f0
Capabilities:
Encode data using xor

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x38
mov rsi, rcx
mov rax, qword [0x1406a7e00]
xor rax, rsp
mov qword [rsp + 0x30], rax
mov r8d, dword [rcx + 0x2c4]
mov edx, dword [rcx + 0x4b8]
test edx, edx
je 0x140320852
test r8d, r8d
je 0x140320867
lea rcx, [rsp + 0x2c]
mov r9d, 0x186a0
call fcn.1400b2720
test eax, eax
je 0x140320876
mov ecx, dword [rsp + 0x2c]
call fcn.1400b2cf0
or byte [rsi + 0x502], 1
test eax, eax
jne 0x14032087d
jmp 0x1403208a5
test r8d, r8d
je 0x14032088a
mov ecx, r8d
call fcn.1400b2ca0
mov dword [rsi + 0x4b8], eax
jmp 0x14032089e
mov ecx, edx
call fcn.1400b2ca0
mov dword [rsi + 0x2c4], eax
jmp 0x14032089e
or byte [rsi + 0x502], 1
mov eax, 0x2000
or eax, dword [rsi + 0x16c]
jmp 0x1403208b0
mov dword [rsi + 0x4b8], 0x186a0
mov dword [rsi + 0x2c4], 0x186a0
or byte [rsi + 0x502], 1
mov eax, 0xffffdfff
and eax, dword [rsi + 0x16c]
mov dword [rsi + 0x16c], eax
mov ecx, eax
and ecx, 0x40080
cmp ecx, 0x40000
jne 0x1403208e1
and eax, 0xfd7ffeff
mov dword [rsi + 0x16c], eax
and byte [rsi + 0x169], 0xdf
mov word [rsi + 0x280], 0
mov ecx, dword [rsi + 0x2c4]
call fcn.1400b2cf0
mov edx, dword [rsi + 0x16c]
test eax, eax
jne 0x140320909
and edx, 0xff7fffff
mov dword [rsi + 0x16c], edx
and byte [rsi + 0x169], 0xdf
test edx, 0x600000
je 0x14032091f
mov rcx, rsi
call fcn.1400b24f0
mov edx, dword [rsi + 0x16c]
test edx, 0x100
jne 0x14032095b
mov eax, edx
not eax
test eax, 0x4080
jne 0x14032096b
movzx eax, word [rsi + 0x29e]
cmp ax, word [rsi + 0x2a0]
jne 0x14032096b
cmp ax, word [rsi + 0x2a2]
jne 0x14032096b
or byte [rsi + 0x165], 8
mov word [rsi + 0x2a4], ax
jmp 0x14032096b
test byte [rsi + 0x287], 2
jne 0x14032096b
or byte [rsi + 0x165], 8
movzx ecx, byte [rsi + 0x287]
cmp cl, 3
jne 0x1403209cb
movzx ecx, word [rsi + 0x280]
test rcx, rcx
je 0x140320a7d
mov rax, qword [rsi + 0x308]
xor r8d, r8d
xor r9d, r9d
jmp 0x1403209ac
inc r8
cmp rcx, r8
je 0x140320a62
movzx r10d, byte [rax + r8]
cmp r10d, 0xff
je 0x1403209a0
test r10d, r10d
jne 0x140320a90
mov r9d, 1
jmp 0x1403209a0
test cl, 4
jne 0x1403209fa
mov eax, edx
and byte [rsi + 0x169], 0xdf
and eax, 0xff7fffff
cmp word [rsi + 0x280], 0
mov dword [rsi + 0x16c], eax
jne 0x1403209fc
and edx, 0xff7ffe7f
mov dword [rsi + 0x16c], edx
mov eax, edx
mov edx, eax
not edx
test edx, 0x1100
jne 0x140320c01
and cl, 2
jne 0x140320c01
movzx edx, word [rsi + 0x2a4]
movzx ecx, word [rsi + 0x318]
movzx r8d, byte [rsi + 0x288]
cmp r8d, 4
je 0x140320b0d
cmp r8d, 2
je 0x140320b29
cmp r8d, 1
jne 0x140320b2f
mov r8d, edx
shl r8d, 8
sub r8d, edx
mov r9d, ecx
shl r9d, 8
sub r9d, ecx
jmp 0x140320b21
mov eax, edx
and eax, 0xff7fffff
mov dword [rsi + 0x16c], eax
and byte [rsi + 0x169], 0xdf
test r9d, r9d
jne 0x140320a92
jmp 0x140320a84
and byte [rsi + 0x169], 0xdf
and edx, 0xff7ffe7f
mov dword [rsi + 0x16c], edx
mov eax, edx
mov edx, eax
not edx
test edx, 0x1100
jne 0x140320c01
mov rdx, qword [rsi + 0x270]
movzx r8d, byte [rsi + 0x29c]
lea r8, [r8 + r8*2]
movzx r9d, word [rdx + r8]
movd xmm0, r9d
pxor xmm1, xmm1
punpcklbw xmm0, xmm1
movd dword [rsi + 0x29e], xmm0
movzx edx, byte [rdx + r8 + 2]
mov word [rsi + 0x2a2], dx
test rcx, rcx
je 0x140320c01
mov edx, eax
and edx, 0x2080000
cmp edx, 0x80000
jne 0x140320c01
mov rax, qword [rsi + 0x308]
cmp cx, 8
jae 0x140320b69
xor edx, edx
jmp 0x140320bf0
mov r8d, edx
shl r8d, 4
add r8d, edx
mov r9d, ecx
shl r9d, 4
add r9d, ecx
mov edx, r8d
mov ecx, r9d
jmp 0x140320b2f
imul edx, edx, 0x55
imul ecx, ecx, 0x55
mov word [rsi + 0x2a2], dx
mov word [rsi + 0x2a0], dx
mov word [rsi + 0x29e], dx
test eax, 0x2000000
jne 0x140320c01
mov word [rsi + 0x316], cx
mov word [rsi + 0x314], cx
mov word [rsi + 0x312], cx
jmp 0x140320c01
cmp cx, 0x20
jae 0x140320b73
xor edx, edx
jmp 0x140320bb5
mov edx, ecx
and edx, 0xffffffe0
xor r8d, r8d
pcmpeqd xmm0, xmm0
nop
movdqu xmm1, xmmword [rax + r8]
movdqu xmm2, xmmword [rax + r8 + 0x10]
pxor xmm1, xmm0
pxor xmm2, xmm0
movdqu xmmword [rax + r8], xmm1
movdqu xmmword [rax + r8 + 0x10], xmm2
add r8, 0x20
cmp rdx, r8
jne 0x140320b80
cmp rdx, rcx
je 0x140320bfb
test cl, 0x18
je 0x140320bf0
mov r8, rdx
mov edx, ecx
and edx, 0xfffffff8
pcmpeqd xmm0, xmm0
nop word cs:[rax + rax]
movq xmm1, qword [rax + r8]
pxor xmm1, xmm0
movq qword [rax + r8], xmm1
add r8, 8
cmp rdx, r8
jne 0x140320bd0
cmp rdx, rcx
je 0x140320bfb
nop
not byte [rax + rdx]
inc rdx
cmp rcx, rdx
jne 0x140320bf0
mov eax, dword [rsi + 0x16c]
mov ecx, eax
and ecx, 0x380
cmp ecx, 0x280
jne 0x140320c50
cmp byte [rsi + 0x288], 0x10
je 0x140320c50
movq xmm0, qword [rsi + 0x29e]
pxor xmm1, xmm1
punpcklwd xmm0, xmm1
movdqa xmm1, xmm0
pslld xmm1, 8
psubd xmm1, xmm0
paddd xmm1, xmmword [0x1405d3a00]
psrld xmm1, 0x10
packssdw xmm1, xmm1
movq qword [rsi + 0x29e], xmm1
mov ecx, eax
and ecx, 0x80
test eax, 0x4000400
je 0x140320c8e
test ecx, ecx
je 0x140320c8e
mov edx, eax
and edx, 0x100
jne 0x140320c8e
cmp byte [rsi + 0x288], 0x10
jne 0x140320c8e
movq xmm0, qword [rsi + 0x29e]
pmullw xmm0, xmmword [0x1405d3a10]
movq qword [rsi + 0x29e], xmm0
movzx edx, word [rsi + 0x2a4]
mov word [rsi + 0x2ae], dx
mov rdx, qword [rsi + 0x29c]
mov qword [rsi + 0x2a6], rdx
test eax, 0x2000
jne 0x140320d44
test eax, 0x600000
je 0x140320ce5
mov ecx, dword [rsi + 0x4b8]
call fcn.1400b2cf0
test eax, eax
jne 0x140320d44
mov ecx, dword [rsi + 0x2c4]
call fcn.1400b2cf0
test eax, eax
jne 0x140320d44
mov ecx, 0x80
and ecx, dword [rsi + 0x16c]
test ecx, ecx
je 0x140320d1f
mov ecx, dword [rsi + 0x4b8]
call fcn.1400b2cf0
test eax, eax
jne 0x140320d44
mov ecx, dword [rsi + 0x2c4]
call fcn.1400b2cf0
test eax, eax
jne 0x140320d44
cmp byte [rsi + 0x294], 3
jne 0x140320d1f
mov ecx, dword [rsi + 0x298]
call fcn.1400b2cf0
test eax, eax
jne 0x140320d44
mov ecx, dword [rsi + 0x16c]
test ecx, 0x800000
je 0x1403214ea
mov ecx, dword [rsi + 0x2c4]
call fcn.1400b2cf0
test eax, eax
je 0x1403214e4
movzx edx, byte [rsi + 0x288]
mov rcx, rsi
call fcn.1400b3020
mov ecx, dword [rsi + 0x16c]
test cl, cl
js 0x140320dfd
cmp byte [rsi + 0x287], 3
jne 0x1403212ed
test ecx, 0x1000
je 0x140320d83
mov eax, ecx
and eax, 0x600000
jne 0x1403212ed
movzx edx, word [rsi + 0x278]
test rdx, rdx
je 0x140320df2
mov rax, qword [rsi + 0x270]
lea rcx, [rdx + rdx*2]
xor edx, edx
nop dword [rax]
mov r8, qword [rsi + 0x2c8]
movzx r9d, byte [rax + rdx]
movzx r8d, byte [r8 + r9]
mov byte [rax + rdx], r8b
mov r8, qword [rsi + 0x2c8]
movzx r9d, byte [rax + rdx + 1]
movzx r8d, byte [r8 + r9]
mov byte [rax + rdx + 1], r8b
mov r8, qword [rsi + 0x2c8]
movzx r9d, byte [rax + rdx + 2]
movzx r8d, byte [r8 + r9]
mov byte [rax + rdx + 2], r8b
add rdx, 3
cmp rcx, rdx
jne 0x140320da0
mov ecx, dword [rsi + 0x16c]
and ecx, 0xffffdfff
jmp 0x1403212e7
test ecx, 0x600000
je 0x140320e14
lea rdx, str.libpng_does_not_support_gammabackgroundrgb_to_gray
mov rcx, rsi
call fcn.1400b4440
cmp byte [rsi + 0x287], 3
jne 0x140320eb1
mov r13, qword [rsi + 0x270]
movzx ebx, word [rsi + 0x278]
movzx eax, byte [rsi + 0x294]
mov ebp, 0x186a0
cmp eax, 1
je 0x140321066
cmp eax, 3
je 0x14032106f
mov r14d, 0x186a0
cmp eax, 2
jne 0x140321090
movzx eax, word [rsi + 0x29e]
mov rcx, qword [rsi + 0x2c8]
mov rdx, qword [rsi + 0x2e0]
movzx edi, byte [rcx + rax]
movzx r8d, word [rsi + 0x2a0]
movzx r9d, byte [rcx + r8]
mov byte [rsp + 0x2b], r9b
movzx r9d, word [rsi + 0x2a2]
movzx ebp, byte [rcx + r9]
movzx r15d, byte [rdx + rax]
movzx r12d, byte [rdx + r8]
movzx eax, byte [rdx + r9]
test rbx, rbx
jne 0x140321148
jmp 0x1403212dc
movzx eax, byte [rsi + 0x294]
cmp eax, 3
je 0x140320ed8
cmp eax, 2
je 0x140320ef3
cmp eax, 1
jne 0x14032162d
mov ebx, dword [rsi + 0x2c4]
mov edi, 0x186a0
jmp 0x140320f13
mov ecx, dword [rsi + 0x298]
call fcn.1400b2ca0
mov ebx, eax
mov ecx, dword [rsi + 0x298]
mov edx, dword [rsi + 0x2c4]
jmp 0x140320f0c
mov ecx, dword [rsi + 0x4b8]
call fcn.1400b2ca0
mov ebx, eax
mov edx, dword [rsi + 0x2c4]
mov ecx, dword [rsi + 0x4b8]
call fcn.1400b2d10
mov edi, eax
mov ecx, ebx
call fcn.1400b2cf0
mov r14d, eax
mov ecx, edi
call fcn.1400b2cf0
mov ebp, eax
test r14d, r14d
je 0x140320f44
movzx edx, word [rsi + 0x2a4]
mov rcx, rsi
mov r8d, ebx
call fcn.1400b2dd0
mov word [rsi + 0x2ae], ax
test ebp, ebp
je 0x140320f61
movzx edx, word [rsi + 0x2a4]
mov rcx, rsi
mov r8d, edi
call fcn.1400b2dd0
mov word [rsi + 0x2a4], ax
movzx eax, word [rsi + 0x29e]
cmp ax, word [rsi + 0x2a0]
jne 0x140320fb9
cmp ax, word [rsi + 0x2a2]
jne 0x140320fb9
cmp ax, word [rsi + 0x2a4]
jne 0x140320fb9
movzx ecx, word [rsi + 0x2ae]
mov word [rsi + 0x2ac], cx
mov word [rsi + 0x2aa], cx
mov word [rsi + 0x2a8], cx
mov word [rsi + 0x2a2], ax
mov word [rsi + 0x2a0], ax
mov word [rsi + 0x29e], ax
jmp 0x140321054
test r14d, r14d
je 0x140321005
movzx edx, ax
mov rcx, rsi
mov r8d, ebx
call fcn.1400b2dd0
mov word [rsi + 0x2a8], ax
movzx edx, word [rsi + 0x2a0]
mov rcx, rsi
mov r8d, ebx
call fcn.1400b2dd0
mov word [rsi + 0x2aa], ax
movzx edx, word [rsi + 0x2a2]
mov rcx, rsi
mov r8d, ebx
call fcn.1400b2dd0
mov word [rsi + 0x2ac], ax
test ebp, ebp
je 0x140321054
movzx edx, word [rsi + 0x29e]
mov rcx, rsi
mov r8d, edi
call fcn.1400b2dd0
mov word [rsi + 0x29e], ax
movzx edx, word [rsi + 0x2a0]
mov rcx, rsi
mov r8d, edi
call fcn.1400b2dd0
mov word [rsi + 0x2a0], ax
movzx edx, word [rsi + 0x2a2]
mov rcx, rsi
mov r8d, edi
call fcn.1400b2dd0
mov word [rsi + 0x2a2], ax
mov byte [rsi + 0x294], 1
mov ecx, dword [rsi + 0x16c]
jmp 0x1403212ed
mov r14d, dword [rsi + 0x2c4]
jmp 0x140321090
mov ecx, dword [rsi + 0x298]
call fcn.1400b2ca0
mov r14d, eax
mov ecx, dword [rsi + 0x298]
mov edx, dword [rsi + 0x2c4]
call fcn.1400b2d10
mov ebp, eax
mov ecx, ebp
call fcn.1400b2cf0
movzx edi, word [rsi + 0x29e]
test eax, eax
je 0x1403210d1
mov ecx, edi
mov edx, ebp
call fcn.1400b2d70
mov edi, eax
movzx ecx, word [rsi + 0x2a0]
mov edx, ebp
call fcn.1400b2d70
mov byte [rsp + 0x2b], al
movzx ecx, word [rsi + 0x2a2]
mov edx, ebp
call fcn.1400b2d70
mov ebp, eax
jmp 0x1403210e3
movzx eax, byte [rsi + 0x2a0]
mov byte [rsp + 0x2b], al
movzx ebp, byte [rsi + 0x2a2]
mov ecx, r14d
call fcn.1400b2cf0
movzx r15d, word [rsi + 0x29e]
test eax, eax
je 0x140321130
mov ecx, r15d
mov edx, r14d
call fcn.1400b2d70
mov r15d, eax
movzx ecx, word [rsi + 0x2a0]
mov edx, r14d
call fcn.1400b2d70
mov r12d, eax
movzx ecx, word [rsi + 0x2a2]
mov edx, r14d
call fcn.1400b2d70
test rbx, rbx
jne 0x140321148
jmp 0x1403212dc
movzx r12d, byte [rsi + 0x2a0]
movzx eax, byte [rsi + 0x2a2]
test rbx, rbx
je 0x1403212dc
add r13, 2
xor ecx, ecx
movzx r15d, r15b
movzx r8d, r12b
movzx r12d, al
jmp 0x1403211ac
mov rax, qword [rsi + 0x2c8]
movzx edx, byte [r13 - 2]
movzx eax, byte [rax + rdx]
mov byte [r13 - 2], al
mov rax, qword [rsi + 0x2c8]
movzx edx, byte [r13 - 1]
movzx eax, byte [rax + rdx]
mov byte [r13 - 1], al
mov rax, qword [rsi + 0x2c8]
movzx edx, byte [r13]
movzx eax, byte [rax + rdx]
mov byte [r13], al
inc rcx
add r13, 3
cmp rbx, rcx
je 0x1403212dc
movzx r9d, word [rsi + 0x280]
cmp rcx, r9
jae 0x140321160
mov r9, qword [rsi + 0x308]
movzx r9d, byte [r9 + rcx]
cmp r9d, 0xff
je 0x140321160
test r9d, r9d
jne 0x1403211e6
mov byte [r13 - 2], dil
movzx eax, byte [rsp + 0x2b]
mov byte [r13 - 1], al
mov byte [r13], bpl
jmp 0x14032119c
mov r10, qword [rsi + 0x2d8]
mov r11, qword [rsi + 0x2e0]
movzx r14d, byte [r13 - 2]
movzx r11d, byte [r11 + r14]
imul r11d, r9d
not r9b
movzx r9d, r9b
imul r9d, r15d
lea r14d, [r9 + r11]
lea edx, [r9 + r11]
add edx, 0x80
movzx edx, dh
lea edx, [rdx + r14 + 0x80]
movzx edx, dh
movzx edx, byte [r10 + rdx]
mov byte [r13 - 2], dl
mov rdx, qword [rsi + 0x2d8]
mov r9, qword [rsi + 0x2e0]
movzx r10d, byte [r13 - 1]
movzx r9d, byte [r9 + r10]
mov r10, qword [rsi + 0x308]
movzx r10d, byte [r10 + rcx]
imul r9d, r10d
xor r10d, 0xff
imul r10d, r8d
lea r11d, [r10 + r9]
lea eax, [r10 + r9]
add eax, 0x80
movzx eax, ah
lea eax, [rax + r11 + 0x80]
movzx eax, ah
movzx eax, byte [rdx + rax]
mov byte [r13 - 1], al
mov rax, qword [rsi + 0x2d8]
mov rdx, qword [rsi + 0x2e0]
movzx r9d, byte [r13]
movzx edx, byte [rdx + r9]
mov r9, qword [rsi + 0x308]
movzx r9d, byte [r9 + rcx]
imul edx, r9d
xor r9d, 0xff
imul r9d, r12d
lea r10d, [r9 + rdx]
add edx, r9d
add edx, 0x80
movzx edx, dh
add edx, r10d
add edx, 0x80
movzx edx, dh
jmp 0x140321194
mov ecx, 0xffffdf7f
and ecx, dword [rsi + 0x16c]
mov dword [rsi + 0x16c], ecx
mov eax, ecx
and eax, 0x1008
cmp eax, 8
jne 0x1403214c5
cmp byte [rsi + 0x287], 3
jne 0x1403214c5
movzx r9d, word [rsi + 0x278]
movzx edx, r9w
movzx r8d, byte [rsi + 0x2f8]
mov eax, 8
and ecx, 0xfffffff7
mov dword [rsi + 0x16c], ecx
lea ecx, [r8 - 1]
cmp cl, 6
ja 0x1403213af
test r9w, r9w
je 0x1403213af
mov ecx, 8
sub ecx, r8d
cmp dx, 1
jne 0x14032134e
xor r8d, r8d
jmp 0x140321393
mov r9d, edx
and r9d, 0xfffffffe
xor r10d, r10d
xor r8d, r8d
nop dword [rax + rax]
mov r11, qword [rsi + 0x270]
movzx edi, byte [r11 + r10]
shr edi, cl
mov byte [r11 + r10], dil
mov r11, qword [rsi + 0x270]
movzx edi, byte [r11 + r10 + 3]
shr edi, cl
mov byte [r11 + r10 + 3], dil
add r8, 2
add r10, 6
cmp r9, r8
jne 0x140321360
test dl, 1
je 0x1403213af
mov r9, qword [rsi + 0x270]
lea r8, [r8 + r8*2]
movzx r10d, byte [r9 + r8]
shr r10d, cl
mov byte [r9 + r8], r10b
movzx ecx, byte [rsi + 0x2f9]
lea r8d, [rcx - 1]
cmp r8b, 6
ja 0x140321437
test dx, dx
je 0x140321437
sub eax, ecx
cmp dx, 1
jne 0x1403213d2
xor r8d, r8d
jmp 0x140321417
mov r9d, edx
and r9d, 0xfffffffe
xor r10d, r10d
xor r8d, r8d
nop
mov r11, qword [rsi + 0x270]
movzx edi, byte [r11 + r10 + 1]
mov ecx, eax
shr edi, cl
mov byte [r11 + r10 + 1], dil
mov r11, qword [rsi + 0x270]
movzx edi, byte [r11 + r10 + 4]
shr edi, cl
mov byte [r11 + r10 + 4], dil
add r8, 2
add r10, 6
cmp r9, r8
jne 0x1403213e0
test dl, 1
je 0x140321437
mov r9, qword [rsi + 0x270]
lea r8, [r8 + r8*2]
movzx r10d, byte [r9 + r8 + 1]
mov ecx, eax
shr r10d, cl
mov byte [r9 + r8 + 1], r10b
movzx eax, byte [rsi + 0x2fa]
lea ecx, [rax - 1]
cmp cl, 6
ja 0x1403214c5
test dx, dx
je 0x1403214c5
mov ecx, 8
sub ecx, eax
cmp dx, 1
jne 0x14032145c
xor eax, eax
jmp 0x1403214a7
mov r8d, edx
and r8d, 0xfffffffe
xor r9d, r9d
xor eax, eax
nop dword [rax + rax]
mov r10, qword [rsi + 0x270]
movzx r11d, byte [r10 + r9 + 2]
shr r11d, cl
mov byte [r10 + r9 + 2], r11b
mov r10, qword [rsi + 0x270]
movzx r11d, byte [r10 + r9 + 5]
shr r11d, cl
mov byte [r10 + r9 + 5], r11b
add rax, 2
add r9, 6
cmp r8, rax
jne 0x140321470
test dl, 1
je 0x1403214c5
mov rdx, qword [rsi + 0x270]
lea rax, [rax + rax*2]
movzx r8d, byte [rdx + rax + 2]
shr r8d, cl
mov byte [rdx + rax + 2], r8b
mov rcx, qword [rsp + 0x30]
xor rcx, rsp
call fcn.1405602f0
nop
add rsp, 0x38
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov ecx, dword [rsi + 0x16c]
test cl, cl
jns 0x1403212ed
cmp byte [rsi + 0x287], 3
jne 0x1403212ed
movzx eax, word [rsi + 0x280]
test rax, rax
je 0x140321622
mov rcx, qword [rsi + 0x270]
movzx r12d, word [rsi + 0x29e]
movzx r11d, r12b
movzx r8d, word [rsi + 0x2a0]
movzx edi, r8b
movzx r9d, word [rsi + 0x2a2]
movzx ebx, r9b
add rcx, 2
xor r10d, r10d
movzx r11d, r11w
movzx edi, di
movzx ebx, bx
jmp 0x1403215f3
movzx r14d, bp
movzx r15d, byte [rcx - 2]
imul r15d, r14d
not bpl
movzx r14d, bpl
imul r14d, r11d
lea ebp, [r14 + r15]
add ebp, 0x80
movzx ebp, bp
mov edx, ebp
shr edx, 8
add edx, ebp
mov byte [rcx - 2], dh
movzx edx, byte [rcx - 1]
mov r14, qword [rsi + 0x308]
movzx r14d, byte [r14 + r10]
imul edx, r14d
xor r14d, 0xff
imul r14d, edi
add edx, r14d
add edx, 0x80
movzx ebp, dx
mov edx, ebp
shr edx, 8
add edx, ebp
mov byte [rcx - 1], dh
movzx edx, byte [rcx]
mov r14, qword [rsi + 0x308]
movzx r14d, byte [r14 + r10]
imul edx, r14d
xor r14d, 0xff
imul r14d, ebx
add edx, r14d
add edx, 0x80
movzx ebp, dx
mov edx, ebp
shr edx, 8
add edx, ebp
mov byte [rcx], dh
inc r10
add rcx, 3
cmp rax, r10
je 0x14032161c
mov r14, qword [rsi + 0x308]
movzx ebp, byte [r14 + r10]
cmp ebp, 0xff
je 0x1403215e7
test ebp, ebp
jne 0x140321550
mov byte [rcx - 2], r12b
mov byte [rcx - 1], r8b
mov byte [rcx], r9b
jmp 0x1403215e7
mov ecx, dword [rsi + 0x16c]
and ecx, 0xffffff7f
jmp 0x1403212e7
lea rdx, str.invalid_background_gamma_type
mov rcx, rsi
call fcn.1400b41d0
int3