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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x547900
mov eax, dword fs:[0]
push eax
sub esp, 0x60
push ebx
push esi
push edi
mov eax, dword [0x5a5084]
xor eax, esp
push eax
lea eax, [esp + 0x70]
mov dword fs:[0], eax
mov edi, ecx
mov esi, dword [ebp + 0xc]
xor ebx, ebx
cmp esi, ebx
jne 0x40d6a4
mov ecx, dword [ebp + 8]
xor eax, eax
cmp dword [ecx + 4], ebx
jmp 0x40d9af
mov eax, dword [esi + 4]
lea edx, [esp + 0x18]
push edx
push eax
mov dword [esp + 0x20], ebx
call sub.gdiplus.dll_GdipGetImageWidth
cmp eax, ebx
je 0x40d6bd
mov dword [esi + 8], eax
mov edx, dword [esi + 4]
lea ecx, [esp + 0x10]
push ecx
push edx
mov dword [esp + 0x18], ebx
call sub.gdiplus.dll_GdipGetImageHeight
cmp eax, ebx
je 0x40d6d6
mov dword [esi + 8], eax
fild dword [esp + 0x18]
fld dword [ebp + 0x10]
fld st(0)
fmulp st(2)
fxch st(1)
call fcn.00546c10
fild dword [esp + 0x10]
mov esi, eax
mov dword [esp + 0x20], esi
fstp dword [esp + 0x1c]
fmul dword [esp + 0x1c]
call fcn.00546c10
cmp edi, ebx
mov ebx, dword [esp + 0x18]
mov dword [esp + 0x24], eax
mov dword [esp + 0x14], 1
je 0x40d73b
test ebx, ebx
je 0x40d73b
cmp ebx, edi
jl 0x40d73b
mov eax, ebx
cdq
idiv edi
mov ecx, eax
mov eax, esi
cdq
idiv ecx
mov dword [esp + 0x14], ecx
test edx, edx
je 0x40d733
sub ecx, edx
jmp 0x40d735
xor ecx, ecx
add esi, ecx
mov dword [esp + 0x20], esi
mov eax, dword [esp + 0x24]
push eax
push esi
mov esi, dword [ebp + 8]
call fcn.00412d90
test eax, eax
jne 0x40d755
cmp dword [esi + 4], eax
jmp 0x40d9af
mov eax, dword [esi + 0x10]
test eax, eax
je 0x40d773
mov ecx, dword [esi + 0xc]
imul ecx, dword [esi + 8]
add ecx, ecx
add ecx, ecx
push ecx
push 0
push eax
call fcn.00472a32
add esp, 0xc
push 0
call dword [sym.imp.USER32.dll_GetDC]
mov esi, eax
push esi
mov dword [esp + 0x44], esi
call dword [sym.imp.GDI32.dll_CreateCompatibleDC]
mov edi, eax
test edi, edi
mov dword [esp + 0x38], edi
je 0x40d99e
mov edx, dword [ebp + 8]
mov eax, dword [edx + 4]
push eax
push edi
call dword [sym.imp.GDI32.dll_SelectObject]
lea ecx, [esp + 0x18]
push ecx
push edi
mov dword [esp + 0x44], eax
mov dword [esp + 0x20], 0
call sub.gdiplus.dll_GdipCreateFromHDC
mov esi, dword [esp + 0x18]
mov dword [esp + 0x48], eax
mov dword [esp + 0x44], esi
push 2
push esi
mov dword [esp + 0x80], 0
call sub.gdiplus.dll_GdipSetInterpolationMode
test eax, eax
je 0x40d7e2
mov dword [esp + 0x48], eax
fld1
fcomp dword [ebp + 0x10]
fnstsw ax
test ah, 0x44
jnp 0x40d954
cmp dword [esp + 0x14], 1
je 0x40d954
mov esi, dword [ebp + 0xc]
mov eax, dword [esi + 4]
lea edx, [esp + 0x2c]
push edx
push eax
call sub.gdiplus.dll_GdipGetImagePixelFormat
test eax, eax
je 0x40d815
mov dword [esi + 8], eax
mov ecx, dword [esp + 0x2c]
mov edx, dword [esp + 0x10]
push ebx
lea esi, [esp + 0x60]
call fcn.00407940
mov edi, esi
mov byte [esp + 0x78], 1
call fcn.0040d9d0
mov esi, eax
test esi, esi
je 0x40d940
mov ecx, dword [esi]
push 0xffffff
push ecx
call sub.gdiplus.dll_GdipGraphicsClear
test eax, eax
je 0x40d851
mov dword [esi + 4], eax
mov ecx, dword [esp + 0x10]
mov eax, dword [ebp + 0xc]
push 0
push 0
mov edx, ebx
call fcn.00407a30
mov eax, ebx
cdq
idiv dword [esp + 0x14]
mov ecx, dword [esp + 0x14]
mov dword [esp + 0x28], 0
mov ebx, eax
mov eax, dword [esp + 0x20]
cdq
idiv ecx
test ecx, ecx
mov dword [esp + 0x30], ebx
mov dword [esp + 0x34], eax
jle 0x40d940
fild dword [esp + 0x30]
xor eax, eax
mov dword [esp + 0x20], eax
fstp dword [esp + 0x54]
fld dword [esp + 0x1c]
mov dword [esp + 0x1c], eax
fstp dword [esp + 0x58]
fild dword [esp + 0x1c]
sub esp, 0x10
lea edi, [esp + 0x6c]
fstp dword [esp + 0x5c]
fld dword [esp + 0x68]
fstp dword [esp + 0xc]
fld dword [esp + 0x64]
fstp dword [esp + 8]
fldz
fstp dword [esp + 4]
fld dword [esp + 0x5c]
fstp dword [esp]
call fcn.0040da10
mov esi, eax
test esi, esi
je 0x40d940
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 0x24]
mov edi, dword [esp + 0x34]
push 0
mov ecx, dword [esp + 0x24]
push 0
push 0
push 2
push edx
mov edx, dword [esi + 4]
push ebx
push 0
push 0
push eax
mov eax, dword [esp + 0x3c]
push edi
push 0
push ecx
push edx
push eax
call sub.gdiplus.dll_GdipDrawImageRectRectI
test eax, eax
je 0x40d919
mov dword [esp + 0x48], eax
mov edx, dword [esi]
mov eax, dword [edx]
push 1
mov ecx, esi
call eax
mov eax, dword [esp + 0x28]
add dword [esp + 0x1c], ebx
add dword [esp + 0x20], edi
add eax, 1
cmp eax, dword [esp + 0x14]
mov dword [esp + 0x28], eax
jl 0x40d8a9
mov ecx, dword [esp + 0x60]
push ecx
call sub.gdiplus.dll_GdipDisposeImage
mov esi, dword [esp + 0x18]
mov edi, dword [esp + 0x38]
jmp 0x40d981
mov ecx, dword [esp + 0x10]
mov edx, dword [ebp + 0xc]
mov eax, dword [edx + 4]
mov edx, dword [esp + 0x24]
push 0
push 0
push 0
push 2
push ecx
mov ecx, dword [esp + 0x34]
push ebx
push 0
push 0
push edx
push ecx
push 0
push 0
push eax
push esi
call sub.gdiplus.dll_GdipDrawImageRectRectI
mov edx, dword [esp + 0x3c]
push edx
push edi
call dword [sym.imp.GDI32.dll_SelectObject]
push edi
call dword [sym.imp.GDI32.dll_DeleteDC]
push esi
call sub.gdiplus.dll_GdipDeleteGraphics
mov esi, dword [esp + 0x40]
push esi
push 0
call dword [sym.imp.USER32.dll_ReleaseDC]
mov ecx, dword [ebp + 8]
xor eax, eax
cmp dword [ecx + 4], eax
setne al
mov ecx, dword [esp + 0x70]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc