Function at 0x1003d5a0
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x54
mov edx, dword [esp + 0x5c]
push ebp
mov ebp, ecx
mov dword [esp + 8], ebp
test edx, edx
jne 0x1003d5bb
xor al, al
pop ebp
add esp, 0x54
ret 0xc
cmp word [ebp + 0xe], 4
push ebx
push edi
mov dword [esp + 0x44], 0
jne 0x1003d5fc
push dword [esp + 0x6c]
call sym.FreeImage.dll__FreeImage_Clone_4
mov edi, eax
mov dword [esp + 0x44], edi
test edi, edi
jne 0x1003d5ea
pop edi
pop ebx
xor al, al
pop ebp
add esp, 0x54
ret 0xc
push edi
mov ebx, edi
mov dword [esp + 0x30], edi
call sym.FreeImage.dll__FreeImage_Invert_4
mov edx, dword [esp + 0x68]
jmp 0x1003d604
mov ebx, dword [esp + 0x6c]
mov dword [esp + 0x2c], ebx
movzx ecx, word [ebp + 0xc]
xor eax, eax
push esi
cmp cx, 8
mov esi, 1
cmovg esi, eax
mov eax, dword [ebp + 0xb0]
mov dword [esp + 0x70], esi
test eax, 0x100
je 0x1003d62c
xor esi, esi
jmp 0x1003d641
test eax, 0x200
je 0x1003d645
xor eax, eax
mov esi, 1
cmp cx, 0x10
cmovg esi, eax
mov dword [esp + 0x70], esi
mov ax, si
mov ch, al
mov cl, ah
push edx
movzx eax, cx
mov dword [esp + 0x50], eax
lea eax, [esp + 0x50]
push 1
push 2
push eax
mov eax, dword [esp + 0x78]
mov eax, dword [eax + 4]
call eax
cmp eax, 1
jne 0x1003d7ec
movsx eax, word [ebp + 2]
mov edx, dword [ebp + 8]
mov edi, dword [ebp + 4]
mov dword [esp + 0x10], eax
movzx eax, word [ebp + 0xc]
movsx ecx, ax
mov ebp, ecx
mov dword [esp + 0x44], 1
shr ebp, 3
cmp ecx, 1
mov dword [esp + 0x40], edx
cmove ebp, dword [esp + 0x44]
mov dword [esp + 0x1c], edi
mov dword [esp + 0x20], ebp
cmp ax, 1
jne 0x1003d6b3
lea ebp, [edx + 7]
shr ebp, 3
jmp 0x1003d6b6
imul ebp, edx
cmp ecx, 1
jne 0x1003d6c1
mov dword [esp + 0x34], ecx
jmp 0x1003d6ce
push ebx
call sym.FreeImage.dll__FreeImage_GetBPP_4
shr eax, 3
mov dword [esp + 0x34], eax
test ebx, ebx
je 0x1003d703
mov esi, dword [ebx]
cmp dword [esi + 0x128], 0
je 0x1003d6ed
mov esi, dword [esi + 0x12c]
mov dword [esp + 0x18], esi
mov esi, dword [esp + 0x70]
jmp 0x1003d70b
push ebx
call sym.FreeImage.dll__FreeImage_GetLine_4
lea esi, [eax + 3]
and esi, 0xfffffffc
mov dword [esp + 0x18], esi
mov esi, dword [esp + 0x70]
jmp 0x1003d70b
mov dword [esp + 0x18], 0
lea eax, [edi - 1]
push eax
push ebx
call sym.FreeImage.dll__FreeImage_GetScanLine_8
push ebp
mov dword [esp + 0x48], eax
call fcn.1026947b
add esp, 4
mov ebx, eax
mov dword [esp + 0x54], ebx
sub esi, 0
je 0x1003da15
sub esi, 1
jne 0x1003daad
mov ecx, dword [esp + 0x40]
mov eax, 0x2040811
add ecx, 0x7e
mul ecx
sub ecx, edx
shr ecx, 1
add ecx, edx
shr ecx, 6
add ecx, ebp
push ecx
call fcn.1026947b
mov esi, dword [esp + 0x14]
xor ecx, ecx
imul esi, edi
mov edx, 4
mov dword [esp + 0x2c], eax
push 0x105a20a0
mov eax, esi
mov dword [esp + 0x34], esi
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.102694a7
add esp, 0xc
mov dword [esp + 0x70], eax
test eax, eax
jne 0x1003d79d
test ebx, ebx
je 0x1003dadd
jmp 0x1003dad4
lea ecx, [esi*4]
push ecx
push 0
push eax
mov dword [esp + 0x4c], ecx
call fcn.1026e960
mov eax, dword [esp + 0x74]
add esp, 0xc
mov esi, dword [esp + 0x6c]
mov eax, dword [eax + 0xc]
push esi
call eax
mov ecx, dword [esp + 0x14]
push esi
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x6c]
cmp word [ecx], 1
push 1
jne 0x1003d7f8
mov ecx, dword [esp + 0x34]
add ecx, ecx
push ecx
push dword [esp + 0x7c]
mov ecx, dword [eax + 4]
call ecx
cmp eax, 1
je 0x1003d80a
pop esi
pop edi
pop ebx
xor al, al
pop ebp
add esp, 0x54
ret 0xc
push dword [esp + 0x48]
mov eax, dword [eax + 4]
push dword [esp + 0x7c]
call eax
cmp eax, 1
jne 0x1003d7ec
xor eax, eax
mov dword [esp + 0x3c], eax
cmp dword [esp + 0x10], eax
jbe 0x1003d8c7
mov ecx, dword [esp + 0x70]
mov dword [esp + 0x24], ecx
mov ecx, dword [esp + 0x14]
push eax
push dword [esp + 0x34]
call fcn.1003c300
mov esi, eax
mov dword [esp + 0x38], 0
mov eax, dword [esp + 0x20]
imul esi, eax
add esi, dword [esp + 0x44]
test edi, edi
je 0x1003d8a5
mov edi, dword [esp + 0x24]
nop dword [eax]
push eax
push dword [esp + 0x38]
push ebp
push esi
push ebx
call fcn.1003d410
push ebp
push ebx
push dword [esp + 0x30]
call fcn.1003d4e0
push dword [esp + 0x6c]
mov dword [edi], eax
push 1
push eax
mov eax, dword [esp + 0x74]
push dword [esp + 0x34]
mov eax, dword [eax + 4]
call eax
cmp eax, 1
jne 0x1003d7ec
mov eax, dword [esp + 0x38]
add edi, 4
sub esi, dword [esp + 0x18]
inc eax
cmp eax, dword [esp + 0x1c]
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0x20]
jb 0x1003d850
mov edi, dword [esp + 0x1c]
mov eax, dword [esp + 0x3c]
lea ecx, [edi*4]
add dword [esp + 0x24], ecx
inc eax
mov dword [esp + 0x3c], eax
cmp eax, dword [esp + 0x10]
jb 0x1003d822
mov esi, dword [esp + 0x6c]
mov eax, dword [esp + 0x28]
test eax, eax
je 0x1003d8d8
push eax
call fcn.10269476
add esp, 4
mov ebp, dword [esp + 0x68]
push 0
push dword [esp + 0x54]
mov eax, dword [ebp + 8]
push esi
call eax
mov eax, dword [esp + 0x14]
xor ecx, ecx
mov edi, dword [esp + 0x2c]
cmp word [eax], 1
jne 0x1003d98c
mov eax, edi
mov edx, 2
mul edx
push 0x105a20a0
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.102694a7
add esp, 8
mov dword [esp + 0x6c], eax
test eax, eax
jne 0x1003d92f
test ebx, ebx
je 0x1003db0e
jmp 0x1003db05
xor edx, edx
test edi, edi
je 0x1003d95a
mov ebx, dword [esp + 0x70]
mov ebp, dword [esp + 0x6c]
nop dword [eax]
mov ax, word [ebx + edx*4]
mov ch, al
mov cl, ah
mov word [ebp + edx*2], cx
inc edx
cmp edx, edi
jb 0x1003d940
mov ebx, dword [esp + 0x54]
mov ebp, dword [esp + 0x68]
push esi
push 1
lea eax, [edi + edi]
mov edi, dword [esp + 0x74]
push eax
mov eax, dword [ebp + 4]
push edi
call eax
cmp eax, 1
jne 0x1003d7ec
push edi
call fcn.10269476
mov eax, dword [ebp + 8]
add esp, 4
push 2
push 0
push esi
call eax
jmp 0x1003daad
test edi, edi
je 0x1003d9ed
mov edx, dword [esp + 0x70]
cmp edi, 8
jb 0x1003d9db
cmp dword [0x105a2390], 2
jl 0x1003d9db
mov eax, edi
xor ecx, ecx
and eax, 0xfffffff8
nop dword [eax]
movups xmm0, xmmword [edx + ecx*4]
pshufb xmm0, xmmword [0x103f9b00]
movups xmmword [edx + ecx*4], xmm0
movups xmm0, xmmword [edx + ecx*4 + 0x10]
pshufb xmm0, xmmword [0x103f9b00]
movups xmmword [edx + ecx*4 + 0x10], xmm0
add ecx, 8
cmp ecx, eax
jb 0x1003d9b0
cmp ecx, edi
jae 0x1003d9ed
nop
mov eax, dword [edx + ecx*4]
bswap eax
mov dword [edx + ecx*4], eax
inc ecx
cmp ecx, edi
jb 0x1003d9e0
mov eax, dword [ebp + 4]
push esi
push 1
push dword [esp + 0x48]
push dword [esp + 0x7c]
call eax
cmp eax, 1
jne 0x1003d7ec
mov eax, dword [ebp + 8]
push 2
push 0
push esi
call eax
jmp 0x1003daad
xor ecx, ecx
mov dword [esp + 0x70], ecx
cmp dword [esp + 0x10], ecx
jbe 0x1003daad
mov eax, dword [esp + 0x30]
mov esi, ecx
test eax, eax
je 0x1003da51
mov eax, dword [eax]
cmp dword [eax], 1
jne 0x1003da51
mov eax, dword [esp + 0x14]
cmp word [eax + 0xe], 3
jne 0x1003da51
test ecx, ecx
je 0x1003da4a
cmp ecx, 2
jne 0x1003da51
mov esi, 2
sub esi, ecx
mov eax, dword [esp + 0x20]
xor edi, edi
imul esi, eax
add esi, dword [esp + 0x44]
cmp dword [esp + 0x1c], edi
jbe 0x1003da9e
push eax
push dword [esp + 0x38]
push ebp
push esi
push ebx
call fcn.1003d410
push dword [esp + 0x6c]
mov eax, dword [esp + 0x6c]
push 1
push ebp
push ebx
mov eax, dword [eax + 4]
call eax
cmp eax, 1
jne 0x1003d7ec
sub esi, dword [esp + 0x18]
inc edi
mov eax, dword [esp + 0x20]
cmp edi, dword [esp + 0x1c]
jb 0x1003da64
mov ecx, dword [esp + 0x70]
inc ecx
mov dword [esp + 0x70], ecx
cmp ecx, dword [esp + 0x10]
jb 0x1003da25
test ebx, ebx
je 0x1003daba
push ebx
call fcn.10269476
add esp, 4
mov eax, dword [esp + 0x48]
test eax, eax
je 0x1003dac8
push eax
call sym.FreeImage.dll__FreeImage_Unload_4
pop esi
pop edi
pop ebx
mov al, 1
pop ebp
add esp, 0x54
ret 0xc
push ebx
call fcn.10269476
add esp, 4
xorps xmm0, xmm0
mov dword [esp + 0x58], vtable.std::bad_alloc.0
push 0x10410e84
lea eax, [esp + 0x5c]
movq qword [esp + 0x60], xmm0
push eax
mov dword [esp + 0x64], str.bad_allocation
call fcn.1026eb3b
push ebx
call fcn.10269476
add esp, 4
xorps xmm0, xmm0
mov dword [esp + 0x58], vtable.std::bad_alloc.0
push 0x10410e84
lea eax, [esp + 0x5c]
movq qword [esp + 0x60], xmm0
push eax
mov dword [esp + 0x64], str.bad_allocation
call fcn.1026eb3b
int3