Function at 0x1402dd0e0
Capabilities:
Encode data using xor

Disassembly:
push rbx
push rdi
sub rsp, 0x38
mov rbx, rcx
mov rdi, rdx
mov rcx, qword [rcx + 0x248]
test rcx, rcx
je 0x1402ddc3a
mov eax, dword [rbx + 0x168]
and eax, 0x4040
cmp eax, 0x4000
je 0x1402ddc4a
mov edx, dword [rbx + 0x16c]
mov qword [rsp + 0x58], rsi
mov qword [rsp + 0x60], r14
mov qword [rsp + 0x30], r15
mov r15d, 4
lea r14d, [r15 + 3]
bt edx, 0xc
jae 0x1402dd307
movzx eax, byte [rdi + 0x10]
movzx r8d, word [rbx + 0x280]
cmp al, 3
jne 0x1402dd17a
mov r9, qword [rbx + 0x270]
mov eax, r8d
mov dword [rsp + 0x28], eax
lea r8, [rcx + 1]
mov rax, qword [rbx + 0x308]
mov rdx, rdi
mov rcx, rbx
mov qword [rsp + 0x20], rax
call fcn.1402db9f0
jmp 0x1402dd307
test r8w, r8w
je 0x1402dd19e
bt edx, 0x19
jae 0x1402dd19e
lea rdx, [rcx + 1]
mov rcx, rdi
lea r8, [rbx + 0x310]
call fcn.1402db520
jmp 0x1402dd307
mov esi, dword [rdi]
lea rdx, [rcx + 1]
test al, al
jne 0x1402dd307
movzx eax, byte [rdi + 0x11]
cmp al, 8
jae 0x1402dd307
mov ecx, eax
sub ecx, 1
je 0x1402dd2af
sub ecx, 1
je 0x1402dd241
cmp ecx, 2
jne 0x1402dd2fb
lea eax, [rsi - 1]
mov r9d, r15d
mov r8d, eax
lea r10, [rsi - 1]
and eax, 1
shr r8, 1
shl eax, 2
add r8, rdx
sub r9d, eax
add r10, rdx
mov r11d, esi
test esi, esi
je 0x1402dd2fb
nop dword [rax + rax]
movzx edx, byte [r8]
lea r10, [r10 - 1]
movzx ecx, r9b
shr dl, cl
movzx eax, dl
shl dl, 4
and al, 0xf
xor al, dl
mov byte [r10 + 1], al
cmp r9d, r15d
lea rax, [r8 - 1]
cmovne rax, r8
mov r8, rax
xor eax, eax
cmp r9d, r15d
cmovne eax, r15d
mov r9d, eax
sub r11, 1
jne 0x1402dd200
jmp 0x1402dd2fb
lea eax, [rsi - 1]
mov r8d, 6
mov r9d, eax
lea r10, [rsi - 1]
and eax, 3
shr r9, 2
add eax, eax
add r9, rdx
sub r8d, eax
add r10, rdx
mov r11, rsi
test esi, esi
je 0x1402dd2fb
nop
movzx edx, byte [r9]
movzx ecx, r8b
shr dl, cl
and dl, 3
movzx eax, dl
shl al, 2
or al, dl
shl al, 2
or al, dl
shl al, 2
or al, dl
mov byte [r10], al
cmp r8d, 6
jne 0x1402dd2a0
xor r8d, r8d
dec r9
jmp 0x1402dd2a4
add r8d, 2
dec r10
sub r11, 1
jne 0x1402dd270
jmp 0x1402dd2fb
lea eax, [rsi - 1]
mov r10, rsi
mov r8d, eax
lea r9, [rsi - 1]
add r9, rdx
shr r8, 3
add r8, rdx
and eax, r14d
mov edx, r14d
sub edx, eax
test esi, esi
je 0x1402dd2fb
movzx eax, byte [r8]
movzx ecx, dl
shr al, cl
and al, 1
neg al
sbb al, al
mov byte [r9], al
cmp edx, r14d
jne 0x1402dd2f0
xor edx, edx
dec r8
jmp 0x1402dd2f2
inc edx
dec r9
sub r10, 1
jne 0x1402dd2d2
mov byte [rdi + 0x11], 8
mov byte [rdi + 0x13], 8
mov qword [rdi + 8], rsi
mov eax, dword [rbx + 0x16c]
and eax, 0x40080
cmp eax, 0x40000
jne 0x1402dd339
movzx eax, byte [rdi + 0x10]
sub al, r15b
test al, 0xfd
jne 0x1402dd339
mov rdx, qword [rbx + 0x248]
xor r8d, r8d
inc rdx
mov rcx, rdi
call fcn.1402dedb0
test dword [rbx + 0x16c], 0x600000
je 0x1402dd39c
mov r8, qword [rbx + 0x248]
mov rdx, rdi
inc r8
mov rcx, rbx
call fcn.1402dc810
test eax, eax
je 0x1402dd39c
mov eax, dword [rbx + 0x16c]
and eax, 0x600000
mov byte [rbx + 0x3f0], 1
cmp eax, 0x400000
jne 0x1402dd386
lea rdx, str.png_do_rgb_to_gray_found_nongray_pixel
mov rcx, rbx
call fcn.1402e0070
mov eax, dword [rbx + 0x16c]
and eax, 0x600000
cmp eax, 0x200000
je 0x1402ddc5a
test dword [rbx + 0x16c], 0x4000
mov qword [rsp + 0x50], rbp
je 0x1402dd3cb
test dword [rbx + 0x164], 0x800
jne 0x1402dd3cb
mov rdx, qword [rbx + 0x248]
mov rcx, rdi
inc rdx
call fcn.1402dc190
test byte [rbx + 0x16c], 0x80
je 0x1402dd3e9
mov rdx, qword [rbx + 0x248]
mov r8, rbx
inc rdx
mov rcx, rdi
call fcn.1402da310
mov ecx, dword [rbx + 0x16c]
mov eax, ecx
and eax, 0x602000
cmp eax, 0x2000
jne 0x1402dd432
test cl, cl
jns 0x1402dd414
cmp word [rbx + 0x280], 0
jne 0x1402dd432
test byte [rbx + 0x287], r15b
jne 0x1402dd432
cmp byte [rbx + 0x287], 3
je 0x1402dd432
mov rdx, qword [rbx + 0x248]
mov r8, rbx
inc rdx
mov rcx, rdi
call fcn.1402dbcf0
mov eax, dword [rbx + 0x16c]
and eax, 0x40080
cmp eax, 0x40080
jne 0x1402dd464
movzx eax, byte [rdi + 0x10]
sub al, r15b
test al, 0xfd
jne 0x1402dd464
mov rdx, qword [rbx + 0x248]
xor r8d, r8d
inc rdx
mov rcx, rdi
call fcn.1402dedb0
test dword [rbx + 0x16c], 0x800000
mov ebp, 3
je 0x1402dd55f
movzx eax, byte [rdi + 0x10]
test r15b, al
je 0x1402dd55f
movzx ecx, byte [rdi + 0x11]
mov rsi, qword [rbx + 0x248]
mov r8d, dword [rdi]
cmp cl, 8
jne 0x1402dd4e5
mov r10, qword [rbx + 0x2d8]
test r10, r10
je 0x1402dd550
and al, 2
mov r9d, 2
mov edx, r9d
cmovne rdx, r15
add rdx, rsi
test r8d, r8d
je 0x1402dd55f
test al, al
cmovne r9, r15
nop word [rax + rax]
movzx eax, byte [rdx]
movzx ecx, byte [rax + r10]
mov byte [rdx], cl
add rdx, r9
add r8d, 0xffffffff
jne 0x1402dd4d0
jmp 0x1402dd55f
cmp cl, 0x10
jne 0x1402dd550
mov r11, qword [rbx + 0x2e8]
test r11, r11
je 0x1402dd550
and al, 2
mov r9, rbp
cmovne r9, r14
add r9, rsi
test r8d, r8d
je 0x1402dd55f
movzx esi, byte [rbx + 0x2c0]
test al, al
mov r10, r15
mov ecx, 8
cmovne r10, rcx
nop dword [rax]
movzx eax, byte [r9 + 1]
mov rcx, rsi
shr rax, cl
movzx ecx, byte [r9]
mov rax, qword [r11 + rax*8]
movzx edx, word [rax + rcx*2]
movzx eax, dx
mov byte [r9 + 1], dl
shr ax, 8
mov byte [r9], al
add r9, r10
add r8d, 0xffffffff
jne 0x1402dd520
jmp 0x1402dd55f
lea rdx, str.png_do_encode_alpha:_unexpected_call
mov rcx, rbx
call fcn.1402e0070
mov r10d, dword [rbx + 0x16c]
bt r10d, 0x1a
jae 0x1402dd5d2
cmp byte [rdi + 0x11], 0x10
mov rcx, qword [rbx + 0x248]
lea rdx, [rcx + 1]
jne 0x1402dd5d2
mov r9, qword [rdi + 8]
mov r8, rdx
inc r9
add r9, rcx
cmp rdx, r9
jae 0x1402dd5b8
movzx ecx, byte [rdx]
lea r8, [r8 + 1]
movzx eax, byte [rdx + 1]
add rdx, 2
sub eax, ecx
sub eax, 0xffffff80
imul eax, eax, 0xffff
sar eax, 0x18
add ecx, eax
mov byte [r8 - 1], cl
cmp rdx, r9
jb 0x1402dd590
movzx ecx, byte [rdi + 0x12]
movzx eax, cl
mov byte [rdi + 0x11], 8
shl al, 3
imul ecx, dword [rdi]
mov byte [rdi + 0x13], al
mov eax, ecx
mov qword [rdi + 8], rax
bt r10d, 0xa
jae 0x1402dd62c
cmp byte [rdi + 0x11], 0x10
mov r8, qword [rbx + 0x248]
lea rcx, [r8 + 1]
jne 0x1402dd62c
inc r8
mov rdx, rcx
add r8, qword [rdi + 8]
cmp rcx, r8
jae 0x1402dd612
nop dword [rax]
movzx eax, byte [rcx]
add rcx, 2
mov byte [rdx], al
lea rdx, [rdx + 1]
cmp rcx, r8
jb 0x1402dd600
movzx ecx, byte [rdi + 0x12]
movzx eax, cl
mov byte [rdi + 0x11], 8
shl al, 3
imul ecx, dword [rdi]
mov byte [rdi + 0x13], al
mov eax, ecx
mov qword [rdi + 8], rax
test r10b, 0x40
je 0x1402dd65d
mov rdx, qword [rbx + 0x248]
mov rcx, rdi
mov r9, qword [rbx + 0x3a0]
inc rdx
mov r8, qword [rbx + 0x398]
call fcn.1402dc370
cmp qword [rdi + 8], 0
je 0x1402ddc6a
mov r9d, dword [rbx + 0x16c]
bt r9d, 9
jae 0x1402dd6c0
cmp byte [rdi + 0x11], 8
jne 0x1402dd6c0
cmp byte [rdi + 0x10], bpl
je 0x1402dd6c0
mov rcx, qword [rdi + 8]
mov r8, qword [rbx + 0x248]
inc r8
add r8, rcx
lea rdx, [rcx + r8]
cmp rdx, r8
jbe 0x1402dd6a7
movzx eax, byte [r8 - 1]
dec r8
mov byte [rdx - 1], al
add rdx, 0xfffffffffffffffe
mov byte [rdx], al
cmp rdx, r8
ja 0x1402dd691
mov rax, qword [rdi + 8]
add rax, rax
mov byte [rdi + 0x11], reloc.COMCTL32.dll_CreateUpDownControl
mov qword [rdi + 8], rax
movzx eax, byte [rdi + 0x12]
shl al, 4
mov byte [rdi + 0x13], al
bt r9d, 0xe
jae 0x1402dd6e5
test dword [rbx + 0x164], 0x800
je 0x1402dd6e5
mov rdx, qword [rbx + 0x248]
mov rcx, rdi
inc rdx
call fcn.1402dc190
test byte [rbx + 0x16c], 0x20
je 0x1402dd700
mov rdx, qword [rbx + 0x248]
mov rcx, rdi
inc rdx
call fcn.1402dec50
mov r10d, dword [rbx + 0x16c]
bt r10d, 0x13
jae 0x1402dd7fe
mov rcx, qword [rbx + 0x248]
movzx eax, byte [rdi + 0x10]
inc rcx
mov r8d, dword [rdi]
cmp al, 6
jne 0x1402dd791
add rcx, qword [rdi + 8]
cmp byte [rdi + 0x11], 8
jne 0x1402dd75b
mov r9, rcx
test r8d, r8d
je 0x1402dd7fe
mov edx, r8d
movzx eax, byte [rcx - 1]
sub rcx, r15
not al
mov byte [r9 - 1], al
mov r9, rcx
sub rdx, 1
jne 0x1402dd740
jmp 0x1402dd7fe
mov rdx, rcx
test r8d, r8d
je 0x1402dd7fe
mov r9, r8
nop word [rax + rax]
movzx eax, byte [rcx - 1]
not al
mov byte [rdx - 1], al
movzx eax, byte [rcx - 2]
sub rcx, 8
not al
mov byte [rdx - 2], al
mov rdx, rcx
sub r9, 1
jne 0x1402dd770
jmp 0x1402dd7fe
cmp al, r15b
jne 0x1402dd7fe
mov rax, qword [rdi + 8]
add rcx, rax
cmp byte [rdi + 0x11], 8
mov rdx, rcx
jne 0x1402dd7ce
test r8d, r8d
je 0x1402dd7fe
mov r9, r8
nop
movzx eax, byte [rcx - 1]
lea rcx, [rcx - 2]
lea rdx, [rdx - 2]
not al
mov byte [rdx + 1], al
movzx eax, byte [rcx]
mov byte [rdx], al
sub r9, 1
jne 0x1402dd7b0
jmp 0x1402dd7fe
test r8d, r8d
je 0x1402dd7fe
mov r9, r8
nop word [rax + rax]
movzx eax, byte [rcx - 1]
not al
mov byte [rdx - 1], al
movzx eax, byte [rcx - 2]
sub rcx, r15
not al
mov byte [rdx - 2], al
mov rdx, rcx
sub r9, 1
jne 0x1402dd7e0
test r10b, 8
je 0x1402dd81d
mov rdx, qword [rbx + 0x248]
lea r8, [rbx + 0x2fd]
inc rdx
mov rcx, rdi
call fcn.1402dcd40
test byte [rbx + 0x16c], r15b
je 0x1402dd9a3
mov r8, qword [rbx + 0x248]
movzx eax, byte [rdi + 0x11]
inc r8
cmp al, 8
jae 0x1402dd9a3
mov r11d, dword [rdi]
mov ecx, eax
sub ecx, 1
je 0x1402dd926
sub ecx, 1
je 0x1402dd8c8
cmp ecx, 2
jne 0x1402dd988
lea eax, [r11 - 1]
mov r10d, r11d
mov edx, eax
lea r9, [r11 - 1]
add r9, r8
shr rdx, 1
add rdx, r8
and eax, 1
mov r8d, 1
sub r8d, eax
shl r8d, 2
test r11d, r11d
je 0x1402dd988
nop dword [rax + rax]
movzx eax, byte [rdx]
lea r9, [r9 - 1]
movzx ecx, r8b
shr al, cl
and al, 0xf
mov byte [r9 + 1], al
cmp r8d, r15d
lea rax, [rdx - 1]
cmovne rax, rdx
mov rdx, rax
xor eax, eax
cmp r8d, r15d
cmovne eax, r15d
mov r8d, eax
sub r10, 1
jne 0x1402dd890
jmp 0x1402dd988
lea eax, [r11 - 1]
mov r9, r11
mov edx, eax
lea r10, [r11 - 1]
and eax, ebp
shr rdx, 2
sub ebp, eax
add rdx, r8
add ebp, ebp
add r10, r8
test r11d, r11d
je 0x1402dd988
nop
movzx eax, byte [rdx]
lea r10, [r10 - 1]
movzx ecx, bpl
shr al, cl
and al, 3
mov byte [r10 + 1], al
cmp ebp, 6
lea rax, [rdx - 1]
cmovne rax, rdx
xor ecx, ecx
cmp ebp, 6
mov rdx, rax
lea eax, [rbp + 2]
cmovne ecx, eax
mov ebp, ecx
sub r9, 1
jne 0x1402dd8f0
jmp 0x1402dd988
lea eax, [r11 - 1]
mov r9, r11
mov edx, eax
lea r10, [r11 - 1]
shr rdx, 3
and eax, r14d
add rdx, r8
add r10, r8
sub r14d, eax
test r11d, r11d
je 0x1402dd988
nop dword [rax + rax]
movzx eax, byte [rdx]
lea r10, [r10 - 1]
movzx ecx, r14b
shr al, cl
and al, 1
mov byte [r10 + 1], al
cmp r14d, 7
lea rax, [rdx - 1]
cmovne rax, rdx
xor ecx, ecx
cmp r14d, 7
mov rdx, rax
lea eax, [r14 + 1]
cmovne ecx, eax
mov r14d, ecx
sub r9, 1
jne 0x1402dd950
movzx ecx, byte [rdi + 0x12]
movzx eax, cl
mov byte [rdi + 0x11], 8
shl al, 3
imul ecx, r11d
mov byte [rdi + 0x13], al
mov eax, ecx
mov qword [rdi + 8], rax
cmp byte [rdi + 0x10], 3
jne 0x1402dd9bd
cmp dword [rbx + 0x27c], 0
jl 0x1402dd9bd
mov rdx, rdi
mov rcx, rbx
call fcn.1402deab0
test byte [rbx + 0x16c], 1
je 0x1402dd9d8
mov rdx, qword [rbx + 0x248]
mov rcx, rdi
inc rdx
call fcn.1402de9b0
test dword [rbx + 0x16c], 0x10000
je 0x1402dd9f6
mov rdx, qword [rbx + 0x248]
mov rcx, rdi
inc rdx
call fcn.1402ded40
test dword [rbx + 0x16c], 0x8000
je 0x1402dda23
mov rdx, qword [rbx + 0x248]
mov rcx, rdi
movzx r8d, word [rbx + 0x292]
inc rdx
mov r9d, dword [rbx + 0x168]
call fcn.1402dc4f0
mov r11d, dword [rbx + 0x16c]
bt r11d, 0x11
jae 0x1402ddb90
mov rdx, qword [rbx + 0x248]
movzx eax, byte [rdi + 0x10]
inc rdx
mov ecx, dword [rdi]
cmp al, 6
jne 0x1402ddb09
mov r8, qword [rdi + 8]
add r8, rdx
cmp byte [rdi + 0x11], 8
jne 0x1402ddaa1
mov rdx, r8
test ecx, ecx
je 0x1402ddb90
mov r9d, ecx
nop dword [rax + rax]
movzx eax, byte [r8 - 2]
lea rdx, [rdx - 4]
movzx ecx, byte [r8 - 1]
lea r8, [r8 - 4]
mov byte [rdx + 3], al
movzx eax, byte [r8 + 1]
mov byte [rdx + 2], al
movzx eax, byte [r8]
mov byte [rdx + 1], al
mov byte [rdx], cl
sub r9, 1
jne 0x1402dda70
jmp 0x1402ddb90
mov r9, r8
test ecx, ecx
je 0x1402ddb90
mov r10, rcx
nop
movzx eax, byte [r8 - 3]
lea r9, [r9 - 8]
movzx ecx, byte [r8 - 1]
movzx edx, byte [r8 - 2]
lea r8, [r8 - 8]
mov byte [r9 + 7], al
movzx eax, byte [r8 + 4]
mov byte [r9 + 6], al
movzx eax, byte [r8 + 3]
mov byte [r9 + 5], al
movzx eax, byte [r8 + 2]
mov byte [r9 + 4], al
movzx eax, byte [r8 + 1]
mov byte [r9 + 3], al
movzx eax, byte [r8]
mov byte [r9 + 2], al
mov byte [r9 + 1], cl
mov byte [r9], dl
sub r10, 1
jne 0x1402ddab0
jmp 0x1402ddb90
cmp al, r15b
jne 0x1402ddb90
cmp byte [rdi + 0x11], 8
mov rax, qword [rdi + 8]
jne 0x1402ddb4e
add rdx, rax
mov r8, rdx
test ecx, ecx
je 0x1402ddb90
mov r9, rcx
nop dword [rax]
movzx ecx, byte [rdx - 1]
lea rdx, [rdx - 2]
movzx eax, byte [rdx]
mov byte [r8 - 1], al
lea r8, [r8 - 2]
mov byte [r8], cl
sub r9, 1
jne 0x1402ddb30
jmp 0x1402ddb90
lea r8, [rax + rdx]
mov r9, r8
test ecx, ecx
je 0x1402ddb90
mov r10, rcx
nop dword [rax]
movzx eax, byte [r8 - 3]
lea r9, [r9 - 4]
movzx ecx, byte [r8 - 1]
movzx edx, byte [r8 - 2]
lea r8, [r8 - 4]
mov byte [r9 + 3], al
movzx eax, byte [r8]
mov byte [r9 + 2], al
mov byte [r9 + 1], cl
mov byte [r9], dl
sub r10, 1
jne 0x1402ddb60
test r11b, 0x10
je 0x1402ddba8
mov rdx, qword [rbx + 0x248]
mov rcx, rdi
inc rdx
call fcn.1402def60
test dword [rbx + 0x16c], 0x100000
je 0x1402ddc1f
mov rax, qword [rbx + 0x148]
test rax, rax
je 0x1402ddbd2
mov r8, qword [rbx + 0x248]
mov rdx, rdi
inc r8
mov rcx, rbx
call rax
movzx eax, byte [rbx + 0x160]
test al, al
je 0x1402ddbe0
mov byte [rdi + 0x11], al
movzx eax, byte [rbx + 0x161]
test al, al
je 0x1402ddbee
mov byte [rdi + 0x12], al
movzx eax, byte [rdi + 0x11]
movzx ecx, byte [rdi + 0x12]
imul ecx, eax
movzx eax, cl
mov ecx, dword [rdi]
mov byte [rdi + 0x13], al
cmp al, 8
jb 0x1402ddc0f
shr rax, 3
imul rax, rcx
jmp 0x1402ddc1b
imul rax, rcx
add rax, 7
shr rax, 3
mov qword [rdi + 8], rax
mov rbp, qword [rsp + 0x50]
mov rsi, qword [rsp + 0x58]
mov r14, qword [rsp + 0x60]
mov r15, qword [rsp + 0x30]
add rsp, 0x38
pop rdi
pop rbx
ret
lea rdx, str.NULL_row_buffer
mov rcx, rbx
call fcn.1402dfbb0
int3
lea rdx, str.Uninitialized_row
mov rcx, rbx
call fcn.1402dfbb0
int3
lea rdx, str.png_do_rgb_to_gray_found_nongray_pixel
mov rcx, rbx
call fcn.1402dfbb0
int3
lea rdx, str.png_do_quantize_returned_rowbytes0
mov rcx, rbx
call fcn.1402dfbb0
int3