Function at 0x101080e0
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x574
push ebx
push ebp
push esi
push edi
mov edi, ecx
mov esi, 0x2000
mov dword [esp + 0x14], edi
movzx edx, word [edi + 0x16]
movzx eax, word [edi + 0x14]
imul edx, eax
cmp word [edi + 0x492be], 0
movd xmm0, edx
cvtdq2ps xmm0, xmm0
mulss xmm0, dword [edi + 0x6cc]
cvttss2si ebx, xmm0
je 0x10108126
mov eax, ebx
cdq
sub eax, edx
mov ebx, eax
sar ebx, 1
test dword [edi + 0x67c], 0xfffffffd
jne 0x10108183
cmp dword [edi + 0x6d4], 0
jne 0x10108183
mov eax, dword [edi + 0x184]
xor esi, esi
test eax, eax
jle 0x10108183
mov ebp, dword [edi + 0x492c0]
mov edi, eax
add ebp, 0x7ffc
xor edx, edx
mov eax, 0x1fff
mov ecx, ebp
nop
add edx, dword [ecx]
cmp edx, ebx
jg 0x1010816f
dec eax
sub ecx, 4
cmp eax, 0x20
jg 0x10108160
cmp esi, eax
cmovl esi, eax
add ebp, 0x8000
sub edi, 1
jne 0x10108155
mov edi, dword [esp + 0x14]
lea eax, [esi*8]
mov ecx, edi
movd xmm0, eax
cvtdq2ps xmm0, xmm0
divss xmm0, dword [edi + 0x66c]
cvttss2si eax, xmm0
movups xmm0, xmmword [edi + 0x628]
push eax
push 2
sub esp, 0x10
movups xmmword [esp], xmm0
call fcn.1010f7e0
test byte [edi + 0x30], 4
mov ax, word [edi + 0x14]
mov word [edi + 0x1c], ax
movzx eax, word [edi + 0x16]
mov word [edi + 0x1e], ax
je 0x101081df
add word [edi + 0x14], ax
mov ax, word [edi + 0x14]
sub ax, word [edi + 0x16]
sub word [edi + 0x14], ax
mov word [edi + 0x16], ax
mov eax, dword [edi + 0x6a0]
mov ecx, edi
imul eax, dword [edi + 0x184]
cdq
and edx, 7
add eax, edx
sar eax, 3
push eax
movzx eax, word [edi + 0x16]
push eax
call fcn.1012fe40
mov ebp, eax
mov ecx, edi
push str.write_ppm_tiff__
push ebp
call fcn.1012ff00
cmp dword [edi + 0x6a4], 0
je 0x10108271
push 1
lea eax, [esp + 0x28]
mov ecx, edi
push eax
call fcn.101289c0
push dword [edi + 0x49284]
lea eax, [esp + 0x28]
push 1
push 0x560
push eax
call fcn.102013d8
mov eax, dword [edi + 0x492c4]
add esp, 0x10
test eax, eax
je 0x101082e3
push dword [edi + 0x49284]
push 1
push dword [eax]
call dword [sym.imp.WS2_32.dll_ntohl]
push eax
push dword [edi + 0x492c4]
call fcn.102013d8
add esp, 0x10
jmp 0x101082e3
mov esi, dword [edi + 0x184]
mov ecx, dword [edi + 0x6a0]
cmp esi, 3
jle 0x101082b2
lea eax, [edi + 0x1d4]
push eax
mov eax, 1
shl eax, cl
dec eax
push eax
movzx eax, word [edi + 0x14]
push esi
push eax
movzx eax, word [edi + 0x16]
push eax
push str.P7_nWIDTH__d_nHEIGHT__d_nDEPTH__d_nMAXVAL__d_nTUPLTYPE__s_nENDHDR_n
push dword [edi + 0x49284]
call fcn.1006ef40
add esp, 0x1c
jmp 0x101082e3
mov edx, 1
mov eax, esi
shl edx, cl
movzx ecx, word [edi + 0x14]
dec edx
push edx
cdq
push ecx
movzx ecx, word [edi + 0x16]
sub eax, edx
push ecx
sar eax, 1
add eax, 5
push eax
push str.P_d_n_d__d_n_d_n
push dword [edi + 0x49284]
call fcn.1006ef40
add esp, 0x18
push 0
push 0
mov ecx, edi
call fcn.1010f790
push 1
mov esi, eax
mov ecx, edi
push 0
mov dword [esp + 0x18], esi
call fcn.1010f790
movzx ecx, word [edi + 0x16]
sub eax, esi
push ecx
push 0
mov ecx, edi
mov dword [esp + 0x1c], eax
call fcn.1010f790
push 0
push 1
mov ecx, edi
mov esi, eax
call fcn.1010f790
sub eax, esi
xor esi, esi
mov dword [esp + 0x20], eax
xor eax, eax
mov dword [esp + 0x1c], esi
cmp ax, word [edi + 0x14]
jae 0x101084a1
mov edx, dword [esp + 0x10]
nop dword [eax]
xor eax, eax
xor ebx, ebx
cmp ax, word [edi + 0x16]
jae 0x1010841a
mov ecx, dword [esp + 0x14]
lea eax, [edx*8]
mov dword [esp + 0x18], eax
nop dword [eax]
xor edx, edx
cmp dword [edi + 0x6a0], 8
jne 0x101083ab
cmp dword [edi + 0x184], edx
jle 0x101083f4
mov esi, eax
nop dword [eax]
mov ecx, dword [edi + 0x184]
lea esi, [esi + 2]
mov eax, dword [edi + 8]
imul ecx, ebx
movzx eax, word [esi + eax - 2]
add ecx, ebp
mov al, byte [edi + eax*2 + 0x769]
mov byte [ecx + edx], al
inc edx
cmp edx, dword [edi + 0x184]
jl 0x10108380
jmp 0x101083ec
cmp dword [edi + 0x184], edx
jle 0x101083f4
mov esi, eax
nop word [eax + eax]
mov ecx, dword [edi + 0x184]
lea esi, [esi + 2]
mov eax, dword [edi + 8]
imul ecx, ebx
movzx eax, word [esi + eax - 2]
add ecx, edx
inc edx
mov ax, word [edi + eax*2 + 0x768]
mov word [ebp + ecx*2], ax
cmp edx, dword [edi + 0x184]
jl 0x101083c0
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x18]
add dword [esp + 0x10], ecx
lea edx, [ecx*8]
add eax, edx
inc ebx
mov dword [esp + 0x18], eax
movzx eax, word [edi + 0x16]
cmp ebx, eax
mov eax, dword [esp + 0x18]
jl 0x10108360
mov esi, dword [esp + 0x1c]
cmp dword [edi + 0x6a0], 0x10
jne 0x10108459
cmp dword [edi + 0x6a4], 0
jne 0x10108459
push 0x55aa
call dword [sym.imp.WS2_32.dll_htons]
mov ecx, 0x55aa
cmp ax, cx
je 0x10108459
movzx eax, word [edi + 0x16]
imul eax, dword [edi + 0x184]
add eax, eax
push eax
push ebp
push ebp
call fcn.1020f676
add esp, 0xc
push dword [edi + 0x49284]
movzx eax, word [edi + 0x16]
push eax
mov eax, dword [edi + 0x6a0]
imul eax, dword [edi + 0x184]
cdq
and edx, 7
add eax, edx
sar eax, 3
push eax
push ebp
call fcn.102013d8
mov edx, dword [esp + 0x20]
inc esi
add edx, dword [esp + 0x30]
add esp, 0x10
movzx eax, word [edi + 0x14]
mov dword [esp + 0x1c], esi
mov dword [esp + 0x10], edx
cmp esi, eax
jl 0x10108340
push ebp
mov ecx, edi
call fcn.1012fed0
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x574
ret