Function at 0x140003850
Capabilities:
Write file on windows

Disassembly:
push rbx
push rsi
push rdi
sub rsp, 0x50
movzx eax, word [0x14000d0d4]
mov rsi, rdx
mov rbx, rcx
cmp eax, 2
je 0x140003881
cmp eax, 5
lea rdi, str.Gray
lea rcx, str.CMYK
cmove rdi, rcx
jmp 0x140003888
lea rdi, [0x14000aa30]
mov rdx, rbx
lea rcx, str.__PostScript_Level_2_only._n
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputs]
cmp word [0x14000d0d4], 3
je 0x1400038bc
mov r8, rdi
lea rdx, str._Device_s_setcolorspace_n
mov rcx, rbx
call fcn.140005670
add rsp, 0x50
pop rdi
pop rsi
pop rbx
ret
movzx ecx, byte [0x14000d0cc]
lea rax, [rsp + 0x88]
mov edi, 1
mov qword [rsp + 0x20], rax
shl edi, cl
lea r9, [rsp + 0x30]
mov rcx, rsi
lea r8, [rsp + 0x80]
mov edx, 0x140
call sub.tiff.dll_TIFFGetField
test eax, eax
jne 0x140003910
mov rcx, qword [0x14000d0a8]
lea rdx, str.Palette_image_w_o__Colormap__tag
call sub.tiff.dll_TIFFError
add rsp, 0x50
pop rdi
pop rsi
pop rbx
ret
mov rax, qword [rsp + 0x88]
mov edx, edi
mov r9, qword [rsp + 0x30]
mov rcx, rsi
mov r8, qword [rsp + 0x80]
mov qword [rsp + 0x70], rbp
mov qword [rsp + 0x20], rax
mov qword [rsp + 0x78], r14
movsxd rbp, edi
call fcn.1400051c0
xor esi, esi
cmp eax, 0x10
jne 0x140003be0
mov r9d, esi
test edi, edi
jle 0x140003b3c
cmp edi, 4
jb 0x140003b3c
cmp dword [0x14000d030], 2
jl 0x140003b3c
mov rdx, qword [rsp + 0x88]
lea eax, [rdi - 1]
movsxd rcx, eax
mov rax, qword [rsp + 0x30]
lea r10, [rdx + rcx*2]
lea r14, [rax + rcx*2]
cmp rdx, r14
ja 0x140003996
cmp r10, rax
jae 0x140003b3c
mov r8, qword [rsp + 0x80]
lea r11, [r8 + rcx*2]
cmp rdx, r11
ja 0x1400039b0
cmp r10, r8
jae 0x140003b44
cmp rax, r11
ja 0x1400039be
cmp r14, r8
jae 0x140003b44
movaps xmmword [rsp + 0x40], xmm6
mov ecx, edi
and ecx, 0x80000003
jge 0x1400039d4
dec ecx
or ecx, 0xfffffffc
inc ecx
mov rdx, qword [rsp + 0x88]
mov eax, edi
movdqa xmm4, xmmword [0x14000b360]
sub eax, ecx
mov rcx, qword [rsp + 0x80]
mov r8, rsi
movdqa xmm3, xmmword [0x14000b380]
movsxd r10, eax
mov eax, 0xf
movd xmm5, eax
mov eax, 0x1f
movd xmm6, eax
mov rax, qword [rsp + 0x30]
sub rcx, rax
sub rdx, rax
nop dword [rax + rax]
movq xmm0, qword [rcx + rax]
lea rax, [rax + 8]
pmovzxwd xmm1, xmm0
pmulld xmm1, xmm4
movdqa xmm2, xmm1
movdqa xmm0, xmm1
punpckhdq xmm0, xmm1
add r9d, 4
punpckldq xmm2, xmm1
add r8, 4
pmuldq xmm0, xmm3
pmuldq xmm2, xmm3
shufps xmm2, xmm0, 0xdd
paddd xmm2, xmm1
psrad xmm2, xmm5
movdqa xmm0, xmm2
psrld xmm0, xmm6
paddd xmm0, xmm2
pshuflw xmm0, xmm0, 0xd8
pshufhw xmm1, xmm0, 0xd8
movq xmm0, qword [rax - 8]
pshufd xmm2, xmm1, 0xd8
movq qword [rcx + rax - 8], xmm2
pmovzxwd xmm1, xmm0
pmulld xmm1, xmm4
movdqa xmm2, xmm1
movdqa xmm0, xmm1
punpckhdq xmm0, xmm1
punpckldq xmm2, xmm1
pmuldq xmm0, xmm3
pmuldq xmm2, xmm3
shufps xmm2, xmm0, 0xdd
paddd xmm2, xmm1
psrad xmm2, xmm5
movdqa xmm0, xmm2
psrld xmm0, xmm6
paddd xmm0, xmm2
pshuflw xmm0, xmm0, 0xd8
pshufhw xmm1, xmm0, 0xd8
movq xmm0, qword [rdx + rax - 8]
pshufd xmm2, xmm1, 0xd8
movq qword [rax - 8], xmm2
pmovzxwd xmm1, xmm0
pmulld xmm1, xmm4
movdqa xmm2, xmm1
movdqa xmm0, xmm1
punpckldq xmm2, xmm1
punpckhdq xmm0, xmm1
pmuldq xmm0, xmm3
pmuldq xmm2, xmm3
shufps xmm2, xmm0, 0xdd
paddd xmm2, xmm1
psrad xmm2, xmm5
movdqa xmm0, xmm2
psrld xmm0, xmm6
paddd xmm0, xmm2
pshuflw xmm0, xmm0, 0xd8
pshufhw xmm1, xmm0, 0xd8
pshufd xmm2, xmm1, 0xd8
movq qword [rdx + rax - 8], xmm2
cmp r8, r10
jl 0x140003a20
movaps xmm6, xmmword [rsp + 0x40]
mov r8, qword [rsp + 0x80]
movsxd r9, r9d
cmp r9, rbp
jge 0x140003be0
movzx eax, word [r8 + r9*2]
imul ecx, eax, 0xff
mov eax, 0x80008001
imul ecx
add edx, ecx
sar edx, 0xf
mov eax, edx
shr eax, 0x1f
add edx, eax
mov word [r8 + r9*2], dx
mov rax, qword [rsp + 0x30]
lea r8, [rax + r9*2]
movzx eax, word [rax + r9*2]
imul ecx, eax, 0xff
mov eax, 0x80008001
imul ecx
add edx, ecx
sar edx, 0xf
mov eax, edx
shr eax, 0x1f
add edx, eax
mov word [r8], dx
mov rax, qword [rsp + 0x88]
lea r8, [rax + r9*2]
inc r9
movzx eax, word [r8]
imul ecx, eax, 0xff
mov eax, 0x80008001
imul ecx
add edx, ecx
sar edx, 0xf
mov eax, edx
shr eax, 0x1f
add edx, eax
mov word [r8], dx
cmp r9, rbp
jge 0x140003be0
mov r8, qword [rsp + 0x80]
jmp 0x140003b50
lea r8d, [rdi - 1]
mov rcx, rbx
lea rdx, str.___Indexed__DeviceRGB__d
call fcn.140005670
cmp dword [0x14000d070], esi
mov rdx, rbx
je 0x140003c24
lea rcx, [0x14000aac4]
mov dword [0x14000d6f8], 0x48
mov dword [0x14000d6fc], esi
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputs]
sub dword [0x14000d6f8], 2
jmp 0x140003c31
lea rcx, [0x14000aac8]
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputs]
test edi, edi
jle 0x140003cf1
mov rdi, rsi
lea r14, [0x14000aacc]
cmp dword [0x14000d070], 0
je 0x140003c87
mov rax, qword [rsp + 0x80]
mov rdx, rbx
movzx ecx, byte [rax + rdi*2]
call fcn.140001360
mov rax, qword [rsp + 0x30]
mov rdx, rbx
movzx ecx, byte [rax + rdi*2]
call fcn.140001360
mov rax, qword [rsp + 0x88]
mov rdx, rbx
movzx ecx, byte [rax + rdi*2]
call fcn.140001360
jmp 0x140003ce3
mov eax, esi
and eax, 0x80000007
jge 0x140003c97
dec eax
or eax, 0xfffffff8
inc eax
test eax, eax
lea rcx, [0x14000aad0]
mov rdx, rbx
cmovne rcx, r14
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputs]
mov rax, qword [rsp + 0x88]
lea rdx, str._02hx_02hx_02hx
movzx ecx, word [rax + rdi*2]
mov rax, qword [rsp + 0x30]
mov dword [rsp + 0x20], ecx
mov rcx, rbx
movzx r9d, word [rax + rdi*2]
mov rax, qword [rsp + 0x80]
movzx r8d, word [rax + rdi*2]
call fcn.140005670
inc esi
inc rdi
cmp rdi, rbp
jl 0x140003c43
cmp dword [0x14000d070], 0
mov r14, qword [rsp + 0x78]
mov rbp, qword [rsp + 0x70]
je 0x140003d61
movsxd rax, dword [0x14000d6fc]
test eax, eax
jle 0x140003d58
xor edx, edx
lea rdi, [0x14000d700]
lea rcx, [rdi + rax]
lea r8d, [rdx + 3]
call sub.tiff.dll__TIFFmemset
mov rcx, rdi
call fcn.140001000
mov ecx, dword [0x14000d6fc]
mov r9, rbx
inc ecx
mov r8d, 1
movsxd rdx, ecx
lea rcx, str.____
cmp byte [rax], 0x7a
cmove rax, rcx
mov rcx, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
lea rcx, [0x14000b314]
jmp 0x140003d68
lea rcx, [0x14000aae8]
mov rdx, rbx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputs]
mov rdx, rbx
lea rcx, str.__setcolorspace_n
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fputs]
add rsp, 0x50
pop rdi
pop rsi
pop rbx
ret